All pastes #637091 Raw Edit

bgr

public text v1 · immutable
#637091 ·published 2007-07-28 15:05 UTC
rendered paste body
// assume byteArray[] is the array with code.

// We know that we're going to increase by 16 bits, so we just do that and move through the array

for(int i = 0; i < byteArray.Length; i+= 16)
{
    Brg565 pixel;

    pixel.PackedValue = 0;

    for(int packedBit = 0; packedBit < 16; packedBit++)
    {
        pixel.PackedValue += byteArray[i + packedBit] << (15 - packedBit);
    }

    // do whatever with the Brg656
}