Widget to draw rendered output of a session.
More...
#include <OutputPreview.h>
Widget to draw rendered output of a session.
omni::ui::OutputPreview::OutputPreview |
( |
QWidget * |
_parent = nullptr | ) |
|
32 TransformedRect<OutputPreview>(
this)
omni::ui::OutputPreview::~OutputPreview |
( |
| ) |
|
void omni::ui::OutputPreview::dataModelChanged |
( |
| ) |
|
|
signal |
void omni::ui::OutputPreview::dataToFrontend |
( |
| ) |
|
|
privatevirtual |
QRect omni::ui::OutputPreview::desktopRect |
( |
| ) |
const |
|
virtual |
Return desktop rectangle.
Implements omni::ui::mixin::TransformedRect< OutputPreview >.
42 using namespace render;
43 auto& _exportSettings =
dataModel()->exportSettings();
45 QRect _rect = _exportSettings.excludeUnassignedProjectors()
46 ?
dataModel()->screenSetup().desktopRect()
47 :
dataModel()->screenSetup().combinedDesktopRect();
49 if (_exportSettings.outputType() == OutputType::PLAIN_IMAGE) {
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
int verticalMultiplier() const
Definition: OutputPreview.cpp:159
void omni::ui::OutputPreview::drawBorder |
( |
QColor |
_color, |
|
|
QRect const & |
_rect, |
|
|
QPoint & |
_capPos, |
|
|
QString const & |
_caption |
|
) |
| |
|
private |
void omni::ui::OutputPreview::drawScreen |
( |
QPainter & |
_p, |
|
|
QScreen const * |
_screen |
|
) |
| |
|
private |
145 auto& _screenSetup =
dataModel()->screenSetup();
147 _p.setPen(QPen(QColor(
"#FFFFFF")));
148 _p.setBrush(Qt::NoBrush);
149 auto _rect = _screenSetup.screenGeometry(_screen);
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
int verticalMultiplier() const
Definition: OutputPreview.cpp:159
QRect desktopRect() const
Return desktop rectangle.
Definition: OutputPreview.cpp:39
void omni::ui::OutputPreview::drawTuning |
( |
QPainter & |
_p, |
|
|
proj::Tuning const * |
_tuning |
|
) |
| |
|
private |
112 auto & _screenSetup =
dataModel()->screenSetup();
114 QRectF _imageRect(_tuning->contentGeometry().translated(-
ScreenSetup::desktopRect().topLeft() + _tuning->screenGeometry().topLeft()));
117 auto& _exportSettings =
dataModel()->exportSettings();
119 proj::Calibration _calib(_exportSettings.outputMode());
120 _calib.setRenderSize(_tuningImageRect.size());
121 _calib.render(*_tuning);
126 _image = _calib.toImage();
128 _image = _calib.toPreviewImage();
131 _p.drawImage(_tuningImageRect.topLeft(), _image);
132 _p.setPen(QPen(_tuning->color(), 2));
133 _p.setBrush(Qt::NoBrush);
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
QRect desktopRect() const
Pure virtual method which returns overall desktop rect.
Definition: ScreenSetup.h:55
int verticalMultiplier() const
Definition: OutputPreview.cpp:159
bool omni::ui::OutputPreview::frontendToData |
( |
| ) |
|
|
inlineprivatevirtual |
QRect omni::ui::OutputPreview::getRectForTuning |
( |
proj::Tuning const * |
| ) |
|
|
private |
Return non transformed rectangle for tuning.
void omni::ui::OutputPreview::paintEvent |
( |
QPaintEvent * |
_event | ) |
|
|
protected |
67 auto& _screenSetup =
dataModel()->screenSetup();
68 auto& _exportSettings =
dataModel()->exportSettings();
70 auto _rect = this->rect();
72 QPainter _painter(
this);
73 _painter.setBrush(QBrush(
"#080808"));
74 _painter.setPen(Qt::NoPen);
75 _painter.drawRect(_rect);
77 QRectF _imageRect(0, 0,
image_.width(),
image_.height());
80 auto _screens = _screenSetup.usedScreens();
82 if (_screens.empty()) {
83 QFont _font(
"Helvetica",30 / devicePixelRatio());
84 _painter.setFont(_font);
85 _painter.setPen(QPen(
"#ffffff"));
86 _painter.setBrush(QBrush(
"#cccccc"));
87 _painter.drawText(rect(),Qt::AlignCenter,
"Nothing to export!");
91 for (
auto& _screen : _screens) {
95 for (
auto& _tuning :
dataModel()->tunings()) {
96 if (!_tuning->hasScreen() && _exportSettings.excludeUnassignedProjectors())
continue;
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
QImage image_
Definition: OutputPreview.h:78
void drawScreen(QPainter &, QScreen const *)
Definition: OutputPreview.cpp:144
void drawTuning(QPainter &, proj::Tuning const *)
Definition: OutputPreview.cpp:110
bool needsUpdate_
Definition: OutputPreview.h:77
void omni::ui::OutputPreview::resizeEvent |
( |
QResizeEvent * |
_event | ) |
|
|
protected |
void triggerUpdate()
Definition: OutputPreview.cpp:56
void omni::ui::OutputPreview::timerEvent |
( |
QTimerEvent * |
| ) |
|
|
protected |
bool needsUpdate_
Definition: OutputPreview.h:77
void omni::ui::OutputPreview::triggerUpdate |
( |
| ) |
|
|
slot |
bool needsUpdate_
Definition: OutputPreview.h:77
int omni::ui::OutputPreview::verticalMultiplier |
( |
| ) |
const |
|
private |
160 auto& _exportSettings =
dataModel()->exportSettings();
162 using namespace render;
164 if (_exportSettings.outputType() != OutputType::PLAIN_IMAGE) {
168 switch (_exportSettings.mappingOutputMode()) {
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
QImage omni::ui::OutputPreview::image_ |
|
private |
bool omni::ui::OutputPreview::needsUpdate_ = true |
|
private |
int omni::ui::OutputPreview::timerId_ = 0 |
|
private |
The documentation for this class was generated from the following files: