Specifications

Intel
®
Image Processing Library Reference Manual
5-24
5
PreMultiplyAlpha
Pre-multiplies alpha
values of an image.
void iplPreMultiplyAlpha (IplImage*
image
,
int
alphaValue
);
image
The image for which the alpha pre-multiplication is
performed.
alphaValue
The global alpha value to use in the range 0 to 256. If
this value is negative (for example, -1), the internal
alpha channel of the image is used. It is an error
condition if an alpha channel does not exist.
Discussion
The function iplPreMultiplyAlpha() converts an image to the pre-
multiplied alpha form. If (R, G, B, A) are the red, green, blue, and alpha
values of a pixel, then the pixel is stored as (R*α,G*α,B*α,A)after
execution of this function. Here α[is the pixel’s normalized alpha value in
the range 0 to 1.
Optionally, a global alpha value
alphaValue
can be used for the entire
image. Then the pixels are stored as (R*α,G*α,B*α,
alphaValue
)ifthe
image has an alpha channel or (R*α,G*α,B*α) if the image does not
have an alpha channel. Here α[is the normalized
alphaValue
in the range
0to1.
The function
iplPreMultiplyAlpha() can be used for unsigned pixel
data only. It supports ROI, mask ROI and tiling.