comparison Framework/Scene2D/GrayscaleStyleConfigurator.cpp @ 913:2b4b6b86520a

Re-enabled gl debug output in GuiAdapter + REMOVED GZIP ENCODING IN OrthancSeriesVolumeProgressiveLoader + added ability to use custom windowing in GrayscaleStyleConfigurator
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 19 Jul 2019 10:30:40 +0200
parents e62e7361fd60
children 4d1f57773b5b
comparison
equal deleted inserted replaced
910:a6c12fe88bcb 913:2b4b6b86520a
32 hasWindowing_ = true; 32 hasWindowing_ = true;
33 windowing_ = windowing; 33 windowing_ = windowing;
34 revision_++; 34 revision_++;
35 } 35 }
36 36
37 void GrayscaleStyleConfigurator::SetCustomWindowing(float windowCenter, float windowWidth)
38 {
39 SetWindowing(ImageWindowing_Custom);
40 customWindowCenter_ = windowCenter;
41 customWindowWidth_ = windowWidth;
42 }
37 43
38 void GrayscaleStyleConfigurator::SetLinearInterpolation(bool enabled) 44 void GrayscaleStyleConfigurator::SetLinearInterpolation(bool enabled)
39 { 45 {
40 linearInterpolation_ = enabled; 46 linearInterpolation_ = enabled;
41 revision_++; 47 revision_++;
42 } 48 }
43 49
44
45 TextureBaseSceneLayer* GrayscaleStyleConfigurator::CreateTextureFromImage( 50 TextureBaseSceneLayer* GrayscaleStyleConfigurator::CreateTextureFromImage(
46 const Orthanc::ImageAccessor& image) const 51 const Orthanc::ImageAccessor& image) const
47 { 52 {
48 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); 53 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
49 } 54 }
50 55
51
52 TextureBaseSceneLayer* GrayscaleStyleConfigurator::CreateTextureFromDicom( 56 TextureBaseSceneLayer* GrayscaleStyleConfigurator::CreateTextureFromDicom(
53 const Orthanc::ImageAccessor& frame, 57 const Orthanc::ImageAccessor& frame,
54 const DicomInstanceParameters& parameters) const 58 const DicomInstanceParameters& parameters) const
55 { 59 {
56 std::auto_ptr<TextureBaseSceneLayer> layer(parameters.CreateTexture(frame)); 60 std::auto_ptr<TextureBaseSceneLayer> layer(parameters.CreateTexture(frame));
64 { 68 {
65 return layer.release(); 69 return layer.release();
66 } 70 }
67 } 71 }
68 72
69
70 void GrayscaleStyleConfigurator::ApplyStyle(ISceneLayer& layer) const 73 void GrayscaleStyleConfigurator::ApplyStyle(ISceneLayer& layer) const
71 { 74 {
72 FloatTextureSceneLayer& l = dynamic_cast<FloatTextureSceneLayer&>(layer); 75 FloatTextureSceneLayer& l = dynamic_cast<FloatTextureSceneLayer&>(layer);
73 76
74 l.SetLinearInterpolation(linearInterpolation_); 77 l.SetLinearInterpolation(linearInterpolation_);
75 78
76 if (hasWindowing_) 79 if (hasWindowing_)
77 { 80 {
78 l.SetWindowing(windowing_); 81 if (windowing_ != ImageWindowing_Custom)
82 {
83 l.SetWindowing(windowing_);
84 }
85 else
86 {
87 l.SetCustomWindowing(customWindowCenter_, customWindowWidth_);
88 }
79 } 89 }
80 } 90 }
81 } 91 }