Skip to content
Snippets Groups Projects
Commit 65262f12 authored by Stéphane Albert's avatar Stéphane Albert
Browse files

BUG: MANTIS-1204: Fixed desynchronized gamma between image-view and quicklook-view.

parent 1aaf39f9
No related branches found
No related tags found
No related merge requests found
......@@ -181,6 +181,15 @@ MainWindow
bool isGLSL = m_ImageView->GetRenderer()->CheckGLCapabilities( &m_GLSL140 );
// MANTIS-1204
// {
//
// Forward GLSL state to quicklook view.
assert( GetQuicklookView()!=NULL );
assert( GetQuicklookView()->GetRenderer()!=NULL );
GetQuicklookView()->GetRenderer()->SetGLSLEnabled( isGLSL );
// }
assert( m_ShaderWidget!=NULL );
......
......@@ -215,6 +215,12 @@ public:
/**
*/
inline bool IsBypassRenderingEnabled() const;
/**
*/
inline bool SetGLSLEnabled( bool );
/**
*/
inline bool IsGLSLEnabled() const;
/**
*/
inline bool ZoomToRegion( const PointType & origin,
......@@ -264,7 +270,8 @@ protected:
AbstractImageViewRenderer( QObject* parent = NULL ) :
QObject( parent ),
m_StackedLayerModel( NULL ),
m_BypassRenderingEnabled( false )
m_BypassRenderingEnabled( false ),
m_GLSLEnabled( true )
{
}
......@@ -330,6 +337,9 @@ private:
/**
*/
bool m_BypassRenderingEnabled: 1;
/**
*/
bool m_GLSLEnabled: 1;
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
......@@ -419,6 +429,28 @@ AbstractImageViewRenderer
return bypass;
}
/*****************************************************************************/
inline
bool
AbstractImageViewRenderer
::IsGLSLEnabled() const
{
return m_GLSLEnabled;
}
/*****************************************************************************/
inline
bool
AbstractImageViewRenderer
::SetGLSLEnabled( bool isEnabled )
{
bool wasEnabled = m_GLSLEnabled;
m_GLSLEnabled = isEnabled;
return wasEnabled;
}
/*****************************************************************************/
inline
void
......
......@@ -197,15 +197,15 @@ ImageViewRenderer
);
}
//
// Set GLSL effects state.
SetGLSLEnabled( isOk );
//
// Return if check has succeeded.
if( isOk )
return true;
//
// Disable GLSL effects.
m_EffectsEnabled = false;
//
// Construct message.
QString message(
......@@ -696,6 +696,8 @@ ImageViewRenderer
imageSettings->SetMaxBlue( settings.GetHighIntensity(RGBW_CHANNEL_BLUE ) );
}
// qDebug() << this << " gamma: " << settings.GetGamma();
imageSettings->SetGamma( settings.GetGamma() );
if( properties==NULL )
......@@ -722,6 +724,10 @@ ImageViewRenderer
if( !fragmentShader.IsNull() )
{
// If this point is reached, shader is not null which means
// that isGLSLEnabled() is true.
assert( IsGLSLEnabled() );
otb::StandardShader::Pointer shader(
otb::DynamicCast< otb::StandardShader >( fragmentShader )
);
......@@ -877,7 +883,7 @@ ImageViewRenderer
// << "\tQString:" << vectorImageModel->GetFilename()
// << "\tstd::string" << QFile::encodeName( vectorImageModel->GetFilename() );
if( m_EffectsEnabled )
if( IsGLSLEnabled() )
{
// qDebug() << "Created shader for" << FromStdString( it->first );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment