0
votes

Compositing multiple images into one using Qt's QPixmap as the storage:

QPainter painter(&destinationPixmap);
painter.drawPixmap(0, 0, sourcePixmap);

This seems to be quite slow (2-10ms for a maximised window on typical monitor) - any way to do it quicker without changing to completely different technology?

1
Do you know this?: Qt Graphics and Performance – An Overview. Depending on how the images are composited, may be, QImage may provide benefit with conversion to QPixmap as late as possible. Hard to say without more details.Scheff's Cat
Just off the top of my head, probably omp parallel could help ?Vishaal Shankar
"Qt Graphics and Performance" mentions that QPixmaps are a pool of OpenGL Frame Buffer Objects, which explains why they're faster than CPU-based QImage.OJW

1 Answers

0
votes

Qt documentation says:

QImage is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen.

So the proper way is to complete all composition manipulations with QImages and then, if you are going to display/repaint the result multiple times, it would be better to convert a resulting QImage to a QPixmap before it rendered.