RoundCornerImageProcessor
public struct RoundCornerImageProcessor: ImageProcessor
Processor for making round corner images. Only CG-based images are supported in macOS, if a non-CG image passed in, the processor will do nothing.
-
Identifier of the processor.
Note
See documentation ofImageProcessorprotocol for more.Declaration
Swift
public let identifier: String -
Corner radius will be applied in processing.
Declaration
Swift
public let cornerRadius: CGFloat -
The target corners which will be applied rounding.
Declaration
Swift
public let roundingCorners: RectCorner -
Target size of output image should be. If
nil, the image will keep its original size after processing.Declaration
Swift
public let targetSize: CGSize? -
Background color of the output image. If
nil, it will stay transparent.Declaration
Swift
public let backgroundColor: Color? -
Initialize a
RoundCornerImageProcessorDeclaration
Swift
public init(cornerRadius: CGFloat, targetSize: CGSize? = nil, roundingCorners corners: RectCorner = .all, backgroundColor: Color? = nil)Parameters
cornerRadiusCorner radius will be applied in processing.
targetSizeTarget size of output image should be. If
nil, the image will keep its original size after processing. Default isnil.cornersThe target corners which will be applied rounding. Default is
.all.backgroundColorBackgroud color to apply for the output image. Default is
nil. -
Process an input
ImageProcessItemitem to an image for this processor.Note
See documentation of
ImageProcessorprotocol for more.Declaration
Swift
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image?Parameters
itemInput item which will be processed by
selfoptionsOptions when processing the item.
Return Value
The processed image.
View on GitHub
Install in Dash
RoundCornerImageProcessor Structure Reference