|
|
|
|
@ -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)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|