diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-03-06 15:59:15 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-03-06 15:59:15 (GMT) |
commit | 9d02e84906d7782d030e57b8d889f4ec50d431e8 (patch) | |
tree | d498795c0c69817fdddb0846e3996bafdc685833 /ds9/library | |
parent | 059b1aacc9ead51229cd612984a71b39113d2945 (diff) | |
download | blt-9d02e84906d7782d030e57b8d889f4ec50d431e8.zip blt-9d02e84906d7782d030e57b8d889f4ec50d431e8.tar.gz blt-9d02e84906d7782d030e57b8d889f4ec50d431e8.tar.bz2 |
support animated gif
Diffstat (limited to 'ds9/library')
-rw-r--r-- | ds9/library/movie.tcl | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/ds9/library/movie.tcl b/ds9/library/movie.tcl index 054f87e..f8efcf6 100644 --- a/ds9/library/movie.tcl +++ b/ds9/library/movie.tcl @@ -148,6 +148,17 @@ proc MovieCreate {fn} { DisplayMode } + # reduce colors if needed + switch $movie(type) { + gif { + $current(colorbar) configure -colors 64 + update + $current(frame) colormap [$current(colorbar) get colormap] + update + } + default {} + } + set movie(fn) $fn switch $movie(action) { frame {MovieFrame} @@ -155,6 +166,17 @@ proc MovieCreate {fn} { 3d {Movie3d} } + # reset colors if needed + switch $movie(type) { + gif { + $current(colorbar) configure -colors 2048 + update + $current(frame) colormap [$current(colorbar) get colormap] + update + } + default {} + } + if {[info exists modesav]} { set current(display) $modesav DisplayMode @@ -337,26 +359,12 @@ proc MoviePhotoGIF {} { } if {$movie(first)} { - set ww [image width $ph] - set hh [image height $ph] - agif create $movie(fn) $ww $hh - switch -- $current(colorbar) { - colorbar { - switch -- $colorbar(map) { - grey - - red - - green - - blue {agif colortable $colorbar(map)} - default {agif colortable pseudo} - } - } - colorbarrgb {agif colortable rgb} - } + agif create $movie(fn) [image width $ph] [image height $ph] set movie(first) 0 } agif add $ph - image delete $ph + return 0 } |