Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyWidget.cpp @ 754:92c400a09f1b
Merge from default
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 22 May 2019 16:13:46 +0200 |
parents | be9c1530d40a |
children | b537002f83a9 d33ae2b0db9d |
comparison
equal
deleted
inserted
replaced
753:a386bbc955dc | 754:92c400a09f1b |
---|---|
33 bool RadiographyWidget::IsInvertedInternal() const | 33 bool RadiographyWidget::IsInvertedInternal() const |
34 { | 34 { |
35 // MONOCHROME1 images must be inverted and the user can invert the | 35 // MONOCHROME1 images must be inverted and the user can invert the |
36 // image, too -> XOR the two | 36 // image, too -> XOR the two |
37 return (scene_->GetPreferredPhotomotricDisplayMode() == | 37 return (scene_->GetPreferredPhotomotricDisplayMode() == |
38 PhotometricDisplayMode_Monochrome1) ^ invert_; | 38 RadiographyPhotometricDisplayMode_Monochrome1) ^ invert_; |
39 } | 39 } |
40 | 40 |
41 void RadiographyWidget::RenderBackground( | 41 void RadiographyWidget::RenderBackground( |
42 Orthanc::ImageAccessor& image, float minValue, float maxValue) | 42 Orthanc::ImageAccessor& image, float minValue, float maxValue) |
43 { | 43 { |
44 // wipe background before rendering | 44 // wipe background before rendering |
45 float backgroundValue = minValue; | 45 float backgroundValue = minValue; |
46 | 46 |
47 switch (scene_->GetPreferredPhotomotricDisplayMode()) | 47 switch (scene_->GetPreferredPhotomotricDisplayMode()) |
48 { | 48 { |
49 case PhotometricDisplayMode_Monochrome1: | 49 case RadiographyPhotometricDisplayMode_Monochrome1: |
50 case PhotometricDisplayMode_Default: | 50 case RadiographyPhotometricDisplayMode_Default: |
51 if (IsInvertedInternal()) | 51 if (IsInvertedInternal()) |
52 backgroundValue = maxValue; | 52 backgroundValue = maxValue; |
53 else | 53 else |
54 backgroundValue = minValue; | 54 backgroundValue = minValue; |
55 break; | 55 break; |
56 case PhotometricDisplayMode_Monochrome2: | 56 case RadiographyPhotometricDisplayMode_Monochrome2: |
57 if (IsInvertedInternal()) | 57 if (IsInvertedInternal()) |
58 backgroundValue = minValue; | 58 backgroundValue = minValue; |
59 else | 59 else |
60 backgroundValue = maxValue; | 60 backgroundValue = maxValue; |
61 break; | 61 break; |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 | 152 |
153 bool RadiographyWidget::RenderScene(CairoContext& context, | 153 bool RadiographyWidget::RenderScene(CairoContext& context, |
154 const ViewportGeometry& view) | 154 const Deprecated::ViewportGeometry& view) |
155 { | 155 { |
156 cairo_t* cr = context.GetObject(); | 156 cairo_t* cr = context.GetObject(); |
157 | 157 |
158 if (RenderInternal(context.GetWidth(), context.GetHeight(), interpolation_)) | 158 if (RenderInternal(context.GetWidth(), context.GetHeight(), interpolation_)) |
159 { | 159 { |