Command: readPGM

NEST HelpDesk Command Index NEST Quick Reference

Name:
readPGM - read in grey-level image in PGM Format.

Synopsis:
string readPGM -> int    int    int   arraytype
fname  readPGM -> width height maxval [grayvals]

Description:
this function reads an image file in the PGM format and 
returns the width, height, maximum gray value and the 
image itself (as a linear array).
On Unix systems, man pgm should give you a description
of the PGM (Portable GrayMap) image format.

Parameters:
fname      - name of file to be read
[grayvals] - one-dim. array containing the pixel gray values,
             starting from the upper left corner of the image, 
   	  continuing rowwise (normal englissh reading order).
maxval     - the maximum gray value
width      - width of image in pixels (no. of columns)
height     - height of image (no. of rows)

Examples:
(FancyImage.pgm) readPGM -> 16 24 255 [grayvals]
    
This reads the image FancyImage.pgm, and tells you that it has 
16 columns, 24 rows, and a maximum gray value of 255. The pixel
gray values are stored in the array.

Author:
Schmuker, Gewaltig

FirstVersion:
9.1.2003

SeeAlso:writePGM
Source:
 /home/abuild/rpmbuild/BUILD/nest-2.4.1/sli/sligraphics.cc

NEST HelpDesk Command Index NEST Quick Reference

© 2000-2010 The NEST Initiative