|
|
@@ -47,6 +47,7 @@ import UniformTypeIdentifiers
|
|
|
nonisolated(unsafe) private let animatedImageDataKey = malloc(1)!
|
|
|
nonisolated(unsafe) private let imageFrameCountKey = malloc(1)!
|
|
|
nonisolated(unsafe) private let imageSourceKey = malloc(1)!
|
|
|
+nonisolated(unsafe) private let imageCreatingOptionsKey = malloc(1)!
|
|
|
#if os(macOS)
|
|
|
nonisolated(unsafe) private let imagesKey = malloc(1)!
|
|
|
nonisolated(unsafe) private let durationKey = malloc(1)!
|
|
|
@@ -55,6 +56,7 @@ nonisolated(unsafe) private let durationKey = malloc(1)!
|
|
|
private let animatedImageDataKey = malloc(1)!
|
|
|
private let imageFrameCountKey = malloc(1)!
|
|
|
private let imageSourceKey = malloc(1)!
|
|
|
+private let imageCreatingOptionsKey = malloc(1)!
|
|
|
#if os(macOS)
|
|
|
private let imagesKey = malloc(1)!
|
|
|
private let durationKey = malloc(1)!
|
|
|
@@ -68,6 +70,11 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
|
|
|
set { setRetainedAssociatedObject(base, animatedImageDataKey, newValue) }
|
|
|
}
|
|
|
|
|
|
+ private(set) var imageCreatingOptions: ImageCreatingOptions? {
|
|
|
+ get { return getAssociatedObject(base, imageCreatingOptionsKey) }
|
|
|
+ set { setRetainedAssociatedObject(base, imageCreatingOptionsKey, newValue) }
|
|
|
+ }
|
|
|
+
|
|
|
public var imageFrameCount: Int? {
|
|
|
get { return getAssociatedObject(base, imageFrameCountKey) }
|
|
|
set { setRetainedAssociatedObject(base, imageFrameCountKey, newValue) }
|
|
|
@@ -359,6 +366,7 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
|
|
|
image?.kf.animatedImageData = source.data
|
|
|
image?.kf.imageFrameCount = source.frameCount
|
|
|
image?.kf.frameSource = source
|
|
|
+ image?.kf.imageCreatingOptions = options
|
|
|
return image
|
|
|
#else
|
|
|
|
|
|
@@ -390,6 +398,7 @@ extension KingfisherWrapper where Base: KFCrossPlatformImage {
|
|
|
}
|
|
|
|
|
|
image?.kf.imageFrameCount = source.frameCount
|
|
|
+ image?.kf.imageCreatingOptions = options
|
|
|
return image
|
|
|
#endif
|
|
|
}
|