AlphaComp
Combines two images using alpha (opacity) values of both images.
Syntax
Case 1: Not-in-place operation
IppStatus ippiAlphaComp_<mod>
(
const Ipp<datatype>*
pSrc1
,
int
src1Step
,
const Ipp<datatype>*
pSrc2
,
int
src2Step
,
Ipp<datatype>*
pDst
,
int
dstStep
,
IppiSize
roiSize
,
IppiAlphaType
alphaType
);
Supported values for
mod
:8u_AC1R | 16u_AC1R | 16s_AC4R | 32u_AC1R | 32s_AC1R | 32f_AC1R |
8u_AC4R | 16u_AC4R | 16s_AC1R | 32u_AC4R | 32s_AC4R | 32f_AC4R |
IppStatus ippiAlphaComp_<mod>
(
const Ipp<datatype>* const
pSrc1
[4]
,
int
src1Step
,
const Ipp<datatype>* const
pSrc2
[4]
,
int
src2Step
,
Ipp<datatype>* const
pDst
[4]
,
int
dstStep
,
IppiSize
roiSize
,
IppiAlphaType
alphaType
);
Supported values for
mod
:8u_AP4R | 16u_AP4R |
Case 2: In-place operation
IppStatus ippiAlphaComp_<mod>
(
const Ipp<datatype>*
pSrc
,
int
srcStep
,
Ipp<datatype>*
pSrcDst
,
int
srcDstStep
,
IppiSize
roiSize
,
IppiAlphaType
alphaType
);
Supported values for
mod
:8u_AC4IR | 16u_AC4IR | 16s_AC4IR | 32u_AC4IR | 32s_AC4IR | 32f_AC4IR |
IppStatus ippiAlphaComp_<mod>
(
const Ipp<datatype>* const
pSrc
[4]
,
int
srcStep
,
Ipp<datatype>* const
pSrcDst
[4]
,
int
srcDstStep
,
IppiSize
roiSize
,
IppiAlphaType
alphaType
);
Supported values for
mod
:8u_AP4IR | 16u_AP4IR |
Include Files
ippi.h
Domain Dependencies
Headers:
ippcore.h
,
ippvm.h
,
ipps.h
Libraries:
ippcore.lib
,
ippvm.lib
,
ipps.lib
Parameters
- pSrc,pSrc1,pSrc2
- Pointers to the source image ROI for pixel-order data. An array of pointers to ROI in the separate source color planes in case of planar data.
- srcStep,src1Step,src2Step
- Distances, in bytes, between the starting points of consecutive lines in the source images.
- pSrcDst
- Pointer to the source and destination buffer or an array of pointers to separate source and destination color planes for in-place operation.
- pDst
- Pointer to the destination image ROI for pixel-order data. An array of pointers to ROI in the separate destination color planes in case of planar data.
- srcDstStep
- Distance, in bytes, between the starting points of consecutive lines in the source and destination image for in-place operation.
- dstStep
- Distance, in bytes, between the starting points of consecutive lines in the destination image.
- roiSize
- Size of the source and destination ROI, in pixels.
- alphaType
- The composition type to perform. See Table“Possible Values of the Parameter alphaType”for the type value and description.
Description
This function operates with ROI (see Regions of Interest in Intel IPP).
This function performs an image compositing operation on RGBA images using alpha values of both images. The compositing is done by overlaying pixels (, ,, ) from the foreground image ,,, ) from the background image ,,, ) in the resultant image
r
A
g
A
b
A
α
A
pSrc1
with pixels (r
B
g
B
b
B
α
B
pSrc2
to produce pixels (r
C
g
C
b
C
α
C
pDst
. The alpha values are assumed to be normalized to the range [0..1].The type of the compositing operation is indicated by the
alphaType
parameter. Use Table “Possible Values of the Parameter alphaType”
to choose a valid alphaType
value depending on the required composition type. For example, the resulting pixel color components for the OVER operation (see Table “Types of Image Composing Operations”
) are computed as follows:r
C
α
A
r
A
α
A
α
B
r
B
g
C
α
A
g
A
α
A
α
B
g
B
b
C
α
A
b
A
α
A
α
B
b
B
The resulting (normalized) alpha value is computed as
α
C
α
A
α
A
α
B
This function can be used for unsigned pixel data only.
Return Values
- ippStsNoErr
- Indicates no error. Any other value indicates an error or a warning.
- ippStsNullPtrErr
- Indicates an error condition if one of the specified pointers isNULL.
- ippStsSizeErr
- Indicates an error condition ifroiSizehas a field with zero or negative value.