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

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

AddSquare

Adds squared pixel values of a source image to floating-point pixel values of an accumulator image.

Syntax

Case 1: In-place operation

IppStatus ippiAddSquare_<mod>(const Ipp<srcDatatype>* pSrc, int srcStep, Ipp32f* pSrcDst, int srcDstStep, IppiSize roiSize);

Supported values for mod:

8u32f_C1IR

16u32f_C1IR

32f_C1IR

Case 2: Masked in-place operation

IppStatus ippiAddSquare_<mod>(const Ipp<srcDatatype>* pSrc, int srcStep, 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

pSrc

Pointer to the source image ROI.

srcStep

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

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 squared pixel values of the source image pSrc to floating-point pixel values of the accumulator image pSrcDst as follows:

pSrcDst(x,y) = pSrcDst(x,y) + pSrc(x,y)2

Addition of the squared pixel values in case of a masked operation is performed only if the respective mask value is nonzero; otherwise, the accumulator pixel value remains unchanged.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error condition if any of the specified pointers is NULL.

ippStsSizeErr

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

ippStsStepErr

Indicates an error when srcStep, maskStep, or srcDstStep 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.