comparison Framework/Layers/GrayscaleFrameRenderer.cpp @ 328:c80b5bddf86b am-2

support of monochrome1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 Oct 2018 10:26:33 +0200
parents 3a4ca166fafa
children b3b3fa0e3689
comparison
equal deleted inserted replaced
327:8716176ff7f0 328:c80b5bddf86b
79 { 79 {
80 // https://en.wikipedia.org/wiki/Linear_interpolation 80 // https://en.wikipedia.org/wiki/Linear_interpolation
81 v = static_cast<uint8_t>(255.0f * (*p - x0) / (x1 - x0)); 81 v = static_cast<uint8_t>(255.0f * (*p - x0) / (x1 - x0));
82 } 82 }
83 83
84 if (style.reverse_) 84 if (style.reverse_ ^ (photometric_ == Orthanc::PhotometricInterpretation_Monochrome1))
85 { 85 {
86 v = 255 - v; 86 v = 255 - v;
87 } 87 }
88 } 88 }
89 89
116 double pixelSpacingY, 116 double pixelSpacingY,
117 bool isFullQuality) : 117 bool isFullQuality) :
118 FrameRenderer(frameSlice, pixelSpacingX, pixelSpacingY, isFullQuality), 118 FrameRenderer(frameSlice, pixelSpacingX, pixelSpacingY, isFullQuality),
119 frame_(frame), 119 frame_(frame),
120 defaultWindowCenter_(converter.GetDefaultWindowCenter()), 120 defaultWindowCenter_(converter.GetDefaultWindowCenter()),
121 defaultWindowWidth_(converter.GetDefaultWindowWidth()) 121 defaultWindowWidth_(converter.GetDefaultWindowWidth()),
122 photometric_(converter.GetPhotometricInterpretation())
122 { 123 {
123 if (frame == NULL) 124 if (frame == NULL)
124 { 125 {
125 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 126 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
126 } 127 }