ilGetBytesPerRow(3X)
NAME
ilGetBytesPerRow() − return the number of bytes required to hold one image scan line
SYNOPSIS
void
ilGetBytesPerRow (
ilImageDes *pDes,
ilImageFormat *pDes,
long width
long *pnBytesPerRow);
DESCRIPTION
ilGetBytesPerRow() returns the number of bytes required to hold one scan line of an image.
*pDes points to a descriptor of the image.
*pFormat points to the format of the image.
width is the width in pixels of one scan line of the image
*pNBytesPerRow
receives an array of IL_MAX_SAMPLES long where the minimum scan line width, in bytes, is returned for each plane. If pFormat->sampleOrder is IL_SAMPLE_PIXELS, there is one plane of data, and on return *pNBytesPerRow will contain the minimum length of each scan line in bytes. If pFormat->sampleOrder is IL_SAMPLE_PLANES, there are pDes->nSamplesPerPixels planes, and pNBytesPerRow[i] will contain the byte length for each plane "i" where "i" ranges from 0 to pDes->nSamplesPerPixels - 1.
RETURN VALUE
ilGetBytesPerRow() has no return value.
ERRORS
If the call fails, context->error receives a non-zero error code.
EXAMPLE
The following example returns in the variable numBytes the number of bytes required to hold one scan line of a YCbCr, plane oriented image that is 640 pixels wide.
long rowBytesPerPlane [IL_MAX_SAMPLES];
.
.
.
/∗ Get the bytes per row ∗/
if (!ilGetBytesPerRow (IL_DES_YCBCR_2, IL_FORMAT_3BYTE_PLANE,
640, rowBytesPerPlane)) return(context->error);
AUTHOR
ilGetBytesPerRow() was developed by HP.
SEE ALSO
ilImageDes(3X), ilImageFormat(3X), ilerror(3X).
Using the Image Developer’s Kit.
Hewlett-Packard Company — Image Library: February, 1995