本文整理汇总了C++中Fixture::getColorStream方法的典型用法代码示例。如果您正苦于以下问题:C++ Fixture::getColorStream方法的具体用法?C++ Fixture::getColorStream怎么用?C++ Fixture::getColorStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fixture
的用法示例。
在下文中一共展示了Fixture::getColorStream方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getColorStreamNullBrightnessModelTest
void FixtureTests::getColorStreamNullBrightnessModelTest()
{
// Don't expect usable data, but at least don't crash.
Fixture fixture;
fixture.setLocations(QList<QPoint>({{1,1}}));
QList<QColor> colorStream = fixture.getColorStream(QImage());
QCOMPARE(colorStream.count(), 0);
}
示例2: getColorStreamNullFrameTest
void FixtureTests::getColorStreamNullFrameTest()
{
// A null frame is equivalent to being out of bounds, so
// we expect blank data back.
Fixture fixture;
fixture.setLocations(QList<QPoint>({{1,1}}));
fixture.setBrightnessModel(new ExponentialBrightness(1,1,1));
QList<QColor> colorStream = fixture.getColorStream(QImage());
QCOMPARE(colorStream.count(), 1);
QCOMPARE(colorStream.at(0), QColor(0,0,0,255));
}
示例3: getColorStreamBrightnessModelAppliedTest
void FixtureTests::getColorStreamBrightnessModelAppliedTest()
{
QImage image(1,1,QImage::Format_ARGB32_Premultiplied);
image.fill(QColor(128,128,128,255));
QList<QPoint> locations;
locations.append(QPoint(0,0)); // In bounds
Fixture fixture;
fixture.setLocations(locations);
fixture.setBrightnessModel(new ExponentialBrightness(1,2,3));
QList<QColor> colorStream = fixture.getColorStream(image);
QCOMPARE(colorStream.count(), 1);
QCOMPARE(colorStream.at(0), QColor(128,64,32,255));
}
示例4: getColorStreamBadLocationsTest
void FixtureTests::getColorStreamBadLocationsTest()
{
QImage image(2,2,QImage::Format_ARGB32_Premultiplied);
image.fill(QColor(1,2,3,255));
QList<QPoint> locations;
locations.append(QPoint(-1,0)); // Negative out of bounds
locations.append(QPoint(0,0)); // In bounds
locations.append(QPoint(1,1)); // In bounds
locations.append(QPoint(2,2)); // Positive out of bounds
Fixture fixture;
fixture.setLocations(locations);
fixture.setBrightnessModel(new ExponentialBrightness(1,1,1));
QList<QColor> colorStream = fixture.getColorStream(image);
QCOMPARE(colorStream.count(), 4);
QCOMPARE(colorStream.at(0), QColor(0,0,0,255));
QCOMPARE(colorStream.at(1), QColor(1,2,3,255));
QCOMPARE(colorStream.at(2), QColor(1,2,3,255));
QCOMPARE(colorStream.at(3), QColor(0,0,0,255));
}