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.
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.