Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultCacheSize = 10
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoadOptions ¶ added in v0.6.0
type LoadOptions struct { // Size of resized image. Empty this means no resized. // If either X or Y of size is zero, auto filled it by calculating // from the other with keep aspect ratio. // For example, Let source image size (W, H) = (1920, 1080) and resized size // (RW, RH) = (960, 0) then auto-filled resized size (RW', RH') = (960, 540) // since 1920:1080 = 960:540. ResizedSize image.Point }
LoadOptions is options for image loading.
type Loader ¶ added in v0.6.0
type Loader struct {
// contains filtered or unexported fields
}
Loader holds image caches. concurrent use is OK.
func NewLoader ¶ added in v0.6.0
Loader has cachedSize cache entries. the oldest image is removed from cache using LRU. use DefaultCacheSize if cachedSize <= 0.
func (*Loader) Get ¶ added in v0.6.0
get cached image by using image's file name. if not found, load image data from file and return loaded image with loading error. error nil means loaded image found.
func (*Loader) GetWithOptions ¶ added in v0.6.0
It is almost same as Get(), except that it accepts options for loaded image property.
Click to show internal directories.
Click to hide internal directories.