I'm trying to port some (open source) code that has been constructed to have a common backend section and various graphical front ends (GTK, Windows, Motif PocketPC etc). My ultimate target is the iPhone but as I'm trying to use Quartz 2D, my understanding is that this should also work on my MBP and that's what I'm using to get build my understanding.
The program has a 131 by 16 pixel display area that can provide a monochrome output.
The backend sends the pixel data in the form of an array of bytes with the appropriate bits set. I know that there are 131 pixels to each horizontal row (which takes 17 bytes) and there are 16 such rows and that I'm always presented with the entire array.
I've been reading the Quartz 2D manuals that I can find on the Apple Developer site and I can see how to create a bitmap context with the necessary pixel dimensions. However I'm not sure how to specify the bits within the bitmap.
I read that I can have a 1-bit bitmap which I interpret to be a monochrome arrangement that is similar (I need to confirm the order of the bits within the byte) to the one I've been provided. However all of the examples seem to read data from a bitmap file and I can't see how to set the individual bits.
Therefore, using Quartz 2D:
1) am I right that I can create a 1-bit per pixel bitmap?
2) how can I set a individual pixel value (either 1-bit or 32-bit ARGB value if necessary)?
Pointers and examples would be appreciated.
Thanks
Susan
(obviously a graphical novice!)
The program has a 131 by 16 pixel display area that can provide a monochrome output.
The backend sends the pixel data in the form of an array of bytes with the appropriate bits set. I know that there are 131 pixels to each horizontal row (which takes 17 bytes) and there are 16 such rows and that I'm always presented with the entire array.
I've been reading the Quartz 2D manuals that I can find on the Apple Developer site and I can see how to create a bitmap context with the necessary pixel dimensions. However I'm not sure how to specify the bits within the bitmap.
I read that I can have a 1-bit bitmap which I interpret to be a monochrome arrangement that is similar (I need to confirm the order of the bits within the byte) to the one I've been provided. However all of the examples seem to read data from a bitmap file and I can't see how to set the individual bits.
Therefore, using Quartz 2D:
1) am I right that I can create a 1-bit per pixel bitmap?
2) how can I set a individual pixel value (either 1-bit or 32-bit ARGB value if necessary)?
Pointers and examples would be appreciated.
Thanks
Susan
(obviously a graphical novice!)