Re: Core Graphics: creating an image mask from a PDF?
Jim
On Dec 14, 2020, at 8:17 PM, Graham Cox <graham@...> wrote:I’ve used CoreImage (CIBlendWithMask filter) to use a mask. https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIBlendWithMask CoreImage makes it easy to create solid-color images as well. CIImage *bkgImage = [CIImage imageWithColor:[CIColor colorWithRed:0 green:0 blue:0 alpha:0]]; Alternatively, if you want to stick with the CoreGraphics functions, you can use ImageIO to create a data output of your CGImageRef bitmap that you should be able to feed into CGImageMaskCreate(). Jim Crate |
|