]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/images/gif/gif.factor
factor: trim using lists
[factor.git] / extra / images / gif / gif.factor
index 92ed3cd995505cb4a43ca5c61c7a438efa52fcf8..079efdbb5c4ac43065151666625c4d593a7d3f1e 100644 (file)
@@ -1,13 +1,12 @@
 ! 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?
@@ -53,7 +52,7 @@ TUPLE: comment-extension
 introducer label comment-data ;
 
 TUPLE: trailer byte ;
-CONSTRUCTOR: trailer ( byte -- obj ) ;
+CONSTRUCTOR: <trailer> trailer ( byte -- obj ) ;
 
 CONSTANT: IMAGE-DESCRIPTOR 0x2c
 ! Extensions
@@ -113,7 +112,7 @@ CONSTANT: BLOCK-TERMINATOR 0x00
 : 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
@@ -248,5 +247,5 @@ ERROR: loading-gif-error gif-image ;
 : 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 ;