Daniel Wilson
asked on
Java - Efficient way to copy bit array to 32-bit int array
I'm working with some imaging stuff. I have an array of bytes, but each bit represents a pixel as this is a monochrome image.
The buffer into which I need to copy is for a CMYK image. It expects 32 bits/pixel.
I think I need to turn each 0 bit into 0x00000000 and each 1 bit into 0x FFFFFFFF.
I could run a loop that did bitwise math. But is there an EFFICIENT way of doing this?
thanks.
The buffer into which I need to copy is for a CMYK image. It expects 32 bits/pixel.
I think I need to turn each 0 bit into 0x00000000 and each 1 bit into 0x FFFFFFFF.
I could run a loop that did bitwise math. But is there an EFFICIENT way of doing this?
thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I thought it sounded a little strange ;-)
ASKER
Yes. This is a stencil mask in a PDF.