[Qt-interest] which QImage::Format is the right one, how to construct colortable?

Matthias Pospiech matthias.pospiech at gmx.de
Mon Jul 12 15:33:15 CEST 2010


I have a camera which has several ways to store the image in an array.
I would like to chose a one which I can pass directly to a QImage, 
however I fail to see which one is correct:

This table lists how the camera saves the images:
http://www.ids-imaging.de/frontend/files/uEyeManuals/Manual_ger/uEye_Handbuch/index.html?sdk_allgemeines_farbformate.html

which has only few options where only one pixel is within 32 bit, or 
aligned with 32 bit. Especially 8 bit mono versions include 4 pixel in 
32 bit.

Now I wonder if these match in storage:

Qt                                            -        camera format
-----------------------------------------
QImage::Format_RGB32    -    RGB32(8 8 8)
QImage::Format_ARGB32   -    RGBY(8 8 8 8)
QImage::Format_RGB16    -    BGR16(5 6 5)
QImage::Format_RGB555   -    BGR15(5 5 5)
QImage::Format_Indexed8 -    Mono8 (8, 8, 8, 8)

I am not familier with these storage formats, so I would appreaciate if 
someone could
verify that I am right or wrong.

Besides the format I also need to know how to calculate the BytesPerLine 
(which I need to pass)
and I wonder how a colortable would look like, which I need to pass to 
the QImage in
image.setColorTable( const QVector<QRgb>  colors )

Matthias




More information about the Qt-interest-old mailing list