Re: Attempting to draw upon a CGLayer upon a NSView
Re: Attempting to draw upon a CGLayer upon a NSView
- Subject: Re: Attempting to draw upon a CGLayer upon a NSView
- From: Scott Thompson <email@hidden>
- Date: Sun, 12 Mar 2006 23:19:49 -0600
On Mar 11, 2006, at 12:52 AM, Alexander Rauchfuss wrote:
I needed a way to compose CIImages offscreen so I decided to use a
CGLayer.
A cocoadev entry pointed me in the right direction.
http://www.cocoadev.com/index.pl?CGLayerCreateWithContextWarning
Below is my simplified CIImage and CGLayer code.
The lines that concern me are:
// This seems like it should work, but then again I do not have
much experience with Quartz.
CIContext *layerContext = [CIContext contextWithCGContext:
CGLayerGetContext(offscreenLayer) options: nil];
I don't really see anything wrong with this code. From a conceptual
standpoint, it seems like it should work. Have you tried drawing the
CGLayer to the screen after drawing into it through the CIContext?
(just to make sure that the contents are transferred to the layer
properly?)
Your approach does strike me as odd though. It seems that if you
want to composite two images off-screen, you should be able to do it
by creating a CIImage that uses the compositing filters to combine them:
<http://developer.apple.com/documentation/GraphicsImaging/
Conceptual/CoreImaging/ci_filters/chapter_5_section_5.html>
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