UIImage+ForceDecode.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. @interface UIImage (ForceDecode)
  10. /**
  11. A bool value indicating whether the image has already been decoded. This can help to avoid extra force decode.
  12. */
  13. @property (nonatomic, assign) BOOL sd_isDecoded;
  14. /**
  15. Decode the provided image. This is useful if you want to force decode the image before rendering to improve performance.
  16. @param image The image to be decoded
  17. @return The decoded image
  18. */
  19. + (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image;
  20. /**
  21. Decode and scale down the provided image
  22. @param image The image to be decoded
  23. @return The decoded and scaled down image
  24. */
  25. + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
  26. /**
  27. Decode and scale down the provided image with limit bytes
  28. @param image The image to be decoded
  29. @param bytes The limit bytes size. Provide 0 to use the build-in limit.
  30. @return The decoded and scaled down image
  31. */
  32. + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes;
  33. @end