- //lesen
- red = (shortpixel & 0xfc00) >> 11;
- green = (shortpixel & 0x07e0) >> 6;
- blue = (shortpixel & 0x003f) >> 1;
- alpha = shortpixel & 0x0001;
- //schreiben
- shortpixel = (red << 11) | 0x03ff;
- shortpixel = (green << 6) | (shortpixel & 0xfc1f);
- shortpixel = (blue << 1) | (shortpixel & 0xffc1);
- shortpixel = alpha | (shortpixel & 0xfffe);