Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QPixmap and 16-bit colour depth
Forum Updated to NodeBB v4.3 + New Features

QPixmap and 16-bit colour depth

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 2 Posters 8.9k 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.
  • S Offline
    S Offline
    SteveKing
    wrote on last edited by
    #1

    Hi,

    I'm developing for Windows CE 5.0 and for a display that only has 16-bit colour depth. Is there a performance hit for having all the QPixmaps at 32-bit colour depth, if so is there a way to solve this? It seems that even if I load 16-bit bitmaps they get converted internally to 32-bit. I'm just concerned that the processor is doing lots of 32 -> 16 conversions every paint.

    Thanks,

    Steve

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      It seems that even if I load 16-bit bitmaps they get converted internally to 32-bit

      Can you elaborate why you think so?

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #3

        Also, check if QImageReader can be of any help in your case

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SteveKing
          wrote on last edited by
          #4

          Ahem, sorry my mis-reading of the QPixmap help on defaultDepth. I thought the "is always 32 on Windows" covered WinCE too. Having run a test on the platform the defaultDepth comes back as 16 so I don't think I need to worry.

          I'll get my coat...

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            u could also try with QImageReader, I've found it better in terms of memory footprint and performance

            1 Reply Last reply
            0
            • S Offline
              S Offline
              snowpong
              wrote on last edited by
              #6

              Yes, blitting a 32bit pixmap to 16bit screen, or the other way 16bit to 32bit, will typically give a significant performance hit. For every blit the system needs to rearrange the colors you are blitting into the right format. This is bad.

              Even 32bit to 32bit or 16bit to 16bit can give a performance hit if the bit-order, the format of RGB, is different. For example it could be a 565 being blitted to a 556 or whatver funky stuff you have :) Check out "http://doc.qt.nokia.com/4.6/qimage.html#Format-enum":http://doc.qt.nokia.com/4.6/qimage.html#Format-enum to see a list of the different formats we're talking about here.

              Typically Qt will detect what the proper depth and format is for your system, and automatically choose that for the pixmaps in Qt, but it could be an idea for you to really check that what you're blitting (number of bits and also the format) is the same as what the screen is running on.

              "Depending on the system, QPixmap is stored using a RGB32 or a premultiplied alpha format. If the image has an alpha channel, and if the system allows, the preferred format is premultiplied alpha."
              from "http://doc.qt.nokia.com/4.6/qpixmap.html#pixmap-information
              ":http://doc.qt.nokia.com/4.6/qpixmap.html#pixmap-information

              However, you QImages are probably still 32bit I would assume. Unless you need an alpha channel when you paint on them , you might consider using QImages of QImage::Format_RGB16 instead. It's not like you need 32bit color depth if you end up blitting it all to a 16bit display. Saves a lot of memory and should be faster as well.

              [edit: fixed links / $chetankjain]

              1 Reply Last reply
              0
              • ? This user is from outside of this forum
                ? This user is from outside of this forum
                Guest
                wrote on last edited by
                #7

                hi snowpong, changed the urls you posted to links

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  snowpong
                  wrote on last edited by
                  #8

                  Thanks. I assumed they'd be "auto" generated - I know better now :)

                  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