Specifications
Intel
®
Image Processing Library Reference Manual
4-38
4
PutPixel,
GetPixel
Sets/retrieves a value of
an image’s pixel.
void iplPutPixel(IplImage*
image
, int
x
, int
y
,
void* pixel);
void iplGetPixel(IplImage*
image
, int
x
, int
y
,
void* pixel);
image
An image header with allocated image data.
x, y
The pixel coordinates.
pixel
The pointer to a buffer storing the consecutive
channel values for the pixel.
Discussion
The function iplPutPixel() sets the channels in
image
’s pixel (
x
,
y
)to
the values specified in the buffer
pixel
.
The function
iplGetPixel() retrieves the values of all channels in
image
’s pixel (
x
,
y
) to the buffer
pixel
.
All channels are processed, including the alpha channel (if applicable).
The channel values in the buffer are stored consecutively.
The functions work for all pixel depths supported in the library. The ROI
and mask are ignored.
Example 4-7 on the next page illustrates the usage of the function
iplGetPixel().