Blender V4.5
OCIO_config.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include <memory>
8
11#include "BLI_string_ref.hh"
12
13namespace blender::ocio {
14
15class ColorSpace;
16class Display;
17class Look;
18class CPUProcessor;
19class GPUShaderBinder;
20
33
34class Config {
35 public:
36 /* -------------------------------------------------------------------- */
39
40 virtual ~Config() = default;
41
46 static std::unique_ptr<Config> create_from_environment();
47
52 static std::unique_ptr<Config> create_from_file(StringRefNull filename);
53
63 static std::unique_ptr<Config> create_fallback();
64
66
67 /* -------------------------------------------------------------------- */
70
74 virtual float3 get_default_luma_coefs() const = 0;
75
81
86 virtual const char *get_color_space_from_filepath(const char *filepath) const = 0;
87
89
90 /* -------------------------------------------------------------------- */
93
99 virtual const ColorSpace *get_color_space(StringRefNull name) const = 0;
100
104 virtual int get_num_color_spaces() const = 0;
105
110 virtual const ColorSpace *get_color_space_by_index(int index) const = 0;
111
118 virtual const ColorSpace *get_sorted_color_space_by_index(int index) const = 0;
119
121
122 /* -------------------------------------------------------------------- */
125
129 virtual const Display *get_default_display() const = 0;
130
135 virtual const Display *get_display_by_name(StringRefNull name) const = 0;
136
140 virtual int get_num_displays() const = 0;
141
146 virtual const Display *get_display_by_index(int index) const = 0;
147
149
150 /* -------------------------------------------------------------------- */
153
159 StringRefNull view) const = 0;
160
162
163 /* -------------------------------------------------------------------- */
166
171 virtual const Look *get_look_by_name(StringRefNull name) const = 0;
172
176 virtual int get_num_looks() const = 0;
177
182 virtual const Look *get_look_by_index(int index) const = 0;
183
185
186 /* -------------------------------------------------------------------- */
189
194 virtual std::shared_ptr<const CPUProcessor> get_display_cpu_processor(
195 const DisplayParameters &display_parameters) const = 0;
196
200 virtual std::shared_ptr<const CPUProcessor> get_cpu_processor(
201 StringRefNull from_colorspace, StringRefNull to_colorspace) const = 0;
202
204
205 /* -------------------------------------------------------------------- */
208
212 virtual const GPUShaderBinder &get_gpu_shader_binder() const = 0;
213
215};
216
217} // namespace blender::ocio
static AppView * view
virtual const Look * get_look_by_name(StringRefNull name) const =0
virtual float3 get_default_luma_coefs() const =0
virtual const Look * get_look_by_index(int index) const =0
virtual const ColorSpace * get_sorted_color_space_by_index(int index) const =0
virtual int get_num_looks() const =0
static std::unique_ptr< Config > create_fallback()
Definition config.cc:35
virtual const Display * get_display_by_index(int index) const =0
virtual ~Config()=default
virtual const GPUShaderBinder & get_gpu_shader_binder() const =0
virtual const ColorSpace * get_color_space_by_index(int index) const =0
virtual const ColorSpace * get_display_view_color_space(StringRefNull display, StringRefNull view) const =0
virtual const Display * get_display_by_name(StringRefNull name) const =0
virtual const char * get_color_space_from_filepath(const char *filepath) const =0
virtual int get_num_color_spaces() const =0
virtual std::shared_ptr< const CPUProcessor > get_cpu_processor(StringRefNull from_colorspace, StringRefNull to_colorspace) const =0
virtual const Display * get_default_display() const =0
virtual const ColorSpace * get_color_space(StringRefNull name) const =0
static std::unique_ptr< Config > create_from_environment()
Definition config.cc:15
virtual int get_num_displays() const =0
virtual float3x3 get_xyz_to_scene_linear_matrix() const =0
virtual std::shared_ptr< const CPUProcessor > get_display_cpu_processor(const DisplayParameters &display_parameters) const =0
static std::unique_ptr< Config > create_from_file(StringRefNull filename)
Definition config.cc:24
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3