Re: CIImage initWithCGLayer is deprecated in 10.11
Re: CIImage initWithCGLayer is deprecated in 10.11
- Subject: Re: CIImage initWithCGLayer is deprecated in 10.11
- From: Jeff Szuhay <email@hidden>
- Date: Thu, 09 Jun 2016 16:57:12 -0700
> On Jun 9, 2016, at 4:20 AM, Graham Cox <email@hidden <mailto:email@hidden>> wrote:
>
> Why do you draw into a CGLayer rather than a CGImage?
For a couple reasons:
• Because I draw my shapes into a CGLayer with Quartz2D. I’m not working with
images on disk or from streams.
• As recommends in the Quartz2D docs, use GCLayers for repeated drawing
of the same image.
• CGLayers seems far simpler to work with than bitmaps.
I could use CIImage if I could use the CGContextPaths as inputs to the CIImage
directly, but I can’t see how to do that. And CIContexts seem to be orthogonal
to CGContexts.
In my scenario, I have 4 layers that have a non-trivial shape drawn into them.
The drawing for them is only done once, ever.
Then they are drawn into a 5th layer with some offset depending upon the desired
angle of the final image. This drawing is done each time the angle for the shape
changes (like a clock hand). I rely on the “painters model” of overlaying the layers to
get the effect I want. I couldn’t figure out any other way to do it.
Here it is (reduced) — highlights/shadows with no color. Actual size is 512x512.
Full-size image is here <http://www.quartertiltwo.com/image/IndentEffect_noColor.png>.
Full-size image with color is here: <http://www.quartertiltwo.com/image/IndentEffect_blue.png>.
_______________________________________________
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