Structures
The following structures are available globally.
-
Represents a basic and default
See moreCacheSerializer
used in Kingfisher disk cache system. It could serialize and deserialize images in PNG, JPEG and GIF format. For image other than these formats, a normalizedpngRepresentation
will be used.Declaration
Swift
public struct DefaultCacheSerializer : CacheSerializer
-
FormatIndicatedCacheSerializer
lets you indicate an image format for serialized caches.It could serialize and deserialize PNG, JPEG and GIF images. For image other than these formats, a normalized
pngRepresentation
will be used.Example:
See morelet profileImageSize = CGSize(width: 44, height: 44) // A round corner image. let imageProcessor = RoundCornerImageProcessor( cornerRadius: profileImageSize.width / 2, targetSize: profileImageSize) let optionsInfo: KingfisherOptionsInfo = [ .cacheSerializer(FormatIndicatedCacheSerializer.png), .processor(imageProcessor)] A URL pointing to a JPEG image. let url = URL(string: "https://example.com/image.jpg")! // Image will be always cached as PNG format to preserve alpha channel for round rectangle. // So when you load it from cache again later, it will be still round cornered. // Otherwise, the corner part would be filled by white color (since JPEG does not contain an alpha channel). imageView.kf.setImage(with: url, options: optionsInfo)
Declaration
Swift
public struct FormatIndicatedCacheSerializer : CacheSerializer
-
Represents the caching operation result.
See moreDeclaration
Swift
public struct CacheStoreResult
-
Wrapper for Kingfisher compatible types. This type provides an extension point for connivence methods in Kingfisher.
See moreDeclaration
Swift
public struct KingfisherWrapper<Base>
-
Undocumented
Declaration
Swift
public struct RetrieveImageDownloadTask
-
The default modifier. It does nothing and returns the image as is.
See moreDeclaration
Swift
@available(*, deprecated, message: "Use `nil` in KingfisherOptionsInfo to indicate no modifier.") public struct DefaultImageModifier : ImageModifier
-
Represents an image data provider for loading from a local file URL on disk. Uses this type for adding a disk image to Kingfisher. Compared to loading it directly, you can get benefit of using Kingfisher’s extension methods, as well as applying
See moreImageProcessor
s and storing the image toImageCache
of Kingfisher.Declaration
Swift
public struct LocalFileImageDataProvider : ImageDataProvider
-
Represents an image data provider for loading image from a given Base64 encoded string.
See moreDeclaration
Swift
public struct Base64ImageDataProvider : ImageDataProvider
-
Represents an image data provider for a raw data object.
See moreDeclaration
Swift
public struct RawImageDataProvider : ImageDataProvider
-
Represents the result of a Kingfisher retrieving image task.
See moreDeclaration
Swift
public struct RetrieveImageResult
-
The parsed options info used across Kingfisher methods. Each property in this type corresponds a case member in
See moreKingfisherOptionsInfoItem
. When aKingfisherOptionsInfo
sent to Kingfisher related methods, it will be parsed and converted to aKingfisherParsedOptionsInfo
first, and pass through the internal methods.Declaration
Swift
public struct KingfisherParsedOptionsInfo
-
A wrapper struct for a
See moreTransformer
of CIImage filters. AFilter
value could be used to create aCIImage
processor.Declaration
Swift
public struct Filter
-
Represents a set of image creating options used in Kingfisher.
See moreDeclaration
Swift
public struct ImageCreatingOptions
-
The default processor. It converts the input data to a valid image. Images of .PNG, .JPEG and .GIF format are supported. If an image item is given as
See more.image
case,DefaultImageProcessor
will do nothing on it and return the associated image.Declaration
Swift
public struct DefaultImageProcessor : ImageProcessor
-
Represents the rect corner setting when processing a round corner image.
See moreDeclaration
Swift
public struct RectCorner : OptionSet
-
Processor for adding an blend mode to images. Only CG-based images are supported.
See moreDeclaration
Swift
public struct BlendImageProcessor : ImageProcessor
-
Processor for adding an compositing operation to images. Only CG-based images are supported in macOS.
See more -
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.
Note: The input image will be rendered with round corner pixels removed. If the image itself does not contain alpha channel (for example, a JPEG image), the processed image will contain an alpha channel in memory in order to show correctly. However, when cached into disk, the image format will be respected and the alpha channel will be removed. That means when you load the processed image from cache again, you will lose transparent corner. You could use
See moreFormatIndicatedCacheSerializer.png
to force Kingfisher to serialize the image to PNG format in this case.Declaration
Swift
public struct RoundCornerImageProcessor : ImageProcessor
-
Processor for resizing images. If you need to resize a data represented image to a smaller size, use
See moreDownsamplingImageProcessor
instead, which is more efficient and takes less memory.Declaration
Swift
public struct ResizingImageProcessor : ImageProcessor
-
Processor for adding blur effect to images.
See moreAccelerate.framework
is used underhood for a better performance. A simulated Gaussian blur with specified blur radius will be applied.Declaration
Swift
public struct BlurImageProcessor : ImageProcessor
-
Processor for adding an overlay to images. Only CG-based images are supported in macOS.
See moreDeclaration
Swift
public struct OverlayImageProcessor : ImageProcessor
-
Processor for tint images with color. Only CG-based images are supported.
See moreDeclaration
Swift
public struct TintImageProcessor : ImageProcessor
-
Processor for applying some color control to images. Only CG-based images are supported. watchOS is not supported.
See moreDeclaration
Swift
public struct ColorControlsProcessor : ImageProcessor
-
Processor for applying black and white effect to images. Only CG-based images are supported. watchOS is not supported.
See moreDeclaration
Swift
public struct BlackWhiteProcessor : ImageProcessor
-
Processor for cropping an image. Only CG-based images are supported. watchOS is not supported.
See moreDeclaration
Swift
public struct CroppingImageProcessor : ImageProcessor
-
Processor for downsampling an image. Compared to
ResizingImageProcessor
, this processor does not render the images to resize. Instead, it downsample the input data directly to an image. It is a more efficient thanResizingImageProcessor
.Only CG-based images are supported. Animated images (like GIF) is not supported.
See moreDeclaration
Swift
public struct DownsamplingImageProcessor : ImageProcessor
-
Undocumented
See moreDeclaration
Swift
public struct ImageProgressive
-
A wrapper for creating an
See moreImageModifier
easier. This type conforms toImageModifier
and wraps an image modify block. If theblock
throws an error, the original image will be used.Declaration
Swift
public struct AnyImageModifier : ImageModifier
-
Modifier for setting the rendering mode of images.
See moreDeclaration
Swift
public struct RenderingModeImageModifier : ImageModifier
-
Modifier for setting the
See moreflipsForRightToLeftLayoutDirection
property of images.Declaration
Swift
public struct FlipsForRightToLeftLayoutDirectionImageModifier : ImageModifier
-
Modifier for setting the
See morealignmentRectInsets
property of images.Declaration
Swift
public struct AlignmentRectInsetsImageModifier : ImageModifier
-
A wrapper for creating an
See moreImageDownloadRedirectHandler
easier. This type conforms toImageDownloadRedirectHandler
and wraps an redirect request modify block.Declaration
Swift
public struct AnyRedirectHandler : ImageDownloadRedirectHandler
-
A wrapper for creating an
See moreImageDownloadRequestModifier
easier. This type conforms toImageDownloadRequestModifier
and wraps an image modify block.Declaration
Swift
public struct AnyModifier : ImageDownloadRequestModifier