|
|
@@ -28,6 +28,16 @@
|
|
|
*/
|
|
|
+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale;
|
|
|
|
|
|
+/**
|
|
|
+ Create and decode a image with the specify image data and scale, allow specify animate/static control
|
|
|
+
|
|
|
+ @param data The image data
|
|
|
+ @param scale The image scale factor. Should be greater than or equal to 1.0.
|
|
|
+ @param firstFrameOnly Even if the image data is animated image format, decode the first frame only as static image.
|
|
|
+ @return The created image
|
|
|
+ */
|
|
|
++ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly;
|
|
|
+
|
|
|
#pragma mark - Encode
|
|
|
/**
|
|
|
Encode the current image to the data, the image format is unspecified
|
|
|
@@ -53,4 +63,14 @@
|
|
|
*/
|
|
|
- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality;
|
|
|
|
|
|
+/**
|
|
|
+ Encode the current image to data with the specify image format and compression quality, allow specify animate/static control
|
|
|
+
|
|
|
+ @param imageFormat The specify image format
|
|
|
+ @param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality.
|
|
|
+ @param firstFrameOnly Even if the image is animated image, encode the first frame only as static image.
|
|
|
+ @return The encoded data. If can't encode, return nil
|
|
|
+ */
|
|
|
+- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly;
|
|
|
+
|
|
|
@end
|