comparison Framework/Radiography/RadiographyWidget.cpp @ 516:11fa6f00e33c bgo-commands-codegen

Dummy changes (warnings, dummy dtor to check proper deletion, line wrapping) + fixes for AM changes (Corner renamed to ControlPoint...)
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 12 Mar 2019 08:51:15 +0100
parents 64d90190a08c
children 1201b12eb9f8
comparison
equal deleted inserted replaced
515:1dbf2d9ed1e4 516:11fa6f00e33c
30 namespace OrthancStone 30 namespace OrthancStone
31 { 31 {
32 32
33 bool RadiographyWidget::IsInvertedInternal() const 33 bool RadiographyWidget::IsInvertedInternal() const
34 { 34 {
35 return (scene_->GetPreferredPhotomotricDisplayMode() == PhotometricDisplayMode_Monochrome1) ^ invert_; // MONOCHROME1 images must be inverted and the user can invert the image too -> XOR the two 35 // MONOCHROME1 images must be inverted and the user can invert the
36 } 36 // image, too -> XOR the two
37 37 return (scene_->GetPreferredPhotomotricDisplayMode() ==
38 void RadiographyWidget::RenderBackground(Orthanc::ImageAccessor& image, float minValue, float maxValue) 38 PhotometricDisplayMode_Monochrome1) ^ invert_;
39 }
40
41 void RadiographyWidget::RenderBackground(
42 Orthanc::ImageAccessor& image, float minValue, float maxValue)
39 { 43 {
40 // wipe background before rendering 44 // wipe background before rendering
41 float backgroundValue = minValue; 45 float backgroundValue = minValue;
42 46
43 switch (scene_->GetPreferredPhotomotricDisplayMode()) 47 switch (scene_->GetPreferredPhotomotricDisplayMode())
57 break; 61 break;
58 default: 62 default:
59 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); 63 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
60 } 64 }
61 65
62 Orthanc::ImageProcessing::Set(image, backgroundValue); 66 Orthanc::ImageProcessing::Set(image, static_cast<int64_t>(backgroundValue));
63 } 67 }
64 68
65 bool RadiographyWidget::RenderInternal(unsigned int width, 69 bool RadiographyWidget::RenderInternal(unsigned int width,
66 unsigned int height, 70 unsigned int height,
67 ImageInterpolation interpolation) 71 ImageInterpolation interpolation)
80 { 84 {
81 if (floatBuffer_.get() == NULL || 85 if (floatBuffer_.get() == NULL ||
82 floatBuffer_->GetWidth() != width || 86 floatBuffer_->GetWidth() != width ||
83 floatBuffer_->GetHeight() != height) 87 floatBuffer_->GetHeight() != height)
84 { 88 {
85 floatBuffer_.reset(new Orthanc::Image(Orthanc::PixelFormat_Float32, width, height, false)); 89 floatBuffer_.reset(new Orthanc::Image(
90 Orthanc::PixelFormat_Float32, width, height, false));
86 } 91 }
87 92
88 if (cairoBuffer_.get() == NULL || 93 if (cairoBuffer_.get() == NULL ||
89 cairoBuffer_->GetWidth() != width || 94 cairoBuffer_->GetWidth() != width ||
90 cairoBuffer_->GetHeight() != height) 95 cairoBuffer_->GetHeight() != height)
166 cairo_paint(cr); 171 cairo_paint(cr);
167 } 172 }
168 173
169 if (hasSelection_) 174 if (hasSelection_)
170 { 175 {
171 scene_->DrawBorder(context, selectedLayer_, view.GetZoom()); 176 scene_->DrawBorder(
177 context, static_cast<unsigned int>(selectedLayer_), view.GetZoom());
172 } 178 }
173 179
174 return true; 180 return true;
175 } 181 }
176 182