diff Framework/Radiography/RadiographyAlphaLayer.h @ 1196:a5f2a6b04a31

RadiographyScene: windowing is now only applied to the Dicom layer
author Alain Mazy <alain@mazy.be>
date Wed, 27 Nov 2019 17:51:33 +0100
parents 77e0eb83ff63
children 54cbffabdc45 1c7ae79c426d
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyAlphaLayer.h	Tue Nov 26 16:32:29 2019 +0100
+++ b/Framework/Radiography/RadiographyAlphaLayer.h	Wed Nov 27 17:51:33 2019 +0100
@@ -33,14 +33,12 @@
   class RadiographyAlphaLayer : public RadiographyLayer
   {
   private:
-    std::auto_ptr<Orthanc::ImageAccessor>  alpha_;      // Grayscale8
-    bool                                   useWindowing_;
-    float                                  foreground_;
+    std::auto_ptr<Orthanc::ImageAccessor>  alpha_;       // Grayscale8 in the range [0, 255]  0 = transparent, 255 = opaque -> the foreground value will be displayed
+    float                                  foreground_;  // in the range [0.0, 65535.0]
 
   public:
     RadiographyAlphaLayer(MessageBroker& broker, const RadiographyScene& scene) :
       RadiographyLayer(broker, scene),
-      useWindowing_(true),
       foreground_(0)
     {
     }
@@ -48,7 +46,6 @@
 
     void SetForegroundValue(float foreground)
     {
-      useWindowing_ = false;
       foreground_ = foreground;
     }
 
@@ -57,11 +54,6 @@
       return foreground_;
     }
 
-    bool IsUsingWindowing() const
-    {
-      return useWindowing_;
-    }
-
     void SetAlpha(Orthanc::ImageAccessor* image);
 
     virtual bool GetDefaultWindowing(float& center,
@@ -73,7 +65,10 @@
 
     virtual void Render(Orthanc::ImageAccessor& buffer,
                         const AffineTransform2D& viewTransform,
-                        ImageInterpolation interpolation) const;
+                        ImageInterpolation interpolation,
+                        float windowCenter,
+                        float windowWidth,
+                        bool applyWindowing) const;
 
     virtual bool GetRange(float& minValue,
                           float& maxValue) const;