Portability | portable |
---|---|
Stability | provisional |
Maintainer | claude@mathr.co.uk |
Safe Haskell | Safe-Infered |
PNM image format header parsing and pretty printing.
PNM is PBM + PGM + PPM, a family of lowest common denominator image file formats.
References: http://netpbm.sourceforge.net/doc/pnm.html.
- data PNM
- pnmRasterBytes :: PNM -> Maybe Integer
- pnmPretty :: PNM -> ByteString
- data Parse p
- pnmParse :: ByteString -> Parse PNM
- pnms :: ByteString -> [(PNM, ByteString)]
- unpnms :: [(PNM, ByteString)] -> ByteString
- onPNMs :: (PNM -> ByteString -> (PNM, ByteString)) -> ByteString -> ByteString
- onPNMs' :: (PNM -> ByteString -> ByteString) -> ByteString -> ByteString
Documentation
pnmRasterBytes :: PNM -> Maybe IntegerSource
Compute the raster size in bytes for binary PNM images.
pnmPretty :: PNM -> ByteStringSource
Pretty-print a PNM image header without any comments.
The result of parsing.
pnmParse :: ByteString -> Parse PNMSource
Parse a PNM image header.
pnms :: ByteString -> [(PNM, ByteString)]Source
Parse a sequence of binary PNM images.
Malformed input (including huge raster sizes or plain images) is treated as end-of-image-stream.
unpnms :: [(PNM, ByteString)] -> ByteStringSource
Pretty-print a sequence of binary PNM images.
The precondition that the raster is of the correct length is not checked, so malformed output is possible.
onPNMs :: (PNM -> ByteString -> (PNM, ByteString)) -> ByteString -> ByteStringSource
Process a sequence of binary PNM images.
Malformed input (including huge raster sizes or plain images) is treated as end-of-image-stream.
The precondition that the raster is of the correct length is not checked, so malformed output is possible.
Header comments are not preserved.
onPNMs' :: (PNM -> ByteString -> ByteString) -> ByteString -> ByteStringSource
Process a sequence of binary PNM images.
Malformed input (including huge raster sizes or plain images) is treated as end-of-image-stream.
The precondition that the raster is of the correct length is not checked, so malformed output is possible.
Header comments are preserved. Assuming well-formed input:
onPNMs' (\_ r -> r) = id