FWImageCoder


@interface FWImageCoder : NSObject

图片解码器,支持动图

  • 单例模式

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) FWImageCoder *_Nonnull sharedInstance;
  • 是否启用HEIC动图,因系统解码性能原因,默认为NO,禁用HEIC动图

    Declaration

    Objective-C

    @property (nonatomic) BOOL heicsEnabled;
  • 解析图片数据到Image,可指定scale

    Declaration

    Objective-C

    - (nullable UIImage *)
        decodedImageWithData:(nullable NSData *)data
                       scale:(CGFloat)scale
                     options:
                         (nullable NSDictionary<FWImageCoderOptions, id> *)options;
  • 编码UIImage到图片数据,可指定格式

    Declaration

    Objective-C

    - (nullable NSData *)
        encodedDataWithImage:(nullable UIImage *)image
                      format:(FWImageFormat)format
                     options:
                         (nullable NSDictionary<FWImageCoderOptions, id> *)options;