UIImage+Metadata.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "SDWebImageCompat.h"
  9. #import "NSData+ImageContentType.h"
  10. /**
  11. UIImage category for image metadata, including animation, loop count, format, incremental, etc.
  12. */
  13. @interface UIImage (Metadata)
  14. /**
  15. * UIKit:
  16. * For static image format, this value is always 0.
  17. * For animated image format, 0 means infinite looping.
  18. * Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
  19. * AppKit:
  20. * NSImage currently only support animated via GIF imageRep unlike UIImage.
  21. * The getter of this property will get the loop count from GIF imageRep
  22. * The setter of this property will set the loop count from GIF imageRep
  23. */
  24. @property (nonatomic, assign) NSUInteger sd_imageLoopCount;
  25. /**
  26. * UIKit:
  27. * Check the `images` array property.
  28. * AppKit:
  29. * NSImage currently only support animated via GIF imageRep unlike UIImage. It will check the imageRep's frame count.
  30. */
  31. @property (nonatomic, assign, readonly) BOOL sd_isAnimated;
  32. /**
  33. * UIKit:
  34. * Check the `isSymbolImage` property. Also check the system PDF(iOS 11+) && SVG(iOS 13+) support.
  35. * AppKit:
  36. * NSImage supports PDF && SVG && EPS imageRep, check the imageRep class.
  37. */
  38. @property (nonatomic, assign, readonly) BOOL sd_isVector;
  39. /**
  40. * The image format represent the original compressed image data format.
  41. * If you don't manually specify a format, this information is retrieve from CGImage using `CGImageGetUTType`, which may return nil for non-CG based image. At this time it will return `SDImageFormatUndefined` as default value.
  42. * @note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
  43. */
  44. @property (nonatomic, assign) SDImageFormat sd_imageFormat;
  45. /**
  46. A bool value indicating whether the image is during incremental decoding and may not contains full pixels.
  47. */
  48. @property (nonatomic, assign) BOOL sd_isIncremental;
  49. @end