|
virtual void | clear ()=0 |
|
virtual bool | attribute (const std::string &name, TypeDesc type, const void *val)=0 |
|
virtual bool | attribute (const std::string &name, int val)=0 |
|
virtual bool | attribute (const std::string &name, float val)=0 |
|
virtual bool | attribute (const std::string &name, double val)=0 |
|
virtual bool | attribute (const std::string &name, const char *val)=0 |
|
virtual bool | attribute (const std::string &name, const std::string &val)=0 |
|
virtual bool | getattribute (const std::string &name, TypeDesc type, void *val)=0 |
| Get the named attribute, store it in value.
|
|
virtual bool | getattribute (const std::string &name, int &val)=0 |
|
virtual bool | getattribute (const std::string &name, float &val)=0 |
|
virtual bool | getattribute (const std::string &name, double &val)=0 |
|
virtual bool | getattribute (const std::string &name, char **val)=0 |
|
virtual bool | getattribute (const std::string &name, std::string &val)=0 |
|
virtual std::string | resolve_filename (const std::string &filename) const =0 |
|
virtual bool | get_image_info (ustring filename, int subimage, int miplevel, ustring dataname, TypeDesc datatype, void *data)=0 |
|
bool | get_image_info (ustring filename, ustring dataname, TypeDesc datatype, void *data) |
| Back-compatible version of get_image_info – DEPRECATED.
|
|
virtual bool | get_imagespec (ustring filename, ImageSpec &spec, int subimage=0, int miplevel=0, bool native=false)=0 |
|
virtual const ImageSpec * | imagespec (ustring filename, int subimage=0, int miplevel=0, bool native=false)=0 |
|
virtual bool | get_pixels (ustring filename, int subimage, int miplevel, int xbegin, int xend, int ybegin, int yend, int zbegin, int zend, TypeDesc format, void *result)=0 |
|
virtual bool | get_pixels (ustring filename, int subimage, int miplevel, int xbegin, int xend, int ybegin, int yend, int zbegin, int zend, int chbegin, int chend, TypeDesc format, void *result, stride_t xstride=AutoStride, stride_t ystride=AutoStride, stride_t zstride=AutoStride)=0 |
|
virtual Tile * | get_tile (ustring filename, int subimage, int miplevel, int x, int y, int z)=0 |
|
virtual void | release_tile (Tile *tile) const =0 |
|
virtual const void * | tile_pixels (Tile *tile, TypeDesc &format) const =0 |
|
virtual std::string | geterror () const =0 |
|
virtual std::string | getstats (int level=1) const =0 |
|
virtual void | reset_stats ()=0 |
|
virtual void | invalidate (ustring filename)=0 |
|
virtual void | invalidate_all (bool force=false)=0 |
|
Define an API to an abstract class that manages image files, caches of open file handles as well as tiles of pixels so that truly huge amounts of image data may be accessed by an application with low memory footprint.
virtual bool ImageCache::attribute |
( |
const std::string & |
name, |
|
|
TypeDesc |
type, |
|
|
const void * |
val |
|
) |
| |
|
pure virtual |
Set an attribute controlling the image cache. Return true if the name and type were recognized and the attrib was set. Documented attributes: int max_open_files : maximum number of file handles held open float max_memory_MB : maximum tile cache size, in MB string searchpath : colon-separated search path for images string plugin_searchpath : colon-separated search path for plugins int autotile : if >0, tile size to emulate for non-tiled images int autoscanline : autotile using full width tiles int automip : if nonzero, emulate mipmap on the fly int accept_untiled : if nonzero, accept untiled images, but if zero, reject untiled images (default=1) int accept_unmipped : if nonzero, accept unmipped images (def=1) int statistics:level : verbosity of statistics auto-printed. int forcefloat : if nonzero, convert all to float. int failure_retries : number of times to retry a read before fail. int deduplicate : if nonzero, detect duplicate textures (default=1) string substitute_image : uses the named image in place of all texture and image references. int unassociatedalpha : if nonzero, keep unassociated alpha images
virtual bool ImageCache::get_pixels |
( |
ustring |
filename, |
|
|
int |
subimage, |
|
|
int |
miplevel, |
|
|
int |
xbegin, |
|
|
int |
xend, |
|
|
int |
ybegin, |
|
|
int |
yend, |
|
|
int |
zbegin, |
|
|
int |
zend, |
|
|
TypeDesc |
format, |
|
|
void * |
result |
|
) |
| |
|
pure virtual |
Retrieve the rectangle of pixels spanning [xbegin..xend) X [ybegin..yend) X [zbegin..zend), with "exclusive end" a la STL, specified as integer pixel coordinates in the designated subimage & miplevel, storing the pixel values beginning at the address specified by result. The pixel values will be converted to the type specified by format. It is up to the caller to ensure that result points to an area of memory big enough to accommodate the requested rectangle (taking into consideration its dimensions, number of channels, and data format). Requested pixels outside the valid pixel data region will be filled in with 0 values.
Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.
virtual bool ImageCache::get_pixels |
( |
ustring |
filename, |
|
|
int |
subimage, |
|
|
int |
miplevel, |
|
|
int |
xbegin, |
|
|
int |
xend, |
|
|
int |
ybegin, |
|
|
int |
yend, |
|
|
int |
zbegin, |
|
|
int |
zend, |
|
|
int |
chbegin, |
|
|
int |
chend, |
|
|
TypeDesc |
format, |
|
|
void * |
result, |
|
|
stride_t |
xstride = AutoStride , |
|
|
stride_t |
ystride = AutoStride , |
|
|
stride_t |
zstride = AutoStride |
|
) |
| |
|
pure virtual |
Retrieve the rectangle of pixels spanning [xbegin..xend) X [ybegin..yend) X [zbegin..zend), channels [chbegin..chend), with "exclusive end" a la STL, specified as integer pixel coordinates in the designated subimage & miplevel, storing the pixel values beginning at the address specified by result and with the given x, y, and z strides (in bytes). The pixel values will be converted to the type specified by format. If the strides are set to AutoStride, they will be automatically computed assuming a contiguous data layout. It is up to the caller to ensure that result points to an area of memory big enough to accommodate the requested rectangle (taking into consideration its dimensions, number of channels, and data format). Requested pixels outside the valid pixel data region will be filled in with 0 values.
Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.