Blender V5.3
blender::ocio::Config Class Referenceabstract

#include <OCIO_config.hh>

Inherited by blender::ocio::LibOCIOConfig.

Public Member Functions

Color space information
virtual float3 get_default_luma_coefs () const =0
virtual float3x3 get_xyz_to_scene_linear_matrix () const =0
virtual const char * get_color_space_from_filepath (const char *filepath) const =0
Color space API
virtual const ColorSpace * get_color_space (StringRefNull name) const =0
virtual int get_num_active_color_spaces () const =0
virtual int get_num_all_color_spaces () const =0
virtual const ColorSpace * get_color_space_by_index (int index) const =0
virtual const ColorSpace * get_sorted_color_space_by_index (int index) const =0
virtual const ColorSpace * get_color_space_by_interop_id (StringRefNull interop_id) const =0
virtual const ColorSpace * get_color_space_for_hdr_image (StringRefNull name) const =0
virtual bool is_role (StringRefNull name) const =0
Working colorspace API
virtual void set_scene_linear_role (StringRefNull name)=0
Display API
virtual const Display * get_default_display () const =0
virtual const Display * get_display_by_name (StringRefNull name) const =0
virtual int get_num_displays () const =0
virtual const Display * get_display_by_index (int index) const =0
Display colorspace API
virtual const ColorSpace * get_display_view_color_space (StringRefNull display, StringRefNull view) const =0
Look API
virtual const Look * get_look_by_name (StringRefNull name) const =0
virtual int get_num_looks () const =0
virtual const Look * get_look_by_index (int index) const =0
Processor API
virtual std::shared_ptr< const CPUProcessor > get_display_cpu_processor (const DisplayParameters &display_parameters) const =0
virtual std::shared_ptr< const CPUProcessor > get_cpu_processor (StringRefNull from_colorspace, StringRefNull to_colorspace) const =0
GPU-side processing
virtual const GPUShaderBinder & get_gpu_shader_binder () const =0

Construction

virtual ~Config ()=default
virtual bool switch_to_from_environment (FunctionRef< bool(const Config &)> validate)=0
virtual bool switch_to (Config &new_config, FunctionRef< bool(const Config &)> validate)=0
static std::unique_ptr< Config > create_from_environment ()
static std::unique_ptr< Config > create_fallback ()

Detailed Description

Definition at line 50 of file OCIO_config.hh.

Constructor & Destructor Documentation

◆ ~Config()

virtual blender::ocio::Config::~Config ( )
virtualdefault

Member Function Documentation

◆ create_fallback()

std::unique_ptr< Config > blender::ocio::Config::create_fallback ( )
static

Create the built-in fallback configuration, which is embedded in the code and so is guaranteed to load.

It is used in cases actual OpenColorIO configuration has failed to be created so that Blender interface can be displayed.

Definition at line 16 of file config.cc.

References blender::ocio::LibOCIOConfig::create_fallback().

Referenced by blender::colormanage_config_load_candidates(), blender::ocio::TEST_F(), and ~Config().

◆ create_from_environment()

std::unique_ptr< Config > blender::ocio::Config::create_from_environment ( )
static

Create OpenColorIO configuration using configuration from the environment variables. If there is an error creating the configuration nullptr is returned.

Definition at line 11 of file config.cc.

References blender::ocio::LibOCIOConfig::create_from_environment().

Referenced by blender::colormanage_config_load_candidates(), and ~Config().

◆ get_color_space()

virtual const ColorSpace * blender::ocio::Config::get_color_space ( StringRefNull name) const
pure virtual

Get color space with the given name, role name, or alias. Color space names take precedence over roles. If the color space does not exist nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::colormanage_load_config(), and blender::colormanage_role_color_space_name_get().

◆ get_color_space_by_index()

virtual const ColorSpace * blender::ocio::Config::get_color_space_by_index ( int index) const
pure virtual

Get color space with the given index within the configuration. If the index is invalid nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::imbuf::tests::TEST_F().

◆ get_color_space_by_interop_id()

virtual const ColorSpace * blender::ocio::Config::get_color_space_by_interop_id ( StringRefNull interop_id) const
pure virtual

Get color space for the given interop ID. If not found a nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::colormanage_load_config().

◆ get_color_space_for_hdr_image()

virtual const ColorSpace * blender::ocio::Config::get_color_space_for_hdr_image ( StringRefNull name) const
pure virtual

Get colorspace to be used for saving and loading HDR image files, which may need adjustments compared to the colorspace as chosen by the user.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_color_space_from_filepath()

virtual const char * blender::ocio::Config::get_color_space_from_filepath ( const char * filepath) const
pure virtual

Get the color space of the first rule that matched filepath. If there is no such color space nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_cpu_processor()

virtual std::shared_ptr< const CPUProcessor > blender::ocio::Config::get_cpu_processor ( StringRefNull from_colorspace,
StringRefNull to_colorspace ) const
pure virtual

Get processor which converts color between given color spaces.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_default_display()

virtual const Display * blender::ocio::Config::get_default_display ( ) const
pure virtual

Get the default display in this configuration.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_default_luma_coefs()

virtual float3 blender::ocio::Config::get_default_luma_coefs ( ) const
pure virtual

Get the default coefficients for computing luma.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::colormanage_update_matrices().

◆ get_display_by_index()

virtual const Display * blender::ocio::Config::get_display_by_index ( int index) const
pure virtual

Get display with the given index within the configuration. If the index is invalid nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::colormanage_load_config().

◆ get_display_by_name()

virtual const Display * blender::ocio::Config::get_display_by_name ( StringRefNull name) const
pure virtual

Get display with the given name. If the display does not exist nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_display_cpu_processor()

virtual std::shared_ptr< const CPUProcessor > blender::ocio::Config::get_display_cpu_processor ( const DisplayParameters & display_parameters) const
pure virtual

Get processor which converts color space from the given from_colorspace to the display space.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_display_view_color_space()

virtual const ColorSpace * blender::ocio::Config::get_display_view_color_space ( StringRefNull display,
StringRefNull view ) const
pure virtual

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

Implemented in blender::ocio::LibOCIOConfig.

◆ get_gpu_shader_binder()

virtual const GPUShaderBinder & blender::ocio::Config::get_gpu_shader_binder ( ) const
pure virtual

Get API which can be used to bind GPU shaders for color space conversion.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_look_by_index()

virtual const Look * blender::ocio::Config::get_look_by_index ( int index) const
pure virtual

Get look with the given index within the configuration. If the index is invalid nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_look_by_name()

virtual const Look * blender::ocio::Config::get_look_by_name ( StringRefNull name) const
pure virtual

Get look with the given name. If the look does not exist nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

◆ get_num_active_color_spaces()

virtual int blender::ocio::Config::get_num_active_color_spaces ( ) const
pure virtual

Get the number of active color spaces in this configuration.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::ui::colorspaces_menu_draw(), and blender::imbuf::tests::TEST_F().

◆ get_num_all_color_spaces()

virtual int blender::ocio::Config::get_num_all_color_spaces ( ) const
pure virtual

Get the number of all color spaces, including the inactive color spaces after the active ones.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::imbuf::tests::TEST_F().

◆ get_num_displays()

virtual int blender::ocio::Config::get_num_displays ( ) const
pure virtual

Get the number of displays in this configuration.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::colormanage_load_config().

◆ get_num_looks()

virtual int blender::ocio::Config::get_num_looks ( ) const
pure virtual

Get the number of looks in this configuration.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::colormanage_load_config().

◆ get_sorted_color_space_by_index()

virtual const ColorSpace * blender::ocio::Config::get_sorted_color_space_by_index ( int index) const
pure virtual

Get color space with the given index within the sorted array. This function allows to iterate color spaces in their alphabetical order.

If the index is invalid nullptr is returned.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::ui::colorspaces_menu_draw().

◆ get_xyz_to_scene_linear_matrix()

virtual float3x3 blender::ocio::Config::get_xyz_to_scene_linear_matrix ( ) const
pure virtual

Get conversion matrix from XYZ space to the scene linear. TODO(sergey): Specialize which exactly XYZ space it is.

Implemented in blender::ocio::LibOCIOConfig.

Referenced by blender::ocio::calculate_white_point_matrix(), and blender::colormanage_update_matrices().

◆ is_role()

virtual bool blender::ocio::Config::is_role ( StringRefNull name) const
pure virtual

Returns true if the name is a role rather than a color space.

Implemented in blender::ocio::LibOCIOConfig.

◆ set_scene_linear_role()

virtual void blender::ocio::Config::set_scene_linear_role ( StringRefNull name)
pure virtual

◆ switch_to()

virtual bool blender::ocio::Config::switch_to ( Config & new_config,
FunctionRef< bool(const Config &)> validate )
pure virtual

Switch this configuration in-place to #new_config, and take over its color spaces and other data.

Returns false if #validate returned false. This configuration is then left unchanged.

Implemented in blender::ocio::LibOCIOConfig.

◆ switch_to_from_environment()

virtual bool blender::ocio::Config::switch_to_from_environment ( FunctionRef< bool(const Config &)> validate)
pure virtual

Switch this configuration in-place to the configuration from the environment variable, for runtime configuration switching.

Returns false if the configuration could not be created or #validate returned false. This configuration is then left unchanged.

Implemented in blender::ocio::LibOCIOConfig.


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