Browse Source

Compare retained image pixels without assuming SIMD color rounding

stream-multiview
evgeny 1 week ago
parent
commit
9c7d088f8b
  1. 5
      tools/chatgui/tests/test_video_frame_image.cpp

5
tools/chatgui/tests/test_video_frame_image.cpp

@ -45,10 +45,11 @@ private slots:
output[0] = image.bits();
QCOMPARE(sws_scale(converter, source->data, source->linesize, 0, height, output, strides), height);
for (int y = 0; y < height; y++) QCOMPARE(memcmp(image.constScanLine(y), guarded.data() + y * strides[0], width * 3), 0);
QColor corner = image.pixelColor(width - 1, height - 1), first = image.pixelColor(0, 0);
QImage shared = image; image = {};
QCOMPARE(shared.pixelColor(width - 1, height - 1), QColor(19, 19, 19));
QCOMPARE(shared.pixelColor(width - 1, height - 1), corner);
QImage detached = shared; detached.fill(Qt::red);
QCOMPARE(shared.pixelColor(0, 0), QColor(19, 19, 19)); QCOMPARE(detached.pixelColor(0, 0), QColor(Qt::red));
QCOMPARE(shared.pixelColor(0, 0), first); QCOMPARE(detached.pixelColor(0, 0), QColor(Qt::red));
}
};

Loading…
Cancel
Save