Vips.Image.tilecache (original) (raw)
Method
VipsImagetilecache
Declaration [src]
int
vips_tilecache (
VipsImage* in,
VipsImage** out,
...
)
Description [src]
This operation behaves rather like vips_copy() between imagesin
and out
, except that it keeps a cache of computed pixels. This cache is made of up to max_tiles
tiles (a value of -1 means any number of tiles), and each tile is of size tile_width
by tile_height
pixels.
Each cache tile is made with a single call tovips_region_prepare().
When the cache fills, a tile is chosen for reuse. If access
isVIPS_ACCESS_RANDOM, then the least-recently-used tile is reused. Ifaccess
is VIPS_ACCESS_SEQUENTIALthe top-most tile is reused.
By default, tile_width
and tile_height
are 128 pixels, and the operation will cache up to 1,000 tiles. access
defaults to VIPS_ACCESS_RANDOM.
Normally, only a single thread at once is allowed to calculate tiles. If you set threaded
to TRUE
, vips_tilecache() will allow many threads to calculate tiles at once, and share the cache between them.
Normally the cache is dropped when computation finishes. Set persistent
toTRUE
to keep the cache between computations.
Optional arguments
tile_width
:gint
, width of tiles in cachetile_height
:gint
, height of tiles in cachemax_tiles
:gint
, maximum number of tiles to cacheaccess
: VipsAccess, hint expected access patternthreaded
:gboolean
, allow many threadspersistent
:gboolean
, don’t drop cache at end of computation
This method is not directly available to language bindings.
Parameters
out
Type: VipsImage
Output image.
The argument will be set by the function. |
---|
The caller of the method takes ownership of the returned data, and is responsible for freeing it. |
...
Type: ``
NULL
-terminated list of optional named arguments.
Return value
Type: int
0 on success, -1 on error.