Blender V5.3
libocio_view.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_string_ref.hh"
10
11#include "OCIO_scope.hh"
12#include "OCIO_view.hh"
13
14#include "libocio_colorspace.hh"
15
16namespace blender::ocio {
17
18struct ScopeInfo;
19
20class LibOCIOView : public View {
21 StringRefNull name_;
22 StringRefNull description_;
23 bool is_hdr_ = false;
24 bool is_data_ = false;
25 bool support_emulation_ = false;
26 Gamut gamut_ = Gamut::Unknown;
28 const LibOCIOColorSpace *display_colorspace_ = nullptr;
29 mutable std::unique_ptr<ScopeInfo> scope_info_;
30
31 public:
32 LibOCIOView(const int index,
33 const StringRefNull name,
35 const bool is_hdr,
36 const bool is_data,
37 const bool support_emulation,
38 const Gamut gamut,
41 : name_(name),
42 description_(description),
43 is_hdr_(is_hdr),
44 is_data_(is_data),
45 support_emulation_(support_emulation),
46 gamut_(gamut),
47 transfer_function_(transfer_function),
48 display_colorspace_(display_colorspace)
49 {
50 this->index = index;
51 }
52
53 StringRefNull name() const override
54 {
55 return name_;
56 }
57
58 StringRefNull description() const override
59 {
60 return description_;
61 }
62
63 bool is_hdr() const override
64 {
65 return is_hdr_;
66 }
67
68 bool support_emulation() const override
69 {
70 return support_emulation_;
71 }
72
73 Gamut gamut() const override
74 {
75 return gamut_;
76 }
77
79 {
80 return transfer_function_;
81 }
82
83 const ColorSpace *display_colorspace() const override
84 {
85 return display_colorspace_;
86 }
87
89 int max_nits() const override;
90
94 const ScopeInfo &scope_info() const override;
95
100 void append_scope_space_transforms(OCIO_NAMESPACE::GroupTransformRcPtr &group,
101 StringRefNull lin_cie_xyz_d65_name) const;
102
104};
105
106} // namespace blender::ocio
Read Blender memory allocation and freeing.
LibOCIOView(const int index, const StringRefNull name, const StringRefNull description, const bool is_hdr, const bool is_data, const bool support_emulation, const Gamut gamut, const TransferFunction transfer_function, const LibOCIOColorSpace *display_colorspace)
Gamut gamut() const override
bool support_emulation() const override
MEM_CXX_CLASS_ALLOC_FUNCS("LibOCIOView")
StringRefNull description() const override
StringRefNull name() const override
bool is_hdr() const override
TransferFunction transfer_function() const override
int max_nits() const override
const ScopeInfo & scope_info() const override
const ColorSpace * display_colorspace() const override
void append_scope_space_transforms(OCIO_NAMESPACE::GroupTransformRcPtr &group, StringRefNull lin_cie_xyz_d65_name) const