UIImage+MemoryCacheCost.h 1.0 KB

1234567891011121314151617181920212223
  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 (MemoryCacheCost)
  10. /**
  11. The memory cache cost for specify image used by image cache. The cost function is the pixles count held in memory.
  12. If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost.
  13. For `UIImage`, this method return the single frame pixles count when `image.images` is nil for static image. Retuen full frame pixels count when `image.images` is not nil for animated image.
  14. For `NSImage`, this method return the single frame pixels count because `NSImage` does not store all frames in memory.
  15. @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.
  16. */
  17. @property (assign, nonatomic) NSUInteger sd_memoryCost;
  18. @end