Blender V5.0
fallback_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 "MEM_guardedalloc.h"
8
9#include "BLI_vector.hh"
10
11#include "OCIO_config.hh"
12
18
19namespace blender::ocio {
20
21class ColorSpace;
22class Display;
23class View;
24
25class FallbackConfig : public Config {
26 /* Color spaces in this configuration. */
27 FallbackColorSpace colorspace_linear_{0, "Linear", FallbackColorSpace::Type::LINEAR};
28 FallbackColorSpace colorspace_data_{1, "Non-Color", FallbackColorSpace::Type::DATA};
29 FallbackColorSpace colorspace_srgb_{2, "sRGB", FallbackColorSpace::Type::SRGB};
30
31 FallbackDefaultDisplay default_display_{&colorspace_srgb_};
32 FallbackDefaultLook default_look_;
33
34 /* Vectors that contain non-owning pointers to the color spaces and display. */
35 Vector<const ColorSpace *> color_spaces_{
36 &colorspace_linear_, &colorspace_data_, &colorspace_srgb_};
37
38 FallbackProcessorCache processor_cache_;
39 FallbackGPUShaderBinder gpu_shader_binder_{*this};
40
41 public:
42 /* Color space information. */
43 float3 get_default_luma_coefs() const override;
45 const char *get_color_space_from_filepath(const char *filepath) const override;
46
47 /* Color space API. */
48 const ColorSpace *get_color_space(StringRefNull name) const override;
49 int get_num_color_spaces() const override;
50 const ColorSpace *get_color_space_by_index(int index) const override;
51 const ColorSpace *get_sorted_color_space_by_index(int index) const override;
52 const ColorSpace *get_color_space_by_interop_id(StringRefNull interop_id) const override;
54
55 /* Working space API. */
57
58 /* Display API. */
59 const Display *get_default_display() const override;
60 const Display *get_display_by_name(StringRefNull name) const override;
61 int get_num_displays() const override;
62 const Display *get_display_by_index(int index) const override;
63
64 /* Display colorspace API. */
66 StringRefNull view) const override;
67
68 /* Look API. */
69 const Look *get_look_by_name(StringRefNull name) const override;
70 int get_num_looks() const override;
71 const Look *get_look_by_index(int index) const override;
72
73 /* Processor API. */
74 std::shared_ptr<const CPUProcessor> get_display_cpu_processor(
75 const DisplayParameters &display_parameters) const override;
76 std::shared_ptr<const CPUProcessor> get_cpu_processor(
77 StringRefNull from_colorspace, StringRefNull to_colorspace) const override;
78
79 /* Processor API. */
80 const GPUShaderBinder &get_gpu_shader_binder() const override;
81
82 MEM_CXX_CLASS_ALLOC_FUNCS("FallbackConfig");
83};
84
85} // namespace blender::ocio
static AppView * view
Read Guarded memory(de)allocation.
const char * get_color_space_from_filepath(const char *filepath) const override
std::shared_ptr< const CPUProcessor > get_cpu_processor(StringRefNull from_colorspace, StringRefNull to_colorspace) const override
const ColorSpace * get_color_space(StringRefNull name) const override
int get_num_displays() const override
const Look * get_look_by_index(int index) const override
std::shared_ptr< const CPUProcessor > get_display_cpu_processor(const DisplayParameters &display_parameters) const override
const Display * get_display_by_name(StringRefNull name) const override
const ColorSpace * get_sorted_color_space_by_index(int index) const override
const ColorSpace * get_color_space_for_hdr_image(StringRefNull name) const override
void set_scene_linear_role(StringRefNull name) override
const Look * get_look_by_name(StringRefNull name) const override
const ColorSpace * get_color_space_by_interop_id(StringRefNull interop_id) const override
const Display * get_default_display() const override
int get_num_color_spaces() const override
float3 get_default_luma_coefs() const override
int get_num_looks() const override
const ColorSpace * get_color_space_by_index(int index) const override
const GPUShaderBinder & get_gpu_shader_binder() const override
const ColorSpace * get_display_view_color_space(StringRefNull display, StringRefNull view) const override
float3x3 get_xyz_to_scene_linear_matrix() const override
MEM_CXX_CLASS_ALLOC_FUNCS("FallbackConfig")
const Display * get_display_by_index(int index) const override
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3
const char * name