diff Framework/Scene2D/GrayscaleStyleConfigurator.cpp @ 1212:ab06dfdf3b75 broker

integration mainline->broker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Dec 2019 16:54:24 +0100
parents 177e7d431cd1 b5dec783ba08
children 0ca50d275b9a
line wrap: on
line diff
--- a/Framework/Scene2D/GrayscaleStyleConfigurator.cpp	Wed Dec 04 16:47:21 2019 +0100
+++ b/Framework/Scene2D/GrayscaleStyleConfigurator.cpp	Wed Dec 04 16:54:24 2019 +0100
@@ -30,9 +30,10 @@
   GrayscaleStyleConfigurator::GrayscaleStyleConfigurator() :
     revision_(0),
     linearInterpolation_(false),
-    hasWindowing_(false),
+    hasWindowingOverride_(false),
     customWindowWidth_(0),
     customWindowCenter_(0),
+    hasInversionOverride_(false),
     inverted_(false),
     applyLog_(false)
   {
@@ -40,7 +41,7 @@
 
   void GrayscaleStyleConfigurator::SetWindowing(ImageWindowing windowing)
   {
-    hasWindowing_ = true;
+    hasWindowingOverride_ = true;
     windowing_ = windowing;
     revision_++;
   }
@@ -60,6 +61,7 @@
 
   void GrayscaleStyleConfigurator::SetInverted(bool inverted)
   {
+    hasInversionOverride_ = true;
     inverted_ = inverted;
     revision_++;
   }
@@ -105,7 +107,7 @@
     
     l.SetLinearInterpolation(linearInterpolation_);
 
-    if (hasWindowing_)
+    if (hasWindowingOverride_)
     {
       if (windowing_ != ImageWindowing_Custom)
       {
@@ -117,7 +119,11 @@
       }
     }
 
-    l.SetInverted(inverted_);
+    if (hasInversionOverride_)
+    {
+      l.SetInverted(inverted_);
+    }
+
     l.SetApplyLog(applyLog_);
   }
 }