Re: Efficient way to composite large images?
Re: Efficient way to composite large images?
- Subject: Re: Efficient way to composite large images?
- From: Scott Thompson <email@hidden>
- Date: Sun, 12 Mar 2006 21:49:23 -0600
On Mar 12, 2006, at 8:54 PM, Matt Ball wrote:
Thanks, but from what I can tell, CGLayer is best for drawing the same
image multiple times. Since each layer in my app is different, I don't
know how useful it will be...
I think I know what you're talking about when you say "multiple
times". You're thinking of using images as a rubber samp.
But, don't you want to draw your layers multiple times? I mean it
sounds like each time one of your layers changes, you redraw all of
them. You're going to be drawing each layer multiple times... it's
just that each time you draw it, you draw it to the same place.
Basically a CGLayer is just an offscreen canvas that is optimized for
drawing on a particular CGContext. A CGLayer drawing to the screen,
for example, will automatically use the same color space as the
screen. If you happen to be working with a Quartz Extreme capable
machine, the CGLayer might also take some representation of your
image and put it in VRAM where the video card can blast it to the
screen at top speed.
I'd recommend trying your application with CGLayers in place and see
if that helps your performance.
If the CGLayer doesn't help you, then the next step you might take is
to jump straight to OpenGL. Using OpenGL, you could create textures
out of your images and draw them onto quads. This is the way that Mac
OS X draws many of it's more dramatic effects. For example, the
images screen savers draw their cross fades and such using OpenGL.
Coding to OpenGL would be more complicated than using high-level
libraries like Quartz, but since you'd be coding "closer to the
metal" your performance could improve.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden