Re: Speed problems using NSImage. Solution?
Re: Speed problems using NSImage. Solution?
- Subject: Re: Speed problems using NSImage. Solution?
- From: Erik Buck <email@hidden>
- Date: Sun, 7 Jan 2007 21:46:34 -0500
On Jan 7, 2007, at 8:47 PM, John Stiles wrote:
Erik Buck wrote:
NSImage is ultimately implemented on top of OpenGL too.
This is highly misleading.
NSImage doesn't use the GPU. It renders into a RAM back-buffer,
using exclusively CPU-based algorithms. This RAM back-buffer is
later DMAed and blit to the screen by the WindowServer using OpenGL.
All of the benefits that one traditionally associates with OpenGL
and GPU-based rendering are lost when using NSImage.
Fair enough. Core Image is more directly accelerated by OpenGL and
provides many benefits one traditionally associates with OpenGL and
GPU-based rendering.
One can of course mix and match for the desired combination of
flexibility, output quality, and speed.
One can use an NSImage or more accurately an NSBitmapImageRep as the
source data for an OpenGL texture though just like many other image
types. NSImage can be used with Quartz Composer also. http://
developer.apple.com/technotes/tn2005/tn2143.html
There is a nice sample of an NSView subclass that can toggle between
OpenGL and Cocoa/Quartz rendering at http://developer.apple.com/
samplecode/Reducer/listing12.html.
These examples among others shows how to use an NSImage as an OpenGL
texture:
http://developer.apple.com/samplecode/NSGLImage/ http://
developer.apple.com/samplecode/Custom_Cocoa_OpenGL/
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaDrawingGuide/Images/chapter_7_section_6.html
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/
OpenGL-MacProgGuide/opengl_texturedata/chapter_10_section_8.html
_______________________________________________
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