42 void attach(
GfxContext* ctx, port_index producer, QSize size);
44 void setProducer(port_index producer);
45 void setSize(QSize size);
48 bool attached()
const noexcept;
49 port_index producer()
const noexcept {
return m_producer; }
52 bool tapped()
const noexcept;
54 bool onHub()
const noexcept;
62 static QRectF
fit(
const QRectF& box, QSize size)
noexcept
66 const QSizeF s = QSizeF(size).scaled(box.size(), Qt::KeepAspectRatio);
67 return {box.center().x() - s.width() / 2., box.center().y() - s.height() / 2., s.width(), s.height()};
71 QPointer<GfxContext> m_ctx;
72 port_index m_producer{-1, -1};
74 std::shared_ptr<QRhiReadbackResult> m_readback;
Definition GfxContext.hpp:74
What a texture outlet produces, as an image any view can paint: an inspector widget,...
Definition TexturePreview.hpp:33
static QRectF fit(const QRectF &box, QSize size) noexcept
Where an image of size goes in box: as large as fits, centred.
Definition TexturePreview.hpp:62