ImageProcessor
public protocol ImageProcessor
Requirements
crop(image:to:)
Crop the image to a given size. The image is center-cropped
func crop(image: UIImage, to size: CGSize) -> UIImage?
Parameters
image
: The image to cropsize
: The size to which the image needs to be cropped
Returns
The cropped image
scale(image:to:)
Scale an image to a given size maintaining the aspect ratio.
func scale(image: UIImage, to size: CGSize) -> UIImage
Parameters
image
: The image to scalesize
: The size to which the image needs to be scaled
Returns
The scaled image