@octane-xplat/nativescript-mason-core 0.0.1 → 1.0.0-beta.0

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.
Files changed (187) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +113 -2
  3. package/artifact-inventory.json +746 -0
  4. package/box-shadow.d.ts +10 -0
  5. package/box-shadow.js +48 -0
  6. package/common.d.ts +482 -0
  7. package/common.js +2645 -0
  8. package/css-colors.d.ts +17 -0
  9. package/css-colors.js +54 -0
  10. package/css-filter.d.ts +17 -0
  11. package/css-filter.js +140 -0
  12. package/css-keyframes.d.ts +41 -0
  13. package/css-keyframes.js +437 -0
  14. package/css-math.d.ts +34 -0
  15. package/css-math.js +300 -0
  16. package/css-shorthands.d.ts +65 -0
  17. package/css-shorthands.js +673 -0
  18. package/css-transform.d.ts +6 -0
  19. package/css-transform.js +100 -0
  20. package/diagnostics.d.ts +51 -0
  21. package/diagnostics.js +52 -0
  22. package/display-density.d.ts +9 -0
  23. package/display-density.js +20 -0
  24. package/fonts.d.ts +20 -0
  25. package/fonts.js +88 -0
  26. package/foreign-layout.d.ts +6 -0
  27. package/foreign-layout.js +149 -0
  28. package/gradient-stops.d.ts +25 -0
  29. package/gradient-stops.js +112 -0
  30. package/index.android.d.ts +9 -0
  31. package/index.android.js +8 -0
  32. package/index.d.ts +10 -0
  33. package/index.ios.d.ts +9 -0
  34. package/index.ios.js +8 -0
  35. package/ios-host-README.md +124 -0
  36. package/layout-types.d.ts +192 -0
  37. package/mask.d.ts +54 -0
  38. package/mask.js +26 -0
  39. package/native-types-README.md +51 -0
  40. package/package.json +44 -6
  41. package/panel-helpers.d.ts +3 -0
  42. package/panel-helpers.js +8 -0
  43. package/platforms/android/MasonCore.aar +0 -0
  44. package/platforms/android/include.gradle +6 -0
  45. package/platforms/android/manifest.json +73 -0
  46. package/platforms/ios/FontManager.LICENSE +201 -0
  47. package/platforms/ios/MasonCore.xcframework/Info.plist +43 -0
  48. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/Mason.h +25 -0
  49. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
  50. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/mason_native.h +601 -0
  51. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Info.plist +0 -0
  52. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/MasonCore +0 -0
  53. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  54. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.abi.json +100095 -0
  55. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.private.swiftinterface +3174 -0
  56. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  57. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftinterface +3174 -0
  58. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/module.modulemap +9 -0
  59. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
  60. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
  61. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/Mason.h +25 -0
  62. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
  63. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/mason_native.h +601 -0
  64. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Info.plist +0 -0
  65. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/MasonCore +0 -0
  66. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  67. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.abi.json +100095 -0
  68. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3174 -0
  69. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  70. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3174 -0
  71. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/module.modulemap +9 -0
  72. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
  73. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
  74. package/platforms/ios/Package.resolved +24 -0
  75. package/platforms/ios/SDWebImage.LICENSE +20 -0
  76. package/platforms/ios/build.xcconfig +4 -0
  77. package/platforms/ios/device-manifest.json +213 -0
  78. package/platforms/ios/include/FontManager/NSCFontDescriptors.h +36 -0
  79. package/platforms/ios/include/FontManager/NSCFontFace.h +98 -0
  80. package/platforms/ios/include/FontManager/NSCFontFaceSet.h +73 -0
  81. package/platforms/ios/include/FontManager/NSCFontManagerUmbrella.h +7 -0
  82. package/platforms/ios/include/FontManager/NSCFontParser.h +22 -0
  83. package/platforms/ios/include/FontManager/NSCFontRegex.h +4 -0
  84. package/platforms/ios/include/FontManager/NSCFontResolver.h +43 -0
  85. package/platforms/ios/include/FontManager/NSCFontStyle.h +27 -0
  86. package/platforms/ios/include/FontManager/NSCFontTypes.h +41 -0
  87. package/platforms/ios/include/SDWebImage/NSButton+WebCache.h +340 -0
  88. package/platforms/ios/include/SDWebImage/NSData+ImageContentType.h +63 -0
  89. package/platforms/ios/include/SDWebImage/NSImage+Compatibility.h +67 -0
  90. package/platforms/ios/include/SDWebImage/SDAnimatedImage.h +136 -0
  91. package/platforms/ios/include/SDWebImage/SDAnimatedImagePlayer.h +113 -0
  92. package/platforms/ios/include/SDWebImage/SDAnimatedImageRep.h +33 -0
  93. package/platforms/ios/include/SDWebImage/SDAnimatedImageView+WebCache.h +168 -0
  94. package/platforms/ios/include/SDWebImage/SDAnimatedImageView.h +125 -0
  95. package/platforms/ios/include/SDWebImage/SDCallbackQueue.h +59 -0
  96. package/platforms/ios/include/SDWebImage/SDDiskCache.h +146 -0
  97. package/platforms/ios/include/SDWebImage/SDGraphicsImageRenderer.h +84 -0
  98. package/platforms/ios/include/SDWebImage/SDImageAPNGCoder.h +19 -0
  99. package/platforms/ios/include/SDWebImage/SDImageAWebPCoder.h +23 -0
  100. package/platforms/ios/include/SDWebImage/SDImageCache.h +482 -0
  101. package/platforms/ios/include/SDWebImage/SDImageCacheConfig.h +153 -0
  102. package/platforms/ios/include/SDWebImage/SDImageCacheDefine.h +179 -0
  103. package/platforms/ios/include/SDWebImage/SDImageCachesManager.h +81 -0
  104. package/platforms/ios/include/SDWebImage/SDImageCoder.h +347 -0
  105. package/platforms/ios/include/SDWebImage/SDImageCoderHelper.h +251 -0
  106. package/platforms/ios/include/SDWebImage/SDImageCodersManager.h +58 -0
  107. package/platforms/ios/include/SDWebImage/SDImageFrame.h +44 -0
  108. package/platforms/ios/include/SDWebImage/SDImageGIFCoder.h +22 -0
  109. package/platforms/ios/include/SDWebImage/SDImageGraphics.h +28 -0
  110. package/platforms/ios/include/SDWebImage/SDImageHEICCoder.h +25 -0
  111. package/platforms/ios/include/SDWebImage/SDImageIOAnimatedCoder.h +65 -0
  112. package/platforms/ios/include/SDWebImage/SDImageIOCoder.h +30 -0
  113. package/platforms/ios/include/SDWebImage/SDImageLoader.h +146 -0
  114. package/platforms/ios/include/SDWebImage/SDImageLoadersManager.h +40 -0
  115. package/platforms/ios/include/SDWebImage/SDImageTransformer.h +283 -0
  116. package/platforms/ios/include/SDWebImage/SDMemoryCache.h +78 -0
  117. package/platforms/ios/include/SDWebImage/SDWebImage.h +91 -0
  118. package/platforms/ios/include/SDWebImage/SDWebImageCacheKeyFilter.h +35 -0
  119. package/platforms/ios/include/SDWebImage/SDWebImageCacheSerializer.h +39 -0
  120. package/platforms/ios/include/SDWebImage/SDWebImageCompat.h +102 -0
  121. package/platforms/ios/include/SDWebImage/SDWebImageDefine.h +420 -0
  122. package/platforms/ios/include/SDWebImage/SDWebImageDownloader.h +320 -0
  123. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderConfig.h +113 -0
  124. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderDecryptor.h +52 -0
  125. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderOperation.h +191 -0
  126. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderRequestModifier.h +72 -0
  127. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderResponseModifier.h +72 -0
  128. package/platforms/ios/include/SDWebImage/SDWebImageError.h +33 -0
  129. package/platforms/ios/include/SDWebImage/SDWebImageIndicator.h +119 -0
  130. package/platforms/ios/include/SDWebImage/SDWebImageManager.h +290 -0
  131. package/platforms/ios/include/SDWebImage/SDWebImageOperation.h +27 -0
  132. package/platforms/ios/include/SDWebImage/SDWebImageOptionsProcessor.h +78 -0
  133. package/platforms/ios/include/SDWebImage/SDWebImagePrefetcher.h +168 -0
  134. package/platforms/ios/include/SDWebImage/SDWebImageTransition.h +131 -0
  135. package/platforms/ios/include/SDWebImage/UIButton+WebCache.h +402 -0
  136. package/platforms/ios/include/SDWebImage/UIImage+ExtendedCacheData.h +24 -0
  137. package/platforms/ios/include/SDWebImage/UIImage+ForceDecode.h +52 -0
  138. package/platforms/ios/include/SDWebImage/UIImage+GIF.h +26 -0
  139. package/platforms/ios/include/SDWebImage/UIImage+MemoryCacheCost.h +27 -0
  140. package/platforms/ios/include/SDWebImage/UIImage+Metadata.h +104 -0
  141. package/platforms/ios/include/SDWebImage/UIImage+MultiFormat.h +81 -0
  142. package/platforms/ios/include/SDWebImage/UIImage+Transform.h +164 -0
  143. package/platforms/ios/include/SDWebImage/UIImageView+HighlightedWebCache.h +142 -0
  144. package/platforms/ios/include/SDWebImage/UIImageView+WebCache.h +209 -0
  145. package/platforms/ios/include/SDWebImage/UIView+WebCache.h +131 -0
  146. package/platforms/ios/include/SDWebImage/UIView+WebCacheOperation.h +52 -0
  147. package/platforms/ios/include/SDWebImage/UIView+WebCacheState.h +63 -0
  148. package/platforms/ios/include/module.modulemap +2 -0
  149. package/platforms/ios/manifest.json +132 -0
  150. package/platforms/ios/simulator-manifest.json +213 -0
  151. package/plugin-README.md +197 -0
  152. package/properties.d.ts +154 -0
  153. package/properties.js +2454 -0
  154. package/pseudo.d.ts +9 -0
  155. package/pseudo.js +57 -0
  156. package/scroll/index.android.d.ts +15 -0
  157. package/scroll/index.android.js +72 -0
  158. package/scroll/index.d.ts +5 -0
  159. package/scroll/index.ios.d.ts +18 -0
  160. package/scroll/index.ios.js +106 -0
  161. package/style.d.ts +768 -0
  162. package/style.js +7151 -0
  163. package/symbols.d.ts +25 -0
  164. package/symbols.js +41 -0
  165. package/tree/index.android.d.ts +11 -0
  166. package/tree/index.android.js +42 -0
  167. package/tree/index.d.ts +15 -0
  168. package/tree/index.ios.d.ts +26 -0
  169. package/tree/index.ios.js +53 -0
  170. package/typings/android-declarations.d.ts +4 -0
  171. package/typings/android.d.ts +9730 -0
  172. package/typings/manifest.json +45 -0
  173. package/typings/native.d.ts +5 -0
  174. package/typings/objc!FontManager.d.ts +389 -0
  175. package/typings/objc!MasonCore.d.ts +2472 -0
  176. package/typings/objc!SDWebImage.d.ts +3378 -0
  177. package/units.d.ts +29 -0
  178. package/units.js +44 -0
  179. package/utils/index.android.d.ts +211 -0
  180. package/utils/index.android.js +595 -0
  181. package/utils/index.ios.d.ts +222 -0
  182. package/utils/index.ios.js +790 -0
  183. package/view/index.android.d.ts +13 -0
  184. package/view/index.android.js +74 -0
  185. package/view/index.d.ts +2 -0
  186. package/view/index.ios.d.ts +24 -0
  187. package/view/index.ios.js +157 -0
@@ -0,0 +1,81 @@
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
+
12
+ /**
13
+ UIImage category for convenient image format decoding/encoding.
14
+ */
15
+ @interface UIImage (MultiFormat)
16
+ #pragma mark - Decode
17
+ /**
18
+ Create and decode a image with the specify image data
19
+
20
+ @param data The image data
21
+ @return The created image
22
+ */
23
+ + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data;
24
+
25
+ /**
26
+ Create and decode a image with the specify image data and scale
27
+
28
+ @param data The image data
29
+ @param scale The image scale factor. Should be greater than or equal to 1.0.
30
+ @return The created image
31
+ */
32
+ + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale;
33
+
34
+ /**
35
+ Create and decode a image with the specify image data and scale, allow specify animate/static control
36
+
37
+ @param data The image data
38
+ @param scale The image scale factor. Should be greater than or equal to 1.0.
39
+ @param firstFrameOnly Even if the image data is animated image format, decode the first frame only as static image.
40
+ @return The created image
41
+ */
42
+ + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly;
43
+
44
+ #pragma mark - Encode
45
+ /**
46
+ Encode the current image to the data, the image format is unspecified
47
+
48
+ @note If the receiver is `SDAnimatedImage`, this will return the animated image data if available. No more extra encoding process.
49
+ @note For macOS, if the receiver contains only `SDAnimatedImageRep`, this will return the animated image data if available. No more extra encoding process.
50
+ @return The encoded data. If can't encode, return nil
51
+ */
52
+ - (nullable NSData *)sd_imageData;
53
+
54
+ /**
55
+ Encode the current image to data with the specify image format
56
+
57
+ @param imageFormat The specify image format
58
+ @return The encoded data. If can't encode, return nil
59
+ */
60
+ - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat NS_SWIFT_NAME(sd_imageData(as:));
61
+
62
+ /**
63
+ Encode the current image to data with the specify image format and compression quality
64
+
65
+ @param imageFormat The specify image format
66
+ @param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality.
67
+ @return The encoded data. If can't encode, return nil
68
+ */
69
+ - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality NS_SWIFT_NAME(sd_imageData(as:compressionQuality:));
70
+
71
+ /**
72
+ Encode the current image to data with the specify image format and compression quality, allow specify animate/static control
73
+
74
+ @param imageFormat The specify image format
75
+ @param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality.
76
+ @param firstFrameOnly Even if the image is animated image, encode the first frame only as static image.
77
+ @return The encoded data. If can't encode, return nil
78
+ */
79
+ - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly NS_SWIFT_NAME(sd_imageData(as:compressionQuality:firstFrameOnly:));
80
+
81
+ @end
@@ -0,0 +1,164 @@
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
+ /// The scale mode to apply when image drawing on a container with different sizes.
12
+ typedef NS_ENUM(NSUInteger, SDImageScaleMode) {
13
+ /// The option to scale the content to fit the size of itself by changing the aspect ratio of the content if necessary.
14
+ SDImageScaleModeFill = 0,
15
+ /// The option to scale the content to fit the size of the view by maintaining the aspect ratio. Any remaining area of the view’s bounds is transparent.
16
+ SDImageScaleModeAspectFit = 1,
17
+ /// The option to scale the content to fill the size of the view. Some portion of the content may be clipped to fill the view’s bounds.
18
+ SDImageScaleModeAspectFill = 2
19
+ };
20
+
21
+ #if SD_UIKIT || SD_WATCH
22
+ typedef UIRectCorner SDRectCorner;
23
+ #else
24
+ typedef NS_OPTIONS(NSUInteger, SDRectCorner) {
25
+ SDRectCornerTopLeft = 1 << 0,
26
+ SDRectCornerTopRight = 1 << 1,
27
+ SDRectCornerBottomLeft = 1 << 2,
28
+ SDRectCornerBottomRight = 1 << 3,
29
+ SDRectCornerAllCorners = ~0UL
30
+ };
31
+ #endif
32
+
33
+ /**
34
+ Provide some common method for `UIImage`.
35
+ Image process is based on Core Graphics and vImage.
36
+ */
37
+ @interface UIImage (Transform)
38
+
39
+ #pragma mark - Image Geometry
40
+
41
+ /**
42
+ Returns a new image which is resized from this image.
43
+ You can specify a larger or smaller size than the image size. The image content will be changed with the scale mode.
44
+
45
+ @param size The new size to be resized, values should be positive.
46
+ @param scaleMode The scale mode for image content.
47
+ @return The new image with the given size.
48
+ */
49
+ - (nullable UIImage *)sd_resizedImageWithSize:(CGSize)size scaleMode:(SDImageScaleMode)scaleMode;
50
+
51
+ /**
52
+ Returns a new image which is cropped from this image.
53
+
54
+ @param rect Image's inner rect.
55
+ @return The new image with the cropping rect.
56
+ */
57
+ - (nullable UIImage *)sd_croppedImageWithRect:(CGRect)rect;
58
+
59
+ /**
60
+ Rounds a new image with a given corner radius and corners.
61
+
62
+ @param cornerRadius The radius of each corner oval. Values larger than half the
63
+ rectangle's width or height are clamped appropriately to
64
+ half the width or height.
65
+ @param corners A bitmask value that identifies the corners that you want
66
+ rounded. You can use this parameter to round only a subset
67
+ of the corners of the rectangle.
68
+ @param borderWidth The inset border line width. Values larger than half the rectangle's
69
+ width or height are clamped appropriately to half the width
70
+ or height.
71
+ @param borderColor The border stroke color. nil means clear color.
72
+ @return The new image with the round corner.
73
+ */
74
+ - (nullable UIImage *)sd_roundedCornerImageWithRadius:(CGFloat)cornerRadius
75
+ corners:(SDRectCorner)corners
76
+ borderWidth:(CGFloat)borderWidth
77
+ borderColor:(nullable UIColor *)borderColor;
78
+
79
+ /**
80
+ Returns a new rotated image (relative to the center).
81
+
82
+ @param angle Rotated radians in counterclockwise.⟲
83
+ @param fitSize YES: new image's size is extend to fit all content.
84
+ NO: image's size will not change, content may be clipped.
85
+ @return The new image with the rotation.
86
+ */
87
+ - (nullable UIImage *)sd_rotatedImageWithAngle:(CGFloat)angle fitSize:(BOOL)fitSize;
88
+
89
+ /**
90
+ Returns a new horizontally(vertically) flipped image.
91
+
92
+ @param horizontal YES to flip the image horizontally. ⇋
93
+ @param vertical YES to flip the image vertically. ⥯
94
+ @return The new image with the flipping.
95
+ */
96
+ - (nullable UIImage *)sd_flippedImageWithHorizontal:(BOOL)horizontal vertical:(BOOL)vertical;
97
+
98
+ #pragma mark - Image Blending
99
+
100
+ /**
101
+ Return a tinted image with the given color. This actually use `sourceIn` blend mode.
102
+ @note Before 5.20, this API actually use `sourceAtop` and cause naming confusing. After 5.20, we match UIKit's behavior using `sourceIn`.
103
+
104
+ @param tintColor The tint color.
105
+ @return The new image with the tint color.
106
+ */
107
+ - (nullable UIImage *)sd_tintedImageWithColor:(nonnull UIColor *)tintColor;
108
+
109
+ /**
110
+ Return a tinted image with the given color and blend mode.
111
+ @note The blend mode treat `self` as background image (destination), treat `tintColor` as input image (source). So mostly you need `source` variant blend mode (use `sourceIn` not `destinationIn`), which is different from UIKit's `+[UIImage imageWithTintColor:]`.
112
+
113
+ @param tintColor The tint color.
114
+ @param blendMode The blend mode.
115
+ @return The new image with the tint color.
116
+ */
117
+ - (nullable UIImage *)sd_tintedImageWithColor:(nonnull UIColor *)tintColor blendMode:(CGBlendMode)blendMode;
118
+
119
+ /**
120
+ Return the pixel color at specify position. The point is from the top-left to the bottom-right and 0-based. The returned the color is always be RGBA format. The image must be CG-based.
121
+ @note The point's x/y will be converted into integer.
122
+ @note The point's x/y should not be smaller than 0, or greater than or equal to width/height.
123
+ @note The overhead of object creation means this method is best suited for infrequent color sampling. For heavy image processing, grab the raw bitmap data and process yourself.
124
+
125
+ @param point The position of pixel
126
+ @warning This API currently support 8 bits per component only (RGBA8888 etc), not RGBA16U/RGBA10
127
+ @return The color for specify pixel, or nil if any error occur
128
+ */
129
+ - (nullable UIColor *)sd_colorAtPoint:(CGPoint)point;
130
+
131
+ /**
132
+ Return the pixel color array with specify rectangle. The rect is from the top-left to the bottom-right and 0-based. The returned the color is always be RGBA format. The image must be CG-based.
133
+ @note The rect's origin and size will be converted into integer.
134
+ @note The rect's width/height should not be smaller than or equal to 0. The minX/minY should not be smaller than 0. The maxX/maxY should not be greater than width/height. Attention this limit is different from `sd_colorAtPoint:` (point: (0, 0) like rect: (0, 0, 1, 1))
135
+ @note The overhead of object creation means this method is best suited for infrequent color sampling. For heavy image processing, grab the raw bitmap data and process yourself.
136
+
137
+ @param rect The rectangle of pixels
138
+ @return The color array for specify pixels, or nil if any error occur
139
+ */
140
+ - (nullable NSArray<UIColor *> *)sd_colorsWithRect:(CGRect)rect;
141
+
142
+ #pragma mark - Image Effect
143
+
144
+ /**
145
+ Return a new image applied a blur effect.
146
+
147
+ @param blurRadius The radius of the blur in points, 0 means no blur effect.
148
+
149
+ @return The new image with blur effect, or nil if an error occurs (e.g. no enough memory).
150
+ */
151
+ - (nullable UIImage *)sd_blurredImageWithRadius:(CGFloat)blurRadius;
152
+
153
+ #if SD_UIKIT || SD_MAC
154
+ /**
155
+ Return a new image applied a CIFilter.
156
+
157
+ @param filter The CIFilter to be applied to the image.
158
+ @return The new image with the CIFilter, or nil if an error occurs (e.g. no
159
+ enough memory).
160
+ */
161
+ - (nullable UIImage *)sd_filteredImageWithFilter:(nonnull CIFilter *)filter;
162
+ #endif
163
+
164
+ @end
@@ -0,0 +1,142 @@
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 UIImageView for highlighted state.
17
+ */
18
+ @interface UIImageView (HighlightedWebCache)
19
+
20
+ #pragma mark - Highlighted Image
21
+
22
+ /**
23
+ * Get the current highlighted image URL.
24
+ */
25
+ @property (nonatomic, strong, readonly, nullable) NSURL *sd_currentHighlightedImageURL;
26
+
27
+ /**
28
+ * Set the imageView `highlightedImage` with an `url`.
29
+ *
30
+ * The download is asynchronous and cached.
31
+ *
32
+ * @param url The url for the image.
33
+ */
34
+ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT;
35
+
36
+ /**
37
+ * Set the imageView `highlightedImage` with an `url` and custom options.
38
+ *
39
+ * The download is asynchronous and cached.
40
+ *
41
+ * @param url The url for the image.
42
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
43
+ */
44
+ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
45
+ options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
46
+
47
+ /**
48
+ * Set the imageView `highlightedImage` with an `url`, custom options and context.
49
+ *
50
+ * The download is asynchronous and cached.
51
+ *
52
+ * @param url The url for the image.
53
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
54
+ * @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.
55
+ */
56
+ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
57
+ options:(SDWebImageOptions)options
58
+ context:(nullable SDWebImageContext *)context;
59
+
60
+ /**
61
+ * Set the imageView `highlightedImage` with an `url`.
62
+ *
63
+ * The download is asynchronous and cached.
64
+ *
65
+ * @param url The url for the image.
66
+ * @param completedBlock A block called when operation has been completed. This block has no return value
67
+ * and takes the requested UIImage as first parameter. In case of error the image parameter
68
+ * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
69
+ * indicating if the image was retrieved from the local cache or from the network.
70
+ * The fourth parameter is the original image url.
71
+ */
72
+ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
73
+ completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
74
+
75
+ /**
76
+ * Set the imageView `highlightedImage` with an `url` and custom options.
77
+ *
78
+ * The download is asynchronous and cached.
79
+ *
80
+ * @param url The url for the image.
81
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
82
+ * @param completedBlock A block called when operation has been completed. This block has no return value
83
+ * and takes the requested UIImage as first parameter. In case of error the image parameter
84
+ * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
85
+ * indicating if the image was retrieved from the local cache or from the network.
86
+ * The fourth parameter is the original image url.
87
+ */
88
+ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
89
+ options:(SDWebImageOptions)options
90
+ completed:(nullable SDExternalCompletionBlock)completedBlock;
91
+
92
+ /**
93
+ * Set the imageView `highlightedImage` with an `url` and custom options.
94
+ *
95
+ * The download is asynchronous and cached.
96
+ *
97
+ * @param url The url for the image.
98
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
99
+ * @param progressBlock A block called while image is downloading
100
+ * @note the progress block is executed on a background queue
101
+ * @param completedBlock A block called when operation has been completed. This block has no return value
102
+ * and takes the requested UIImage as first parameter. In case of error the image parameter
103
+ * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
104
+ * indicating if the image was retrieved from the local cache or from the network.
105
+ * The fourth parameter is the original image url.
106
+ */
107
+ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
108
+ options:(SDWebImageOptions)options
109
+ progress:(nullable SDImageLoaderProgressBlock)progressBlock
110
+ completed:(nullable SDExternalCompletionBlock)completedBlock;
111
+
112
+ /**
113
+ * Set the imageView `highlightedImage` with an `url`, custom options and context.
114
+ *
115
+ * The download is asynchronous and cached.
116
+ *
117
+ * @param url The url for the image.
118
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
119
+ * @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.
120
+ * @param progressBlock A block called while image is downloading
121
+ * @note the progress block is executed on a background queue
122
+ * @param completedBlock A block called when operation has been completed. This block has no return value
123
+ * and takes the requested UIImage as first parameter. In case of error the image parameter
124
+ * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
125
+ * indicating if the image was retrieved from the local cache or from the network.
126
+ * The fourth parameter is the original image url.
127
+ */
128
+ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
129
+ options:(SDWebImageOptions)options
130
+ context:(nullable SDWebImageContext *)context
131
+ progress:(nullable SDImageLoaderProgressBlock)progressBlock
132
+ completed:(nullable SDExternalCompletionBlock)completedBlock;
133
+
134
+ /**
135
+ * Cancel the current highlighted image load (for `UIImageView.highlighted`)
136
+ * @note For normal image, use `sd_cancelCurrentImageLoad`
137
+ */
138
+ - (void)sd_cancelCurrentHighlightedImageLoad;
139
+
140
+ @end
141
+
142
+ #endif
@@ -0,0 +1,209 @@
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 "SDWebImageManager.h"
11
+
12
+ /**
13
+ * Usage with a UITableViewCell sub-class:
14
+ *
15
+ * @code
16
+
17
+ #import <SDWebImage/UIImageView+WebCache.h>
18
+
19
+ ...
20
+
21
+ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
22
+ {
23
+ static NSString *MyIdentifier = @"MyIdentifier";
24
+
25
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
26
+
27
+ if (cell == nil) {
28
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier];
29
+ }
30
+
31
+ // Here we use the provided sd_setImageWithURL:placeholderImage: method to load the web image
32
+ // Ensure you use a placeholder image otherwise cells will be initialized with no image
33
+ [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"]
34
+ placeholderImage:[UIImage imageNamed:@"placeholder"]];
35
+
36
+ cell.textLabel.text = @"My Text";
37
+ return cell;
38
+ }
39
+
40
+ * @endcode
41
+ */
42
+
43
+ /**
44
+ * Integrates SDWebImage async downloading and caching of remote images with UIImageView.
45
+ */
46
+ @interface UIImageView (WebCache)
47
+
48
+ #pragma mark - Image State
49
+
50
+ /**
51
+ * Get the current image URL.
52
+ */
53
+ @property (nonatomic, strong, readonly, nullable) NSURL *sd_currentImageURL;
54
+
55
+ #pragma mark - Image Loading
56
+
57
+ /**
58
+ * Set the imageView `image` with an `url`.
59
+ *
60
+ * The download is asynchronous and cached.
61
+ *
62
+ * @param url The url for the image.
63
+ */
64
+ - (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT;
65
+
66
+ /**
67
+ * Set the imageView `image` with an `url` and a placeholder.
68
+ *
69
+ * The download is asynchronous and cached.
70
+ *
71
+ * @param url The url for the image.
72
+ * @param placeholder The image to be set initially, until the image request finishes.
73
+ * @see sd_setImageWithURL:placeholderImage:options:
74
+ */
75
+ - (void)sd_setImageWithURL:(nullable NSURL *)url
76
+ placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT;
77
+
78
+ /**
79
+ * Set the imageView `image` with an `url`, placeholder and custom options.
80
+ *
81
+ * The download is asynchronous and cached.
82
+ *
83
+ * @param url The url for the image.
84
+ * @param placeholder The image to be set initially, until the image request finishes.
85
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
86
+ */
87
+ - (void)sd_setImageWithURL:(nullable NSURL *)url
88
+ placeholderImage:(nullable UIImage *)placeholder
89
+ options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
90
+
91
+ /**
92
+ * Set the imageView `image` with an `url`, placeholder, custom options and context.
93
+ *
94
+ * The download is asynchronous and cached.
95
+ *
96
+ * @param url The url for the image.
97
+ * @param placeholder The image to be set initially, until the image request finishes.
98
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
99
+ * @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.
100
+ */
101
+ - (void)sd_setImageWithURL:(nullable NSURL *)url
102
+ placeholderImage:(nullable UIImage *)placeholder
103
+ options:(SDWebImageOptions)options
104
+ context:(nullable SDWebImageContext *)context;
105
+
106
+ /**
107
+ * Set the imageView `image` with an `url`.
108
+ *
109
+ * The download is asynchronous and cached.
110
+ *
111
+ * @param url The url for the image.
112
+ * @param completedBlock A block called when operation has been completed. This block has no return value
113
+ * and takes the requested UIImage as first parameter. In case of error the image parameter
114
+ * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
115
+ * indicating if the image was retrieved from the local cache or from the network.
116
+ * The fourth parameter is the original image url.
117
+ */
118
+ - (void)sd_setImageWithURL:(nullable NSURL *)url
119
+ completed:(nullable SDExternalCompletionBlock)completedBlock;
120
+
121
+ /**
122
+ * Set the imageView `image` with an `url`, placeholder.
123
+ *
124
+ * The download is asynchronous and cached.
125
+ *
126
+ * @param url The url for the image.
127
+ * @param placeholder The image to be set initially, until the image request finishes.
128
+ * @param completedBlock A block called when operation has been completed. This block has no return value
129
+ * and takes the requested UIImage as first parameter. In case of error the image parameter
130
+ * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
131
+ * indicating if the image was retrieved from the local cache or from the network.
132
+ * The fourth parameter is the original image url.
133
+ */
134
+ - (void)sd_setImageWithURL:(nullable NSURL *)url
135
+ placeholderImage:(nullable UIImage *)placeholder
136
+ completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
137
+
138
+ /**
139
+ * Set the imageView `image` with an `url`, placeholder and custom options.
140
+ *
141
+ * The download is asynchronous and cached.
142
+ *
143
+ * @param url The url for the image.
144
+ * @param placeholder The image to be set initially, until the image request finishes.
145
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
146
+ * @param completedBlock A block called when operation has been completed. This block has no return value
147
+ * and takes the requested UIImage as first parameter. In case of error the image parameter
148
+ * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
149
+ * indicating if the image was retrieved from the local cache or from the network.
150
+ * The fourth parameter is the original image url.
151
+ */
152
+ - (void)sd_setImageWithURL:(nullable NSURL *)url
153
+ placeholderImage:(nullable UIImage *)placeholder
154
+ options:(SDWebImageOptions)options
155
+ completed:(nullable SDExternalCompletionBlock)completedBlock;
156
+
157
+ /**
158
+ * Set the imageView `image` with an `url`, placeholder and custom options.
159
+ *
160
+ * The download is asynchronous and cached.
161
+ *
162
+ * @param url The url for the image.
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
+ placeholderImage:(nullable UIImage *)placeholder
175
+ options:(SDWebImageOptions)options
176
+ progress:(nullable SDImageLoaderProgressBlock)progressBlock
177
+ completed:(nullable SDExternalCompletionBlock)completedBlock;
178
+
179
+ /**
180
+ * Set the imageView `image` with an `url`, placeholder, custom options and context.
181
+ *
182
+ * The download is asynchronous and cached.
183
+ *
184
+ * @param url The url for the image.
185
+ * @param placeholder The image to be set initially, until the image request finishes.
186
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
187
+ * @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.
188
+ * @param progressBlock A block called while image is downloading
189
+ * @note the progress block is executed on a background queue
190
+ * @param completedBlock A block called when operation has been completed. This block has no return value
191
+ * and takes the requested UIImage as first parameter. In case of error the image parameter
192
+ * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
193
+ * indicating if the image was retrieved from the local cache or from the network.
194
+ * The fourth parameter is the original image url.
195
+ */
196
+ - (void)sd_setImageWithURL:(nullable NSURL *)url
197
+ placeholderImage:(nullable UIImage *)placeholder
198
+ options:(SDWebImageOptions)options
199
+ context:(nullable SDWebImageContext *)context
200
+ progress:(nullable SDImageLoaderProgressBlock)progressBlock
201
+ completed:(nullable SDExternalCompletionBlock)completedBlock;
202
+
203
+ /**
204
+ * Cancel the current normal image load (for `UIImageView.image`)
205
+ * @note For highlighted image, use `sd_cancelCurrentHighlightedImageLoad`
206
+ */
207
+ - (void)sd_cancelCurrentImageLoad;
208
+
209
+ @end