Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyAlphaLayer.cpp @ 503:77e0eb83ff63 am-touch-events
layers are now Observable and emitting LayerEdited messages
author | amazy |
---|---|
date | Tue, 26 Feb 2019 12:58:03 +0100 |
parents | 4eb96c6b4e96 |
children | 42dadae61fa9 |
comparison
equal
deleted
inserted
replaced
502:3ae7563b4fe1 | 503:77e0eb83ff63 |
---|---|
43 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); | 43 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); |
44 } | 44 } |
45 | 45 |
46 SetSize(image->GetWidth(), image->GetHeight()); | 46 SetSize(image->GetWidth(), image->GetHeight()); |
47 alpha_ = raii; | 47 alpha_ = raii; |
48 | |
49 EmitMessage(RadiographyLayer::LayerEditedMessage(*this)); | |
48 } | 50 } |
49 | 51 |
50 void RadiographyAlphaLayer::Render(Orthanc::ImageAccessor& buffer, | 52 void RadiographyAlphaLayer::Render(Orthanc::ImageAccessor& buffer, |
51 const AffineTransform2D& viewTransform, | 53 const AffineTransform2D& viewTransform, |
52 ImageInterpolation interpolation) const | 54 ImageInterpolation interpolation) const |
82 float value = foreground_; | 84 float value = foreground_; |
83 | 85 |
84 if (useWindowing_) | 86 if (useWindowing_) |
85 { | 87 { |
86 float center, width; | 88 float center, width; |
87 if (scene_.GetWindowing(center, width)) | 89 if (GetScene().GetWindowing(center, width)) |
88 { | 90 { |
89 value = center + width / 2.0f; // set it to the maximum pixel value of the image | 91 value = center + width / 2.0f; // set it to the maximum pixel value of the image |
90 } | 92 } |
91 } | 93 } |
92 | 94 |