LUT_Cubic

Maps an image by applying intensity transformation with cubic interpolation.

Syntax

Case 1: Not-in-place operation on one-channel integer data

IppStatus ippiLUT_Cubic_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize roiSize, const Ipp32s* pValues, const Ipp32s* pLevels, int nLevels);

Supported values for mod:

8u_C1R 16u_CIR 16s_CIR

Case 2: Not-in-place operation on multi-channel integer data

IppStatus ippiLUT_Cubic_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize roiSize, const Ipp32s* pValues[3], const Ipp32s* pLevels[3], int nLevels[3]);

Supported values for mod:

8u_C3R 16u_C3R 16s_C3R
8u_AC4R 16u_AC4R 16s_AC4R

IppStatus ippiLUT_Cubic_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize roiSize, const Ipp32s* pValues[4], const Ipp32s* pLevels[4], int nLevels[4]);

Supported values for mod:

8u_C4R 16u_C4R 16s_C4R

Case 3: Not-in-place operation on one-channel floating-point data

IppStatus ippiLUT_Cubic_32f_C1R(const Ipp32f* pSrc, int srcStep, Ipp32f* pDst, int dstStep, IppiSize roiSize, const Ipp32f* pValues, const Ipp32f* pLevels, int nLevels);

Case 4: Not-in-place operation on multi-channel floating-point data

IppStatus ippiLUT_Cubic_<mod>(const Ipp32f* pSrc, int srcStep, Ipp32f* pDst, int dstStep, IppiSize roiSize, const Ipp32f* pValues[3], const Ipp32f* pLevels[3], int nLevels[3]);

Supported values for mod:

32f_C3R
32f_AC4R

IppStatus ippiLUT_Cubic_32f_C4R(const Ipp32f* pSrc, int srcStep, Ipp32f* pDst, int dstStep, IppiSize roiSize, const Ipp32f* pValues[4], const Ipp32f* pLevels[4], int nLevels[4]);

Case 5: In-place operation on one-channel integer data

IppStatus ippiLUT_Cubic_<mod>(Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize roiSize, const Ipp32s* pValues, const Ipp32s* pLevels, int nLevels);

Supported values for mod:

8u_C1IR 16u_C1IR 16s_C1IR

Case 6: In-place operation on multi-channel integer data

IppStatus ippiLUT_Cubic_<mod>(Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize roiSize, const Ipp32s* pValues[3], const Ipp32s* pLevels[3], int nLevels[3]);

Supported values for mod:

8u_C3IR 16u_C3IR 16s_C3IR
8u_AC4IR 16u_AC4IR 16s_AC4IR

IppStatus ippiLUT_Cubic_<mod>(Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize roiSize, const Ipp32s* pValues[4], const Ipp32s* pLevels[4], int nLevels[4]);

Supported values for mod:

8u_C4IR 16u_C4IR 16s_C4IR

Case 7: In-place operation on one-channel floating-point data

IppStatus ippiLUT_Cubic_32f_C1R(Ipp32f* pSrcDst, int srcDstStep, IppiSize roiSize, const Ipp32f* pValues, const Ipp32f* pLevels, int nLevels);

Case 8: In-place operation on multi-channel floating-point data

IppStatus ippiLUT_Cubic_<mod>(Ipp32f* pSrcDst, int srcDstStep, IppiSize roiSize, const Ipp32f* pValues[3], const Ipp32f* pLevels[3], int nLevels[3]);

Supported values for mod:

32f_C3IR
32f_AC4IR

IppStatus ippiLUT_Cubic_32f_C4IR(Ipp32f* pSrcDst, int srcDstStep, IppiSize roiSize, const Ipp32f* pValues[4], const Ipp32f* pLevels[4], int nLevels[4]);

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.

pSrcDst

Pointer to the source and destination mage ROI 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 ROI in pixels.

pValues

Pointer to the array of intensity values. In case of multi-channel data, pValues is an array of pointers to the intensity values array for each channel.

pLevels

Pointer to the array of level values. In case of multi-channel data, pLevels is an array of pointers to the level values array for each channel.

nLevels

Number of levels, separate for each channel.

Description

The function ippiLUT_Cubic is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP).

This function performs intensity transformation of the source image pSrc using the lookup table (LUT) with cubic interpolation between neighbor levels. The LUT is specified by the arrays pLevels and pValues.

Every source pixel pSrc(x,y) from the range [pLevels[k], pLevels[k+1]) is mapped to the destination pixel pDst(x,y) whose value is computed as

pDst(x,y)= A*pSrc(x,y)3 + B*pSrc(x,y)2 + C*pSrc(x,y) + D.

([pLevels[k-1], pLevels[k-1])

([pLevels[k], pLevels[k])

([pLevels[k+1], pLevels[k+1])

([pLevels[k+2], pLevels[k+2])

Correspondingly, coefficients A, B, C, D are computed by solving the following set of linear equations:

A*pLevels[k-1]3 + B*pLevels[k-1]2 + C*pLevels[k-1] + D = pValues[k-1]

A*pLevels[k]3 + B*pLevels[k]2 + C*pLevels[k] + D = pValues[k]

A*pLevels[k+1]3 + B*pLevels[k+1]2 + C*pLevels[k+1] + D = pValues[k+1]

A*pLevels[k+2]3 + B*pLevels[k+2]2 + C*pLevels[k+2] + D = pValues[k+2]

Length of the pLevels and pValues arrays is defined by the nLevels parameter. Pixels in the pSrc image that are not in the range [pLevels[0], pLevels[nLevels-1]) are copied to the pDst image without any transformation.

Figure Example Mapping Curves Used by the ippiLUT Function Flavors shows particular curves that are used in all the ippiLUT function flavors for mapping. The level values are 0, 64, 128, 192, 256; the intensity values are 20, 60, 160, 180, 230.

Return Values

ippStsNoErr

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

ippStsNullPtrErr

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

ippStsSizeErr

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

ippStsMemAllocErr

Indicates an error when there is not enough memory for inner buffers.

ippStsLUTNofLevelsErr

Indicates an error when the nLevels is less than 2.

Submit feedback on this help topic

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