]> gitweb.factorcode.org Git - factor.git/commitdiff
images.*: remove usage of io.streams.limited
authorSlava Pestov <slava@factorcode.org>
Fri, 2 Sep 2011 05:29:14 +0000 (22:29 -0700)
committerSlava Pestov <slava@factorcode.org>
Fri, 2 Sep 2011 05:31:45 +0000 (22:31 -0700)
basis/images/cocoa/cocoa.factor
basis/images/gdiplus/gdiplus.factor
basis/images/loader/loader.factor

index 115315aa18117c032cc56a5cd98dc310d0d039a0..6d4b97da1f4d13a99fc835a7d3bb95307748f905 100644 (file)
@@ -1,7 +1,7 @@
 ! (c)2010 Joe Groff bsd license
 USING: accessors alien.data cocoa cocoa.classes cocoa.messages
 combinators core-foundation.data core-graphics.types fry images
-images.loader io kernel literals math sequences ;
+images.loader io kernel math sequences ;
 IN: images.cocoa
 
 SINGLETON: ns-image
@@ -36,9 +36,9 @@ ERROR: ns-image-planar-images-not-supported ;
 
 : check-return ( n -- )
     {
-        { NSImageRepLoadStatusUnknownType   [ ns-image-unknown-type   ] }
-        { NSImageRepLoadStatusInvalidData   [ ns-image-invalid-data   ] }
-        { NSImageRepLoadStatusUnexpectedEOF [ ns-image-unexpected-eof ] }
+        { NSImageRepLoadStatusUnknownType   [ ns-image-unknown-type   ] }
+        { NSImageRepLoadStatusInvalidData   [ ns-image-invalid-data   ] }
+        { NSImageRepLoadStatusUnexpectedEOF [ ns-image-unexpected-eof ] }
         [ drop ]
     } case ;
 
index 7b47af3d3abf2a666b893070fef39b18593360cf..d97bd5c467bdaae151cca343e638633ecb82aeca 100644 (file)
@@ -1,9 +1,8 @@
 ! (c)2010 Joe Groff bsd license\r
 USING: accessors alien.c-types alien.data alien.enums\r
-classes.struct destructors images images.loader\r
-io.streams.limited kernel locals math windows.com\r
-windows.gdiplus windows.streams windows.types typed\r
-byte-arrays grouping sequences ;\r
+classes.struct destructors images images.loader kernel locals\r
+math windows.com windows.gdiplus windows.streams windows.types\r
+typed byte-arrays grouping sequences ;\r
 IN: images.gdiplus\r
 \r
 SINGLETON: gdi+-image\r
index 52a80459d9d1b5416f06275c97dd9febd498b787..7be8300f636e5b2da83da9c8bbae180cda62d4eb 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2009 Doug Coleman, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: assocs byte-arrays io.encodings.binary io.files
-io.pathnames io.streams.byte-array io.streams.limited
-io.streams.throwing kernel namespaces sequences strings
-unicode.case fry ;
+USING: ascii assocs byte-arrays io.encodings.binary io.files
+io.pathnames io.streams.byte-array kernel namespaces sequences
+strings fry ;
 IN: images.loader
 
 ERROR: unknown-image-extension extension ;
@@ -19,9 +18,6 @@ types [ H{ } clone ] initialize
 : image-class ( path -- class )
     file-extension (image-class) ;
 
-: open-image-file ( path -- stream )
-    binary <limited-file-reader> ;
-
 PRIVATE>
 
 ! Image Decode
@@ -34,16 +30,18 @@ GENERIC: stream>image ( stream class -- image )
     swap types get set-at ;
 
 : load-image ( path -- image )
-    [ open-image-file ] [ image-class ] bi load-image* ;
+    [ binary <file-reader> ] [ image-class ] bi load-image* ;
 
 M: object load-image* stream>image ;
 
 M: byte-array load-image*
     [ binary <byte-reader> ] dip stream>image ;
 
-M: string load-image* [ open-image-file ] dip stream>image ;
+M: string load-image*
+    [ binary <file-reader> ] dip stream>image ;
 
-M: pathname load-image* [ open-image-file ] dip stream>image ;
+M: pathname load-image*
+    [ binary <file-reader> ] dip stream>image ;
 
 ! Image Encode
 
@@ -52,4 +50,3 @@ GENERIC: image>stream ( image class -- )
 : save-graphic-image ( image path -- )
     [ image-class ] [ ] bi
     binary [ image>stream ] with-file-writer ;
-