added functions to override the resolution and matrix transform of the viewer widget
While in most circumstances these shouldn't be used, they're useful for showing things like export previews
This commit is contained in:
@@ -185,6 +185,16 @@ void ViewerWidget::SetColorMenuEnabled(bool enabled)
|
||||
gl_widget_->SetColorMenuEnabled(enabled);
|
||||
}
|
||||
|
||||
void ViewerWidget::SetOverrideSize(int width, int height)
|
||||
{
|
||||
SizeChangedSlot(width, height);
|
||||
}
|
||||
|
||||
void ViewerWidget::SetMatrix(const QMatrix4x4 &mat)
|
||||
{
|
||||
gl_widget_->SetMatrix(mat);
|
||||
}
|
||||
|
||||
void ViewerWidget::SetTexture(OpenGLTexturePtr tex)
|
||||
{
|
||||
if (tex == nullptr) {
|
||||
|
||||
@@ -71,6 +71,10 @@ public:
|
||||
|
||||
void SetColorMenuEnabled(bool enabled);
|
||||
|
||||
void SetOverrideSize(int width, int height);
|
||||
|
||||
void SetMatrix(const QMatrix4x4& mat);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Set the texture to draw and draw it
|
||||
|
||||
@@ -69,6 +69,12 @@ void ViewerGLWidget::DisconnectColorManager()
|
||||
ConnectColorManager(nullptr);
|
||||
}
|
||||
|
||||
void ViewerGLWidget::SetMatrix(const QMatrix4x4 &mat)
|
||||
{
|
||||
matrix_ = mat;
|
||||
update();
|
||||
}
|
||||
|
||||
void ViewerGLWidget::SetOCIODisplay(const QString &display)
|
||||
{
|
||||
ocio_display_ = display;
|
||||
@@ -135,7 +141,7 @@ void ViewerGLWidget::paintGL()
|
||||
f->glBindTexture(GL_TEXTURE_2D, texture_);
|
||||
|
||||
// Blit using the pipeline retrieved in initializeGL()
|
||||
olive::gl::OCIOBlit(pipeline_, ocio_lut_, true);
|
||||
olive::gl::OCIOBlit(pipeline_, ocio_lut_, true, matrix_);
|
||||
|
||||
// Release retrieved texture
|
||||
f->glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
@@ -94,6 +94,13 @@ public:
|
||||
*/
|
||||
void DisconnectColorManager();
|
||||
|
||||
/**
|
||||
* @brief Set the transformation matrix to draw with
|
||||
*
|
||||
* Set this if you want the drawing to pass through some sort of transform (most of the time you won't want this).
|
||||
*/
|
||||
void SetMatrix(const QMatrix4x4& mat);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Set the texture to draw and draw it
|
||||
@@ -195,6 +202,11 @@ private:
|
||||
*/
|
||||
ColorProcessorPtr color_service_;
|
||||
|
||||
/**
|
||||
* @brief Drawing matrix (defaults to identity)
|
||||
*/
|
||||
QMatrix4x4 matrix_;
|
||||
|
||||
bool color_menu_enabled_;
|
||||
|
||||
private slots:
|
||||
|
||||
Reference in New Issue
Block a user