#include #include void main() { IppStatus status=ippStsNoErr; /* print the version of ipp being used */ const IppLibraryVersion* lib = ippiGetLibVersion(); printf("%s %s %d.%d.%d.%d\n", lib->Name, lib->Version,lib->major, lib->minor, lib->majorBuild, lib->build); /* create a source test image */ Ipp8u * pSrc; int srcWidth=3, srcHeight=4; IppiSize srcSize = { srcWidth, srcHeight}; IppiRect srcRoi = { 0, 0, srcWidth, srcHeight}; int nChannel=3; int srcStep; /* Note: the srcStep != channel*srcWidth in most of case. srcStep may be = ((nChannel*srcWidth+3)>>2)<<2 if bmp 4 bytes-aligned format; srcStep may be = a 32x value if use ippiMalloc(), it is 32 bytes-aligned */ pSrc=ippiMalloc_8u_C3(srcWidth, srcHeight, &srcStep); status=ippiImageJaehne_8u_C3R(pSrc, srcStep,srcSize); //create a destination test image */ Ipp8u * pDst; int dstWidth=17, dstHeight=23; IppiSize dstSize = { dstWidth, dstHeight }; IppiRect dstRoi = { 0, 0, dstWidth, dstHeight }; int dstStep; pDst=ippiMalloc_8u_C3(dstWidth, dstHeight, &dstStep); /* set/calculate of the x, y dimensions Factors,Shift Value,Interpolation value please note, xFactor is double type float point number. */ double xFactor = (double)dstWidth / srcWidth; double yFactor = (double)dstHeight / srcHeight; double xShift = 0.0; double yShift = 0.0; /* interploation options are: IPPI_INTER_NN||IPPI_INTER_LINEAR|| IPPI_INTER_CUBIC IPPI_INTER_CUBIC2P_BSPLINE||IPPI_INTER_CUBIC2P_CATMULLROM||PPI_INTER_CUBIC2P_B05C03 IPPI_INTER_SUPER||IPPI_INTER_LANCZOS */ int interpolation = IPPI_INTER_LANCZOS; /* calculation of work buffer size */ Ipp8u * pBuffer; int bufSize = 0; ippiResizeGetBufSize(srcRoi, dstRoi, nChannel, interpolation, &bufSize ); pBuffer= ippsMalloc_8u(bufSize ); /* Resize Image */ status=ippiResizeSqrPixel_8u_C3R(pSrc, srcSize, srcStep, srcRoi, pDst, dstStep, dstRoi, xFactor, yFactor, xShift, yShift, interpolation, pBuffer); printf("%d : %s\n", status, ippGetStatusString(status)); if( NULL != pBuffer ) ippiFree( pBuffer); if( NULL != pDst ) ippiFree( pDst); if( NULL != pSrc ) ippiFree( pSrc); return; }