Error in documentation of QImage Class Format 8-bit image and 32-bit image



  • http://doc.qt.io/qt-5/qimage.html#image-formats

    Under Image Formats it says

    bq. 8-bit images are stored using 8-bit indexes into a color table, i.e. they have a single byte per pixel. The color table is a QVector<QRgb>, and the QRgb typedef is equivalent to an unsigned int containing an ARGB quadruplet on the format 0xAARRGGBB.

    bq. 32-bit images have no color table; instead, each pixel contains an QRgb value. There are three different types of 32-bit images storing RGB (i.e. 0xffRRGGBB), ARGB and premultiplied ARGB values respectively. In the premultiplied format the red, green, and blue channels are multiplied by the alpha component divided by 255.

    I guess 0xAARRGGBB and 0xffRRGGBB are interchanged? Any thing else makes really no sens.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Unless I'm mistaken, the 0xff here is to tell that you are storing only a RGB value in a 32bit container so the Alpha channel is always at 0xff


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.