summaryrefslogtreecommitdiffstats
path: root/pnm.txi
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
commit8466d8cfa486fb30d1755c4261b781135083787b (patch)
treec8c12c67246f543c3cc4f64d1c07e003cb1d45ae /pnm.txi
parent87b82b5822ca54228cfa6df29be3ad9d4bc47d16 (diff)
downloadslib-8466d8cfa486fb30d1755c4261b781135083787b.tar.gz
slib-8466d8cfa486fb30d1755c4261b781135083787b.zip
Import Upstream version 3a1upstream/3a1
Diffstat (limited to 'pnm.txi')
-rw-r--r--pnm.txi66
1 files changed, 66 insertions, 0 deletions
diff --git a/pnm.txi b/pnm.txi
new file mode 100644
index 0000000..67105ad
--- /dev/null
+++ b/pnm.txi
@@ -0,0 +1,66 @@
+@code{(require 'pnm)}
+@ftindex pnm
+
+
+@defun pnm:type-dimensions path
+
+The string @var{path} must name a @dfn{portable bitmap graphics} file.
+@cindex portable bitmap graphics
+@code{pnm:type-dimensions} returns a list of 4 items:
+@enumerate
+@item
+A symbol describing the type of the file named by @var{path}.
+@item
+The image width in pixels.
+@item
+The image height in pixels.
+@item
+The maximum value of pixels assume in the file.
+@end enumerate
+
+The current set of file-type symbols is:
+@table @asis
+@item pbm
+@itemx pbm-raw
+@cindex pbm
+@cindex pbm-raw
+Black-and-White image; pixel values are 0 or 1.
+@item pgm
+@itemx pgm-raw
+@cindex pgm
+@cindex pgm-raw
+Gray (monochrome) image; pixel values are from 0 to @var{maxval}
+specified in file header.
+@item ppm
+@itemx ppm-raw
+@cindex ppm
+@cindex ppm-raw
+RGB (full color) image; red, green, and blue interleaved pixel values
+are from 0 to @var{maxval}
+@end table
+@end defun
+
+@defun pnm:image-file->array path array
+
+
+Reads the @dfn{portable bitmap graphics} file named by @var{path} into
+@cindex portable bitmap graphics
+@var{array}. @var{array} must be the correct size and type for
+@var{path}. @var{array} is returned.
+
+
+@defunx pnm:image-file->array path
+
+@code{pnm:image-file->array} creates and returns an array with the
+@dfn{portable bitmap graphics} file named by @var{path} read into it.
+@cindex portable bitmap graphics
+@end defun
+
+@defun pnm:array-write type array maxval path comment @dots{}
+
+
+Writes the contents of @var{array} to a @var{type} image file named @var{path}. The file
+will have pixel values between 0 and @var{maxval}, which must be compatible
+with @var{type}. For @samp{pbm} files, @var{maxval} must be @samp{1}.
+@var{comment}s are included in the file header.
+@end defun