> On Jun 9, 2016, at 4:20 AM, Graham Cox <graham....@bigpond.com 
> <mailto:graham....@bigpond.com>> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to