I've written a little test application for it. The worker thread emits a signal with a QImage containing a row of the image. This signal is connected to this slot:
void DisplayImage
::newData(int row,
QImage newData
) {
int y = pixmap->height() - 1 - row; //if height is 400, y is in 0-399
//In the raytracer 0,0 is the bottomleft of the screen, not the topleft
painter.drawImage(0, y, newData);
displayLabel.setPixmap(*pixmap);
}
void DisplayImage::newData(int row, QImage newData)
{
int y = pixmap->height() - 1 - row; //if height is 400, y is in 0-399
//In the raytracer 0,0 is the bottomleft of the screen, not the topleft
painter.drawImage(0, y, newData);
displayLabel.setPixmap(*pixmap);
}
To copy to clipboard, switch view to plain text mode
Is this the fastest way to do it, or can I optimize this?
Bookmarks