IPP is a C library, with hundreds of functions like this:
IppStatus ippiTranspose_8u_C1R(const Ipp8u* pSrc, int srcStep,
Ipp8u* pDst, int dstStep,
IppiSize roiSize));
To be able to call these functions in a more convenient, safe and consistent way, we need a C++ wrapper function for each C function. For example:
void ippiTranspose(const Image<Ipp8u> &src, Rect srcRect, Image<Ipp8u> &dst, Point dstPos)
{
if (!src.valid()) throw "Invalid src";
if (!dst.valid()) throw "Invalid dst";
Rect srcRoi = srcRect.isEmpty() ? src.rect() : srcRect;
if (!src.rect().contains(srcRoi)) throw "Invalid src rect";
Rect dstRoi = Rect(dstPos, srcRoi.size());
if (!dst.rect().contains(dstRoi)) throw "Invalid dst rect";
IppStatus st = ippiTranspose_8u_C1R(&src.at(srcRoi.topLeft()), src.step(), &dst.at(dstRoi.topLeft()), dst.step(), toIppiSize(srcRoi.size());
if (st < 0) throw "ippiTranspose_8u_C1R failed";
}
There are logical patterns, which can be applied to all the functions in IPP.
How to automatically generate all these wrappers?