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

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

AddProduct

Adds product of pixel values of two source images to floating-point pixel values of an accumulator image.

Syntax

Case 1: In-place operation

IppStatus ippiAddProduct_<mod>(const Ipp<srcDatatype>* pSrc1, int src1Step, const Ipp<srcDatatype>* pSrc2, int src2Step, Ipp32f* pSrcDst, int srcDstStep, IppiSize roiSize);

Supported values for mod:

8u32f_C1IR

16u32f_C1IR

32f_C1IR

Case 2: Masked in-place operation

IppStatus ippiAddProduct_<mod>(const Ipp<srcDatatype>* pSrc1, int src1Step, const Ipp<srcDatatype>* pSrc2, int src2Step, const Ipp8u* pMask, int maskStep, Ipp32f* pSrcDst, int srcDstStep, IppiSize roiSize);

Supported values for mod:

8u32f_C1IMR

16u32f_C1IMR

32f_C1IMR

Include Files

ippcv.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h, ippi.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib

Parameters

pSrc1, pSrc2

Pointers to the source images ROI.

src1Step, src2Step

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

pMask

Pointer to the mask image.

maskStep

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

pSrcDst

Pointer to the destination (accumulator) image ROI.

srcDstStep

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

roiSize

Size of the image ROI in pixels.

Description

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

This function adds the product of pixel values of two source images pSrc1 and pSrc2 to floating-point pixel values of the accumulator image pSrcDst as given by:

pSrcDst(x,y) = pSrcDst(x,y) + pSrc1(x,y) * pSrc2(x,y)

The products of pixel values in case of a masked operation are added only if the respective mask value is nonzero; otherwise, the accumulator pixel value remains unchanged.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is null.

ippStsSizeErr

Indicates an error when roiSize.width or roiSize.height is negative.

ippStsStepErr

Indicates an error if src1Step, src2Step, maskStep, or srcDdstStep is less than roiSize.width * <pixelSize>.

ippStsNotEvenStepErr

Indicates an error condition if one of step values for floating-point images cannot be divided by 4.