Specifications

Image Creation and Access
4-11
4
Discussion
The function iplCreateImageHeader() creates an IplImage header
according to the specified attributes; see Example 4.1. The image data
pointer is set to
NULL; no memory for image data is allocated.
Example 4-1 Creating and Deleting an Image Header
int example41( void ) {
IplImage *imgh = iplCreateImageHeader(
3, // number of channels
0, // no alpha channel
IPL_DEPTH_8U, // data of byte type
"RGB", // color model
"BGR", // color order
IPL_DATA_ORDER_PIXEL, // channel arrangement
IPL_ORIGIN_TL, // top left orientation
IPL_ALIGN_QWORD, // 8 bytes align
150, // image width
100, // image height
NULL, // no ROI
NULL, // no mask ROI
NULL, // no image ID
NULL); // not tiled
if( NULL == imgh ) return 0;
iplDeallocate( imgh, IPL_IMAGE_HEADER );
return IPL_StsOk == iplGetErrStatus();
}
The function iplCreateImageHeader() sets the image size attribute in
the header to zero. To allocate memory for image data, call the function
iplAllocateImage().