mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
generate image in more generic way in tst_QImageConversion::generateImage()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f74bdda700
commit
d5b4617418
1 changed files with 3 additions and 5 deletions
|
@ -74,12 +74,10 @@ void tst_QImageConversion::convertRgb16ToRGB32()
|
|||
QImage tst_QImageConversion::generateImage(int width, int height)
|
||||
{
|
||||
QImage image(width, height, QImage::Format_RGB16);
|
||||
const int byteWidth = width * 2;
|
||||
|
||||
for (int y = 0; y < image.height(); ++y) {
|
||||
uchar *scanline = image.scanLine(y);
|
||||
for (int x = 0; x < byteWidth; ++x)
|
||||
scanline[x] = x ^ y;
|
||||
for (int x = 0; x < image.width(); ++x) {
|
||||
image.setPixel(x, y, x ^ y);
|
||||
}
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue