HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
related to displays and views.

Functions

void OCIO_NAMESPACE::Config::addSharedView (const char *view, const char *viewTransformName, const char *colorSpaceName, const char *looks, const char *ruleName, const char *description)
 Will throw if view or colorSpaceName are null or empty. More...
 
void OCIO_NAMESPACE::Config::removeSharedView (const char *view)
 Remove a shared view. Will throw if the view does not exist. More...
 
const char * OCIO_NAMESPACE::Config::getDefaultDisplay () const
 
int OCIO_NAMESPACE::Config::getNumDisplays () const
 
const char * OCIO_NAMESPACE::Config::getDisplay (int index) const
 Will return "" if the index is invalid. More...
 
const char * OCIO_NAMESPACE::Config::getDefaultView (const char *display) const
 
const char * OCIO_NAMESPACE::Config::getDefaultView (const char *display, const char *colorspaceName) const
 
int OCIO_NAMESPACE::Config::getNumViews (const char *display) const
 
const char * OCIO_NAMESPACE::Config::getView (const char *display, int index) const
 
int OCIO_NAMESPACE::Config::getNumViews (const char *display, const char *colorspaceName) const
 
const char * OCIO_NAMESPACE::Config::getView (const char *display, const char *colorspaceName, int index) const
 
const char * OCIO_NAMESPACE::Config::getDisplayViewTransformName (const char *display, const char *view) const
 
const char * OCIO_NAMESPACE::Config::getDisplayViewColorSpaceName (const char *display, const char *view) const
 
const char * OCIO_NAMESPACE::Config::getDisplayViewLooks (const char *display, const char *view) const
 Returns the looks attribute of a (display, view) pair. More...
 
const char * OCIO_NAMESPACE::Config::getDisplayViewRule (const char *display, const char *view) const noexcept
 Returns the rule attribute of a (display, view) pair. More...
 
const char * OCIO_NAMESPACE::Config::getDisplayViewDescription (const char *display, const char *view) const noexcept
 Returns the description attribute of a (display, view) pair. More...
 
void OCIO_NAMESPACE::Config::addDisplayView (const char *display, const char *view, const char *colorSpaceName, const char *looks)
 
void OCIO_NAMESPACE::Config::addDisplayView (const char *display, const char *view, const char *viewTransformName, const char *colorSpaceName, const char *looks, const char *ruleName, const char *description)
 For the (display, view) pair, specify the color space or alternatively specify the view transform and display color space. The looks, viewing rule, and description are optional. Pass a null or empty string for any optional arguments. If the view already exists, it is replaced. More...
 
void OCIO_NAMESPACE::Config::addDisplaySharedView (const char *display, const char *sharedView)
 Add a (reference to a) shared view to a display. More...
 
void OCIO_NAMESPACE::Config::removeDisplayView (const char *display, const char *view)
 Remove the view and the display if no more views. More...
 
void OCIO_NAMESPACE::Config::clearDisplays ()
 Clear all the displays. More...
 
void OCIO_NAMESPACE::Config::addVirtualDisplayView (const char *view, const char *viewTransformName, const char *colorSpaceName, const char *looks, const char *ruleName, const char *description)
 
void OCIO_NAMESPACE::Config::addVirtualDisplaySharedView (const char *sharedView)
 
int OCIO_NAMESPACE::Config::getVirtualDisplayNumViews (ViewType type) const noexcept
 Get the number of views associated to the virtual display. More...
 
const char * OCIO_NAMESPACE::Config::getVirtualDisplayView (ViewType type, int index) const noexcept
 Get the view name at a specific index. More...
 
const char * OCIO_NAMESPACE::Config::getVirtualDisplayViewTransformName (const char *view) const noexcept
 
const char * OCIO_NAMESPACE::Config::getVirtualDisplayViewColorSpaceName (const char *view) const noexcept
 
const char * OCIO_NAMESPACE::Config::getVirtualDisplayViewLooks (const char *view) const noexcept
 
const char * OCIO_NAMESPACE::Config::getVirtualDisplayViewRule (const char *view) const noexcept
 
const char * OCIO_NAMESPACE::Config::getVirtualDisplayViewDescription (const char *view) const noexcept
 
void OCIO_NAMESPACE::Config::removeVirtualDisplayView (const char *view) noexcept
 Remove the view from the virtual display. More...
 
void OCIO_NAMESPACE::Config::clearVirtualDisplay () noexcept
 Clear the virtual display. More...
 
int OCIO_NAMESPACE::Config::instantiateDisplayFromMonitorName (const char *monitorName)
 Instantiate a new display from a virtual display, using the monitor name. More...
 
int OCIO_NAMESPACE::Config::instantiateDisplayFromICCProfile (const char *ICCProfileFilepath)
 Instantiate a new display from a virtual display, using an ICC profile. More...
 
int OCIO_NAMESPACE::Config::getNumNamedTransforms (NamedTransformVisibility visibility) const noexcept
 Work on the named transforms selected by visibility. More...
 
const char * OCIO_NAMESPACE::Config::getNamedTransformNameByIndex (NamedTransformVisibility visibility, int index) const noexcept
 Work on the named transforms selected by visibility (active or inactive). More...
 
int OCIO_NAMESPACE::Config::getNumNamedTransforms () const noexcept
 Work on the active named transforms only. More...
 
const char * OCIO_NAMESPACE::Config::getNamedTransformNameByIndex (int index) const noexcept
 Work on the active named transforms only and return an empty string for invalid index. More...
 
int OCIO_NAMESPACE::Config::getIndexForNamedTransform (const char *name) const noexcept
 Get an index from the active named transforms only and return -1 if the name is not found. More...
 
ConstNamedTransformRcPtr OCIO_NAMESPACE::Config::getNamedTransform (const char *name) const noexcept
 Get the named transform from all the named transforms (i.e. active and inactive) and return null if the name is not found. More...
 
void OCIO_NAMESPACE::Config::addNamedTransform (const ConstNamedTransformRcPtr &namedTransform)
 Add or replace named transform. More...
 
void OCIO_NAMESPACE::Config::clearNamedTransforms ()
 Clear all named transforms. More...
 
virtual size_t OCIO_NAMESPACE::SystemMonitors::getNumMonitors () const noexcept=0
 Get the number of active monitors reported by the operating system. More...
 
virtual const char * OCIO_NAMESPACE::SystemMonitors::getMonitorName (size_t idx) const =0
 Get the monitor profile name. More...
 
virtual const char * OCIO_NAMESPACE::SystemMonitors::getProfileFilepath (size_t idx) const =0
 Get the ICC profile path associated to the monitor. More...
 

Detailed Description

... (See descriptions for the non-virtual methods above.)

The virtual display is the way to incorporate the ICC monitor profile for a user's display into OCIO. The views that are defined for the virtual display are the views that are used to create a new display for an ICC profile. They serve as a kind of template that lets OCIO know how to build the new display.

Typically the views will define a View Transform and set the colorSpaceName to "<USE_DISPLAY_NAME>" so that it will use the display color space with the same name as the display, in this case corresponding to the ICC profile.

Function Documentation

void OCIO_NAMESPACE::Config::addDisplaySharedView ( const char *  display,
const char *  sharedView 
)

Add a (reference to a) shared view to a display.

The shared view must be part of the config. See Config::addSharedView

This will throw if:

  • Display or view are null or empty.
  • Display already has a view (shared or not) with the same name.
void OCIO_NAMESPACE::Config::addDisplayView ( const char *  display,
const char *  view,
const char *  colorSpaceName,
const char *  looks 
)

For the (display, view) pair, specify which color space and look to use. If a look is not desired, then just pass a null or empty string.

void OCIO_NAMESPACE::Config::addDisplayView ( const char *  display,
const char *  view,
const char *  viewTransformName,
const char *  colorSpaceName,
const char *  looks,
const char *  ruleName,
const char *  description 
)

For the (display, view) pair, specify the color space or alternatively specify the view transform and display color space. The looks, viewing rule, and description are optional. Pass a null or empty string for any optional arguments. If the view already exists, it is replaced.

Will throw if:

  • Display, view or colorSpace are null or empty.
  • Display already has a shared view with the same name.
void OCIO_NAMESPACE::Config::addNamedTransform ( const ConstNamedTransformRcPtr namedTransform)

Add or replace named transform.

Note
Throws if namedTransform is null, name is missing, or no transform is set. Also throws if the name or the aliases conflict with names or aliases already in the config.
void OCIO_NAMESPACE::Config::addSharedView ( const char *  view,
const char *  viewTransformName,
const char *  colorSpaceName,
const char *  looks,
const char *  ruleName,
const char *  description 
)

Will throw if view or colorSpaceName are null or empty.

The following methods only manipulate active displays and views. Active displays and views are defined from an env. variable or from the config file.

Looks is a potentially comma (or colon) delimited list of lookNames, Where +/- prefixes are optionally allowed to denote forward/inverse look specification. (And forward is assumed in the absence of either)

Add shared view (or replace existing one with same name). Shared views are defined at config level and can be referenced by several displays. Either provide a view transform and a display color space or just a color space (and a null view transform). Looks, rule and description are optional, they can be null or empty.

Shared views using a view transform may use the token <USE_DISPLAY_NAME> for the color space (see :c:var:OCIO_VIEW_USE_DISPLAY_NAME). In that case, when the view is referenced in a display, the display color space that is used will be the one matching the display name. In other words, the view will be customized based on the display it is used in. Config::validate will throw if the config does not contain the matching display color space.

void OCIO_NAMESPACE::Config::addVirtualDisplaySharedView ( const char *  sharedView)
void OCIO_NAMESPACE::Config::addVirtualDisplayView ( const char *  view,
const char *  viewTransformName,
const char *  colorSpaceName,
const char *  looks,
const char *  ruleName,
const char *  description 
)
void OCIO_NAMESPACE::Config::clearDisplays ( )

Clear all the displays.

void OCIO_NAMESPACE::Config::clearNamedTransforms ( )

Clear all named transforms.

void OCIO_NAMESPACE::Config::clearVirtualDisplay ( )
noexcept

Clear the virtual display.

const char* OCIO_NAMESPACE::Config::getDefaultDisplay ( ) const
const char* OCIO_NAMESPACE::Config::getDefaultView ( const char *  display) const
const char* OCIO_NAMESPACE::Config::getDefaultView ( const char *  display,
const char *  colorspaceName 
) const
const char* OCIO_NAMESPACE::Config::getDisplay ( int  index) const

Will return "" if the index is invalid.

const char* OCIO_NAMESPACE::Config::getDisplayViewColorSpaceName ( const char *  display,
const char *  view 
) const

Returns the colorspace attribute of the (display, view) pair. (Note that this may be either a color space or a display color space.)

const char* OCIO_NAMESPACE::Config::getDisplayViewDescription ( const char *  display,
const char *  view 
) const
noexcept

Returns the description attribute of a (display, view) pair.

const char* OCIO_NAMESPACE::Config::getDisplayViewLooks ( const char *  display,
const char *  view 
) const

Returns the looks attribute of a (display, view) pair.

const char* OCIO_NAMESPACE::Config::getDisplayViewRule ( const char *  display,
const char *  view 
) const
noexcept

Returns the rule attribute of a (display, view) pair.

const char* OCIO_NAMESPACE::Config::getDisplayViewTransformName ( const char *  display,
const char *  view 
) const

Returns the view_transform attribute of the (display, view) pair. View can be a shared view of the display. If display is null or empty, config shared views are used.

int OCIO_NAMESPACE::Config::getIndexForNamedTransform ( const char *  name) const
noexcept

Get an index from the active named transforms only and return -1 if the name is not found.

virtual const char* OCIO_NAMESPACE::SystemMonitors::getMonitorName ( size_t  idx) const
pure virtual

Get the monitor profile name.

Get the string describing the monitor. It is used as an argument to instantiateDisplay. It may also be used in a UI to ask a user which of several monitors they want to instantiate a display for.

ConstNamedTransformRcPtr OCIO_NAMESPACE::Config::getNamedTransform ( const char *  name) const
noexcept

Get the named transform from all the named transforms (i.e. active and inactive) and return null if the name is not found.

const char* OCIO_NAMESPACE::Config::getNamedTransformNameByIndex ( NamedTransformVisibility  visibility,
int  index 
) const
noexcept

Work on the named transforms selected by visibility (active or inactive).

Return an empty string for invalid index.

const char* OCIO_NAMESPACE::Config::getNamedTransformNameByIndex ( int  index) const
noexcept

Work on the active named transforms only and return an empty string for invalid index.

int OCIO_NAMESPACE::Config::getNumDisplays ( ) const
virtual size_t OCIO_NAMESPACE::SystemMonitors::getNumMonitors ( ) const
pure virtualnoexcept

Get the number of active monitors reported by the operating system.

int OCIO_NAMESPACE::Config::getNumNamedTransforms ( NamedTransformVisibility  visibility) const
noexcept

Work on the named transforms selected by visibility.

int OCIO_NAMESPACE::Config::getNumNamedTransforms ( ) const
noexcept

Work on the active named transforms only.

int OCIO_NAMESPACE::Config::getNumViews ( const char *  display) const

Return the number of views attached to the display including the number of shared views if any. Return 0 if display does not exist.

int OCIO_NAMESPACE::Config::getNumViews ( const char *  display,
const char *  colorspaceName 
) const

If the config has ViewingRules, get the number of active Views for this colorspace. (If there are no rules, it returns all of them.)

virtual const char* OCIO_NAMESPACE::SystemMonitors::getProfileFilepath ( size_t  idx) const
pure virtual

Get the ICC profile path associated to the monitor.

const char* OCIO_NAMESPACE::Config::getView ( const char *  display,
int  index 
) const
const char* OCIO_NAMESPACE::Config::getView ( const char *  display,
const char *  colorspaceName,
int  index 
) const
int OCIO_NAMESPACE::Config::getVirtualDisplayNumViews ( ViewType  type) const
noexcept

Get the number of views associated to the virtual display.

const char* OCIO_NAMESPACE::Config::getVirtualDisplayView ( ViewType  type,
int  index 
) const
noexcept

Get the view name at a specific index.

const char* OCIO_NAMESPACE::Config::getVirtualDisplayViewColorSpaceName ( const char *  view) const
noexcept
const char* OCIO_NAMESPACE::Config::getVirtualDisplayViewDescription ( const char *  view) const
noexcept
const char* OCIO_NAMESPACE::Config::getVirtualDisplayViewLooks ( const char *  view) const
noexcept
const char* OCIO_NAMESPACE::Config::getVirtualDisplayViewRule ( const char *  view) const
noexcept
const char* OCIO_NAMESPACE::Config::getVirtualDisplayViewTransformName ( const char *  view) const
noexcept
int OCIO_NAMESPACE::Config::instantiateDisplayFromICCProfile ( const char *  ICCProfileFilepath)

Instantiate a new display from a virtual display, using an ICC profile.

On platforms such as Linux, where the SystemMonitors class is not able to obtain a list of ICC profiles from the OS, this method may be used to manually specify a path to an ICC profile.

Will throw if the virtual display definition is missing from the config.

Returns the index of the display.

int OCIO_NAMESPACE::Config::instantiateDisplayFromMonitorName ( const char *  monitorName)

Instantiate a new display from a virtual display, using the monitor name.

This method uses the virtual display to create an actual display for the given monitorName. The new display will receive the views from the virtual display.

After the ICC profile is read, a display name will be created by combining the description text from the profile with the monitorName obtained from the OS. Use the SystemMonitors class to obtain the list of monitorName strings for the displays connected to the computer.

A new display color space will also be created using the display name. It will have a from_display_reference transform that is a FileTransform pointing to the ICC profile.

Any instantiated display color spaces for a virtual display are intended to be temporary (i.e. last as long as the current session). By default, they are not saved when writing a config file. If there is a need to make it a permanent color space, it may be desirable to copy the ICC profile somewhere under the config search_path.

Will throw if the config does not have a virtual display or if the monitorName does not exist.

If there is already a display or a display color space with the name monitorName, it will be replaced/updated.

Returns the index of the display.

void OCIO_NAMESPACE::Config::removeDisplayView ( const char *  display,
const char *  view 
)

Remove the view and the display if no more views.

It does not remove the associated color space. If the view name is a shared view, it only removes the reference to the view from the display but the shared view, remains in the config.

Will throw if the view does not exist.

void OCIO_NAMESPACE::Config::removeSharedView ( const char *  view)

Remove a shared view. Will throw if the view does not exist.

void OCIO_NAMESPACE::Config::removeVirtualDisplayView ( const char *  view)
noexcept

Remove the view from the virtual display.