当前位置: 首页>>代码示例>>C++>>正文


C++ Fixture::getColorStream方法代码示例

本文整理汇总了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);
}
开发者ID:Blinkinlabs,项目名称:PatternPaint,代码行数:11,代码来源:fixturetests.cpp

示例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));
}
开发者ID:Blinkinlabs,项目名称:PatternPaint,代码行数:14,代码来源:fixturetests.cpp

示例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));
}
开发者ID:Blinkinlabs,项目名称:PatternPaint,代码行数:17,代码来源:fixturetests.cpp

示例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));
}
开发者ID:Blinkinlabs,项目名称:PatternPaint,代码行数:23,代码来源:fixturetests.cpp


注:本文中的Fixture::getColorStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。