transform effect complete

This commit is contained in:
itsmattkc
2019-09-10 12:39:08 +10:00
parent 9ff4a81ec8
commit fc4ce3b26e
2 changed files with 17 additions and 1 deletions
+3
View File
@@ -95,6 +95,9 @@ QVariant TransformDistort::Value(NodeOutput *output, const rational &time)
// Scale
mat.scale(scale_input_->get_value(time).value<QVector2D>()*0.01f);
// Anchor Point
mat.translate(anchor_input_->get_value(time).value<QVector2D>() * 0.01f);
return mat;
}
+14 -1
View File
@@ -233,8 +233,21 @@ QVariant MediaInput::Value(NodeOutput *output, const rational &time)
// Draw with the internal texture
internal_tex_.Bind();
QMatrix4x4 transform;
float sequence_aspect_ratio = static_cast<float>(renderer->width()) / static_cast<float>(renderer->height());
float media_aspect_ratio = static_cast<float>(frame_->width()) / static_cast<float>(frame_->height());
transform.scale(1.0f / sequence_aspect_ratio, 1.0f);
// Input transform
transform *= matrix_input_->get_value(time).value<QMatrix4x4>();
transform.scale(media_aspect_ratio, 1.0f);
/*transform.scale(static_cast<float>(frame_->width()) / static_cast<float>(renderer->width()),
static_cast<float>(frame_->height()) / static_cast<float>(renderer->height()));*/
// Use pipeline to blit using transformation matrix from input
QMatrix4x4 transform = matrix_input_->get_value(time).value<QMatrix4x4>();
if (renderer->mode() == olive::RenderMode::kOffline) {
olive::gl::OCIOBlit(pipeline_, ocio_texture_, false, transform);
} else {