@octane-xplat/nativescript-mason-core 0.0.1 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +198 -2
- package/artifact-inventory.json +774 -0
- package/box-shadow.d.ts +10 -0
- package/box-shadow.js +48 -0
- package/common.d.ts +485 -0
- package/common.js +2659 -0
- package/css-colors.d.ts +17 -0
- package/css-colors.js +54 -0
- package/css-environment.d.ts +49 -0
- package/css-environment.js +309 -0
- package/css-filter.d.ts +17 -0
- package/css-filter.js +140 -0
- package/css-keyframes.d.ts +41 -0
- package/css-keyframes.js +437 -0
- package/css-math.d.ts +34 -0
- package/css-math.js +300 -0
- package/css-shorthands.d.ts +65 -0
- package/css-shorthands.js +673 -0
- package/css-transform.d.ts +6 -0
- package/css-transform.js +100 -0
- package/diagnostics.d.ts +51 -0
- package/diagnostics.js +52 -0
- package/display-density.d.ts +9 -0
- package/display-density.js +20 -0
- package/fonts.d.ts +20 -0
- package/fonts.js +88 -0
- package/foreign-layout.d.ts +6 -0
- package/foreign-layout.js +151 -0
- package/gradient-stops.d.ts +25 -0
- package/gradient-stops.js +112 -0
- package/index.android.d.ts +11 -0
- package/index.android.js +9 -0
- package/index.d.ts +12 -0
- package/index.ios.d.ts +11 -0
- package/index.ios.js +9 -0
- package/ios-host-README.md +124 -0
- package/layout-types.d.ts +192 -0
- package/mask.d.ts +54 -0
- package/mask.js +26 -0
- package/native-environment.android.d.ts +3 -0
- package/native-environment.android.js +69 -0
- package/native-environment.d.ts +3 -0
- package/native-environment.ios.d.ts +3 -0
- package/native-environment.ios.js +65 -0
- package/native-types-README.md +51 -0
- package/package.json +47 -6
- package/panel-helpers.d.ts +3 -0
- package/panel-helpers.js +8 -0
- package/platforms/android/MasonCore.aar +0 -0
- package/platforms/android/include.gradle +6 -0
- package/platforms/android/manifest.json +73 -0
- package/platforms/ios/FontManager.LICENSE +201 -0
- package/platforms/ios/MasonCore.xcframework/Info.plist +43 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/Mason.h +25 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/mason_native.h +601 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Info.plist +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/MasonCore +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.abi.json +100095 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.private.swiftinterface +3174 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftinterface +3174 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/module.modulemap +9 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/Mason.h +25 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/mason_native.h +601 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Info.plist +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/MasonCore +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.abi.json +100095 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3174 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3174 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/module.modulemap +9 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
- package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
- package/platforms/ios/Package.resolved +24 -0
- package/platforms/ios/SDWebImage.LICENSE +20 -0
- package/platforms/ios/build.xcconfig +4 -0
- package/platforms/ios/device-manifest.json +213 -0
- package/platforms/ios/include/FontManager/NSCFontDescriptors.h +36 -0
- package/platforms/ios/include/FontManager/NSCFontFace.h +98 -0
- package/platforms/ios/include/FontManager/NSCFontFaceSet.h +73 -0
- package/platforms/ios/include/FontManager/NSCFontManagerUmbrella.h +7 -0
- package/platforms/ios/include/FontManager/NSCFontParser.h +22 -0
- package/platforms/ios/include/FontManager/NSCFontRegex.h +4 -0
- package/platforms/ios/include/FontManager/NSCFontResolver.h +43 -0
- package/platforms/ios/include/FontManager/NSCFontStyle.h +27 -0
- package/platforms/ios/include/FontManager/NSCFontTypes.h +41 -0
- package/platforms/ios/include/SDWebImage/NSButton+WebCache.h +340 -0
- package/platforms/ios/include/SDWebImage/NSData+ImageContentType.h +63 -0
- package/platforms/ios/include/SDWebImage/NSImage+Compatibility.h +67 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImage.h +136 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImagePlayer.h +113 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImageRep.h +33 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImageView+WebCache.h +168 -0
- package/platforms/ios/include/SDWebImage/SDAnimatedImageView.h +125 -0
- package/platforms/ios/include/SDWebImage/SDCallbackQueue.h +59 -0
- package/platforms/ios/include/SDWebImage/SDDiskCache.h +146 -0
- package/platforms/ios/include/SDWebImage/SDGraphicsImageRenderer.h +84 -0
- package/platforms/ios/include/SDWebImage/SDImageAPNGCoder.h +19 -0
- package/platforms/ios/include/SDWebImage/SDImageAWebPCoder.h +23 -0
- package/platforms/ios/include/SDWebImage/SDImageCache.h +482 -0
- package/platforms/ios/include/SDWebImage/SDImageCacheConfig.h +153 -0
- package/platforms/ios/include/SDWebImage/SDImageCacheDefine.h +179 -0
- package/platforms/ios/include/SDWebImage/SDImageCachesManager.h +81 -0
- package/platforms/ios/include/SDWebImage/SDImageCoder.h +347 -0
- package/platforms/ios/include/SDWebImage/SDImageCoderHelper.h +251 -0
- package/platforms/ios/include/SDWebImage/SDImageCodersManager.h +58 -0
- package/platforms/ios/include/SDWebImage/SDImageFrame.h +44 -0
- package/platforms/ios/include/SDWebImage/SDImageGIFCoder.h +22 -0
- package/platforms/ios/include/SDWebImage/SDImageGraphics.h +28 -0
- package/platforms/ios/include/SDWebImage/SDImageHEICCoder.h +25 -0
- package/platforms/ios/include/SDWebImage/SDImageIOAnimatedCoder.h +65 -0
- package/platforms/ios/include/SDWebImage/SDImageIOCoder.h +30 -0
- package/platforms/ios/include/SDWebImage/SDImageLoader.h +146 -0
- package/platforms/ios/include/SDWebImage/SDImageLoadersManager.h +40 -0
- package/platforms/ios/include/SDWebImage/SDImageTransformer.h +283 -0
- package/platforms/ios/include/SDWebImage/SDMemoryCache.h +78 -0
- package/platforms/ios/include/SDWebImage/SDWebImage.h +91 -0
- package/platforms/ios/include/SDWebImage/SDWebImageCacheKeyFilter.h +35 -0
- package/platforms/ios/include/SDWebImage/SDWebImageCacheSerializer.h +39 -0
- package/platforms/ios/include/SDWebImage/SDWebImageCompat.h +102 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDefine.h +420 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloader.h +320 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderConfig.h +113 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderDecryptor.h +52 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderOperation.h +191 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderRequestModifier.h +72 -0
- package/platforms/ios/include/SDWebImage/SDWebImageDownloaderResponseModifier.h +72 -0
- package/platforms/ios/include/SDWebImage/SDWebImageError.h +33 -0
- package/platforms/ios/include/SDWebImage/SDWebImageIndicator.h +119 -0
- package/platforms/ios/include/SDWebImage/SDWebImageManager.h +290 -0
- package/platforms/ios/include/SDWebImage/SDWebImageOperation.h +27 -0
- package/platforms/ios/include/SDWebImage/SDWebImageOptionsProcessor.h +78 -0
- package/platforms/ios/include/SDWebImage/SDWebImagePrefetcher.h +168 -0
- package/platforms/ios/include/SDWebImage/SDWebImageTransition.h +131 -0
- package/platforms/ios/include/SDWebImage/UIButton+WebCache.h +402 -0
- package/platforms/ios/include/SDWebImage/UIImage+ExtendedCacheData.h +24 -0
- package/platforms/ios/include/SDWebImage/UIImage+ForceDecode.h +52 -0
- package/platforms/ios/include/SDWebImage/UIImage+GIF.h +26 -0
- package/platforms/ios/include/SDWebImage/UIImage+MemoryCacheCost.h +27 -0
- package/platforms/ios/include/SDWebImage/UIImage+Metadata.h +104 -0
- package/platforms/ios/include/SDWebImage/UIImage+MultiFormat.h +81 -0
- package/platforms/ios/include/SDWebImage/UIImage+Transform.h +164 -0
- package/platforms/ios/include/SDWebImage/UIImageView+HighlightedWebCache.h +142 -0
- package/platforms/ios/include/SDWebImage/UIImageView+WebCache.h +209 -0
- package/platforms/ios/include/SDWebImage/UIView+WebCache.h +131 -0
- package/platforms/ios/include/SDWebImage/UIView+WebCacheOperation.h +52 -0
- package/platforms/ios/include/SDWebImage/UIView+WebCacheState.h +63 -0
- package/platforms/ios/include/module.modulemap +2 -0
- package/platforms/ios/manifest.json +132 -0
- package/platforms/ios/simulator-manifest.json +213 -0
- package/plugin-README.md +234 -0
- package/properties.d.ts +154 -0
- package/properties.js +2456 -0
- package/pseudo.d.ts +9 -0
- package/pseudo.js +57 -0
- package/scroll/index.android.d.ts +15 -0
- package/scroll/index.android.js +72 -0
- package/scroll/index.d.ts +5 -0
- package/scroll/index.ios.d.ts +18 -0
- package/scroll/index.ios.js +106 -0
- package/style.d.ts +768 -0
- package/style.js +7167 -0
- package/symbols.d.ts +25 -0
- package/symbols.js +41 -0
- package/tree/index.android.d.ts +11 -0
- package/tree/index.android.js +42 -0
- package/tree/index.d.ts +15 -0
- package/tree/index.ios.d.ts +26 -0
- package/tree/index.ios.js +53 -0
- package/typings/android-declarations.d.ts +4 -0
- package/typings/android.d.ts +9730 -0
- package/typings/manifest.json +45 -0
- package/typings/native.d.ts +5 -0
- package/typings/objc!FontManager.d.ts +389 -0
- package/typings/objc!MasonCore.d.ts +2472 -0
- package/typings/objc!SDWebImage.d.ts +3378 -0
- package/units.d.ts +29 -0
- package/units.js +44 -0
- package/utils/index.android.d.ts +211 -0
- package/utils/index.android.js +595 -0
- package/utils/index.ios.d.ts +222 -0
- package/utils/index.ios.js +790 -0
- package/view/index.android.d.ts +13 -0
- package/view/index.android.js +74 -0
- package/view/index.d.ts +2 -0
- package/view/index.ios.d.ts +24 -0
- package/view/index.ios.js +157 -0
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
*
|
|
5
|
+
* For the full copyright and license information, please view the LICENSE
|
|
6
|
+
* file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#import "SDWebImageCompat.h"
|
|
10
|
+
|
|
11
|
+
#if SD_UIKIT
|
|
12
|
+
|
|
13
|
+
#import "SDWebImageManager.h"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Integrates SDWebImage async downloading and caching of remote images with UIButton.
|
|
17
|
+
*/
|
|
18
|
+
@interface UIButton (WebCache)
|
|
19
|
+
|
|
20
|
+
#pragma mark - Image
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get the current image URL.
|
|
24
|
+
* This simply translate to `[self sd_imageURLForState:self.state]` from v5.18.0
|
|
25
|
+
*/
|
|
26
|
+
@property (nonatomic, strong, readonly, nullable) NSURL *sd_currentImageURL;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get the image URL for a control state.
|
|
30
|
+
*
|
|
31
|
+
* @param state Which state you want to know the URL for. The values are described in UIControlState.
|
|
32
|
+
*/
|
|
33
|
+
- (nullable NSURL *)sd_imageURLForState:(UIControlState)state;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the image operation key for a control state.
|
|
37
|
+
*
|
|
38
|
+
* @param state Which state you want to know the URL for. The values are described in UIControlState.
|
|
39
|
+
*/
|
|
40
|
+
- (nonnull NSString *)sd_imageOperationKeyForState:(UIControlState)state;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Set the button `image` with an `url`.
|
|
44
|
+
*
|
|
45
|
+
* The download is asynchronous and cached.
|
|
46
|
+
*
|
|
47
|
+
* @param url The url for the image.
|
|
48
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
49
|
+
*/
|
|
50
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
51
|
+
forState:(UIControlState)state NS_REFINED_FOR_SWIFT;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Set the button `image` with an `url` and a placeholder.
|
|
55
|
+
*
|
|
56
|
+
* The download is asynchronous and cached.
|
|
57
|
+
*
|
|
58
|
+
* @param url The url for the image.
|
|
59
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
60
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
61
|
+
* @see sd_setImageWithURL:placeholderImage:options:
|
|
62
|
+
*/
|
|
63
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
64
|
+
forState:(UIControlState)state
|
|
65
|
+
placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Set the button `image` with an `url`, placeholder and custom options.
|
|
69
|
+
*
|
|
70
|
+
* The download is asynchronous and cached.
|
|
71
|
+
*
|
|
72
|
+
* @param url The url for the image.
|
|
73
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
74
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
75
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
76
|
+
*/
|
|
77
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
78
|
+
forState:(UIControlState)state
|
|
79
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
80
|
+
options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Set the button `image` with an `url`, placeholder, custom options and context.
|
|
84
|
+
*
|
|
85
|
+
* The download is asynchronous and cached.
|
|
86
|
+
*
|
|
87
|
+
* @param url The url for the image.
|
|
88
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
89
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
90
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
91
|
+
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
92
|
+
*/
|
|
93
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
94
|
+
forState:(UIControlState)state
|
|
95
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
96
|
+
options:(SDWebImageOptions)options
|
|
97
|
+
context:(nullable SDWebImageContext *)context;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Set the button `image` with an `url`.
|
|
101
|
+
*
|
|
102
|
+
* The download is asynchronous and cached.
|
|
103
|
+
*
|
|
104
|
+
* @param url The url for the image.
|
|
105
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
106
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
107
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
108
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
109
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
110
|
+
* The fourth parameter is the original image url.
|
|
111
|
+
*/
|
|
112
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
113
|
+
forState:(UIControlState)state
|
|
114
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Set the button `image` with an `url`, placeholder.
|
|
118
|
+
*
|
|
119
|
+
* The download is asynchronous and cached.
|
|
120
|
+
*
|
|
121
|
+
* @param url The url for the image.
|
|
122
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
123
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
124
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
125
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
126
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
127
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
128
|
+
* The fourth parameter is the original image url.
|
|
129
|
+
*/
|
|
130
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
131
|
+
forState:(UIControlState)state
|
|
132
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
133
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Set the button `image` with an `url`, placeholder and custom options.
|
|
137
|
+
*
|
|
138
|
+
* The download is asynchronous and cached.
|
|
139
|
+
*
|
|
140
|
+
* @param url The url for the image.
|
|
141
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
142
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
143
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
144
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
145
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
146
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
147
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
148
|
+
* The fourth parameter is the original image url.
|
|
149
|
+
*/
|
|
150
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
151
|
+
forState:(UIControlState)state
|
|
152
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
153
|
+
options:(SDWebImageOptions)options
|
|
154
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Set the button `image` with an `url`, placeholder and custom options.
|
|
158
|
+
*
|
|
159
|
+
* The download is asynchronous and cached.
|
|
160
|
+
*
|
|
161
|
+
* @param url The url for the image.
|
|
162
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
163
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
164
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
165
|
+
* @param progressBlock A block called while image is downloading
|
|
166
|
+
* @note the progress block is executed on a background queue
|
|
167
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
168
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
169
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
170
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
171
|
+
* The fourth parameter is the original image url.
|
|
172
|
+
*/
|
|
173
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
174
|
+
forState:(UIControlState)state
|
|
175
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
176
|
+
options:(SDWebImageOptions)options
|
|
177
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
178
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Set the button `image` with an `url`, placeholder, custom options and context.
|
|
182
|
+
*
|
|
183
|
+
* The download is asynchronous and cached.
|
|
184
|
+
*
|
|
185
|
+
* @param url The url for the image.
|
|
186
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
187
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
188
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
189
|
+
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
190
|
+
* @param progressBlock A block called while image is downloading
|
|
191
|
+
* @note the progress block is executed on a background queue
|
|
192
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
193
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
194
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
195
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
196
|
+
* The fourth parameter is the original image url.
|
|
197
|
+
*/
|
|
198
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
199
|
+
forState:(UIControlState)state
|
|
200
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
201
|
+
options:(SDWebImageOptions)options
|
|
202
|
+
context:(nullable SDWebImageContext *)context
|
|
203
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
204
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
205
|
+
|
|
206
|
+
#pragma mark - Background Image
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Get the current background image URL.
|
|
210
|
+
*/
|
|
211
|
+
@property (nonatomic, strong, readonly, nullable) NSURL *sd_currentBackgroundImageURL;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Get the background image operation key for a control state.
|
|
215
|
+
*
|
|
216
|
+
* @param state Which state you want to know the URL for. The values are described in UIControlState.
|
|
217
|
+
*/
|
|
218
|
+
- (nonnull NSString *)sd_backgroundImageOperationKeyForState:(UIControlState)state;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Get the background image URL for a control state.
|
|
222
|
+
*
|
|
223
|
+
* @param state Which state you want to know the URL for. The values are described in UIControlState.
|
|
224
|
+
*/
|
|
225
|
+
- (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Set the button `backgroundImage` with an `url`.
|
|
229
|
+
*
|
|
230
|
+
* The download is asynchronous and cached.
|
|
231
|
+
*
|
|
232
|
+
* @param url The url for the image.
|
|
233
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
234
|
+
*/
|
|
235
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
236
|
+
forState:(UIControlState)state NS_REFINED_FOR_SWIFT;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Set the button `backgroundImage` with an `url` and a placeholder.
|
|
240
|
+
*
|
|
241
|
+
* The download is asynchronous and cached.
|
|
242
|
+
*
|
|
243
|
+
* @param url The url for the image.
|
|
244
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
245
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
246
|
+
* @see sd_setImageWithURL:placeholderImage:options:
|
|
247
|
+
*/
|
|
248
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
249
|
+
forState:(UIControlState)state
|
|
250
|
+
placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Set the button `backgroundImage` with an `url`, placeholder and custom options.
|
|
254
|
+
*
|
|
255
|
+
* The download is asynchronous and cached.
|
|
256
|
+
*
|
|
257
|
+
* @param url The url for the image.
|
|
258
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
259
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
260
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
261
|
+
*/
|
|
262
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
263
|
+
forState:(UIControlState)state
|
|
264
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
265
|
+
options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Set the button `backgroundImage` with an `url`, placeholder, custom options and context.
|
|
269
|
+
*
|
|
270
|
+
* The download is asynchronous and cached.
|
|
271
|
+
*
|
|
272
|
+
* @param url The url for the image.
|
|
273
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
274
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
275
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
276
|
+
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
277
|
+
*/
|
|
278
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
279
|
+
forState:(UIControlState)state
|
|
280
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
281
|
+
options:(SDWebImageOptions)options
|
|
282
|
+
context:(nullable SDWebImageContext *)context;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Set the button `backgroundImage` with an `url`.
|
|
286
|
+
*
|
|
287
|
+
* The download is asynchronous and cached.
|
|
288
|
+
*
|
|
289
|
+
* @param url The url for the image.
|
|
290
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
291
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
292
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
293
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
294
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
295
|
+
* The fourth parameter is the original image url.
|
|
296
|
+
*/
|
|
297
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
298
|
+
forState:(UIControlState)state
|
|
299
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Set the button `backgroundImage` with an `url`, placeholder.
|
|
303
|
+
*
|
|
304
|
+
* The download is asynchronous and cached.
|
|
305
|
+
*
|
|
306
|
+
* @param url The url for the image.
|
|
307
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
308
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
309
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
310
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
311
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
312
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
313
|
+
* The fourth parameter is the original image url.
|
|
314
|
+
*/
|
|
315
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
316
|
+
forState:(UIControlState)state
|
|
317
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
318
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Set the button `backgroundImage` with an `url`, placeholder and custom options.
|
|
322
|
+
*
|
|
323
|
+
* The download is asynchronous and cached.
|
|
324
|
+
*
|
|
325
|
+
* @param url The url for the image.
|
|
326
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
327
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
328
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
329
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
330
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
331
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
332
|
+
* The fourth parameter is the original image url.
|
|
333
|
+
*/
|
|
334
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
335
|
+
forState:(UIControlState)state
|
|
336
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
337
|
+
options:(SDWebImageOptions)options
|
|
338
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Set the button `backgroundImage` with an `url`, placeholder and custom options.
|
|
342
|
+
*
|
|
343
|
+
* The download is asynchronous and cached.
|
|
344
|
+
*
|
|
345
|
+
* @param url The url for the image.
|
|
346
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
347
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
348
|
+
* @param progressBlock A block called while image is downloading
|
|
349
|
+
* @note the progress block is executed on a background queue
|
|
350
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
351
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
352
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
353
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
354
|
+
* The fourth parameter is the original image url.
|
|
355
|
+
*/
|
|
356
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
357
|
+
forState:(UIControlState)state
|
|
358
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
359
|
+
options:(SDWebImageOptions)options
|
|
360
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
361
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Set the button `backgroundImage` with an `url`, placeholder, custom options and context.
|
|
365
|
+
*
|
|
366
|
+
* The download is asynchronous and cached.
|
|
367
|
+
*
|
|
368
|
+
* @param url The url for the image.
|
|
369
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
370
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
371
|
+
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
372
|
+
* @param progressBlock A block called while image is downloading
|
|
373
|
+
* @note the progress block is executed on a background queue
|
|
374
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
375
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
376
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
377
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
378
|
+
* The fourth parameter is the original image url.
|
|
379
|
+
*/
|
|
380
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
381
|
+
forState:(UIControlState)state
|
|
382
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
383
|
+
options:(SDWebImageOptions)options
|
|
384
|
+
context:(nullable SDWebImageContext *)context
|
|
385
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
386
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
387
|
+
|
|
388
|
+
#pragma mark - Cancel
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Cancel the current image download
|
|
392
|
+
*/
|
|
393
|
+
- (void)sd_cancelImageLoadForState:(UIControlState)state;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Cancel the current backgroundImage download
|
|
397
|
+
*/
|
|
398
|
+
- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state;
|
|
399
|
+
|
|
400
|
+
@end
|
|
401
|
+
|
|
402
|
+
#endif
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
* (c) Fabrice Aneche
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
#import "SDWebImageCompat.h"
|
|
12
|
+
|
|
13
|
+
@interface UIImage (ExtendedCacheData)
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
Read and Write the extended object and bind it to the image. Which can hold some extra metadata like Image's scale factor, URL rich link, date, etc.
|
|
17
|
+
The extended object should conforms to NSCoding, which we use `NSKeyedArchiver` and `NSKeyedUnarchiver` to archive it to data, and write to disk cache.
|
|
18
|
+
@note The disk cache preserve both of the data and extended data with the same cache key. For manual query, use the `SDDiskCache` protocol method `extendedDataForKey:` instead.
|
|
19
|
+
@note You can specify arbitrary object conforms to NSCoding (NSObject protocol here is used to support object using `NS_ROOT_CLASS`, which is not NSObject subclass). If you load image from disk cache, you should check the extended object class to avoid corrupted data.
|
|
20
|
+
@warning This object don't need to implements NSSecureCoding (but it's recommended), because we allows arbitrary class.
|
|
21
|
+
*/
|
|
22
|
+
@property (nonatomic, strong, nullable) id<NSObject, NSCoding> sd_extendedObject;
|
|
23
|
+
|
|
24
|
+
@end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
*
|
|
5
|
+
* For the full copyright and license information, please view the LICENSE
|
|
6
|
+
* file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#import "SDWebImageCompat.h"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
UIImage category about force decode feature (avoid Image/IO's lazy decoding during rendering behavior).
|
|
13
|
+
*/
|
|
14
|
+
@interface UIImage (ForceDecode)
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
A bool value indicating whether the image has already been decoded. This can help to avoid extra force decode.
|
|
18
|
+
Force decode is used for 2 cases:
|
|
19
|
+
-- 1. for ImageIO created image (via `CGImageCreateWithImageSource` SPI), it's lazy and we trigger the decode before rendering
|
|
20
|
+
-- 2. for non-ImageIO created image (via `CGImageCreate` API), we can ensure it's alignment is suitable to render on screen without copy by CoreAnimation
|
|
21
|
+
@note For coder plugin developer, always use the SDImageCoderHelper's `colorSpaceGetDeviceRGB`/`preferredPixelFormat` to create CGImage.
|
|
22
|
+
@note For more information why force decode, see: https://github.com/path/FastImageCache#byte-alignment
|
|
23
|
+
@note From v5.17.0, the default value is always NO. Use `SDImageForceDecodePolicy` to control complicated policy.
|
|
24
|
+
*/
|
|
25
|
+
@property (nonatomic, assign) BOOL sd_isDecoded;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
Decode the provided image. This is useful if you want to force decode the image before rendering to improve performance.
|
|
29
|
+
|
|
30
|
+
@param image The image to be decoded
|
|
31
|
+
@return The decoded image
|
|
32
|
+
*/
|
|
33
|
+
+ (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
Decode and scale down the provided image
|
|
37
|
+
|
|
38
|
+
@param image The image to be decoded
|
|
39
|
+
@return The decoded and scaled down image
|
|
40
|
+
*/
|
|
41
|
+
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
Decode and scale down the provided image with limit bytes
|
|
45
|
+
|
|
46
|
+
@param image The image to be decoded
|
|
47
|
+
@param bytes The limit bytes size. Provide 0 to use the build-in limit.
|
|
48
|
+
@return The decoded and scaled down image
|
|
49
|
+
*/
|
|
50
|
+
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes;
|
|
51
|
+
|
|
52
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
* (c) Laurin Brandner
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import "SDWebImageCompat.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directly use `SDImageCoder`.
|
|
14
|
+
*/
|
|
15
|
+
@interface UIImage (GIF)
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Creates an animated UIImage from an NSData.
|
|
19
|
+
This will create animated image if the data is Animated GIF. And will create a static image is the data is Static GIF.
|
|
20
|
+
|
|
21
|
+
@param data The GIF data
|
|
22
|
+
@return The created image
|
|
23
|
+
*/
|
|
24
|
+
+ (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data;
|
|
25
|
+
|
|
26
|
+
@end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
*
|
|
5
|
+
* For the full copyright and license information, please view the LICENSE
|
|
6
|
+
* file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#import "SDWebImageCompat.h"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
UIImage category for memory cache cost.
|
|
13
|
+
*/
|
|
14
|
+
@interface UIImage (MemoryCacheCost)
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
The memory cache cost for specify image used by image cache. The cost function is the bytes size held in memory.
|
|
18
|
+
If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost.
|
|
19
|
+
|
|
20
|
+
For `UIImage`, this method return the single frame bytes size when `image.images` is nil for static image. Return full frame bytes size when `image.images` is not nil for animated image.
|
|
21
|
+
For `NSImage`, this method return the single frame bytes size because `NSImage` does not store all frames in memory.
|
|
22
|
+
@note Note that because of the limitations of category this property can get out of sync if you create another instance with CGImage or other methods.
|
|
23
|
+
@note For custom animated class conforms to `SDAnimatedImage`, you can override this getter method in your subclass to return a more proper value instead, which representing the current frame's total bytes.
|
|
24
|
+
*/
|
|
25
|
+
@property (assign, nonatomic) NSUInteger sd_memoryCost;
|
|
26
|
+
|
|
27
|
+
@end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
*
|
|
5
|
+
* For the full copyright and license information, please view the LICENSE
|
|
6
|
+
* file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
#import "SDWebImageCompat.h"
|
|
10
|
+
#import "NSData+ImageContentType.h"
|
|
11
|
+
#import "SDImageCoder.h"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
UIImage category for image metadata, including animation, loop count, format, incremental, etc.
|
|
15
|
+
*/
|
|
16
|
+
@interface UIImage (Metadata)
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* UIKit:
|
|
20
|
+
* For static image format, this value is always 0.
|
|
21
|
+
* For animated image format, 0 means infinite looping.
|
|
22
|
+
* Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
|
|
23
|
+
* AppKit:
|
|
24
|
+
* NSImage currently only support animated via `NSBitmapImageRep`(GIF) or `SDAnimatedImageRep`(APNG/GIF/WebP) unlike UIImage.
|
|
25
|
+
* The getter of this property will get the loop count from animated imageRep
|
|
26
|
+
* The setter of this property will set the loop count from animated imageRep
|
|
27
|
+
* SDAnimatedImage:
|
|
28
|
+
* Returns `animatedImageLoopCount`
|
|
29
|
+
*/
|
|
30
|
+
@property (nonatomic, assign) NSUInteger sd_imageLoopCount;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* UIKit:
|
|
34
|
+
* Returns the `images`'s count by unapply the patch for the different frame durations. Which matches the real visible frame count when displaying on UIImageView.
|
|
35
|
+
* See more in `SDImageCoderHelper.animatedImageWithFrames`.
|
|
36
|
+
* Returns 1 for static image.
|
|
37
|
+
* AppKit:
|
|
38
|
+
* Returns the underlaying `NSBitmapImageRep` or `SDAnimatedImageRep` frame count.
|
|
39
|
+
* Returns 1 for static image.
|
|
40
|
+
* SDAnimatedImage:
|
|
41
|
+
* Returns `animatedImageFrameCount` for animated image, 1 for static image.
|
|
42
|
+
*/
|
|
43
|
+
@property (nonatomic, assign, readonly) NSUInteger sd_imageFrameCount;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* UIKit:
|
|
47
|
+
* Check the `images` array property.
|
|
48
|
+
* AppKit:
|
|
49
|
+
* NSImage currently only support animated via GIF imageRep unlike UIImage. It will check the imageRep's frame count > 1.
|
|
50
|
+
* SDAnimatedImage:
|
|
51
|
+
* Check `animatedImageFrameCount` > 1
|
|
52
|
+
*/
|
|
53
|
+
@property (nonatomic, assign, readonly) BOOL sd_isAnimated;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* UIKit:
|
|
57
|
+
* Check the `isSymbolImage` property. Also check the system PDF(iOS 11+) && SVG(iOS 13+) support.
|
|
58
|
+
* AppKit:
|
|
59
|
+
* NSImage supports PDF && SVG && EPS imageRep, check the imageRep class.
|
|
60
|
+
* SDAnimatedImage:
|
|
61
|
+
* Returns `NO`
|
|
62
|
+
*/
|
|
63
|
+
@property (nonatomic, assign, readonly) BOOL sd_isVector;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The image format represent the original compressed image data format.
|
|
67
|
+
* If you don't manually specify a format, this information is retrieve from CGImage using `CGImageGetUTType`, which may return nil for non-CG based image. At this time it will return `SDImageFormatUndefined` as default value.
|
|
68
|
+
* @note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
|
|
69
|
+
* @note For `SDAnimatedImage`, returns `animatedImageFormat` when animated, or fallback when static.
|
|
70
|
+
*/
|
|
71
|
+
@property (nonatomic, assign) SDImageFormat sd_imageFormat;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
A bool value indicating whether the image is during incremental decoding and may not contains full pixels.
|
|
75
|
+
*/
|
|
76
|
+
@property (nonatomic, assign) BOOL sd_isIncremental;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
A bool value indicating that the image is transformed from original image, so the image data may not always match original download one.
|
|
80
|
+
*/
|
|
81
|
+
@property (nonatomic, assign) BOOL sd_isTransformed;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
A bool value indicating that the image is using thumbnail decode with smaller size, so the image data may not always match original download one.
|
|
85
|
+
@note This just check `sd_decodeOptions[.decodeThumbnailPixelSize] > CGSize.zero`
|
|
86
|
+
*/
|
|
87
|
+
@property (nonatomic, assign, readonly) BOOL sd_isThumbnail;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
A dictionary value contains the decode options when decoded from SDWebImage loading system (say, `SDImageCacheDecodeImageData/SDImageLoaderDecode[Progressive]ImageData`)
|
|
91
|
+
It may not always available and only image decoding related options will be saved. (including [.decodeScaleFactor, .decodeThumbnailPixelSize, .decodePreserveAspectRatio, .decodeFirstFrameOnly])
|
|
92
|
+
@note This is used to identify and check the image is from thumbnail decoding, and the callback's data **will be nil** (because this time the data saved to disk does not match the image return to you. If you need full size data, query the cache with full size url key)
|
|
93
|
+
@warning You should not store object inside which keep strong reference to image itself, which will cause retain cycle.
|
|
94
|
+
@warning This API exist only because of current SDWebImageDownloader bad design which does not callback the context we call it. There will be refactor in future (API break), use with caution.
|
|
95
|
+
*/
|
|
96
|
+
@property (nonatomic, copy) SDImageCoderOptions *sd_decodeOptions;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
A bool value indicating that the image is using HDR
|
|
100
|
+
@note Only valid for CGImage based, for CIImage based, the returned value is not correct.
|
|
101
|
+
*/
|
|
102
|
+
@property (nonatomic, assign, readonly) BOOL sd_isHighDynamicRange;
|
|
103
|
+
|
|
104
|
+
@end
|