[Interest] Convertion between QImage to QPixmap taking to much time.

Till Oliver Knoll till.oliver.knoll at gmail.com
Sat Oct 17 22:03:02 CEST 2015



> ...
> 
> When I put the timer to see how much time Qt spending to create QPixmap, I realize that I converting  from Qimage to QPixmap taking ~20 times more time than crating Qimage from buffer.

Yes, I guess that's perfectly possible. That depends off course on the original data layout and the native pixmap format of the target platform (btw what platform are we talking about?).

Bytes might need to be swizzled, padded, memory aligned etc.

You might try to directly load the raw data into a QPixmap, if all you want is to display the data anyway:

  http://doc.qt.io/qt-5/qpixmap.html#loadFromData

You can try with different raw formats/byte ordering (if possible), to see whether that makes any difference in conversion time.

If all that fails try with OpenGL (textures).

Cheers,
  Oliver


More information about the Interest mailing list