int left, int top, int width, int height, int band, int nbands )
int im_extract_area( IMAGE *in, IMAGE *out,
int left, int top, int width, int height )
int im_extract_bands( IMAGE *in, IMAGE *out,
int chsel, int nbands )
extracts the rectangular portion of the image defined by
left, top, width,
height of image in
and writes the result to image
The area must lie entirely within in the image. Selects the set of
starting at band number
(numbering bands from zero).
Works for any size image, any number of bands, any type. Works for LABPACK
coded images too! But disallows band extraction in this case.
is a convenience function which extracts an area from an
image, leaving the bands the same.
out of an image, starting from band
So, for example, nbands == 2, bands == 1 will form a two band image from an RGB
image, where the two bands are the G and the B bands.
The function returns 0 on success and -1 on error.