How to Convert 8bit image data into RGB based on color palette in Direct2D?
-
As the question states, how can I perform this in Direct2D? This needs to be done at real-time ~35fps. thanks
PKNT
-
As the question states, how can I perform this in Direct2D? This needs to be done at real-time ~35fps. thanks
PKNT
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.
-
As the question states, how can I perform this in Direct2D? This needs to be done at real-time ~35fps. thanks
PKNT
pseduo-code:
foreach (pixel pixel8 in RGBImage)
COLORREF rgb = RGB(pal[pixel8].red, pal[pixel8].green, pal[pixel8].blue); -
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.
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