0

I would like to apply a CIFilter to a CGPath. A quick searching around reveals this is fairly straight forward on iOS. What are the options on OS X?

Are the steps,

  1. create a image context,
  2. create CGPath which uses the image context,
  3. apply filter,
  4. draw image into the current graphics context (i.e. for the NSView)?

This seems like a huge amount of boilerplate for a reasonably common task. I just want to check that I have not missed anything!

Community
  • 1
  • 1
Daniel Farrell
  • 9,316
  • 8
  • 39
  • 62

1 Answers1

0

Core Image operates with image's pixels.
Filters in CoreImage generate CIImage objects and not to change original context. But you can create CIContext to draw to the image context.
You can't apply a filter to the image context directly. But you can create a image from the image context, later you can apply the filter, and blend images together.

Andrew Romanov
  • 4,774
  • 3
  • 25
  • 40