Blender V4.5
libocio_display.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 <memory>
10
11# include "MEM_guardedalloc.h"
12
13# include "BLI_vector.hh"
14
15# include "OCIO_display.hh"
16
18
19# include "libocio_view.hh"
20
21namespace blender::ocio {
22
23class LibOCIOConfig;
24
25class LibOCIODisplay : public Display {
26 /* Store by pointer to allow move semantic.
27 * In practice this must never be nullable. */
28 const LibOCIOConfig *config_ = nullptr;
29
30 StringRefNull name_;
32
33 CPUProcessorCache to_scene_linear_cpu_processor_;
34 CPUProcessorCache from_scene_linear_cpu_processor_;
35
36 public:
37 LibOCIODisplay(int index, const LibOCIOConfig &config);
38 LibOCIODisplay(const LibOCIODisplay &other) = delete;
39 LibOCIODisplay(LibOCIODisplay &&other) noexcept = default;
40
41 ~LibOCIODisplay() = default;
42
43 LibOCIODisplay &operator=(const LibOCIODisplay &other) = delete;
44 LibOCIODisplay &operator=(LibOCIODisplay &&other) = default;
45
46 StringRefNull name() const override
47 {
48 return name_;
49 }
50
51 const View *get_default_view() const override
52 {
53 /* Matches the behavior of OpenColorIO, but avoids using API which potentially throws exception
54 * and requires string lookups. */
55 return get_view_by_index(0);
56 }
57
58 const View *get_view_by_name(StringRefNull name) const override;
59 int get_num_views() const override;
60 const View *get_view_by_index(int index) const override;
61
62 const CPUProcessor *get_to_scene_linear_cpu_processor() const override;
63 const CPUProcessor *get_from_scene_linear_cpu_processor() const override;
64
65 MEM_CXX_CLASS_ALLOC_FUNCS("LibOCIOConfig");
66};
67
68} // namespace blender::ocio
69
70#endif
float[3] Vector
static void View(GHOST_IWindow *window, bool stereo, int eye=0)
Read Guarded memory(de)allocation.
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)