Inherited by bmpImage, gifImage, jpegImage, pngImage, pnmImage, and xpmFileImage.
Public Types | |
typedef SharedImage *(* | Handler )(const char *filename, uchar *header, int headerlen) |
Public Member Functions | |
void | reload (const uchar *datas=0) |
int | remove () |
void | clear_cache () |
void | _draw (const Rectangle &) const |
Static Public Member Functions | |
SharedImage * | get (const char *n) |
void | add_handler (Handler f) |
void | remove_handler (Handler f) |
SharedImage * | get (SharedImage *(*create)(), const char *name, const uchar *datas=0) |
void | reload (const char *name, const uchar *datas=0) |
int | remove (const char *name) |
void | set_root_directory (const char *d) |
void | set_cache_size (unsigned l) |
Static Public Attributes | |
SharedImage * | first_image |
Protected Member Functions | |
void | find_less_used () |
const char * | get_filename () const |
virtual bool | fetch ()=0 |
void | remove_from_tree (SharedImage *&p, SharedImage *image) |
Static Protected Member Functions | |
void | check_mem_usage () |
const char * | get_filename (const char *) |
void | insert (SharedImage *&p, SharedImage *image) |
SharedImage * | find (SharedImage *image, const char *name) |
Protected Attributes | |
SharedImage * | l1 |
SharedImage * | l2 |
const char * | name |
const uchar * | datas |
unsigned int | used |
int | refcount |
Static Protected Attributes | |
const char * | shared_image_root |
int | image_used |
unsigned | mem_usage_limit |
|
fetch to the data/pixels unified buffer the image, return true if success. this method() does NOT draw the image, it only prepares a generic buffer and its info, this method should be used by all non-progresive-reading read() methods so that we avoid redondant code |
|
adds a new handler for hanling a concrete type of image, typically one handler per image type should be registered |
|
Clear the cache for this image and all of its children in the binary tree |
|
Return an SharedImage, using the create function if an image with the given name doesn't already exist. Use datas, or read from the file with filename name if datas==0. |
|
get an image of this name and dimensions , can be already loaded or not |
|
Prepends the shared_image_root to the name. This is what get_filename() would return for a SharedImage with this name. |
|
Return the filename obtained from the concatenation of the image root directory and this image name WARNING : the returned pointer will be available only until next call to get_filename |
|
Reload the image, useful if it has changed on disk, or if the datas / in memory have changed (you can also give a new pointer on datas) |
|
Remove an image from the database and delete it if its refcount has fallen to zero Each remove() decrements the refcount, each get() increments it Return 1 if it has been really deleted. |
|
removes a concrete handler |
|
Set the size of the cache (0 = unlimited is the default) |
|
Set the position where images are looked for on disk |