My environment:
- IPP 2020
- Windows 10
- VS 2019
I'm testing ipprCopyConstBorder_16u_C1V.
It looks like it is designed to place a small image VOI into a large image.
The following code should return a ippStsSizeErr ( since dstRoiVolume.width = 7 < srcRoiVolume.width = 5 + leftBorderWidth 3 ), but it returns ippStsOk.
Please confirm:
void TestCopy() { using namespace std; const IpprVolume srcSize = { 5,5,5 }; const IpprVolume dstSize = { 7,7,7 }; const int numSrc = srcSize.width * srcSize.height * srcSize.depth; const int numDst = dstSize.width * dstSize.height * dstSize.depth; const int srcStep = srcSize.width * sizeof(unsigned short); const int srcPlaneStep = srcSize.width * srcSize.height * sizeof(unsigned short); const int dstStep = dstSize.width * sizeof(unsigned short); const int dstPlaneStep = dstSize.width * dstSize.height * sizeof(unsigned short); vector<unsigned short> srcVol(numSrc), dstVol(numDst); memset(dstVol.data(), 0, numDst * sizeof(unsigned short)); //Set src image. int i = 0; for (int z = 0; z < srcSize.depth; z++) { for (int y = 0; y < srcSize.height; y++) { for (int x = 0; x < srcSize.width; x++) { cout << ""<< i; srcVol[i++] = i; } cout << endl; } cout << endl << endl; } cout << "End outputting src volume"<< endl << endl; cout << "Begin outputting dst volume"<< endl << endl; //Using xBorder = 3 should result in a ippStsSizeErr per the documentation! int xBorder = 3, yBorder = 2, zBorder = 2; unsigned short val = numeric_limits<unsigned short>::max(); IppStatus sts = ipprCopyConstBorder_16u_C1V(srcVol.data(), srcPlaneStep, srcStep, srcSize, dstVol.data(), dstPlaneStep, dstStep, dstSize, xBorder, yBorder, zBorder, &val); assert(sts == ippStsSizeErr); i = 0; for (int z = 0; z < dstSize.depth; z++) { for (int y = 0; y < dstSize.height; y++) { for (int x = 0; x < dstSize.width; x++) { unsigned val = dstVol[i++]; cout << ""<< val; } cout << endl; } cout << endl << endl; } }
TCE Level:
TCE Open Date:
Tuesday, March 17, 2020 - 07:25