images.*: fix all image>stream words in extra so that they work with the added parameter
parent
944718c817
commit
13dc01dbc4
|
@ -428,5 +428,4 @@ M: bmp-image stream>image* ( stream bmp-image -- bitmap )
|
||||||
] bi ;
|
] bi ;
|
||||||
|
|
||||||
M: bmp-image image>stream
|
M: bmp-image image>stream
|
||||||
drop BGR reorder-components output-bmp ;
|
2drop BGR reorder-components output-bmp ;
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ M: pbm-image stream>image*
|
||||||
drop [ [ read-pbm ] throw-on-eof ] with-input-stream ;
|
drop [ [ read-pbm ] throw-on-eof ] with-input-stream ;
|
||||||
|
|
||||||
M: pbm-image image>stream
|
M: pbm-image image>stream
|
||||||
drop {
|
2drop {
|
||||||
[ drop "P4\n" ascii encode write ]
|
[ drop "P4\n" ascii encode write ]
|
||||||
[ dim>> first number>string " " append ascii encode write ]
|
[ dim>> first number>string " " append ascii encode write ]
|
||||||
[ dim>> second number>string "\n" append ascii encode write ]
|
[ dim>> second number>string "\n" append ascii encode write ]
|
||||||
|
|
|
@ -50,7 +50,7 @@ M: ppm-image stream>image*
|
||||||
drop [ [ read-ppm ] throw-on-eof ] with-input-stream ;
|
drop [ [ read-ppm ] throw-on-eof ] with-input-stream ;
|
||||||
|
|
||||||
M: ppm-image image>stream
|
M: ppm-image image>stream
|
||||||
drop {
|
2drop {
|
||||||
[ drop "P6\n" ascii encode write ]
|
[ drop "P6\n" ascii encode write ]
|
||||||
[ dim>> first number>string " " append ascii encode write ]
|
[ dim>> first number>string " " append ascii encode write ]
|
||||||
[ dim>> second number>string "\n" append ascii encode write ]
|
[ dim>> second number>string "\n" append ascii encode write ]
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2009 Keith Lazuka.
|
! Copyright (C) 2009 Keith Lazuka.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors fry images images.loader images.normalization
|
USING: accessors assocs fry images images.loader images.normalization
|
||||||
images.viewer io io.backend io.directories io.encodings.binary
|
images.loader.private images.viewer io io.backend io.directories
|
||||||
io.files io.pathnames io.streams.byte-array kernel locals
|
io.encodings.binary io.files io.pathnames io.streams.byte-array kernel locals
|
||||||
namespaces quotations random sequences serialize tools.test ;
|
namespaces quotations random sequences serialize tools.test ;
|
||||||
IN: images.testing
|
IN: images.testing
|
||||||
|
|
||||||
|
@ -42,8 +42,9 @@ PRIVATE>
|
||||||
f verbose-tests? [
|
f verbose-tests? [
|
||||||
path load-image dup clone normalize-image 1quotation swap
|
path load-image dup clone normalize-image 1quotation swap
|
||||||
'[
|
'[
|
||||||
binary [ _ image-class image>stream ] with-byte-writer
|
binary [
|
||||||
image-class load-image* normalize-image
|
_ image-class [ types get value-at ] keep image>stream
|
||||||
|
] with-byte-writer image-class load-image* normalize-image
|
||||||
] unit-test
|
] unit-test
|
||||||
] with-variable ;
|
] with-variable ;
|
||||||
|
|
||||||
|
|
|
@ -257,7 +257,7 @@ M: tga-image stream>image*
|
||||||
drop [ [ read-tga ] throw-on-eof ] with-input-stream ;
|
drop [ [ read-tga ] throw-on-eof ] with-input-stream ;
|
||||||
|
|
||||||
M: tga-image image>stream
|
M: tga-image image>stream
|
||||||
drop
|
2drop
|
||||||
[
|
[
|
||||||
component-order>> { BGRA BGRA } member? [ bad-tga-unsupported ] unless
|
component-order>> { BGRA BGRA } member? [ bad-tga-unsupported ] unless
|
||||||
] keep
|
] keep
|
||||||
|
@ -287,4 +287,3 @@ M: tga-image image>stream
|
||||||
]
|
]
|
||||||
[ bitmap>> write ]
|
[ bitmap>> write ]
|
||||||
} cleave ;
|
} cleave ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue