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