comparison Framework/Layers/GrayscaleFrameRenderer.cpp @ 378:814fa32e2fcc

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 06 Nov 2018 14:21:02 +0100
parents 557c8ff1db5c
children 17d54c028805
comparison
equal deleted inserted replaced
377:8eb4fe74000f 378:814fa32e2fcc
19 **/ 19 **/
20 20
21 21
22 #include "GrayscaleFrameRenderer.h" 22 #include "GrayscaleFrameRenderer.h"
23 23
24 #include <Core/Images/Image.h>
24 #include <Core/OrthancException.h> 25 #include <Core/OrthancException.h>
25 26
26 namespace OrthancStone 27 namespace OrthancStone
27 { 28 {
28 CairoSurface* GrayscaleFrameRenderer::GenerateDisplay(const RenderStyle& style) 29 CairoSurface* GrayscaleFrameRenderer::GenerateDisplay(const RenderStyle& style)
110 111
111 return result.release(); 112 return result.release();
112 } 113 }
113 114
114 115
115 GrayscaleFrameRenderer::GrayscaleFrameRenderer(Orthanc::ImageAccessor* frame, 116 GrayscaleFrameRenderer::GrayscaleFrameRenderer(const Orthanc::ImageAccessor& frame,
116 const DicomFrameConverter& converter, 117 const DicomFrameConverter& converter,
117 const CoordinateSystem3D& frameSlice, 118 const CoordinateSystem3D& frameSlice,
118 double pixelSpacingX, 119 double pixelSpacingX,
119 double pixelSpacingY, 120 double pixelSpacingY,
120 bool isFullQuality) : 121 bool isFullQuality) :
121 FrameRenderer(frameSlice, pixelSpacingX, pixelSpacingY, isFullQuality), 122 FrameRenderer(frameSlice, pixelSpacingX, pixelSpacingY, isFullQuality),
122 frame_(frame), 123 frame_(Orthanc::Image::Clone(frame)),
123 defaultWindowCenter_(converter.GetDefaultWindowCenter()), 124 defaultWindowCenter_(converter.GetDefaultWindowCenter()),
124 defaultWindowWidth_(converter.GetDefaultWindowWidth()), 125 defaultWindowWidth_(converter.GetDefaultWindowWidth()),
125 photometric_(converter.GetPhotometricInterpretation()) 126 photometric_(converter.GetPhotometricInterpretation())
126 { 127 {
127 if (frame == NULL) 128 if (frame_.get() == NULL)
128 { 129 {
129 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 130 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
130 } 131 }
131 132
132 converter.ConvertFrameInplace(frame_); 133 converter.ConvertFrameInplace(frame_);