Blender V5.0
libocio_look.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 <string>
12
13# include "OCIO_look.hh"
14
15# include "../opencolorio.hh"
16
17namespace blender::ocio {
18
19class LibOCIOLook : public Look {
20 OCIO_NAMESPACE::ConstLookRcPtr ocio_look_;
21
22 /* View and interface name for view specific look. */
23 /* TODO(sergey): Use StringRef when all users supports non-null-terminated strings. */
24 std::string view_;
25 std::string ui_name_;
26
27 public:
28 LibOCIOLook(int index, const OCIO_NAMESPACE::ConstLookRcPtr &ocio_look);
29
30 StringRefNull name() const override
31 {
32 if (ocio_look_) {
33 return ocio_look_->getName();
34 }
35 return "None";
36 }
37
38 StringRefNull ui_name() const override
39 {
40 if (ui_name_.empty()) {
41 return name();
42 }
43 return ui_name_;
44 }
45
46 StringRefNull description() const override
47 {
48 if (ocio_look_) {
49 return ocio_look_->getDescription();
50 }
51 return "";
52 }
53
54 StringRefNull view() const override
55 {
56 return view_;
57 }
58
59 StringRefNull process_space() const override
60 {
61 if (ocio_look_) {
62 return ocio_look_->getProcessSpace();
63 }
64 return "";
65 }
66
67 MEM_CXX_CLASS_ALLOC_FUNCS("LibOCIOLook");
68};
69
70} // namespace blender::ocio
71
72#endif
static AppView * view
Read Guarded memory(de)allocation.
const char * name