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

ID 790148
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

CopyConstBorder

Copies pixels values between two images and adds the border pixels with a constant value.

Syntax

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

IppStatus ippiCopyConstBorder_<mod>(const Ipp<datatype>* pSrc, int srcStep, IppiSize srcRoiSize, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, int topBorderHeight, int leftBorderWidth, Ipp<datatype> value);

Supported values for mod:

8u_C1R 16u_C1R 16s_C1R 32s_C1R 32f_C1R

Case 2: In-place operation on one-channel data

IppStatus ippiCopyConstBorder_<mod>(Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize srcRoiSize, IppiSize dstRoiSize, int topBorderHeight, int leftBorderWidth, const Ipp<datatype> value);

Supported values for mod:

8u_C1IR 16u_C1IR 16s_C1IR 32s_C1IR 32f_C1IR

Case 3: Not-in-place operation on multi-channel data

IppStatus ippiCopyConstBorder_<mod>(const Ipp<datatype>* pSrc, int srcStep, IppiSize srcRoiSize, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, int topBorderHeight, int leftBorderWidth, const Ipp<datatype> value[3]);

Supported values for mod:

8u_C3R 16u_C3R 16s_C3R 32s_C3R 32f_C3R
8u_AC4R 16u_AC4R 16s_AC4R 32s_AC4R 32f_AC4R

IppStatus ippiCopyConstBorder_<mod>(const Ipp<datatype>* pSrc, int srcStep, IppiSize srcRoiSize, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, int topBorderHeight, int leftBorderWidth, const Ipp<datatype> value[4]);

Supported values for mod:

8u_C4R 16u_C4R 16s_C4R 32s_C4R 32f_C4R

Case 4: In-place operation on multi-channel data

IppStatus ippiCopyConstBorder_<mod>(Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize srcRoiSize, IppiSize dstRoiSize, int topBorderHeight, int leftBorderWidth, const Ipp<datatype> value[3]);

Supported values for mod:

8u_C3IR 16u_C3IR 16s_C3IR 32s_C3IR 32f_C3IR
8u_AC4IR 16u_AC4IR 16s_AC4IR 32s_AC4IR 32f_AC4IR

IppStatus ippiCopyConstBorder_<mod>(Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize srcRoiSize, IppiSize dstRoiSize, int topBorderHeight, int leftBorderWidth, const Ipp<datatype> value[4]);

Supported values for mod:

8u_C4IR 16u_C4IR 16s_C4IR 32s_C4IR 32f_C4IR

Case 5: Not-in-place operation on one-channel data with platform-aware functions

IppStatus ippiCopyConstBorder_<mod>(const Ipp<datatype>* pSrc, IppSizeL srcStep, IppiSizeL srcRoiSize, Ipp<datatype>* pDst, IppSizeL dstStep, IppiSizeL dstRoiSize, IppSizeL topBorderHeight, IppSizeL leftBorderWidth, Ipp<datatype> value);

Supported values for mod:

8u_C1R_L 16u_C1R_L 16s_C1R_L 32s_C1R_L 32f_C1R_L

Case 6: In-place operation on one-channel data with platform-aware functions

IppStatus ippiCopyConstBorder_<mod>(Ipp<datatype>* pSrcDst, IppSizeL srcDstStep, IppiSizeL srcRoiSize, IppiSizeL dstRoiSize, IppSizeL topBorderHeight, IppSizeL leftBorderWidth, const Ipp<datatype> value);

Supported values for mod:

8u_C1IR_L 16u_C1IR_L 16s_C1IR_L 32s_C1IR_L 32f_C1IR_L

Case 7: Not-in-place operation on multi-channel data with platform-aware functions

IppStatus ippiCopyConstBorder_<mod>(const Ipp<datatype>* pSrc, IppSizeL srcStep, IppiSizeL srcRoiSize, Ipp<datatype>* pDst, IppSizeL dstStep, IppiSizeL dstRoiSize, IppSizeL topBorderHeight, IppSizeL leftBorderWidth, const Ipp<datatype> value[3]);

Supported values for mod:

8u_C3R_L 16u_C3R_L 16s_C3R_L 32s_C3R_L 32f_C3R_L
8u_AC4R_L 16u_AC4R_L 16s_AC4R_L 32s_AC4R_L 32f_AC4R_L

IppStatus ippiCopyConstBorder_<mod>(const Ipp<datatype>* pSrc, IppSizeL srcStep, IppiSizeL srcRoiSize, Ipp<datatype>* pDst, IppSizeL dstStep, IppiSizeL dstRoiSize, IppSizeL topBorderHeight, IppSizeL leftBorderWidth, const Ipp<datatype> value[4]);

Supported values for mod:

8u_C4R_L 16u_C4R_L 16s_C4R_L 32s_C4R_L 32f_C4R_L

Case 8: In-place operation on multi-channel data with platform-aware functions

IppStatus ippiCopyConstBorder_<mod>(Ipp<datatype>* pSrcDst, IppSizeL srcDstStep, IppiSizeL srcRoiSize, IppiSizeL dstRoiSize, IppSizeL topBorderHeight, IppSizeL leftBorderWidth, const Ipp<datatype> value[3]);

Supported values for mod:

8u_C3IR_L 16u_C3IR_L 16s_C3IR_L 32s_C3IR_L 32f_C3IR_L
8u_AC4IR_L 16u_AC4IR_L 16s_AC4IR_L 32s_AC4IR_L 32f_AC4IR_L

IppStatus ippiCopyConstBorder_<mod>(Ipp<datatype>* pSrcDst, IppSizeL srcDstStep, IppiSizeL srcRoiSize, IppiSizeL dstRoiSize, IppSizeL topBorderHeight, IppSizeL leftBorderWidth, const Ipp<datatype> value[4]);

Supported values for mod:

8u_C4IR_L 16u_C4IR_L 16s_C4IR_L 32s_C4IR_L 32f_C4IR_L

Include Files

ippi.h

Flavors with the _L suffix: ippi_l.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.

srcStep

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

pDst

Pointer to the destination image.

pSrcDst

Pointer to the source/destination image (for in-place flavors).

dstStep

Distance, in bytes, between the starting points of consecutive lines in the destination image.

srcDstStep

Distance, in bytes, between the starting points of consecutive lines in the source/destination image (for in-place flavors).

srcRoiSize

Size of the source ROI, in pixels.

dstRoiSize

Size of the destination ROI, in pixels.

topBorderHeight

Height of the top border, in pixels.

leftBorderWidth

Width of the left border, in pixels.

value

The constant value to assign to the border pixels (constant vector in case of multi-channel images).

Description

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

This function copies the source image pSrc to the destination image pDst and creates border outside the copied area; pixel values of the border are set to the specified constant value that is passed by the value argument. The parameters topBorderHeight and leftBorderWidth specify the position of the first pixel of the source ROI in the destination image ROI (see Figure Creating a Border of Pixels with Constant Value.) Squares marked in red correspond to pixels copied from the source image, that is, the source image ROI.

Creating a Border of Pixels with Constant Value



The height (width) of the destination ROI cannot be less than the sum of the height (width) of source ROI and the topBorderHeight (leftBorderWidth) parameter.

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 srcRoiSize or dstRoiSize has a field with a zero or negative value, or topBorderHeight or leftBorderWidth is less than zero, or dstRoiSize.width < srcRoiSize.width + leftBorderWidth, or dstRoiSize.height < srcRoiSize.height + topBorderHeight.

ippStsStepErr

Indicates an error condition if srcStep or dstStep has a zero or negative value.

Example

The code example below shows how to use the function ippiCopyConstBorder_8u_C1R.

Ipp8u src[8*4] = {3, 3, 3, 3, 3, 8, 8, 8,
                  3, 2, 1, 2, 3, 8, 8, 8,
                  3, 2, 1, 2, 3, 8, 8, 8,
                  3, 3, 3, 3, 3, 8, 8, 8};
Ipp8u dst[8*6];
IppiSize srcRoi = { 5, 4 };
IppiSize dstRoi = { 7, 6 };
int borderWidth  = 1;
int borderHeight = 1;
int borderVal = 0;
		
ippiCopyConstBorder_8u_C1R(src, 8, srcRoi, dst, 8, dstRoi, borderHeight, borderWidth, borderVal);
		Results
source image:
3 3 3 3 3 8 8 8
3 2 1 2 3 8 8 8
3 2 1 2 3 8 8 8   src
3 3 3 3 3 8 8 8
		
destination image:
0 0 0 0 0 0 0
0 3 3 3 3 3 0
0 3 2 1 2 3 0
0 3 2 1 2 3 0    dst
0 3 3 3 3 3 0
0 0 0 0 0 0 0