NAME
nst_read_pnm_file8 - read ppm or pgm image into byte array
PROTOTYPE
int nst_read_pnm_file8( FILE *fp, int iDx, int iDy, int iXll, int iYll, unsigned char *pcR, unsigned char *pcG, unsigned char *pcB)
ARGUMENTS
- FILE *fp
- file ptr of source file
- int iDx
- width of image rectangle to read
- int iDy
- height of image rectangle to read
- int iXll
- x-offset of lower left corner of img rect to read
- int iYll
- y-offset of lower left corner of img rect to read
- unsigned char *pcR
- destination for red or mono image data
- unsigned char *pcG
- destination for green image data
- unsigned char *pcB
- destination for blue image data
DESCRIPTION:
Read a subrectangle of width iDx and height iDy with lower left
corner at (iXll,iYll) from pnm - file fp. If parts of the specified
rectangle are outside the image rectangle specified in the file, these
parts are set black and only the intersection is filled.
Arguments piR,piG,piB must point to the start of (sufficient) destination
memory for the red, green and blue image data.
When the file is a pgm-file (i.e., specifies only monochrome
data), or when at least one of piG and piB is NULL, only
mono data will be returned in piR (in the case of a
ppm file, this will be (R+G+B)/3).
SEE ALSO:
nst_read_pnm_file
FILE
/local/homes/rhaschke/nst7/man/../o.linx86//../nstsrc/nst_aux4.c