Blender V5.0
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#if defined(WITH_OPENCOLORIO)
8
9# include "MEM_guardedalloc.h"
10
11# include "BLI_string_ref.hh"
12
13# include "OCIO_view.hh"
14
15# include "libocio_colorspace.hh"
16
17namespace blender::ocio {
18
19class LibOCIOView : public View {
20 StringRefNull name_;
21 StringRefNull description_;
22 bool is_hdr_ = false;
23 bool support_emulation_ = false;
24 Gamut gamut_ = Gamut::Unknown;
25 TransferFunction transfer_function_ = TransferFunction::Unknown;
26 const LibOCIOColorSpace *display_colorspace_ = nullptr;
27
28 public:
29 LibOCIOView(const int index,
30 const StringRefNull name,
31 const StringRefNull description,
32 const bool is_hdr,
33 const bool support_emulation,
34 const Gamut gamut,
35 const TransferFunction transfer_function,
36 const LibOCIOColorSpace *display_colorspace)
37 : name_(name),
38 description_(description),
39 is_hdr_(is_hdr),
40 support_emulation_(support_emulation),
41 gamut_(gamut),
42 transfer_function_(transfer_function),
43 display_colorspace_(display_colorspace)
44 {
45 this->index = index;
46 }
47
48 StringRefNull name() const override
49 {
50 return name_;
51 }
52
53 StringRefNull description() const override
54 {
55 return description_;
56 }
57
58 bool is_hdr() const override
59 {
60 return is_hdr_;
61 }
62
63 bool support_emulation() const override
64 {
65 return support_emulation_;
66 }
67
68 Gamut gamut() const override
69 {
70 return gamut_;
71 }
72
73 TransferFunction transfer_function() const override
74 {
75 return transfer_function_;
76 }
77
78 const ColorSpace *display_colorspace() const override
79 {
80 return display_colorspace_;
81 }
82
83 MEM_CXX_CLASS_ALLOC_FUNCS("LibOCIOView");
84};
85
86} // namespace blender::ocio
87
88#endif
blender::ocio::ColorSpace ColorSpace
Definition BLF_api.hh:38
Read Guarded memory(de)allocation.
const char * name