2#include <Process/Monitoring/Monitor.hpp>
4#include <Gfx/Graph/TextureKind.hpp>
9#include <Ui/Monitor/LayerHelpers.hpp>
10#include <Ui/Monitor/TextureShapeMonitor.hpp>
11#include <halp/controls.hpp>
12#include <halp/meta.hpp>
36 "For a 3D texture, an array or a cube map: one slice, layer or face, or "
37 "all of them side by side")
40 std::string_view values[2]{
"Single",
"Overview"};
41 Layout init{Layout::Single};
45struct SliceControl : halp::hslider_f32<"Slice", halp::range{0., 1., 0.5}>
48 description,
"Depth of the slice of a 3D texture shown in Single, from 0 to 1")
51struct LayerControl : halp::spinbox_i32<"Layer", halp::range{0, 2047, 0}>
55 "Layer of an array shown in Single, or face of a cube map: 0 to 5 for "
56 "+X, -X, +Y, -Y, +Z, -Z")
62 m.shape.store(s.pack(), std::memory_order_relaxed);
66 return score::gfx::TextureShape::unpack(m.shape.load(std::memory_order_relaxed));
75 layout == Layout::Overview ? score::gfx::TextureLayout::Overview
76 :
score::gfx::TextureLayout::Single,
85 std::size_t first = p.inlets().
size();
86 for(std::size_t i = 0; i < p.inlets().size(); i++)
87 if(p.inlets()[i]->name() == QStringLiteral(
"Layout"))
95 shape, enumValue(
controlInlet(p, first), Layout::Single, Layout::Overview),
96 floatValue(slice, 0.5f), layer ? ossia::convert<int>(layer->value()) : 0);
107 if(!shown.layered() || shown.shape.empty())
109 lines << shown.shape.description();
114 const int w = shown.shape.width, h = shown.shape.height;
115 const int x = std::clamp(
int(pt.u * w), 0, w - 1);
116 const int y = std::clamp(
int(pt.v * h), 0, h - 1);
117 lines << QStringLiteral(
"%1: %2, %3").arg(shown.shape.layerName(pt.layer)).arg(x).arg(y);
119 else if(!shown.overview())
120 lines << shown.shape.layerName(shown.index);
The Process class.
Definition score-lib-process/Process/Process.hpp:82
Definition BufferDecode.hpp:16
const Process::ControlInlet * controlInlet(const Process::ProcessModel &p, std::size_t index) noexcept
Definition LayerHelpers.hpp:36
QStringList describeShown(const score::gfx::ShownTexture &shown, std::optional< QPointF > at={})
Definition TextureLayers.hpp:104
void publish(TextureShapeMonitor &m, const score::gfx::TextureShape &s) noexcept
The node tells the views the texture it got.
Definition TextureLayers.hpp:60
Base toolkit upon which the software is built.
Definition Application.cpp:83
Definition TextureLayers.hpp:52
Definition TextureLayers.hpp:33
Definition TextureLayers.hpp:46
Definition TextureShapeMonitor.hpp:12
Definition MIDISync.hpp:149
Definition TextureKind.hpp:110
Definition TextureKind.hpp:77
static ShownTexture of(TextureShape shape, TextureLayout layout, double slice, int layer) noexcept
Definition TextureKind.cpp:89
QSize size(int max_side) const noexcept
Size of the image shown, at most max_side pixels wide and high.
Definition TextureKind.cpp:137
Definition TextureKind.hpp:31