! Copyrigt (C) 2009 Doug Coleman, Keith Lazuka
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays combinators compression.lzw
-constructors destructors grouping images images.loader io
-io.binary io.buffers io.encodings.string io.encodings.utf8
-kernel make math math.bitwise namespaces sequences ;
+USING: accessors arrays combinators compression.lzw constructors
+endian grouping images images.loader io io.encodings.string
+io.encodings.utf8 kernel make math math.bitwise sequences ;
IN: images.gif
SINGLETON: gif-image
-"gif" gif-image register-image-class
+"gif" gif-image ?register-image-class
TUPLE: loading-gif
loading?
introducer label comment-data ;
TUPLE: trailer byte ;
-CONSTRUCTOR: trailer ( byte -- obj ) ;
+CONSTRUCTOR: <trailer> trailer ( byte -- obj ) ;
CONSTANT: IMAGE-DESCRIPTOR 0x2c
! Extensions
: read-comment-extension ( -- comment-extension )
\ comment-extension new
read-sub-blocks >>comment-data ;
-
+
: read-application-extension ( -- read-application-extension )
\ application-extension new
1 read le> >>block-size
: ensure-loaded ( gif-image -- gif-image )
dup loading?>> [ loading-gif-error ] when ;
-M: gif-image stream>image ( path gif-image -- image )
+M: gif-image stream>image* ( path gif-image -- image )
drop load-gif ensure-loaded gif>image ;