Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QImage Format (32 bit to 16 bit)
Qt 6.11 is out! See what's new in the release blog

QImage Format (32 bit to 16 bit)

Scheduled Pinned Locked Moved General and Desktop
12 Posts 3 Posters 7.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aabc
    wrote on last edited by
    #1

    How can I know my system Image Fornat (QImage::Format_ARGB32, QImage::Format_ARGB6666_Premultiplied, ...) ?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      What is a "system image format"?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Are you looking for the information [[doc:QPaintDevice]] gives you?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aabc
          wrote on last edited by
          #4

          QImage Format has the values:

          QImage::Format_Invalid 0 The image is invalid.
          QImage::Format_Mono 1 The image is stored using 1-bit per pixel. Bytes are packed with the most significant bit (MSB) first.
          QImage::Format_MonoLSB 2 The image is stored using 1-bit per pixel. Bytes are packed with the less significant bit (LSB) first.
          QImage::Format_Indexed8 3 The image is stored using 8-bit indexes into a colormap.
          QImage::Format_RGB32 4 The image is stored using a 32-bit RGB format (0xffRRGGBB).
          QImage::Format_ARGB32 5 The image is stored using a 32-bit ARGB format (0xAARRGGBB).
          QImage::Format_ARGB32_Premultiplied 6 The image is stored using a premultiplied 32-bit ARGB format (0xAARRGGBB), i.e. the red, green, and blue channels are multiplied by the alpha component divided by 255. (If RR, GG, or BB has a higher value than the alpha channel, the results are undefined.) Certain operations (such as image composition using alpha blending) are faster using premultiplied ARGB32 than with plain ARGB32.
          QImage::Format_RGB16 7 The image is stored using a 16-bit RGB format (5-6-5).
          QImage::Format_ARGB8565_Premultiplied 8 The image is stored using a premultiplied 24-bit ARGB format (8-5-6-5).
          QImage::Format_RGB666 9 The image is stored using a 24-bit RGB format (6-6-6). The unused most significant bits is always zero.
          QImage::Format_ARGB6666_Premultiplied 10 The image is stored using a premultiplied 24-bit ARGB format (6-6-6-6).
          QImage::Format_RGB555 11 The image is stored using a 16-bit RGB format (5-5-5). The unused most significant bit is always zero.
          QImage::Format_ARGB8555_Premultiplied 12 The image is stored using a premultiplied 24-bit ARGB format (8-5-5-5).
          QImage::Format_RGB888 13 The image is stored using a 24-bit RGB format (8-8-8).
          QImage::Format_RGB444 14 The image is stored using a 16-bit RGB format (4-4-4). The unused bits are always zero.
          QImage::Format_ARGB4444_Premultiplied 15 The image is stored using a premultiplied 16-bit ARGB format (4-4-4-4).

          How can I tell what is the format used by my system (embedded linux device) ?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            AFAIK: you can't, at least not from QImage.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              aabc
              wrote on last edited by
              #6

              Is there a way to know that from another class ?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                Did you try the class I referenced above? It won't give you the data in the exact same enum format, but perhaps it is enough for your purposes anyway?

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  aabc
                  wrote on last edited by
                  #8

                  My problem is:
                  I have a 32 bit png's and i want to use them on a 16 bit embedded linux device.
                  I want to know the device Format in order to convert the png's to this format before i download this png's to this device so the convertion from 32 bit to the device format wont be at runtime.
                  Any suggestions ?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andre
                    wrote on last edited by
                    #9

                    As long as you don't respond to the suggestions, I fail to see the point in repeating myself. Note that QWidget is also a QPaintDevice...

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      aabc
                      wrote on last edited by
                      #10

                      QPaintDevice does not give me the information I need. It only gives me the depth, which I already know.

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        aabc
                        wrote on last edited by
                        #11

                        How can I know what is the device display RGB (ARGB) format (as in QImage::Format) ?

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          andre
                          wrote on last edited by
                          #12

                          We don't allow opening multiple topics on the same issue, so I merged in your new topic.

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved