UIImage

public extension UIImage

Adds framework-related methods to UIImage.

  • Creates a lower resolution version of an image.

    Declaration

    Swift

    @objc(pesdk_downsampleWithMaxDimension:)
    func downsample(withMaxDimension dimension: CGFloat) -> UIImage

    Parameters

    dimension

    The maximum dimensions of the image.

    Return Value

    A lower resolution version of the image.

  • Resizes an image to a given size with a given interpolation quality.

    Declaration

    Swift

    @objc(pesdk_resizedImageToSize:interpolationQuality:)
    func resizedImage(to newSize: CGSize, interpolationQuality quality: CGInterpolationQuality) -> UIImage

    Parameters

    newSize

    The size of the new image.

    quality

    The interpolation quality.

    Return Value

    A resized image.

  • Resizes an image to a given size with a given interpolation quality, applies a transform and optionally draws the image transposed.

    Declaration

    Swift

    @objc(pesdk_resizedImageToSize:transform:drawTransposed:interpolationQuality:)
    func resizedImage(to newSize: CGSize, transform: CGAffineTransform, drawTransposed transpose: Bool, interpolationQuality quality: CGInterpolationQuality) -> UIImage

    Parameters

    newSize

    The size of the new image.

    transform

    The transform to apply to the image.

    transpose

    Set to true if the image should be drawn transposed, false otherweise.

    quality

    The interpolation quality.

    Return Value

    A resized and transformed image.

  • Returns a copy of the image, taking into account its orientation

    Declaration

    Swift

    @objc(pesdk_normalizedImage)
    var normalizedImage: UIImage { get }
  • Returns a rescaled copy of the image, taking into account its orientation.

    Note

    The image will be scaled disproportionately if necessary to fit the bounds specified by the parameter.

    Declaration

    Swift

    @objc(pesdk_normalizedImageOfSize:)
    func normalizedImage(of size: CGSize) -> UIImage

    Parameters

    size

    The size of the rescaled image.

    Return Value

    The rescaled image.

  • Draws the receiver in the given rect with the given content mode.

    Declaration

    Swift

    @objc(pesdk_drawInRect:withContentMode:)
    func draw(in rect: CGRect, with contentMode: UIView.ContentMode)

    Parameters

    rect

    The rectangle to draw into.

    contentMode

    The content mode to use for drawing.

  • Returns a colored version of the image.

    Declaration

    Swift

    @objc(pesdk_imageWithTintColor:)
    func image(withTint tint: UIColor) -> UIImage

    Parameters

    tint

    The color to colorize the image.

    Return Value

    The colorized image.