Let’s say I have an image represented by a CFMutableBitVector. That means that ever 0 bit represents an off pixel, and every 1 bit represents an on pixel.
Is there a way to, easily and quickly convert this CFMutableBitVector to a low level array of ints where an on-bit represents an all-on-bit integer, and an off-bit represents an all-off-bit integer?
The CFMutableBitVector [0,0,0,1,1,0,1,0];
would translate to:
int[8] =
[
00000000000000000000000000000000,
00000000000000000000000000000000,
00000000000000000000000000000000,
11111111111111111111111111111111,
11111111111111111111111111111111,
00000000000000000000000000000000,
11111111111111111111111111111111,
00000000000000000000000000000000,
];
Now, this being an image from a video stream, this will have to happen very quickly — What’s the fastest way to do such a conversion in Objective-C?
Here’s the sample conversion …