• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
pixel format conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Cocoa, ATSUI, and graphics context
  • Next by Date: Re: Make a borderless window active
  • Previous by thread: Re: Make a borderless window active
  • Next by thread: table view cell vertically centered?
  • Index(es):
    • Date
    • Thread