Portable Image Files
--------------------
`(require 'pnm)'
- Function: pnm:type-dimensions path
The string PATH must name a "portable bitmap graphics" file.
`pnm:type-dimensions' returns a list of 4 items:
1. A symbol describing the type of the file named by PATH.
2. The image width in pixels.
3. The image height in pixels.
4. The maximum value of pixels assume in the file.
The current set of file-type symbols is:
pbm
pbm-raw
Black-and-White image; pixel values are 0 or 1.
pgm
pgm-raw
Gray (monochrome) image; pixel values are from 0 to MAXVAL
specified in file header.
ppm
ppm-raw
RGB (full color) image; red, green, and blue interleaved
pixel values are from 0 to MAXVAL
- Function: pnm:image-file->array path array
Reads the "portable bitmap graphics" file named by PATH into
ARRAY. ARRAY must be the correct size and type for PATH. ARRAY
is returned.
- Function: pnm:image-file->array path
`pnm:image-file->array' creates and returns an array with the
"portable bitmap graphics" file named by PATH read into it.
- Procedure: pnm:array-write type array maxval path
Writes the contents of ARRAY to a TYPE image file named PATH. The
file will have pixel values between 0 and MAXVAL, which must be
compatible with TYPE. For `pbm' files, MAXVAL must be `1'.