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

Celal SAVUR c.savur at gmail.com
Sun Oct 18 15:58:14 CEST 2015


Hi Oliver,

The system is linux OS. The original data is just vector of unsigned char
data, width and height and format. but format is not part of data it part
of struct. Therefore, I cannot use QPixmap.fromRawData();

I do not have any experience with openGL, If you can explain little bit ?






Celal SAVUR



On Sat, Oct 17, 2015 at 4:03 PM, Till Oliver Knoll <
till.oliver.knoll at gmail.com> wrote:

>
>
> > ...
> >
> > 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
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151018/fbc58a4a/attachment.html>


More information about the Interest mailing list