Blender V5.3
sequencer_scopes.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_array.hh"
12#include "BLI_math_base.hh"
14#include "BLI_utility_mixins.hh"
15
16namespace blender {
17
20struct ImBuf;
21
22namespace ed::vse {
23
25 /* Number of bins covering 0..1 scope space range. */
26 static constexpr int NUM_BINS = 256;
27 /* R,G,B counts for each bin. */
29 /* Maximum R,G,B counts across all bins. */
31
32 void calc_from_ibuf(const ImBuf *ibuf,
33 const ColorManagedViewSettings &view_settings,
34 const ColorManagedDisplaySettings &display_settings);
35
36 static int float_to_bin(float f)
37 {
38 int bin = int(f * NUM_BINS);
39 return math::clamp(bin, 0, NUM_BINS - 1);
40 }
41
42 static float bin_to_float(int bin)
43 {
44 return float(bin) / (NUM_BINS - 1);
45 }
46};
47
48struct SeqScopes : public NonCopyable {
49 const ImBuf *last_ibuf = nullptr;
52
53 SeqScopes() = default;
54 ~SeqScopes();
55
56 void cleanup();
57};
58
59} // namespace ed::vse
60} // namespace blender
NonCopyable(const NonCopyable &other)=delete
T clamp(const T &a, const T &min, const T &max)
BMesh Iterators.
VecBase< uint32_t, 3 > uint3
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
void calc_from_ibuf(const ImBuf *ibuf, const ColorManagedViewSettings &view_settings, const ColorManagedDisplaySettings &display_settings)