SDImageFrame.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 "SDWebImageCompat.h"
  10. /**
  11. This class is used for creating animated images via `animatedImageWithFrames` in `SDImageCoderHelper`.
  12. @note If you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+Metadata.h`.
  13. */
  14. @interface SDImageFrame : NSObject
  15. /**
  16. The image of current frame. You should not set an animated image.
  17. */
  18. @property (nonatomic, strong, readonly, nonnull) UIImage *image;
  19. /**
  20. The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero.
  21. */
  22. @property (nonatomic, readonly, assign) NSTimeInterval duration;
  23. /// Create a frame instance with specify image and duration
  24. /// @param image current frame's image
  25. /// @param duration current frame's duration
  26. - (nonnull instancetype)initWithImage:(nonnull UIImage *)image duration:(NSTimeInterval)duration;
  27. /**
  28. Create a frame instance with specify image and duration
  29. @param image current frame's image
  30. @param duration current frame's duration
  31. @return frame instance
  32. */
  33. + (nonnull instancetype)frameWithImage:(nonnull UIImage *)image duration:(NSTimeInterval)duration;
  34. - (nonnull instancetype)init NS_UNAVAILABLE;
  35. + (nonnull instancetype)new NS_UNAVAILABLE;
  36. @end