Re: NSBitmapImageRep
Re: NSBitmapImageRep
- Subject: Re: NSBitmapImageRep
- From: Shawn Erickson <email@hidden>
- Date: Fri, 22 Jun 2007 07:47:18 -0700
On Jun 21, 2007, at 6:17 PM, John Stiles wrote:
On Jun 21, 2007, at 6:13 PM, Scott Stevenson wrote:
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/>
Interesting find, though I can't help but wonder if its performance
is any good on Intel—it looks pretty tuned for Altivec… :) Right
now it's not performance critical, so a simple byteswapping loop is
doing the trick for us.
The Accelerate framework was enhanced to use SSE3, etc. when the
first Intel version of Mac OS X came out. Apple updates this
framework for every major processor they ship in a Mac.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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