UNICORN - iOS
実体メソッド | プロパティ | 全メンバ一覧
HNKCacheFormat クラス

#import <HNKCache.h>

HNKCacheFormat の継承関係図

実体メソッド

(id) - initWithName:
 
(UIImage *) - resizedImageFromImage:
 

プロパティ

BOOL allowUpscaling
 
CGFloat compressionQuality
 
NSString * name
 
CGSize size
 
HNKScaleMode scaleMode
 
unsigned long long diskCapacity
 
unsigned long long diskSize
 
HNKPreloadPolicy preloadPolicy
 
UIImage *(^ preResizeBlock )(NSString *key, UIImage *image)
 
UIImage *(^ postResizeBlock )(NSString *key, UIImage *image)
 

詳解

Image cache format. Defines the transformation applied to images as well as cache policies such as disk capacity.

メソッド詳解

- (id) initWithName: (NSString*)  name

Initializes a format with the given name.

引数
nameName of the format.
- (UIImage *) resizedImageFromImage: (UIImage*)  image

Resized the given image based on the format. Used by the cache to create its images.

引数
imageImage to resize.
戻り値
A resized image based on the format.

プロパティ詳解

- (BOOL) allowUpscaling
readwritenonatomicassign

Allow upscalling. Images smaller than the format size will be upscaled if set to YES. NO by default. Has no effect if the scale mode is HNKScaleModeNone.

- (CGFloat) compressionQuality
readwritenonatomicassign

The quality of the resulting JPEG image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality). 1.0 by default. Only affects opaque images.

- (unsigned long long) diskCapacity
readwritenonatomicassign

The disk cache capacity for the format. If 0 Haneke will only use memory cache. 0 by default.

- (unsigned long long) diskSize
readnonatomicassign

Current size in bytes of the disk cache used by the format.

- (NSString*) name
readnonatomicassign

Format name. Used by Haneke as the format subdirectory name in the disk cache and to uniquely identify the disk queue of the format. Avoid special characters.

- (UIImage*(^ postResizeBlock) (NSString *key, UIImage *image))
readwritenonatomiccopy

Block to be called after an image is resized. The returned image will be used by the cache. nil by default.

警告
The block will be called only if the requested image is not found in the cache.
The block will be called in background when using the asynchronous methods of the cache.
- (HNKPreloadPolicy) preloadPolicy
readwritenonatomicassign

Preload policy. If set, Haneke will add some or all images cached on disk to the memory cache. HNKPreloadPolicyNone by default.

- (UIImage*(^ preResizeBlock) (NSString *key, UIImage *image))
readwritenonatomiccopy

Block to be called before an image is resized. The returned image will be resized. nil by default.

警告
The block will be called only if the requested image is not found in the cache.
The block will be called in background when using the asynchronous methods of the cache.
- (HNKScaleMode) scaleMode
readwritenonatomicassign

Format scale mode. Determines if images will fit or fill the format size or not. HNKScaleModeFill by default.

- (CGSize) size
readwritenonatomicassign

Format image size. Images will be scaled to fit or fill this size or ignore it based on scaleMode. Has no effect if the scale mode is HNKScaleModeNone.


このクラス詳解は次のファイルから抽出されました: