Blender V4.5
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"
13#include "BLI_utility_mixins.hh"
14
15struct ImBuf;
16
17namespace blender::ed::vse {
18
20 /* Byte images just have bins for the 0..255 range. */
21 static constexpr int BINS_BYTE = 256;
22 /* Float images spread -0.25..+1.25 range over 512 bins. */
23 static constexpr int BINS_FLOAT = 512;
24 static constexpr float FLOAT_VAL_MIN = -0.25f;
25 static constexpr float FLOAT_VAL_MAX = 1.25f;
28
29 void calc_from_ibuf(const ImBuf *ibuf);
30 bool is_float_hist() const
31 {
32 return data.size() == BINS_FLOAT;
33 }
34};
35
36struct SeqScopes : public NonCopyable {
37 /* Multiplier to map YUV U,V range (+-0.436, +-0.615) to +-0.5 on both axes. */
38 static constexpr float VECSCOPE_U_SCALE = 0.5f / 0.436f;
39 static constexpr float VECSCOPE_V_SCALE = 0.5f / 0.615f;
40
41 const ImBuf *reference_ibuf = nullptr;
43 ImBuf *zebra_ibuf = nullptr;
44 ImBuf *waveform_ibuf = nullptr;
46 ImBuf *vector_ibuf = nullptr;
48
49 SeqScopes() = default;
50 ~SeqScopes();
51
52 void cleanup();
53};
54
58ImBuf *make_zebra_view_from_ibuf(const ImBuf *ibuf, float perc);
59
60} // namespace blender::ed::vse
NonCopyable(const NonCopyable &other)=delete
ImBuf * make_waveform_view_from_ibuf(const ImBuf *ibuf)
ImBuf * make_vectorscope_view_from_ibuf(const ImBuf *ibuf)
ImBuf * make_sep_waveform_view_from_ibuf(const ImBuf *ibuf)
ImBuf * make_zebra_view_from_ibuf(const ImBuf *ibuf, float perc)
VecBase< uint32_t, 3 > uint3
static constexpr float FLOAT_VAL_MAX
static constexpr float FLOAT_VAL_MIN
void calc_from_ibuf(const ImBuf *ibuf)
static constexpr float VECSCOPE_V_SCALE
static constexpr float VECSCOPE_U_SCALE