本文整理汇总了C++中PNG::getBufferSize方法的典型用法代码示例。如果您正苦于以下问题:C++ PNG::getBufferSize方法的具体用法?C++ PNG::getBufferSize怎么用?C++ PNG::getBufferSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PNG
的用法示例。
在下文中一共展示了PNG::getBufferSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: subImageHelper
void
ImageSearch::search(PNG& srchImg) {
const PNGHelper subImageHelper(srchImg);
const int maxRow = mainImage.getHeight() - srchImg.getHeight();
const int maxCol = mainImage.getWidth() - srchImg.getWidth();
const int pixMatchNeeded = srchImg.getBufferSize() * matchPercent / 400;
for(int col = 0; (col <= maxCol); col++) {
for(int row = 0; (row <= maxRow); row++) {
const MatchedRect srchRegion(row, col, srchImg.getWidth(),
srchImg.getHeight());
if (mrl.isMatched(srchRegion)) {
// Current search rgion is already part of a region
// matched earlier in this method (same as thread).
continue;
}
// Search for a match between sub-images.
PNGHelper mainImgHelper(mainImage, row, col);
int pixMatch = getMatchingPixelCount(isMask, mainImgHelper, subImageHelper,
srchImg.getHeight(),
srchImg.getWidth(), tolerance);
if (pixMatch > pixMatchNeeded) {
// Found a matching region.
mrl += srchRegion;
}
}
}
}