CKP
CKP

Reputation: 11

How to clip a CIImage to a polygon only using GPU?

Because of some performance Issue, now I need to clip an image to polygon with GPU, but UIImage and CGImage/CGContext use CPU only, and the CIImage can not be clipped by path(EX:BezierPath).

Any idea for this? Thanks a lot !!

further explain:

I was using CGContext to clip image for video's frame render.

But CGContext is too slow than CIContext when do rendering.

So I need to find the way to clip image in CIContext.

And now I find the solution that I can use the "CIBlendWithMask" in CIFilter to do something like clipping with CoreImage in CIContext.

Upvotes: 0

Views: 421

Answers (1)

Vidux
Vidux

Reputation: 303

If you are targeting iOS 8+ I strongly suggest you to read about Metal: Metal reference

If you are targeting iOS 7 and lower then OpenGL should be your friend: OpenGL reference

Both references should provide you basic knowledge of Metal and OpenGL, their pipelines and also further references. Now your question is too abstract to answer, later on with basic knowledge more specific question should rise.

Upvotes: 0

Related Questions