Specifications

Image Creation and Access
4-13
4
AllocateImage, AllocateImageFP
Allocates memory for image
dataaccordingtothe
specified header.
void iplAllocateImage(IplImage*
image
, int
doFill,
int
fillValue
);
void iplAllocateImageFP(IplImage*
image
, int
doFill,
float
fillValue
);
image
An image header with a NULL image data pointer.
The pointer will be set to newly allocated image
data memory after calling this function.
doFill
A flag: if zero, indicates that the pixel data should
not be initialized by
fillValue
.
fillValue
The initial value for pixel data.
Discussion
These functions are used to allocate image data on the basis of a specified
image header. The header must be properly constructed before calling this
function. Note that
IPL_DEPTH_32F is the only admissible depth for
IplImage passed into iplAllocateImageFP(); this depth must not be
used for
iplAllocateImage().
Memory is allocated for the image data according to the attributes specified
in the image header; see Example 4-2. The image data pointer will then
point to the allocated memory. It is highly preferable, for efficiency
considerations, that the scanline alignment attribute (argument
align
)in
the image header be set to
IPL_ALIGN_QWORD. This will force the image
data to be aligned on a quadword (64-bit) memory boundary.
The functions set the image size attribute in the header to the number of
bytes allocated for the image.