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

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

GradientColorToGray

Converts a color gradient image to grayscale.

Syntax

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

Supported values for mod:

8u_C3C1R

16u_C3C1R

32f_C3C1R

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.

pDst

Pointer to the destination image ROI.

dstStep

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

roiSize

Size of the source and destination image ROI.

norm

Type of norm to form the mask for dilation; following values are possible:

ippiNormInf

Infinity norm.

ippiNormL1

L1 norm.

ippiNormL2

L2 norm.

Description

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

This function creates the grayscale gradient image pDst from the source three-channel gradient image pSrc. The type of norm is specified by the parameter. Pixel values for destination image are computed for different type of norm in accordance with the following formula:


For integer flavors the result is scaled to the full range of the destination data type.

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.

ippStsStepErr

Indicates an error condition if srcStep or dstStep is less than roiSize.width * < pixelSize>.

ippStsNotEvenStepErr

Indicates an error condition if one of the step values is not divisible by 2 for integer images, or by 4 for floating-point images.

ippStsBadArgErr

Indicates an error condition if norm has an illegal value.