SDImageIOAnimatedCoder.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #import <Foundation/Foundation.h>
  9. #import <ImageIO/ImageIO.h>
  10. #import "SDImageCoder.h"
  11. /**
  12. 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.
  13. All of the properties need the subclass to implement and works as expected.
  14. For Image/IO, See Apple's documentation: https://developer.apple.com/documentation/imageio
  15. */
  16. @interface SDImageIOAnimatedCoder : NSObject <SDProgressiveImageCoder, SDAnimatedImageCoder>
  17. #pragma mark - Subclass Override
  18. /**
  19. The supported animated image format. Such as `SDImageFormatGIF`.
  20. @note Subclass override.
  21. */
  22. @property (class, readonly) SDImageFormat imageFormat;
  23. /**
  24. The supported image format UTI Type. Such as `kUTTypeGIF`.
  25. This can be used for cases when we can not detect `SDImageFormat. Such as progressive decoding's hint format `kCGImageSourceTypeIdentifierHint`.
  26. @note Subclass override.
  27. */
  28. @property (class, readonly, nonnull) NSString *imageUTType;
  29. /**
  30. The image container property key used in Image/IO API. Such as `kCGImagePropertyGIFDictionary`.
  31. @note Subclass override.
  32. */
  33. @property (class, readonly, nonnull) NSString *dictionaryProperty;
  34. /**
  35. The image unclamped delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFUnclampedDelayTime`
  36. @note Subclass override.
  37. */
  38. @property (class, readonly, nonnull) NSString *unclampedDelayTimeProperty;
  39. /**
  40. The image delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFDelayTime`.
  41. @note Subclass override.
  42. */
  43. @property (class, readonly, nonnull) NSString *delayTimeProperty;
  44. /**
  45. The image loop count property key used in Image/IO API. Such as `kCGImagePropertyGIFLoopCount`.
  46. @note Subclass override.
  47. */
  48. @property (class, readonly, nonnull) NSString *loopCountProperty;
  49. /**
  50. The default loop count when there are no any loop count information inside image container metadata.
  51. For example, for GIF format, the standard use 1 (play once). For APNG format, the standard use 0 (infinity loop).
  52. @note Subclass override.
  53. */
  54. @property (class, readonly) NSUInteger defaultLoopCount;
  55. @end