@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,44 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
10
|
+
#import "SDWebImageCompat.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
This class is used for creating animated images via `animatedImageWithFrames` in `SDImageCoderHelper`.
|
|
14
|
+
@note If you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+Metadata.h`.
|
|
15
|
+
*/
|
|
16
|
+
@interface SDImageFrame : NSObject
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
The image of current frame. You should not set an animated image.
|
|
20
|
+
*/
|
|
21
|
+
@property (nonatomic, strong, readonly, nonnull) UIImage *image;
|
|
22
|
+
/**
|
|
23
|
+
The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero.
|
|
24
|
+
*/
|
|
25
|
+
@property (nonatomic, readonly, assign) NSTimeInterval duration;
|
|
26
|
+
|
|
27
|
+
/// Create a frame instance with specify image and duration
|
|
28
|
+
/// @param image current frame's image
|
|
29
|
+
/// @param duration current frame's duration
|
|
30
|
+
- (nonnull instancetype)initWithImage:(nonnull UIImage *)image duration:(NSTimeInterval)duration;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
Create a frame instance with specify image and duration
|
|
34
|
+
|
|
35
|
+
@param image current frame's image
|
|
36
|
+
@param duration current frame's duration
|
|
37
|
+
@return frame instance
|
|
38
|
+
*/
|
|
39
|
+
+ (nonnull instancetype)frameWithImage:(nonnull UIImage *)image duration:(NSTimeInterval)duration;
|
|
40
|
+
|
|
41
|
+
- (nonnull instancetype)init NS_UNAVAILABLE;
|
|
42
|
+
+ (nonnull instancetype)new NS_UNAVAILABLE;
|
|
43
|
+
|
|
44
|
+
@end
|
|
@@ -0,0 +1,22 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
10
|
+
#import "SDImageIOAnimatedCoder.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
Built in coder using ImageIO that supports animated GIF encoding/decoding
|
|
14
|
+
@note `SDImageIOCoder` supports GIF but only as static (will use the 1st frame).
|
|
15
|
+
@note Use `SDImageGIFCoder` for fully animated GIFs. For `UIImageView`, it will produce animated `UIImage`(`NSImage` on macOS) for rendering. For `SDAnimatedImageView`, it will use `SDAnimatedImage` for rendering.
|
|
16
|
+
@note The recommended approach for animated GIFs is using `SDAnimatedImage` with `SDAnimatedImageView`. It's more performant than `UIImageView` for GIF displaying(especially on memory usage)
|
|
17
|
+
*/
|
|
18
|
+
@interface SDImageGIFCoder : SDImageIOAnimatedCoder <SDProgressiveImageCoder, SDAnimatedImageCoder>
|
|
19
|
+
|
|
20
|
+
@property (nonatomic, class, readonly, nonnull) SDImageGIFCoder *sharedCoder;
|
|
21
|
+
|
|
22
|
+
@end
|
|
@@ -0,0 +1,28 @@
|
|
|
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 <CoreGraphics/CoreGraphics.h>
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
These following graphics context method are provided to easily write cross-platform(AppKit/UIKit) code.
|
|
14
|
+
For UIKit, these methods just call the same method in `UIGraphics.h`. See the documentation for usage.
|
|
15
|
+
For AppKit, these methods use `NSGraphicsContext` to create image context and match the behavior like UIKit.
|
|
16
|
+
@note If you don't care bitmap format (ARGB8888) and just draw image, use `SDGraphicsImageRenderer` instead. It's more performant on RAM usage.`
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/// Returns the current graphics context.
|
|
20
|
+
FOUNDATION_EXPORT CGContextRef __nullable SDGraphicsGetCurrentContext(void) CF_RETURNS_NOT_RETAINED;
|
|
21
|
+
/// Creates a bitmap-based graphics context and makes it the current context.
|
|
22
|
+
FOUNDATION_EXPORT void SDGraphicsBeginImageContext(CGSize size);
|
|
23
|
+
/// Creates a bitmap-based graphics context with the specified options.
|
|
24
|
+
FOUNDATION_EXPORT void SDGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale);
|
|
25
|
+
/// Removes the current bitmap-based graphics context from the top of the stack.
|
|
26
|
+
FOUNDATION_EXPORT void SDGraphicsEndImageContext(void);
|
|
27
|
+
/// Returns an image based on the contents of the current bitmap-based graphics context.
|
|
28
|
+
FOUNDATION_EXPORT UIImage * __nullable SDGraphicsGetImageFromCurrentImageContext(void);
|
|
@@ -0,0 +1,25 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
10
|
+
#import "SDImageIOAnimatedCoder.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
This coder is used for HEIC (HEIF with HEVC container codec) image format.
|
|
14
|
+
Image/IO provide the static HEIC (.heic) support in iOS 11/macOS 10.13/tvOS 11/watchOS 4+.
|
|
15
|
+
Image/IO provide the animated HEIC (.heics) support in iOS 13/macOS 10.15/tvOS 13/watchOS 6+.
|
|
16
|
+
See https://nokiatech.github.io/heif/technical.html for the standard.
|
|
17
|
+
@note This coder is not in the default coder list for now, since HEIC animated image is really rare, and Apple's implementation still contains performance issues. You can enable if you need this.
|
|
18
|
+
@note If you need to support lower firmware version for HEIF, you can have a try at https://github.com/SDWebImage/SDWebImageHEIFCoder
|
|
19
|
+
*/
|
|
20
|
+
API_AVAILABLE(ios(13.0), tvos(13.0), macos(10.15), watchos(6.0))
|
|
21
|
+
@interface SDImageHEICCoder : SDImageIOAnimatedCoder <SDProgressiveImageCoder, SDAnimatedImageCoder>
|
|
22
|
+
|
|
23
|
+
@property (nonatomic, class, readonly, nonnull) SDImageHEICCoder *sharedCoder;
|
|
24
|
+
|
|
25
|
+
@end
|
|
@@ -0,0 +1,65 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
10
|
+
#import "SDImageCoder.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
This is the abstract class for all animated coder, which use the Image/IO API. You can not use this directly as real coders. A exception will be raised if you use this class.
|
|
14
|
+
All of the properties need the subclass to implement and works as expected.
|
|
15
|
+
For Image/IO, See Apple's documentation: https://developer.apple.com/documentation/imageio
|
|
16
|
+
*/
|
|
17
|
+
@interface SDImageIOAnimatedCoder : NSObject <SDProgressiveImageCoder, SDAnimatedImageCoder>
|
|
18
|
+
|
|
19
|
+
#pragma mark - Subclass Override
|
|
20
|
+
/**
|
|
21
|
+
The supported animated image format. Such as `SDImageFormatGIF`.
|
|
22
|
+
@note Subclass override.
|
|
23
|
+
*/
|
|
24
|
+
@property (class, readonly) SDImageFormat imageFormat;
|
|
25
|
+
/**
|
|
26
|
+
The supported image format UTI Type. Such as `kSDUTTypeGIF`.
|
|
27
|
+
This can be used for cases when we can not detect `SDImageFormat. Such as progressive decoding's hint format `kCGImageSourceTypeIdentifierHint`.
|
|
28
|
+
@note Subclass override.
|
|
29
|
+
*/
|
|
30
|
+
@property (class, readonly, nonnull) NSString *imageUTType;
|
|
31
|
+
/**
|
|
32
|
+
Some image codec use different UTI Type between animated image and static image.
|
|
33
|
+
For this case, override this method and return the UTI for animated image encoding.
|
|
34
|
+
@note Defaults to use the value of `imageUTType`, so it's @optional actually.
|
|
35
|
+
@note Subclass override.
|
|
36
|
+
*/
|
|
37
|
+
@property (class, readonly, nonnull) NSString *animatedImageUTType;
|
|
38
|
+
/**
|
|
39
|
+
The image container property key used in Image/IO API. Such as `kCGImagePropertyGIFDictionary`.
|
|
40
|
+
@note Subclass override.
|
|
41
|
+
*/
|
|
42
|
+
@property (class, readonly, nonnull) NSString *dictionaryProperty;
|
|
43
|
+
/**
|
|
44
|
+
The image unclamped delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFUnclampedDelayTime`
|
|
45
|
+
@note Subclass override.
|
|
46
|
+
*/
|
|
47
|
+
@property (class, readonly, nonnull) NSString *unclampedDelayTimeProperty;
|
|
48
|
+
/**
|
|
49
|
+
The image delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFDelayTime`.
|
|
50
|
+
@note Subclass override.
|
|
51
|
+
*/
|
|
52
|
+
@property (class, readonly, nonnull) NSString *delayTimeProperty;
|
|
53
|
+
/**
|
|
54
|
+
The image loop count property key used in Image/IO API. Such as `kCGImagePropertyGIFLoopCount`.
|
|
55
|
+
@note Subclass override.
|
|
56
|
+
*/
|
|
57
|
+
@property (class, readonly, nonnull) NSString *loopCountProperty;
|
|
58
|
+
/**
|
|
59
|
+
The default loop count when there are no any loop count information inside image container metadata.
|
|
60
|
+
For example, for GIF format, the standard use 1 (play once). For APNG format, the standard use 0 (infinity loop).
|
|
61
|
+
@note Subclass override.
|
|
62
|
+
*/
|
|
63
|
+
@property (class, readonly) NSUInteger defaultLoopCount;
|
|
64
|
+
|
|
65
|
+
@end
|
|
@@ -0,0 +1,30 @@
|
|
|
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 <Foundation/Foundation.h>
|
|
10
|
+
#import "SDImageCoder.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding.
|
|
14
|
+
|
|
15
|
+
GIF
|
|
16
|
+
Also supports static GIF (meaning will only handle the 1st frame).
|
|
17
|
+
For a full GIF support, we recommend `SDAnimatedImageView` to keep both CPU and memory balanced.
|
|
18
|
+
|
|
19
|
+
HEIC
|
|
20
|
+
This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices, see: https://devstreaming-cdn.apple.com/videos/wwdc/2017/511tj33587vdhds/511/511_working_with_heif_and_hevc.pdf
|
|
21
|
+
Decode(Software): !Simulator && (iOS 11 || tvOS 11 || macOS 10.13)
|
|
22
|
+
Decode(Hardware): !Simulator && ((iOS 11 && A9Chip) || (macOS 10.13 && 6thGenerationIntelCPU))
|
|
23
|
+
Encode(Software): macOS 10.13
|
|
24
|
+
Encode(Hardware): !Simulator && ((iOS 11 && A10FusionChip) || (macOS 10.13 && 6thGenerationIntelCPU))
|
|
25
|
+
*/
|
|
26
|
+
@interface SDImageIOCoder : NSObject <SDProgressiveImageCoder>
|
|
27
|
+
|
|
28
|
+
@property (nonatomic, class, readonly, nonnull) SDImageIOCoder *sharedCoder;
|
|
29
|
+
|
|
30
|
+
@end
|
|
@@ -0,0 +1,146 @@
|
|
|
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 "SDWebImageDefine.h"
|
|
11
|
+
#import "SDWebImageOperation.h"
|
|
12
|
+
#import "SDImageCoder.h"
|
|
13
|
+
|
|
14
|
+
typedef void(^SDImageLoaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL);
|
|
15
|
+
typedef void(^SDImageLoaderCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished);
|
|
16
|
+
|
|
17
|
+
#pragma mark - Context Options
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
A `UIImage` instance from `SDWebImageManager` when you specify `SDWebImageRefreshCached` and image cache hit.
|
|
21
|
+
This can be a hint for image loader to load the image from network and refresh the image from remote location if needed. If the image from remote location does not change, you should call the completion with `SDWebImageErrorCacheNotModified` error. (UIImage)
|
|
22
|
+
@note If you don't implement `SDWebImageRefreshCached` support, you do not need to care about this context option.
|
|
23
|
+
*/
|
|
24
|
+
FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextLoaderCachedImage;
|
|
25
|
+
|
|
26
|
+
#pragma mark - Helper method
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
This is the built-in decoding process for image download from network or local file.
|
|
30
|
+
@note If you want to implement your custom loader with `requestImageWithURL:options:context:progress:completed:` API, but also want to keep compatible with SDWebImage's behavior, you'd better use this to produce image.
|
|
31
|
+
|
|
32
|
+
@param imageData The image data from the network. Should not be nil
|
|
33
|
+
@param imageURL The image URL from the input. Should not be nil
|
|
34
|
+
@param options The options arg from the input
|
|
35
|
+
@param context The context arg from the input
|
|
36
|
+
@return The decoded image for current image data load from the network
|
|
37
|
+
*/
|
|
38
|
+
FOUNDATION_EXPORT UIImage * _Nullable SDImageLoaderDecodeImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, SDWebImageOptions options, SDWebImageContext * _Nullable context);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
This is the built-in decoding process for image progressive download from network. It's used when `SDWebImageProgressiveLoad` option is set. (It's not required when your loader does not support progressive image loading)
|
|
42
|
+
@note If you want to implement your custom loader with `requestImageWithURL:options:context:progress:completed:` API, but also want to keep compatible with SDWebImage's behavior, you'd better use this to produce image.
|
|
43
|
+
|
|
44
|
+
@param imageData The image data from the network so far. Should not be nil
|
|
45
|
+
@param imageURL The image URL from the input. Should not be nil
|
|
46
|
+
@param finished Pass NO to specify the download process has not finished. Pass YES when all image data has finished.
|
|
47
|
+
@param operation The loader operation associated with current progressive download. Why to provide this is because progressive decoding need to store the partial decoded context for each operation to avoid conflict. You should provide the operation from `loadImageWithURL:` method return value.
|
|
48
|
+
@param options The options arg from the input
|
|
49
|
+
@param context The context arg from the input
|
|
50
|
+
@return The decoded progressive image for current image data load from the network
|
|
51
|
+
*/
|
|
52
|
+
FOUNDATION_EXPORT UIImage * _Nullable SDImageLoaderDecodeProgressiveImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, BOOL finished, id<SDWebImageOperation> _Nonnull operation, SDWebImageOptions options, SDWebImageContext * _Nullable context);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
This function get the progressive decoder for current loading operation. If no progressive decoding is happended or decoder is not able to construct, return nil.
|
|
56
|
+
@return The progressive decoder associated with the loading operation.
|
|
57
|
+
*/
|
|
58
|
+
FOUNDATION_EXPORT id<SDProgressiveImageCoder> _Nullable SDImageLoaderGetProgressiveCoder(id<SDWebImageOperation> _Nonnull operation);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
This function set the progressive decoder for current loading operation. If no progressive decoding is happended, pass nil.
|
|
62
|
+
@param progressiveCoder The loading operation to associate the progerssive decoder.
|
|
63
|
+
*/
|
|
64
|
+
FOUNDATION_EXPORT void SDImageLoaderSetProgressiveCoder(id<SDWebImageOperation> _Nonnull operation, id<SDProgressiveImageCoder> _Nullable progressiveCoder);
|
|
65
|
+
|
|
66
|
+
#pragma mark - SDImageLoader
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
This is the protocol to specify custom image load process. You can create your own class to conform this protocol and use as a image loader to load image from network or any available remote resources defined by yourself.
|
|
70
|
+
If you want to implement custom loader for image download from network or local file, you just need to concentrate on image data download only. After the download finish, call `SDImageLoaderDecodeImageData` or `SDImageLoaderDecodeProgressiveImageData` to use the built-in decoding process and produce image (Remember to call in the global queue). And finally callback the completion block.
|
|
71
|
+
If you directly get the image instance using some third-party SDKs, such as image directly from Photos framework. You can process the image data and image instance by yourself without that built-in decoding process. And finally callback the completion block.
|
|
72
|
+
@note It's your responsibility to load the image in the desired global queue(to avoid block main queue). We do not dispatch these method call in a global queue but just from the call queue (For `SDWebImageManager`, it typically call from the main queue).
|
|
73
|
+
*/
|
|
74
|
+
@protocol SDImageLoader <NSObject>
|
|
75
|
+
|
|
76
|
+
@required
|
|
77
|
+
/**
|
|
78
|
+
Whether current image loader supports to load the provide image URL.
|
|
79
|
+
This will be checked every time a new image request come for loader. If this return NO, we will mark this image load as failed. If return YES, we will start to call `requestImageWithURL:options:context:progress:completed:`.
|
|
80
|
+
|
|
81
|
+
@param url The image URL to be loaded.
|
|
82
|
+
@return YES to continue download, NO to stop download.
|
|
83
|
+
*/
|
|
84
|
+
- (BOOL)canRequestImageForURL:(nullable NSURL *)url API_DEPRECATED_WITH_REPLACEMENT("canRequestImageForURL:options:context:", macos(10.10, API_TO_BE_DEPRECATED), ios(8.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED));
|
|
85
|
+
|
|
86
|
+
@optional
|
|
87
|
+
/**
|
|
88
|
+
Whether current image loader supports to load the provide image URL, with associated options and context.
|
|
89
|
+
This will be checked every time a new image request come for loader. If this return NO, we will mark this image load as failed. If return YES, we will start to call `requestImageWithURL:options:context:progress:completed:`.
|
|
90
|
+
|
|
91
|
+
@param url The image URL to be loaded.
|
|
92
|
+
@param options A mask to specify options to use for this request
|
|
93
|
+
@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.
|
|
94
|
+
@return YES to continue download, NO to stop download.
|
|
95
|
+
*/
|
|
96
|
+
- (BOOL)canRequestImageForURL:(nullable NSURL *)url
|
|
97
|
+
options:(SDWebImageOptions)options
|
|
98
|
+
context:(nullable SDWebImageContext *)context;
|
|
99
|
+
|
|
100
|
+
@required
|
|
101
|
+
/**
|
|
102
|
+
Load the image and image data with the given URL and return the image data. You're responsible for producing the image instance.
|
|
103
|
+
|
|
104
|
+
@param url The URL represent the image. Note this may not be a HTTP URL
|
|
105
|
+
@param options A mask to specify options to use for this request
|
|
106
|
+
@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.
|
|
107
|
+
@param progressBlock A block called while image is downloading
|
|
108
|
+
* @note the progress block is executed on a background queue
|
|
109
|
+
@param completedBlock A block called when operation has been completed.
|
|
110
|
+
@return An operation which allow the user to cancel the current request.
|
|
111
|
+
*/
|
|
112
|
+
- (nullable id<SDWebImageOperation>)requestImageWithURL:(nullable NSURL *)url
|
|
113
|
+
options:(SDWebImageOptions)options
|
|
114
|
+
context:(nullable SDWebImageContext *)context
|
|
115
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
116
|
+
completed:(nullable SDImageLoaderCompletedBlock)completedBlock;
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
Whether the error from image loader should be marked indeed un-recoverable or not.
|
|
121
|
+
If this return YES, failed URL which does not using `SDWebImageRetryFailed` will be blocked into black list. Else not.
|
|
122
|
+
|
|
123
|
+
@param url The URL represent the image. Note this may not be a HTTP URL
|
|
124
|
+
@param error The URL's loading error, from previous `requestImageWithURL:options:context:progress:completed:` completedBlock's error.
|
|
125
|
+
@return Whether to block this url or not. Return YES to mark this URL as failed.
|
|
126
|
+
*/
|
|
127
|
+
- (BOOL)shouldBlockFailedURLWithURL:(nonnull NSURL *)url
|
|
128
|
+
error:(nonnull NSError *)error API_DEPRECATED_WITH_REPLACEMENT("shouldBlockFailedURLWithURL:error:options:context:", macos(10.10, API_TO_BE_DEPRECATED), ios(8.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED));
|
|
129
|
+
|
|
130
|
+
@optional
|
|
131
|
+
/**
|
|
132
|
+
Whether the error from image loader should be marked indeed un-recoverable or not, with associated options and context.
|
|
133
|
+
If this return YES, failed URL which does not using `SDWebImageRetryFailed` will be blocked into black list. Else not.
|
|
134
|
+
|
|
135
|
+
@param url The URL represent the image. Note this may not be a HTTP URL
|
|
136
|
+
@param error The URL's loading error, from previous `requestImageWithURL:options:context:progress:completed:` completedBlock's error.
|
|
137
|
+
@param options A mask to specify options to use for this request
|
|
138
|
+
@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.
|
|
139
|
+
@return Whether to block this url or not. Return YES to mark this URL as failed.
|
|
140
|
+
*/
|
|
141
|
+
- (BOOL)shouldBlockFailedURLWithURL:(nonnull NSURL *)url
|
|
142
|
+
error:(nonnull NSError *)error
|
|
143
|
+
options:(SDWebImageOptions)options
|
|
144
|
+
context:(nullable SDWebImageContext *)context;
|
|
145
|
+
|
|
146
|
+
@end
|
|
@@ -0,0 +1,40 @@
|
|
|
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 "SDImageLoader.h"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
A loaders manager to manage multiple loaders
|
|
13
|
+
*/
|
|
14
|
+
@interface SDImageLoadersManager : NSObject <SDImageLoader>
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
Returns the global shared loaders manager instance. By default we will set [`SDWebImageDownloader.sharedDownloader`] into the loaders array.
|
|
18
|
+
*/
|
|
19
|
+
@property (nonatomic, class, readonly, nonnull) SDImageLoadersManager *sharedManager;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
All image loaders in manager. The loaders array is a priority queue, which means the later added loader will have the highest priority
|
|
23
|
+
*/
|
|
24
|
+
@property (nonatomic, copy, nullable) NSArray<id<SDImageLoader>>* loaders;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
Add a new image loader to the end of loaders array. Which has the highest priority.
|
|
28
|
+
|
|
29
|
+
@param loader loader
|
|
30
|
+
*/
|
|
31
|
+
- (void)addLoader:(nonnull id<SDImageLoader>)loader;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Remove an image loader in the loaders array.
|
|
35
|
+
|
|
36
|
+
@param loader loader
|
|
37
|
+
*/
|
|
38
|
+
- (void)removeLoader:(nonnull id<SDImageLoader>)loader;
|
|
39
|
+
|
|
40
|
+
@end
|