Transposes a source image.
Case 1: Not-in-place operation
IppStatus ippiTranspose_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize roiSize);
Supported values for mod:
8u_C1R | 16u_C1R | 16s_C1R | 32s_C1R | 32f_C1R |
8u_C3R | 16u_C3R | 16s_C3R | 32s_C3R | 32f_C3R |
8u_C4R | 16u_C4R | 16s_C4R | 32s_C4R | 32f_C4R |
Case 2: In-place operation
IppStatus ippiTranspose_<mod>(const Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize roiSize);
Supported values for mod:
8u_C1IR | 16u_C1IR | 16s_C1IR | 32s_C1IR | 32f_C1IR |
8u_C3IR | 16u_C3IR | 16s_C3IR | 32s_C3IR | 32f_C3IR |
8u_C4IR | 16u_C4IR | 16s_C4IR | 32s_C4IR | 32f_C4IR |
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 ROI for in-place operation. |
srcDstStep |
Distance in bytes between starts of consecutive lines in the source and destination image buffer for the in-place operation. |
roiSize |
Size of the source ROI in pixels. |
The function ippiTranspose is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP).
This function transposes the source image pSrc (pSrcDst for in-place flavors) and stores the result in pDst (pSrcDst). The destination image is obtained from the source image by transforming the columns to the rows, that is, pDst(x,y) = pSrc(y,x)
The parameter roiSize is specified for the source image; therefore roiSize.width for the destination image is equal to roiSize.height for the source image, and roiSize.height for the destination image is equal to roiSize.width for the source image.
For in-place opeartions, roiSize.width must be equal to roiSize.height.
The code example shows how to use ippi_8u_C1R:
Example “Using ippiTranspose” shows how to use the function ippiTranspose_8u_C1R.
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, with the exception of second mode in Case 4. |
ippStsSizeErr |
Indicates an error condition if roiSize has a field with a zero or negative value, or roiSize.width is not equal to roiSize.height for in-place flavors. |
Ipp8u src[8*4] = {1, 2, 3, 4, 8, 8, 8, 8,
1, 2, 3, 4, 8, 8, 8, 8,
1, 2, 3, 4, 8, 8, 8, 8,
1, 2, 3, 4, 8, 8, 8, 8};
Ipp8u dst[4*4];
IppiSize srcRoi = { 4, 4 };
ippiTranspose_8u_C1R ( src, 8, dst, 4, srcRoi );
Result:
1 2 3 4 8 8 8 8
1 2 3 4 8 8 8 8 src
1 2 3 4 8 8 8 8
1 1 1 1
2 2 2 2
3 3 3 3 dst
4 4 4 4
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.