HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OCIO_NAMESPACE::ColorSpaceMenuHelper Class Referenceabstract

#include <OpenColorAppHelpers.h>

Public Member Functions

virtual size_t getNumColorSpaces () const noexcept=0
 Access to the color spaces (or roles). More...
 
virtual const char * getName (size_t idx) const noexcept=0
 
virtual const char * getUIName (size_t idx) const noexcept=0
 
virtual size_t getIndexFromName (const char *name) const noexcept=0
 
virtual size_t getIndexFromUIName (const char *name) const noexcept=0
 
virtual const char * getDescription (size_t idx) const noexcept=0
 
virtual const char * getFamily (size_t idx) const noexcept=0
 
virtual size_t getNumHierarchyLevels (size_t idx) const noexcept=0
 
virtual const char * getHierarchyLevel (size_t idx, size_t i) const noexcept=0
 
virtual const char * getNameFromUIName (const char *uiName) const noexcept=0
 Get the color space name from the UI name. More...
 
virtual const char * getUINameFromName (const char *name) const noexcept=0
 Get the color space UI name from the name. More...
 
 ColorSpaceMenuHelper (const ColorSpaceMenuHelper &)=delete
 
ColorSpaceMenuHelperoperator= (const ColorSpaceMenuHelper &)=delete
 
virtual ~ColorSpaceMenuHelper ()=default
 Do not use (needed only for pybind11). More...
 

Static Public Member Functions

static ColorSpaceMenuHelperRcPtr Create (ConstColorSpaceMenuParametersRcPtr parameters)
 

Protected Member Functions

 ColorSpaceMenuHelper ()=default
 

Detailed Description

Helper class to create menus for the content of a config.

Menu can list color spaces, roles, named transforms. Each entry has a name, a UI name, a description, and a family. Family can also be accessed as hierarchy levels; levels are created by splitting the family using the 'family separator'. Hierarchy levels are meant to be used as sub-menus.

The UI name is what is intended to be put in application menus seen by the end-user. However, please note that the UI name is not guaranteed to remain stable between releases and so if applications need to save something it should be the 'name' rather than the 'UI name'. Currently, the only difference between the 'name' and 'UI name' is for roles.

The overall ordering of items is: color spaces, named transforms, roles, and additional color spaces. The display color spaces will either come before or after the other color spaces based on where that block of spaces appears in the config. The order of items returned by the menu helper preserves the order of items in the config itself for each type of elements, thus preserving the intent of the config author. For example, if you call getName at idx and idx+1, the name returned at idx+1 will be from farther down in the config than the one at idx as long as both are of the same type. (An application may ask for only the items in one of those blocks if it wants to handle them separately.) If the application makes use of hierarchical menus, that will obviously impose a different order on what the user sees in the menu. Though even with hierarchical menus, applications should try to preserve config ordering (which is equivalent to index ordering) for items within the same sub-menu.

Definition at line 214 of file OpenColorAppHelpers.h.

Constructor & Destructor Documentation

OCIO_NAMESPACE::ColorSpaceMenuHelper::ColorSpaceMenuHelper ( const ColorSpaceMenuHelper )
delete
virtual OCIO_NAMESPACE::ColorSpaceMenuHelper::~ColorSpaceMenuHelper ( )
virtualdefault

Do not use (needed only for pybind11).

OCIO_NAMESPACE::ColorSpaceMenuHelper::ColorSpaceMenuHelper ( )
protecteddefault

Member Function Documentation

static ColorSpaceMenuHelperRcPtr OCIO_NAMESPACE::ColorSpaceMenuHelper::Create ( ConstColorSpaceMenuParametersRcPtr  parameters)
static
virtual const char* OCIO_NAMESPACE::ColorSpaceMenuHelper::getDescription ( size_t  idx) const
pure virtualnoexcept
virtual const char* OCIO_NAMESPACE::ColorSpaceMenuHelper::getFamily ( size_t  idx) const
pure virtualnoexcept
virtual const char* OCIO_NAMESPACE::ColorSpaceMenuHelper::getHierarchyLevel ( size_t  idx,
size_t  i 
) const
pure virtualnoexcept
virtual size_t OCIO_NAMESPACE::ColorSpaceMenuHelper::getIndexFromName ( const char *  name) const
pure virtualnoexcept

Get the index of the element of a given name. Return (size_t)-1 name if NULL or empty, or if no element with that name is found.

virtual size_t OCIO_NAMESPACE::ColorSpaceMenuHelper::getIndexFromUIName ( const char *  name) const
pure virtualnoexcept
virtual const char* OCIO_NAMESPACE::ColorSpaceMenuHelper::getName ( size_t  idx) const
pure virtualnoexcept

Get the color space (or role) name used in the config for this menu item. Will be empty if the index is out of range.

virtual const char* OCIO_NAMESPACE::ColorSpaceMenuHelper::getNameFromUIName ( const char *  uiName) const
pure virtualnoexcept

Get the color space name from the UI name.

virtual size_t OCIO_NAMESPACE::ColorSpaceMenuHelper::getNumColorSpaces ( ) const
pure virtualnoexcept

Access to the color spaces (or roles).

virtual size_t OCIO_NAMESPACE::ColorSpaceMenuHelper::getNumHierarchyLevels ( size_t  idx) const
pure virtualnoexcept

Hierarchy levels are created from the family string. It is split into levels using the 'family separator'.

virtual const char* OCIO_NAMESPACE::ColorSpaceMenuHelper::getUIName ( size_t  idx) const
pure virtualnoexcept

Get the name to use in the menu UI. This might be different from the config name, for example in the case of roles. Will be empty if the index is out of range.

virtual const char* OCIO_NAMESPACE::ColorSpaceMenuHelper::getUINameFromName ( const char *  name) const
pure virtualnoexcept

Get the color space UI name from the name.

ColorSpaceMenuHelper& OCIO_NAMESPACE::ColorSpaceMenuHelper::operator= ( const ColorSpaceMenuHelper )
delete

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