Handbook
Glossary
read-pbm ( -- image )
Vocabulary
images
.
pbm
.
private
Inputs
None
Outputs
image
an
object
Definition
USING:
accessors
combinators
continuations
images
kernel
make
;
IN:
images.pbm.private
::
read-pbm
( -- image )
read-token
:>
type
read-number
:>
width
read-number
:>
height type
{
{
"P1"
[
[
[
read-ascii-bits
]
ignore-errors
]
B{
}
make
]
}
{
"P4"
[
[
width height
read-binary-bits
]
B{
}
make
]
}
}
case
:>
data
image
new
L
>>component-order
{
width height
}
>>dim
f
>>upside-down?
data
>>bitmap
ubyte-components
>>component-type
;