AlphaComp

Combines two images using alpha (opacity) values of both images.

Syntax

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

8s_AC1R

16u_AC1R

16s_AC1R

32u_AC1R

32s_AC1R

32f_AC1R

8s_AC1R

16u_AC1R

16s_AC1R

8u_AC4R

32u_AC4R

32s_AC4R

32f_AC4R

IppStatus ippiAlphaComp_<mod>(const Ipp<datatype>* constpSrc1[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

Parameters

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.

src1Step, src2Step

Distances in bytes between starts of consecutive lines in the source images.

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.

dstStep

Distance in bytes between starts 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

The function ippiAlphaComp is declared in the ippi.h file. It 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 (rA, gA,bA, αA) from the foreground image pSrc1 with pixels (rB,gB,bB, αB) from the background image pSrc2 to produce pixels (rC,gC,bC, αC) in the resultant image 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:

rC = αA * rA +(1 - αA)* αB *rB

gC = αA * gA +(1 - αA)* αB *gB

bC = αA * bA +(1 - αA)* αB *bB

The resulting (normalized) alpha value is computed as

αC = αA +(1 - α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 is NULL.

ippStsSizeErr

Indicates an error condition if roiSize has a field with zero or negative value.

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.