Blender V5.3
blender::ocio::LibOCIOConfig Class Reference

#include <libocio_config.hh>

Inherits blender::ocio::Config.

Classes

struct  ColorSpacesRetained

Public Member Functions

const OCIO_NAMESPACE::ConstConfigRcPtr & get_ocio_config () const
 MEM_CXX_CLASS_ALLOC_FUNCS ("LibOCIOConfig")
Color space information
float3 get_default_luma_coefs () const override
float3x3 get_xyz_to_scene_linear_matrix () const override
const char * get_color_space_from_filepath (const char *filepath) const override
Color space API
const ColorSpace * get_color_space (StringRefNull name) const override
int get_num_active_color_spaces () const override
int get_num_all_color_spaces () const override
const ColorSpace * get_color_space_by_index (int index) const override
const ColorSpace * get_sorted_color_space_by_index (int index) const override
const ColorSpace * get_color_space_by_interop_id (StringRefNull interop_id) const override
bool is_role (StringRefNull name) const override
Working space API
void set_scene_linear_role (StringRefNull name) override
Display API
const Display * get_default_display () const override
const Display * get_display_by_name (StringRefNull name) const override
int get_num_displays () const override
const Display * get_display_by_index (int index) const override
Display colorspace API
const ColorSpace * get_display_view_color_space (StringRefNull display, StringRefNull view) const override
Look API
const Look * get_look_by_name (StringRefNull name) const override
int get_num_looks () const override
const Look * get_look_by_index (int index) const override
Processor API
std::shared_ptr< const CPUProcessor > get_display_cpu_processor (const DisplayParameters &display_parameters) const override
std::shared_ptr< const CPUProcessor > get_cpu_processor (StringRefNull from_colorspace, StringRefNull to_colorspace) const override
const GPUShaderBinder & get_gpu_shader_binder () const override
Public Member Functions inherited from blender::ocio::Config
virtual ~Config ()=default

Static Public Member Functions

static std::unique_ptr< Config > create_fallback ()
static std::unique_ptr< Config > create_from_environment ()
static std::unique_ptr< Config > create_fallback ()

Construction

 ~LibOCIOConfig () override
bool switch_to_from_environment (FunctionRef< bool(const Config &)> validate) override
bool switch_to (Config &new_config, FunctionRef< bool(const Config &)> validate) override
static std::unique_ptr< Config > create_from_environment ()

HDR image API

const ColorSpace * get_color_space_for_hdr_image (StringRefNull name) const override

Detailed Description

Definition at line 29 of file libocio_config.hh.

Constructor & Destructor Documentation

◆ ~LibOCIOConfig()

Member Function Documentation

◆ create_fallback()

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

◆ create_from_environment()

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

◆ get_color_space()

const ColorSpace * blender::ocio::LibOCIOConfig::get_color_space ( StringRefNull name) const
overridevirtual

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.

Implements blender::ocio::Config.

Definition at line 407 of file libocio_config.cc.

References blender::StringRefNull::c_str(), blender::ocio::report_error(), and blender::ocio::report_exception().

Referenced by blender::ocio::display_as_extended_srgb(), blender::ocio::display_as_scope_space(), get_color_space_by_interop_id(), get_color_space_for_hdr_image(), get_display_view_color_space(), blender::ocio::LibOCIODisplay::LibOCIODisplay(), and ~LibOCIOConfig().

◆ get_color_space_by_index()

const ColorSpace * blender::ocio::LibOCIOConfig::get_color_space_by_index ( int index) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 460 of file libocio_config.cc.

Referenced by get_sorted_color_space_by_index(), and ~LibOCIOConfig().

◆ get_color_space_by_interop_id()

const ColorSpace * blender::ocio::LibOCIOConfig::get_color_space_by_interop_id ( StringRefNull interop_id) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 485 of file libocio_config.cc.

References get_color_space().

Referenced by ~LibOCIOConfig().

◆ get_color_space_for_hdr_image()

const ColorSpace * blender::ocio::LibOCIOConfig::get_color_space_for_hdr_image ( StringRefNull name) const
overridevirtual

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.

Implements blender::ocio::Config.

Definition at line 514 of file libocio_config.cc.

References get_color_space(), and blender::ocio::ColorSpace::interop_id().

Referenced by blender::ocio::adjust_for_hdr_image_file(), and ~LibOCIOConfig().

◆ get_color_space_from_filepath()

const char * blender::ocio::LibOCIOConfig::get_color_space_from_filepath ( const char * filepath) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 386 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_cpu_processor()

std::shared_ptr< const CPUProcessor > blender::ocio::LibOCIOConfig::get_cpu_processor ( StringRefNull from_colorspace,
StringRefNull to_colorspace ) const
overridevirtual

Get processor which converts color between given color spaces.

Implements blender::ocio::Config.

Definition at line 729 of file libocio_config.cc.

References blender::StringRefNull::c_str(), and blender::ocio::create_ocio_processor().

Referenced by ~LibOCIOConfig().

◆ get_default_display()

const Display * blender::ocio::LibOCIOConfig::get_default_display ( ) const
overridevirtual

Get the default display in this configuration.

Implements blender::ocio::Config.

Definition at line 621 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_default_luma_coefs()

float3 blender::ocio::LibOCIOConfig::get_default_luma_coefs ( ) const
overridevirtual

Get the default coefficients for computing luma.

Implements blender::ocio::Config.

Definition at line 323 of file libocio_config.cc.

References blender::ocio::report_exception().

Referenced by ~LibOCIOConfig().

◆ get_display_by_index()

const Display * blender::ocio::LibOCIOConfig::get_display_by_index ( int index) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 647 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_display_by_name()

const Display * blender::ocio::LibOCIOConfig::get_display_by_name ( StringRefNull name) const
overridevirtual

◆ get_display_cpu_processor()

std::shared_ptr< const CPUProcessor > blender::ocio::LibOCIOConfig::get_display_cpu_processor ( const DisplayParameters & display_parameters) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 718 of file libocio_config.cc.

References blender::ocio::create_ocio_display_processor().

Referenced by ~LibOCIOConfig().

◆ get_display_view_color_space()

const ColorSpace * blender::ocio::LibOCIOConfig::get_display_view_color_space ( StringRefNull display,
StringRefNull view ) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 661 of file libocio_config.cc.

References blender::StringRefNull::c_str(), get_color_space(), and blender::ocio::report_exception().

Referenced by ~LibOCIOConfig().

◆ get_gpu_shader_binder()

const GPUShaderBinder & blender::ocio::LibOCIOConfig::get_gpu_shader_binder ( ) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 746 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_look_by_index()

const Look * blender::ocio::LibOCIOConfig::get_look_by_index ( int index) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 704 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_look_by_name()

const Look * blender::ocio::LibOCIOConfig::get_look_by_name ( StringRefNull name) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 688 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_num_active_color_spaces()

int blender::ocio::LibOCIOConfig::get_num_active_color_spaces ( ) const
overridevirtual

Get the number of active color spaces in this configuration.

Implements blender::ocio::Config.

Definition at line 450 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_num_all_color_spaces()

int blender::ocio::LibOCIOConfig::get_num_all_color_spaces ( ) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 455 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_num_displays()

int blender::ocio::LibOCIOConfig::get_num_displays ( ) const
overridevirtual

Get the number of displays in this configuration.

Implements blender::ocio::Config.

Definition at line 642 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_num_looks()

int blender::ocio::LibOCIOConfig::get_num_looks ( ) const
overridevirtual

Get the number of looks in this configuration.

Implements blender::ocio::Config.

Definition at line 699 of file libocio_config.cc.

Referenced by ~LibOCIOConfig().

◆ get_ocio_config()

◆ get_sorted_color_space_by_index()

const ColorSpace * blender::ocio::LibOCIOConfig::get_sorted_color_space_by_index ( int index) const
overridevirtual

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.

Implements blender::ocio::Config.

Definition at line 476 of file libocio_config.cc.

References blender::BLI_assert(), and get_color_space_by_index().

Referenced by ~LibOCIOConfig().

◆ get_xyz_to_scene_linear_matrix()

float3x3 blender::ocio::LibOCIOConfig::get_xyz_to_scene_linear_matrix ( ) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 359 of file libocio_config.cc.

References blender::math::invert(), and blender::ocio::to_scene_linear_matrix().

Referenced by ~LibOCIOConfig().

◆ is_role()

bool blender::ocio::LibOCIOConfig::is_role ( StringRefNull name) const
overridevirtual

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

Implements blender::ocio::Config.

Definition at line 503 of file libocio_config.cc.

References blender::StringRefNull::c_str().

Referenced by ~LibOCIOConfig().

◆ MEM_CXX_CLASS_ALLOC_FUNCS()

blender::ocio::LibOCIOConfig::MEM_CXX_CLASS_ALLOC_FUNCS ( "LibOCIOConfig" )

◆ set_scene_linear_role()

void blender::ocio::LibOCIOConfig::set_scene_linear_role ( StringRefNull name)
overridevirtual

Implements blender::ocio::Config.

Definition at line 588 of file libocio_config.cc.

References blender::StringRefNull::c_str().

Referenced by ~LibOCIOConfig().

◆ switch_to()

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

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.

Implements blender::ocio::Config.

Definition at line 61 of file libocio_config.cc.

Referenced by switch_to_from_environment(), and ~LibOCIOConfig().

◆ switch_to_from_environment()

bool blender::ocio::LibOCIOConfig::switch_to_from_environment ( FunctionRef< bool(const Config &)> validate)
overridevirtual

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.

Implements blender::ocio::Config.

Definition at line 50 of file libocio_config.cc.

References create_from_environment(), and switch_to().

Referenced by ~LibOCIOConfig().


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