Synergy Color Management Component - SDK -  2018.0.80
SYNCOLOR::TransformCache Namespace Reference

Color transform cache. More...

Classes

class  Writer
 Cache content wrinting callback class. More...
 

Functions

SYN_EXPORT unsigned numItems ()
 Number of transforms in the cache. More...
 
SYN_EXPORT SynStatus getTransform (const char *id, TransformPtr &pT)
 Transform instance by ID. More...
 
SYN_EXPORT SynStatus serializeTransformCache (Writer &writerCallback)
 Extract the color transform cache data. More...
 
SYN_EXPORT SynStatus populateTransformCache (const char *cacheData)
 Populate the transform cache using the supplied data buffer. More...
 
SYN_EXPORT SynStatus clear ()
 Empties the cache. More...
 

Detailed Description

Color transform cache.

During an application session, some transform caching may occur. The intent of caching is to save applications from doing costly transform creation operations multiple times if this can be avoided.

There are currently two circumstances where transforms will be cached.

If during a session a given transform is finalized with the same parameters, or if a template is used with the same parameters to create a transform, the resulting transform will be retrieved from the cache. Currently, transforms created by reading files or by using the factory methods are not cached until they are finalized (whereas templates are cached at creation).

It is possible to extract from the cache the transform data for saving to file, and to re-populate the cache with the same transforms data in a subsequent session. This approach is useful for example for providing transforms to an external renderer application.

Function Documentation

SYN_EXPORT unsigned SYNCOLOR::TransformCache::numItems ( )

Number of transforms in the cache.

This method is intended for testing purposes.

Returns
Number of transforms in the cache.
SYN_EXPORT SynStatus SYNCOLOR::TransformCache::getTransform ( const char *  id,
TransformPtr &  pT 
)

Transform instance by ID.

If there is no transform corresponding to the ID supplied, a SYNCOLOR::ERROR_SYN_COLOR_CACHE_MISS error is returned.

Parameters
idTransform unique ID. See SYNCOLOR::Transform::getUniqueId().
pTReturned transform.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
SYN_EXPORT SynStatus SYNCOLOR::TransformCache::serializeTransformCache ( Writer &  writerCallback)

Extract the color transform cache data.

Parameters
writerCallbackRequired callback instance. See SYNCOLOR::TransformCache::Writer.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
See also
SYNCOLOR::TransformCache::populateTransformCache().
SYN_EXPORT SynStatus SYNCOLOR::TransformCache::populateTransformCache ( const char *  cacheData)

Populate the transform cache using the supplied data buffer.

Parameters
cacheDataCache data block pointer.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
See also
SYNCOLOR::TransformCache::serializeTransformCache().
SYN_EXPORT SynStatus SYNCOLOR::TransformCache::clear ( )

Empties the cache.

This method is intended for testing only and should not be used.

Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.