Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
ImageIOTextureStream Class Reference

Image texture evaluation.
This class wraps OpenImageIO's texture evaluation system.
This class can be either be instanciated manually (if there is a need for multiple texture systems for example), or accessed through the get_texture_stream() function, which returns an instance shared by the whole application. More...

Public Member Functions

bool evaluate (const UniqueString &filename, MapEvalCtx &eval_ctx, const int &repeat_u, const int &repeat_v, const int &filtering, const int &mipmaps, float *result)
 Evaluation function. Evaluates a particular file using the specified texture coordinates, partial derivatives, etc...
 
CoreString get_peak_cache_memory ()
 Get stream texture cache current used memory size in MB as a string (e.g. "12.34 MB").
 
CoreString get_stats (int log_level=1)
 Returns statistics about the texture system, like number of files opened, cache access/misses, etc...
 
void invalidate (const UniqueString &filename)
 Invalidate the cache of the specified filename. Data from this file will be reloaded if it has been modified.
 
void invalidate_all (bool force=false)
 Invalide the cache for all files.
 
OpenImageIO_v2_1::TextureSystem * get_oiio_texture_system ()
 Returns a pointer to OIIO's texture system.
 
GMathVec2i get_image_size (const UniqueString &filename) const
 
size_t get_memory_size () const
 
void clear ()
 Clear the texture cache.
 

Static Public Member Functions

static ImageIOTextureStreamget_texture_stream ()
 Returns the instance of the ImageIOTextureStream.
 
static void destroy ()
 Destroy the singleton.
 
static void set_cache_size (const double &size)
 Set stream texture cache maximum size in MB.
 
static float get_cache_size ()
 Get stream texture cache maximum size in MB.
 
static float get_cache_used_size ()
 Get stream texture cache current used memory size in MB.
 

Detailed Description

Image texture evaluation.
This class wraps OpenImageIO's texture evaluation system.
This class can be either be instanciated manually (if there is a need for multiple texture systems for example), or accessed through the get_texture_stream() function, which returns an instance shared by the whole application.

Member Function Documentation

void ImageIOTextureStream::clear ( void  )

Clear the texture cache.

Note
DO NOT CALL THIS METHOD DURING AN EVALUATION AS IT WILL LEAD TO A CRASH
bool ImageIOTextureStream::evaluate ( const UniqueString filename,
MapEvalCtx eval_ctx,
const int &  repeat_u,
const int &  repeat_v,
const int &  filtering,
const int &  mipmaps,
float *  result 
)

Evaluation function. Evaluates a particular file using the specified texture coordinates, partial derivatives, etc...

Parameters
filenameName of the file to evaluate
eval_ctxEvaluation parameters.
repeat_u,repeat_vRepeat mode if the pixel to evaluate is outside the visible region of the image.
filteringWhich type of filtering to use
mipmapsHow to use mipmaps for filtering
resultResult color (4 floats)
float ImageIOTextureStream::get_cache_used_size ( )
static

Get stream texture cache current used memory size in MB.

The returned value corresponds to the OIIO stat labeled as "Peak cache memory".

CoreString ImageIOTextureStream::get_peak_cache_memory ( )

Get stream texture cache current used memory size in MB as a string (e.g. "12.34 MB").

The returned value corresponds to the OIIO stat labeled as "Peak cache memory".

Deprecated:
Use get_cache_used_size instead.
void ImageIOTextureStream::invalidate_all ( bool  force = false)

Invalide the cache for all files.

Parameters
forceForce invalidation: the cache will be destroyed even if the files have not changed.
void ImageIOTextureStream::set_cache_size ( const double &  size)
static

Set stream texture cache maximum size in MB.

Parameters
sizeNew maximum size in MB. Must be greater than 10 MB. Values under 512 MB are not recommended.