OverlayImageProcessor

public struct OverlayImageProcessor: ImageProcessor

Processor for adding an overlay to images. Only CG-based images are supported in macOS.

  • Identifier of the processor.

    Note

    See documentation of ImageProcessor protocol for more.

    Declaration

    Swift

    public let identifier: String
  • Overlay color will be used to overlay the input image.

    Declaration

    Swift

    public let overlay: Color
  • Fraction will be used when overlay the color to image.

    Declaration

    Swift

    public let fraction: CGFloat
  • Initialize an OverlayImageProcessor

    Declaration

    Swift

    public init(overlay: Color, fraction: CGFloat = 0.5)

    Parameters

    overlay

    Overlay color will be used to overlay the input image.

    fraction

    Fraction will be used when overlay the color to image. From 0.0 to 1.0. 0.0 means solid color, 1.0 means transparent overlay.

  • Process an input ImageProcessItem item to an image for this processor.

    Note

    See documentation of ImageProcessor protocol for more.

    Declaration

    Swift

    public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image?

    Parameters

    item

    Input item which will be processed by self

    options

    Options when processing the item.

    Return Value

    The processed image.