Re: NSBitmapImageRep
Re: NSBitmapImageRep
- Subject: Re: NSBitmapImageRep
- From: Scott Stevenson <email@hidden>
- Date: Thu, 21 Jun 2007 18:13:49 -0700
On Jun 20, 2007, at 2:58 PM, John Stiles wrote:
Is there any way to tell -initWithBitmapDataPlanes::::: that the
color channels are in reverse order? I couldn't see any option for
this in the API reference but it seems like a fairly common issue.
(OpenGL, for instance, has an incredible variety of supported image
types and is smart enough to convert from what you have to what the
card needs.)
At the end of the day I just need an NSImage, so if there is
another API better suited for the talk that's supported on 10.4.x,
I'd be interested to learn more.
I do have a simple workaround—just byteswap all the image data by
hand before calling this method. This works fine and it was only a
few lines of code, so I can use that if necessary. I'd just like to
know if there is a better way.
I don't think there's anything built in that does this automatically,
but vImage is very good for this sort of low-level conversion, and
has the benefit of using whatever special vector units are available
on the host chip architecture. vImagePermuteChannels() could do what
you want.
<http://developer.apple.com/documentation/Performance/Conceptual/
vImage/>
- Scott_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden