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 for floating point image data
Forum Updated to NodeBB v4.3 + New Features

QImage format for floating point image data

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.7k Views 3 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.
  • P Offline
    P Offline
    Perdrix
    wrote on 3 Sept 2020, 12:39 last edited by Perdrix 9 Mar 2020, 12:40
    #1

    My application currently holds the image data that it is processing in a number of templated "bitmap" classes (not related to Windows DIB).

    Specifically they are:

    Colour bitmaps:

    24 bit colour (3 planes RGB 8 bit)
    48 bit colour (3 planes RGB 16 bit)
    96 bit colour (3 planes RGB 32 bit)
    96 bit colour float (32 planes RGB 32 bit float)

    Monochrome bitmaps (one plane only)

    Single bit bitmap
    8 bit bitmap
    16 bit bitmap
    32 bit bitmap
    32 bit float bitmap

    My problem is that I can create a QImage whose pixel values are correct for the integer representations (by converting to an in storage DIB), but there doesn't appear to be any QImage variant that supports floating point image data.

    The above approach also may not work on MacOS and Linux (do they have DIB support like Windows?).

    Is this a problem I'm just going to have to "hack" my way around (e.g. scale the float bitmap pixel values to uint values and retain a pointer to the original data when I need the raw pixel value), or is there a better solution?

    Thanks a lot
    David

    J 1 Reply Last reply 4 Sept 2020, 08:56
    0
    • K Offline
      K Offline
      Kent-Dorfman
      wrote on 4 Sept 2020, 03:44 last edited by
      #2

      Irrelevant of "modern video hardware", traditional video memory is most often planar, where each primary color gun gets a contiguous chunk of memory, and mapping of integral RGB values into that memory is far more efficient than doing floating point translations for each pixel. My sensibilities tell me that directly supporting floating point QImage would be grossly innefficient, and the docs ony reference formats of fixed bit widths for each color plane.

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Perdrix
        wrote on 4 Sept 2020, 08:16 last edited by
        #3

        What's this got to do with video? These are still images that I need to handle as float. You don't normally render a QImage to the computer display - you would normally interpose a Pixmap which can be 8bits or 16bits per plane.

        K 1 Reply Last reply 4 Sept 2020, 23:25
        0
        • P Perdrix
          3 Sept 2020, 12:39

          My application currently holds the image data that it is processing in a number of templated "bitmap" classes (not related to Windows DIB).

          Specifically they are:

          Colour bitmaps:

          24 bit colour (3 planes RGB 8 bit)
          48 bit colour (3 planes RGB 16 bit)
          96 bit colour (3 planes RGB 32 bit)
          96 bit colour float (32 planes RGB 32 bit float)

          Monochrome bitmaps (one plane only)

          Single bit bitmap
          8 bit bitmap
          16 bit bitmap
          32 bit bitmap
          32 bit float bitmap

          My problem is that I can create a QImage whose pixel values are correct for the integer representations (by converting to an in storage DIB), but there doesn't appear to be any QImage variant that supports floating point image data.

          The above approach also may not work on MacOS and Linux (do they have DIB support like Windows?).

          Is this a problem I'm just going to have to "hack" my way around (e.g. scale the float bitmap pixel values to uint values and retain a pointer to the original data when I need the raw pixel value), or is there a better solution?

          Thanks a lot
          David

          J Offline
          J Offline
          JonB
          wrote on 4 Sept 2020, 08:56 last edited by JonB 9 Apr 2020, 08:58
          #4

          @Perdrix said in QImage format for floating point image data:

          (e.g. scale the float bitmap pixel values to uint values and retain a pointer to the original data when I need the raw pixel value)

          So far as I know, that is what you will need to do. As you can see, QImage/QPixmap only deals with integer values.

          1 Reply Last reply
          0
          • P Perdrix
            4 Sept 2020, 08:16

            What's this got to do with video? These are still images that I need to handle as float. You don't normally render a QImage to the computer display - you would normally interpose a Pixmap which can be 8bits or 16bits per plane.

            K Offline
            K Offline
            Kent-Dorfman
            wrote on 4 Sept 2020, 23:25 last edited by Kent-Dorfman 9 Apr 2020, 23:26
            #5

            @Perdrix said in QImage format for floating point image data:

            What's this got to do with video? These are still images that I need to handle as float. You don't normally render a QImage to the computer display - you would normally interpose a Pixmap which can be 8bits or 16bits per plane.

            It's still purely a matter of efficiency. If you need floating point color data then you should create a specialization of QImage where the constructor converts and stores floating point data in the recognized integer format, and if you want to export that data back out as floating point then it translates it back to export, with the understanding that you may lose fidelity. Any internal pixel operations on floating point are going to be innefficient and complex, and thus the reason it's not directly supported.

            1 Reply Last reply
            1

            1/5

            3 Sept 2020, 12:39

            • Login

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