Handbook
Glossary
image>stream ( image extension class -- )
Vocabulary
images
.
loader
Inputs
image
an
object
extension
an
object
class
an
object
Outputs
None
Definition
IN:
images.loader
GENERIC:
image>stream
( image extension class -- )
Methods
USING:
images
images.bitmap
images.loader
images.normalization
kernel
;
M:
bmp-image
image>stream
2drop
BGR
reorder-components
output-bmp
;
USING:
images.loader
images.loader.gtk
images.loader.gtk.private
kernel
;
M:
gtk-image
image>stream
drop
write-image
;
USING:
accessors
combinators
images.loader
images.pbm
images.pbm.private
io
io.encodings.ascii
io.encodings.string
kernel
math.parser
sequences
;
M:
pbm-image
image>stream
2drop
{
[
drop
"P4\n"
ascii
encode
write
]
[
dim>>
first
number>string
" "
append
ascii
encode
write
]
[
dim>>
second
number>string
"\n"
append
ascii
encode
write
]
[
[
bitmap>>
]
[
dim>>
first
]
bi
write-binary-bits
]
}
cleave
;
USING:
accessors
combinators
images
images.loader
images.pgm
io
io.encodings.ascii
io.encodings.string
kernel
math.parser
sequences
;
M:
pgm-image
image>stream
2drop
{
[
drop
"P5\n"
ascii
encode
write
]
[
dim>>
first
number>string
" "
append
ascii
encode
write
]
[
dim>>
second
number>string
"\n"
append
ascii
encode
write
]
[
component-type>>
ubyte-components
=
[
"255\n"
]
[
"65535\n"
]
if
ascii
encode
write
]
[
bitmap>>
write
]
}
cleave
;
USING:
accessors
combinators
images.loader
images.ppm
io
io.encodings.ascii
io.encodings.string
kernel
math.parser
sequences
;
M:
ppm-image
image>stream
2drop
{
[
drop
"P6\n"
ascii
encode
write
]
[
dim>>
first
number>string
" "
append
ascii
encode
write
]
[
dim>>
second
number>string
"\n"
append
ascii
encode
write
]
[
drop
"255\n"
ascii
encode
write
]
[
bitmap>>
write
]
}
cleave
;
USING:
accessors
combinators
endian
images
images.loader
images.tga
io
kernel
math
sequences
;
M:
tga-image
image>stream
2drop
[
component-order>>
{
BGRA
BGRA
}
member?
[
bad-tga-unsupported
]
unless
]
keep
B{
0
}
write
B{
0
}
write
B{
2
}
write
B{
0 0 0 0 0
}
write
B{
0 0 0 0
}
write
{
[
dim>>
first
2
>le
write
]
[
dim>>
second
2
>le
write
]
[
component-order>>
{
{
BGR
[
~byte-array~
write
]
}
{
BGRA
[
~byte-array~
write
]
}
}
case
]
[
dup
component-order>>
{
{
BGR
[
0
]
}
{
BGRA
[
8
]
}
}
case
swap
upside-down?>>
[
0
]
[
2
]
if
3
shift
bitor
1
>le
write
]
[
bitmap>>
write
]
}
cleave
;