NextFaze / FazeKit

A collection of helper functions and extensions for Swift iOS apps
Apache License 2.0
4 stars 8 forks source link

UIImage Filter Helper #13

Closed swoolcock closed 4 years ago

swoolcock commented 4 years ago

Adds helper functions to UIImage that convert UIKit and CoreGraphics types to the corresponding CoreImage types.

So as to not pollute the UIImage function list, filters that act on images are accessible via an extension field filters, and CIFilter "generators" that do not require an input image are accessible via a static struct UIImage.Generators.

Usage:

let blurredImage = srcImage.filters.gaussianBlur(inputRadius: 20)
let greyscaleImage = srcImage.filters.colorMonochrome()
let textImage = UIImage.Generators.textImage(inputText: "Hello world!")