viewerwindow: implemented displaying a viewer image fullscreen on another monitor
Implements an extra widget to display images on a separate monitor. Both viewers have separate display color controls since different monitors may conform to different standards/transforms.
This commit is contained in:
@@ -114,6 +114,8 @@ void ViewerGLWidget::SetImage(const QString &fn)
|
||||
|
||||
texture_.Upload(load_buffer_.data());
|
||||
|
||||
emit LoadedBuffer(&load_buffer_);
|
||||
|
||||
doneCurrent();
|
||||
|
||||
has_image_ = true;
|
||||
@@ -128,12 +130,16 @@ void ViewerGLWidget::SetImage(const QString &fn)
|
||||
}
|
||||
|
||||
update();
|
||||
|
||||
if (has_image_) {
|
||||
emit LoadedBuffer(&load_buffer_);
|
||||
} else {
|
||||
emit LoadedBuffer(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerGLWidget::SetSignalCursorColorEnabled(bool e)
|
||||
{
|
||||
qDebug() << e;
|
||||
|
||||
signal_cursor_color_ = e;
|
||||
setMouseTracking(e);
|
||||
|
||||
@@ -149,6 +155,28 @@ void ViewerGLWidget::SetSignalCursorColorEnabled(bool e)
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerGLWidget::SetImageFromLoadBuffer(Frame *in_buffer)
|
||||
{
|
||||
has_image_ = in_buffer;
|
||||
|
||||
if (has_image_) {
|
||||
makeCurrent();
|
||||
|
||||
if (!texture_.IsCreated()
|
||||
|| texture_.width() != in_buffer->width()
|
||||
|| texture_.height() != in_buffer->height()
|
||||
|| texture_.format() != in_buffer->format()) {
|
||||
texture_.Create(context(), in_buffer->width(), in_buffer->height(), in_buffer->format(), in_buffer->data());
|
||||
} else {
|
||||
texture_.Upload(in_buffer->data());
|
||||
}
|
||||
|
||||
doneCurrent();
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
void ViewerGLWidget::SetOCIODisplay(const QString &display)
|
||||
{
|
||||
ocio_display_ = display;
|
||||
@@ -198,6 +226,12 @@ const QString &ViewerGLWidget::ocio_look() const
|
||||
return ocio_look_;
|
||||
}
|
||||
|
||||
void ViewerGLWidget::ConnectSibling(ViewerGLWidget *sibling)
|
||||
{
|
||||
connect(this, &ViewerGLWidget::LoadedBuffer, sibling, &ViewerGLWidget::SetImageFromLoadBuffer, Qt::QueuedConnection);
|
||||
sibling->SetImageFromLoadBuffer(&load_buffer_);
|
||||
}
|
||||
|
||||
void ViewerGLWidget::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QOpenGLWidget::mousePressEvent(event);
|
||||
|
||||
Reference in New Issue
Block a user