Re: NSBitmapImageRep and 0RGB data
Re: NSBitmapImageRep and 0RGB data
- Subject: Re: NSBitmapImageRep and 0RGB data
- From: Matthew Harrison <email@hidden>
- Date: Mon, 01 Jul 2002 09:51:54 +0100
- Organization: Beaufort International Group Plc
Cameron Hayne wrote:
On Friday, June 28, 2002, at 02:30 pm, John C. Randolph wrote:
On Thursday, June 27, 2002, at 10:39 AM, Chris Hanson wrote:
If you tell an instance of NSBitmapImageRep to init with data planes
etc. a 32 bpp image using a color space of NSDeviceRGBColorSpace, it
normally expects image data in RGBA order. I have 0RGB data. Right
now I'm munging the data into RGBA before creating an
NSBitmapImageRep, but I think I'm probably doing a bit too much
work. (I also haven't optimized it for AltiVec, so it's relatively
slow.)
Is there a color space constant I can pass that will let
NSBitmapImageRep know my data is in 0RGB order, and let it do the
conversion itself? Or is there some other mechanism I should use?
NSBitmapImageRep has no provision for pixel data in 0RGB order, but
this sounds like a perfect Altivec permute opportunity.
If the data looks like:
0RGB0RGB0RGB0RGB...
Just shift your pointer over by one byte and then it will look like:
RGB0RGB0RGB0RGB...
and you need only add in the extra 'A' byte at the end.
That is eeevill :?) I think I might like it if the performance gain were
significant!
_______________________________________________
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.