pixel format conversion
pixel format conversion
- Subject: pixel format conversion
- From: email@hidden
- Date: Sun, 21 Apr 2002 16:02:04 -0700
I was wondering if anyone had written any altivec code to do this, or
know of a CG* function that does it.
I have image data in the form, RGBXRGBXRGBX and I want it in the form
RGBRGBRGB...
Other than this loop:
int n = w * h; // image size is w by h.
unsigned long *spix; // this points to the RGBX data (n unsigned
longs).
unsigned char *dpix; // this points to the empty buffer sized to
hold the RGB data (3*n bytes).
while (n--) {
*dpix++ = *spix >> 24;
*dpix++ = *spix >> 16;
*dpix++ = *spix >> 8;
spix++;
}
does anyone know of a faster way to convert 32 to 24 bit pixels?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.