Synergy Color Management Component - SDK -  2018.0.80
SYNCOLOR::FileRules Class Referenceabstract

The class contains all the file rules, and the capabilities to manage them. More...

Inheritance diagram for SYNCOLOR::FileRules:
SYNCOLOR::Rules

Public Types

enum  OCIOModes { USE_OCIO_RULES = 0, USE_FILE_PATH_RULES }
 Defines the OCIO modes. More...
 

Public Member Functions

virtual bool isReadOnly () const =0
 Is the rule container read only or not ? More...
 
virtual const char * evaluateFilePath (const char *filePath) const =0
 Evaluate the file path to find the associated color space. More...
 
- Public Member Functions inherited from SYNCOLOR::Rules
virtual SynStatus restoreDefaults ()=0
 Restore the default rules. More...
 
virtual SynStatus load ()=0
 Load rules from preferences. More...
 
virtual SynStatus save () const =0
 Save the rules in the preferences. More...
 
virtual unsigned int getNumRules () const =0
 Get the number of rules. More...
 
virtual SynStatus getRule (unsigned int position, RulePtr &rule) const =0
 Get a specific rule using its position. More...
 
virtual SynStatus getRule (const char *name, RulePtr &rule) const =0
 Get a specific rule using its name. More...
 
virtual SynStatus moveRule (const char *name, int offset)=0
 Move a rule to a new position. More...
 
virtual SynStatus removeRule (const char *name)=0
 Remove a rule using its name. More...
 
virtual SynStatus serialize (RuleWriter &writer) const =0
 Serialize the rule container in XML. More...
 
virtual SynStatus populate (const char *data, unsigned int length)=0
 Populate the rule container. More...
 

Static Public Member Functions

static FileRulesinstance ()
 Get the current container (could be the native one or an OCIO one) More...
 
static void setNativeMode ()
 Set the rule container to the native one. More...
 
static SynStatus setOCIOMode (const char *ocioFilePath, OCIOModes ruleMode)
 Set the rule container to the OCIO one. More...
 

Protected Member Functions

virtual ~FileRules ()
 Default destructor. More...
 

Detailed Description

The class contains all the file rules, and the capabilities to manage them.

Member Enumeration Documentation

Defines the OCIO modes.

Enumerator
USE_OCIO_RULES 

Use the default OCIO rules.

That mode offers two read-only rules. The OCIO rule which is read-only, uses the OCIO library rule. And then the default rule which is used when no color space was found by the previous rule and allows the user to change its color space.

USE_FILE_PATH_RULES 

Use the file path mechanism.

That mode offers the default rule and the capability to create file path based rules. The default rule is used when no color space where found by the previous rule(s) and allows the user to change its color space.

Constructor & Destructor Documentation

virtual SYNCOLOR::FileRules::~FileRules ( )
inlineprotectedvirtual

Default destructor.

Member Function Documentation

static FileRules& SYNCOLOR::FileRules::instance ( )
static

Get the current container (could be the native one or an OCIO one)

Returns
the container instance
static void SYNCOLOR::FileRules::setNativeMode ( )
static

Set the rule container to the native one.

static SynStatus SYNCOLOR::FileRules::setOCIOMode ( const char *  ocioFilePath,
OCIOModes  ruleMode 
)
static

Set the rule container to the OCIO one.

Parameters
ocioFilePathThe file path to the OCIO configuration file
ruleModeThe rules to use in OCIO mode
Returns
The status of the request. Check the error code to determine if an error occurred. See SYNCOLOR::SynStatus above.
virtual bool SYNCOLOR::FileRules::isReadOnly ( ) const
pure virtual

Is the rule container read only or not ?

Note
A read only rule container forbids any changes to the rules.
Returns
true if the rule container is read only
virtual const char* SYNCOLOR::FileRules::evaluateFilePath ( const char *  filePath) const
pure virtual

Evaluate the file path to find the associated color space.

Parameters
filePathThe file path to evaluate
Returns
The associated color space; otherwise, a null or empty string when no color space was found