Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to Convert 8bit image data into RGB based on color palette in Direct2D?

How to Convert 8bit image data into RGB based on color palette in Direct2D?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
4 Posts 3 Posters 1 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.
  • K Offline
    K Offline
    Kiran Satish
    wrote on last edited by
    #1

    As the question states, how can I perform this in Direct2D? This needs to be done at real-time ~35fps. thanks

    PKNT

    CPalliniC C 2 Replies Last reply
    0
    • K Kiran Satish

      As the question states, how can I perform this in Direct2D? This needs to be done at real-time ~35fps. thanks

      PKNT

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      Disclaimer: I don't know if Direct2D provide a shortcut for such a operation. The operation is pretty straightforward: for each input pixel look-up the corresponding palette color and use it to generate the output one. You have to know the bitmap file format in order to do that, however it could be a useful exercise.

      In testa che avete, signor di Ceprano?

      K 1 Reply Last reply
      0
      • K Kiran Satish

        As the question states, how can I perform this in Direct2D? This needs to be done at real-time ~35fps. thanks

        PKNT

        C Offline
        C Offline
        Chris Losinger
        wrote on last edited by
        #3

        pseduo-code:

        foreach (pixel pixel8 in RGBImage)
        COLORREF rgb = RGB(pal[pixel8].red, pal[pixel8].green, pal[pixel8].blue);

        image processing toolkits | batch image processing

        1 Reply Last reply
        0
        • CPalliniC CPallini

          Disclaimer: I don't know if Direct2D provide a shortcut for such a operation. The operation is pretty straightforward: for each input pixel look-up the corresponding palette color and use it to generate the output one. You have to know the bitmap file format in order to do that, however it could be a useful exercise.

          K Offline
          K Offline
          Kiran Satish
          wrote on last edited by
          #4

          Thanks for that suggestion Pallini, I guess I was not clear enough in my questions about how time critical this operation is. In my current application, I do similarly for not so time critical operation. I am looking for something that can do it automatically for me in Direct2D like in OpenCV using LUT & merge commands rather than going pixel by pixel.

          PKNT

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups