12bpp -> tPixMap

BlitzMax Forums/BlitzMax Programming/12bpp -> tPixMap

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

12 bits per pixel, you're saying?

So each component is 4 bits?

First find out if the pixmap has a `pitch`, ie if you need to skip at the end of each row.

Then you can set up a simple loop to go through the source data. Use a byte pointer and read 2 pixels at a time, then use AND's to isolate specific bits and shifts to move them and OR's to combine them. Make each component end up in a separate variable. Then write them out to the pixmap. You can write using a byte pointer, even if the data is stored in int's.