comparison 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
comparison
equal deleted inserted replaced
1211:d10d2acb8a02 1212:ab06dfdf3b75
28 namespace OrthancStone 28 namespace OrthancStone
29 { 29 {
30 GrayscaleStyleConfigurator::GrayscaleStyleConfigurator() : 30 GrayscaleStyleConfigurator::GrayscaleStyleConfigurator() :
31 revision_(0), 31 revision_(0),
32 linearInterpolation_(false), 32 linearInterpolation_(false),
33 hasWindowing_(false), 33 hasWindowingOverride_(false),
34 customWindowWidth_(0), 34 customWindowWidth_(0),
35 customWindowCenter_(0), 35 customWindowCenter_(0),
36 hasInversionOverride_(false),
36 inverted_(false), 37 inverted_(false),
37 applyLog_(false) 38 applyLog_(false)
38 { 39 {
39 } 40 }
40 41
41 void GrayscaleStyleConfigurator::SetWindowing(ImageWindowing windowing) 42 void GrayscaleStyleConfigurator::SetWindowing(ImageWindowing windowing)
42 { 43 {
43 hasWindowing_ = true; 44 hasWindowingOverride_ = true;
44 windowing_ = windowing; 45 windowing_ = windowing;
45 revision_++; 46 revision_++;
46 } 47 }
47 48
48 void GrayscaleStyleConfigurator::SetCustomWindowing(float windowCenter, float windowWidth) 49 void GrayscaleStyleConfigurator::SetCustomWindowing(float windowCenter, float windowWidth)
58 windowWidth = customWindowWidth_; 59 windowWidth = customWindowWidth_;
59 } 60 }
60 61
61 void GrayscaleStyleConfigurator::SetInverted(bool inverted) 62 void GrayscaleStyleConfigurator::SetInverted(bool inverted)
62 { 63 {
64 hasInversionOverride_ = true;
63 inverted_ = inverted; 65 inverted_ = inverted;
64 revision_++; 66 revision_++;
65 } 67 }
66 68
67 void GrayscaleStyleConfigurator::SetLinearInterpolation(bool enabled) 69 void GrayscaleStyleConfigurator::SetLinearInterpolation(bool enabled)
103 { 105 {
104 FloatTextureSceneLayer& l = dynamic_cast<FloatTextureSceneLayer&>(layer); 106 FloatTextureSceneLayer& l = dynamic_cast<FloatTextureSceneLayer&>(layer);
105 107
106 l.SetLinearInterpolation(linearInterpolation_); 108 l.SetLinearInterpolation(linearInterpolation_);
107 109
108 if (hasWindowing_) 110 if (hasWindowingOverride_)
109 { 111 {
110 if (windowing_ != ImageWindowing_Custom) 112 if (windowing_ != ImageWindowing_Custom)
111 { 113 {
112 l.SetWindowing(windowing_); 114 l.SetWindowing(windowing_);
113 } 115 }
115 { 117 {
116 l.SetCustomWindowing(customWindowCenter_, customWindowWidth_); 118 l.SetCustomWindowing(customWindowCenter_, customWindowWidth_);
117 } 119 }
118 } 120 }
119 121
120 l.SetInverted(inverted_); 122 if (hasInversionOverride_)
123 {
124 l.SetInverted(inverted_);
125 }
126
121 l.SetApplyLog(applyLog_); 127 l.SetApplyLog(applyLog_);
122 } 128 }
123 } 129 }