本文整理汇总了C++中DImg::getPixelColor方法的典型用法代码示例。如果您正苦于以下问题:C++ DImg::getPixelColor方法的具体用法?C++ DImg::getPixelColor怎么用?C++ DImg::getPixelColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DImg
的用法示例。
在下文中一共展示了DImg::getPixelColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testActions
void DImageFilterActionTest::testActions()
{
QStringList files = QDir(imagePath()).entryList(QDir::Files);
files.removeOne(originalImage());
DImg original(imagePath() + originalImage());
QVERIFY(!original.isNull());
foreach (const QString& fileName, files)
{
DImg ref(imagePath() + fileName);
QVERIFY(!ref.isNull());
DImageHistory history = ref.getImageHistory();
FilterActionFilter filter;
filter.setFilterActions(history.allActions());
QVERIFY(filter.isReproducible() || filter.isComplexAction());
filter.setupFilter(original.copy());
filter.startFilterDirectly();
qDebug() << filter.filterActions().size();
DImg img = filter.getTargetImage();
QVERIFY(ref.size() == img.size());
bool isEqual = true;
DImg diff(ref.width(), ref.height(), ref.sixteenBit());
diff.fill(DColor(Qt::black));
for (uint x=0; x<ref.width(); x++)
{
for (uint y=0; y<ref.height(); y++)
{
DColor cref = ref.getPixelColor(x,y);
DColor cres = img.getPixelColor(x,y);
if (cref.red() != cres.red() || cref.green() != cres.green() || cref.blue() != cres.blue())
{
//qDebug() << x << y;
diff.setPixelColor(x,y, DColor(Qt::white));
isEqual = false;
}
}
}
if (!isEqual)
{
showDiff(original, ref, img, diff);
}
QVERIFY(isEqual);
}