Blender V4.5
fallback_colorspace.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 <string>
8
9#include "OCIO_colorspace.hh"
10
12
13namespace blender::ocio {
14
16 std::string name_;
17
18 public:
19 enum class Type {
23 };
24
25 FallbackColorSpace(const int index, const StringRefNull name, const Type type) : type_(type)
26 {
27 this->index = index;
28 name_ = name;
29 }
30
31 StringRefNull name() const override
32 {
33 return name_;
34 }
35 StringRefNull description() const override
36 {
37 return "";
38 }
39
40 bool is_invertible() const override
41 {
42 return true;
43 }
44
45 bool is_scene_linear() const override
46 {
47 return type_ == Type::LINEAR;
48 }
49 bool is_srgb() const override
50 {
51 return type_ == Type::SRGB;
52 }
53
54 bool is_data() const override
55 {
56 return type_ == Type::DATA;
57 }
58
60 {
61 if (type_ == Type::SRGB) {
63 return &processor;
64 }
65
66 static FallbackNOOPCPUProcessor processor;
67 return &processor;
68 }
69
71 {
72 if (type_ == Type::SRGB) {
74 return &processor;
75 }
76
77 static FallbackNOOPCPUProcessor processor;
78 return &processor;
79 }
80
81 private:
82 Type type_;
83};
84
85} // namespace blender::ocio
StringRefNull description() const override
FallbackColorSpace(const int index, const StringRefNull name, const Type type)
CPUProcessor * get_from_scene_linear_cpu_processor() const override
StringRefNull name() const override
const CPUProcessor * get_to_scene_linear_cpu_processor() const override
#define DATA(_y, _x)
FallbackCustomCPUProcessor< linearrgb_to_srgb_v3_v3 > FallbackLinearRGBToSRGBCPUProcessor
FallbackCustomCPUProcessor< srgb_to_linearrgb_v3_v3 > FallbackSRGBToLinearRGBCPUProcessor