Image

public typealias Image = UIKit.UIImage
  • Mechanica

    Initializes a new image object from a Base-64 encoded String.

    Declaration

    Swift

    public convenience init?(base64Encoded base64String: String)

    Parameters

    base64String

    The string to parse.

  • Mechanica

    Checks if the image has alpha component.

    Declaration

    Swift

    public var hasAlpha: Bool { get }
  • Mechanica

    Returns whether the image is opaque.

    Declaration

    Swift

    public var isOpaque: Bool { get }
  • Mechanica

    Convert the image to data.

    Note

    If the image has an alpha component, the PNG format will be used, otherwise the JPEG without compression.

    Declaration

    Swift

    public var data: Data? { get }
  • Mechanica

    Returns whether the image is inflated.

    Declaration

    Swift

    public var isInflated: Bool { get set }
  • Mechanica

    Inflates the underlying compressed image data to be backed by an uncompressed bitmap representation.

    It allows a bitmap representation to be constructed in the background rather than on the main thread.

    Note

    Inflating compressed image formats (such as PNG or JPEG) in a background queue can significantly improve drawing performance on the main thread.

    Declaration

    Swift

    public func inflate()
  • Mechanica

    Creates a new image downsampling an image at given URL for display at smaller size.

    Declaration

    Swift

    public class func downsampledImage(at imageURL: URL, to pointSize: CGSize, scaleFactor: CGFloat) -> Image?

    Parameters

    imageURL

    The image URL to read from.

    pointSize

    The size of the new image.

    scale

    The scale factor to apply

    Return Value

    A downsampled image.

  • Mechanica

    Creates a new image downsampling an image with a given data for display at smaller size.

    Declaration

    Swift

    public class func downsampledImage(with imageData: Data, to pointSize: CGSize, scaleFactor: CGFloat) -> Image?

    Parameters

    imageData

    The image data to read from.

    pointSize

    The size of the new image.

    scale

    The scale factor to apply

    Return Value

    A downsampled image.