comparison Framework/Radiography/RadiographyAlphaLayer.cpp @ 1201:ab958fd99b07

RadiographyScene fixes
author Alain Mazy <alain@mazy.be>
date Fri, 29 Nov 2019 16:21:24 +0100
parents a5f2a6b04a31
children 355dba5352d7
comparison
equal deleted inserted replaced
1199:922d2e61aa5d 1201:ab958fd99b07
77 Orthanc::ImageAccessor cropped; 77 Orthanc::ImageAccessor cropped;
78 alpha_->GetRegion(cropped, cropX, cropY, cropWidth, cropHeight); 78 alpha_->GetRegion(cropped, cropX, cropY, cropWidth, cropHeight);
79 79
80 Orthanc::Image tmp(Orthanc::PixelFormat_Grayscale8, buffer.GetWidth(), buffer.GetHeight(), false); 80 Orthanc::Image tmp(Orthanc::PixelFormat_Grayscale8, buffer.GetWidth(), buffer.GetHeight(), false);
81 81
82 unsigned int x1, y1, x2, y2;
83
84 if (!OrthancStone::GetProjectiveTransformExtent(x1, y1, x2, y2,
85 t.GetHomogeneousMatrix(),
86 cropped.GetWidth(),
87 cropped.GetHeight(),
88 buffer.GetWidth(),
89 buffer.GetHeight()))
90 {
91 return; // layer is outside the buffer
92 }
93
82 t.Apply(tmp, cropped, interpolation, true /* clear */); 94 t.Apply(tmp, cropped, interpolation, true /* clear */);
83
84 unsigned int x1, y1, x2, y2;
85 OrthancStone::GetProjectiveTransformExtent(x1, y1, x2, y2,
86 t.GetHomogeneousMatrix(),
87 cropped.GetWidth(),
88 cropped.GetHeight(),
89 buffer.GetWidth(),
90 buffer.GetHeight());
91 95
92 float value = foreground_; 96 float value = foreground_;
93 97
94 if (!applyWindowing) // if applying the windowing, it means we are ie rendering the image for a realtime visualization -> the foreground_ value is the value we want to see on the screen -> don't change it 98 if (!applyWindowing) // if applying the windowing, it means we are ie rendering the image for a realtime visualization -> the foreground_ value is the value we want to see on the screen -> don't change it
95 { 99 {