comparison Framework/Layers/GrayscaleFrameRenderer.cpp @ 728:8190213e2279 am-dev

Merged default into am-dev
author Alain Mazy <am@osimis.io>
date Tue, 21 May 2019 13:25:58 +0200
parents 4f2416d519b4
children
comparison
equal deleted inserted replaced
690:f185cfcb72a0 728:8190213e2279
22 #include "GrayscaleFrameRenderer.h" 22 #include "GrayscaleFrameRenderer.h"
23 23
24 #include <Core/Images/Image.h> 24 #include <Core/Images/Image.h>
25 #include <Core/OrthancException.h> 25 #include <Core/OrthancException.h>
26 26
27 namespace OrthancStone 27 namespace Deprecated
28 { 28 {
29 CairoSurface* GrayscaleFrameRenderer::GenerateDisplay(const RenderStyle& style) 29 OrthancStone::CairoSurface* GrayscaleFrameRenderer::GenerateDisplay(const RenderStyle& style)
30 { 30 {
31 assert(frame_->GetFormat() == Orthanc::PixelFormat_Float32); 31 assert(frame_->GetFormat() == Orthanc::PixelFormat_Float32);
32 32
33 std::auto_ptr<CairoSurface> result; 33 std::auto_ptr<OrthancStone::CairoSurface> result;
34 34
35 float windowCenter, windowWidth; 35 float windowCenter, windowWidth;
36 style.ComputeWindowing(windowCenter, windowWidth, 36 style.ComputeWindowing(windowCenter, windowWidth,
37 defaultWindowCenter_, defaultWindowWidth_); 37 defaultWindowCenter_, defaultWindowWidth_);
38 38
39 float x0 = windowCenter - windowWidth / 2.0f; 39 float x0 = windowCenter - windowWidth / 2.0f;
40 float x1 = windowCenter + windowWidth / 2.0f; 40 float x1 = windowCenter + windowWidth / 2.0f;
41 41
42 //LOG(INFO) << "Window: " << x0 << " => " << x1; 42 //LOG(INFO) << "Window: " << x0 << " => " << x1;
43 43
44 result.reset(new CairoSurface(frame_->GetWidth(), frame_->GetHeight(), false /* no alpha */)); 44 result.reset(new OrthancStone::CairoSurface(frame_->GetWidth(), frame_->GetHeight(), false /* no alpha */));
45 45
46 const uint8_t* lut = NULL; 46 const uint8_t* lut = NULL;
47 if (style.applyLut_) 47 if (style.applyLut_)
48 { 48 {
49 if (Orthanc::EmbeddedResources::GetFileResourceSize(style.lut_) != 3 * 256) 49 if (Orthanc::EmbeddedResources::GetFileResourceSize(style.lut_) != 3 * 256)
112 return result.release(); 112 return result.release();
113 } 113 }
114 114
115 115
116 GrayscaleFrameRenderer::GrayscaleFrameRenderer(const Orthanc::ImageAccessor& frame, 116 GrayscaleFrameRenderer::GrayscaleFrameRenderer(const Orthanc::ImageAccessor& frame,
117 const DicomFrameConverter& converter, 117 const Deprecated::DicomFrameConverter& converter,
118 const CoordinateSystem3D& framePlane, 118 const OrthancStone::CoordinateSystem3D& framePlane,
119 double pixelSpacingX, 119 double pixelSpacingX,
120 double pixelSpacingY, 120 double pixelSpacingY,
121 bool isFullQuality) : 121 bool isFullQuality) :
122 FrameRenderer(framePlane, pixelSpacingX, pixelSpacingY, isFullQuality), 122 FrameRenderer(framePlane, pixelSpacingX, pixelSpacingY, isFullQuality),
123 frame_(Orthanc::Image::Clone(frame)), 123 frame_(Orthanc::Image::Clone(frame)),