Re: The fastest way to render bitmaps to screen in Cocoa on Snow Leopard?
Re: The fastest way to render bitmaps to screen in Cocoa on Snow Leopard?
- Subject: Re: The fastest way to render bitmaps to screen in Cocoa on Snow Leopard?
- From: Michael Ash <email@hidden>
- Date: Thu, 25 Mar 2010 23:27:12 -0400
On Wed, Mar 24, 2010 at 10:02 AM, Oleg Krupnov <email@hidden> wrote:
> Hi,
>
> I need to open a bitmap file, perhaps do some filtering, and render it
> to the screen with the maximum possible performance.
>
> I am allowed to assume Snow Leopard.
>
> Now I am a bit confused what technology (-ies) I should use to achieve
> this in the fastest and easiest, and the most up-to-date way,
>
> (As always, it's difficult for a newbie to understand what is new and
> what is old, what is built on top of what, and what is the latest
> trend).
>
> It seems that I need to use Core Image (CIImage) to do the fastest filtering.
>
> How do I render this to screen? Do I need to use NSOpenGLView for
> this, or a custom NSView will do, what is more efficient?
>
> Obviously, Core Image is built on top of OpenGL, so that I don't seem
> to have to go down to OpenGL when I use Core Image, if I want optimal
> performance. But I am unsure about drawing the result to the screen.
> Will it somehow slow things down when I use good old NSGraphicContext
> to draw a CIImage?
"Fastest and easiest" is almost always self-contradictory. Pick one,
and only one.
For fastest, OpenGL is probably the way to go. OpenGL is the fastest
drawing API on the system. You can create a CIContext around an OpenGL
context, and draw your CIImage into that.
For easiest, OpenGL is definitely not the way to go. Avoid! Plain old
Cocoa drawing is what you're after here. You can ask for the current
NSGraphicsContext inside your drawRect:, then ask it for its CIContext
and draw your CIImage. Simple and painless.
Mike
_______________________________________________
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