HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_ImageCache Class Reference

#include <TIL_ImageCache.h>

+ Inheritance diagram for TIL_ImageCache:

Public Member Functions

 TIL_ImageCache ()
 
 ~TIL_ImageCache () override
 
void setCacheLimit (bool enable)
 
void setCacheSize (unsigned size_in_kb)
 
int64 getCurrentSize () const
 
int64 getMaxSize () const
 
void addToCache (TIL_Image *image)
 
void returnToCache (TIL_Image *&image)
 
void returnToCache (const TIL_Raster *r)
 
void removeSourceFromCache (TIL_ImageSource *source)
 
void removeFrameFromCache (TIL_ImageSource *source, int fr)
 
TIL_ImagegetImageFromCache (TIL_ImageState *match, bool usedscaled=false, UT_FilterType f=UT_FILTER_BOX, bool bump=true)
 
void clearImageCache (bool force_all=false)
 
int getImage (TIL_Image *&image, TIL_ImageSource *source, const char *plane, exint planeindex, float t, void *look, bool updateflag, const TIL_GetImageOptions &opts=TIL_GetImageOptions())
 
void dumpCache (std::ostream &os)
 
int64 utReduceCacheSizeBy (int64 amount) override
 
- Public Member Functions inherited from UT_Cache
 UT_Cache ()
 
virtual ~UT_Cache ()
 
 UT_Cache (const UT_Cache &)=delete
 
UT_Cacheoperator= (const UT_Cache &)=delete
 
void utClearCache ()
 
virtual bool utHasMinSize () const
 
virtual int64 utGetMinSize () const
 
virtual void utSetMinSize (int64)
 
virtual bool utUpdateCacheInfo ()
 

Static Public Member Functions

static int64 getSystemMaxSize ()
 
static void setUpdateCallback (void(*callback)(void *, TIL_Raster *, int, int, float, float))
 
- Static Public Member Functions inherited from UT_Cache
static const UT_ValArray
< UT_Cache * > & 
utGetCacheList ()
 get the list of caches More...
 
static void setCacheAddRemoveCB (void(*callback)(void *), void *data)
 callback to be called when a cache is added or deleted. More...
 
static int64 utClearSpaceFromCaches (int64 amount)
 this method attempts to free up 'amount' bytes from all the caches. More...
 

Protected Member Functions

const char * utGetCacheName () const override
 required - return the english name for this cache. More...
 
int64 utGetCurrentSize () const override
 required - return the current cache size, in bytes More...
 
bool utHasMaxSize () const override
 optional - override if the cache has a well defined maximum size More...
 
int64 utGetMaxSize () const override
 
void utSetMaxSize (int64 size) override
 

Detailed Description

Definition at line 72 of file TIL_ImageCache.h.

Constructor & Destructor Documentation

TIL_ImageCache::TIL_ImageCache ( )
TIL_ImageCache::~TIL_ImageCache ( )
override

Member Function Documentation

void TIL_ImageCache::addToCache ( TIL_Image image)
void TIL_ImageCache::clearImageCache ( bool  force_all = false)
void TIL_ImageCache::dumpCache ( std::ostream &  os)
int64 TIL_ImageCache::getCurrentSize ( ) const
inline

Definition at line 81 of file TIL_ImageCache.h.

int TIL_ImageCache::getImage ( TIL_Image *&  image,
TIL_ImageSource source,
const char *  plane,
exint  planeindex,
float  t,
void look,
bool  updateflag,
const TIL_GetImageOptions opts = TIL_GetImageOptions() 
)
TIL_Image* TIL_ImageCache::getImageFromCache ( TIL_ImageState match,
bool  usedscaled = false,
UT_FilterType  f = UT_FILTER_BOX,
bool  bump = true 
)
int64 TIL_ImageCache::getMaxSize ( ) const
inline

Definition at line 82 of file TIL_ImageCache.h.

static int64 TIL_ImageCache::getSystemMaxSize ( )
static
void TIL_ImageCache::removeFrameFromCache ( TIL_ImageSource source,
int  fr 
)
void TIL_ImageCache::removeSourceFromCache ( TIL_ImageSource source)
void TIL_ImageCache::returnToCache ( TIL_Image *&  image)
void TIL_ImageCache::returnToCache ( const TIL_Raster r)
void TIL_ImageCache::setCacheLimit ( bool  enable)
void TIL_ImageCache::setCacheSize ( unsigned  size_in_kb)
static void TIL_ImageCache::setUpdateCallback ( void(*)(void *, TIL_Raster *, int, int, float, float callback)
static
const char* TIL_ImageCache::utGetCacheName ( ) const
inlineoverrideprotectedvirtual

required - return the english name for this cache.

Implements UT_Cache.

Definition at line 123 of file TIL_ImageCache.h.

int64 TIL_ImageCache::utGetCurrentSize ( ) const
inlineoverrideprotectedvirtual

required - return the current cache size, in bytes

Implements UT_Cache.

Definition at line 125 of file TIL_ImageCache.h.

int64 TIL_ImageCache::utGetMaxSize ( ) const
inlineoverrideprotectedvirtual

Reimplemented from UT_Cache.

Definition at line 129 of file TIL_ImageCache.h.

bool TIL_ImageCache::utHasMaxSize ( ) const
inlineoverrideprotectedvirtual

optional - override if the cache has a well defined maximum size

Reimplemented from UT_Cache.

Definition at line 127 of file TIL_ImageCache.h.

int64 TIL_ImageCache::utReduceCacheSizeBy ( int64  amount)
overridevirtual

required - free contents of the cache by amount bytes. Returns the amount of memory (in bytes) actually freed. This does not change the cache size

Implements UT_Cache.

void TIL_ImageCache::utSetMaxSize ( int64  size)
overrideprotectedvirtual

Reimplemented from UT_Cache.


The documentation for this class was generated from the following file: