Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

AlphaPremul

Pre-multiplies pixel values of an image by its alpha values.

Syntax

Case 1: Not-in-place operation

IppStatus ippiAlphaPremul_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize roiSize);

Supported values for mod:

8u_AC4R

16u_AC4R

IppStatus ippiAlphaPremul_<mod>(const Ipp<datatype>* const pSrc[4], int srcStep, Ipp<datatype>* const pDst[4], int dstStep, IppiSize roiSize);

Supported values for mod:

8u_AP4R

16u_AP4R

Case 2: In-place operation

IppStatus ippiAlphaPremul_<mod>(Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize roiSize);

Supported values for mod:

8u_AC4IR

16u_AC4IR

IppStatus ippiAlphaPremul_<mod>(Ipp<datatype>* const pSrcDst[4], int srcDstStep, IppiSize roiSize);

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

Pointer 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

Distance in bytes between starts of consecutive lines in the source image.

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.

pSrcDst

Pointer to the source and destination buffer or an array of pointers to separate source and destination color planes for the in-place operation.

srcDstStep

Distance in bytes between starts of consecutive lines in the source and destination image for the in-place operation.

roiSize

Size of the source and destination ROI in pixels.

Description

This function operates with ROI (see Regions of Interest in Intel IPP).

This function converts a RGBA source image (pixel order or planar) to the pre-multiplied alpha form. If (r,g,b,a) are the red, green, blue, and alpha values of a pixel, then new pixel values are (r* α, g*α, b*α, a) after execution of this function. Here α is the pixel normalized alpha value in the range 0 to 1.

The function ippiAlphaPremul 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.