viewer: implemented basic deinterlace
Implements a very basic GLSL deinterlace that simply halves the vertical resolution and then interpolates between the fields. This can be toggled on or off. The reasons for being so basic is: - Speed, very quick code running in OpenGL - It would seem the highest quality deinterlacers are temporally based which doesn't make much sense for the viewer, particularly since we can't double the frame rate since our timecode is fixed to the frames. Higher quality interlacing/deinterlacing will be present in the actual renderer.
This commit is contained in:
@@ -43,7 +43,8 @@ ViewerDisplayWidget::ViewerDisplayWidget(QWidget *parent) :
|
||||
signal_cursor_color_(false),
|
||||
gizmos_(nullptr),
|
||||
gizmo_click_(false),
|
||||
last_loaded_buffer_(nullptr)
|
||||
last_loaded_buffer_(nullptr),
|
||||
deinterlace_(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -86,6 +87,12 @@ void ViewerDisplayWidget::SetImage(FramePtr in_buffer)
|
||||
update();
|
||||
}
|
||||
|
||||
void ViewerDisplayWidget::SetDeinterlacing(bool e)
|
||||
{
|
||||
deinterlace_ = e;
|
||||
update();
|
||||
}
|
||||
|
||||
const ViewerSafeMarginInfo &ViewerDisplayWidget::GetSafeMargin() const
|
||||
{
|
||||
return safe_margin_;
|
||||
@@ -212,6 +219,12 @@ void ViewerDisplayWidget::paintGL()
|
||||
// Bind retrieved texture
|
||||
f->glBindTexture(GL_TEXTURE_2D, texture_.texture());
|
||||
|
||||
// Set some parameters
|
||||
color_service()->pipeline()->bind();
|
||||
color_service()->pipeline()->setUniformValue("ove_resolution", texture_.width(), texture_.height());
|
||||
color_service()->pipeline()->setUniformValue("ove_deinterlace", deinterlace_);
|
||||
color_service()->pipeline()->release();
|
||||
|
||||
// Blit using the color service
|
||||
color_service()->ProcessOpenGL(true, matrix_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user