Mercurial > hg > orthanc-stone
comparison Framework/Layers/ColorFrameRenderer.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 |
---|---|
20 | 20 |
21 | 21 |
22 #include "ColorFrameRenderer.h" | 22 #include "ColorFrameRenderer.h" |
23 | 23 |
24 #include <Core/OrthancException.h> | 24 #include <Core/OrthancException.h> |
25 #include <Core/Images/Image.h> | |
25 #include <Core/Images/ImageProcessing.h> | 26 #include <Core/Images/ImageProcessing.h> |
26 | 27 |
27 namespace OrthancStone | 28 namespace OrthancStone |
28 { | 29 { |
29 CairoSurface* ColorFrameRenderer::GenerateDisplay(const RenderStyle& style) | 30 CairoSurface* ColorFrameRenderer::GenerateDisplay(const RenderStyle& style) |
37 | 38 |
38 return display.release(); | 39 return display.release(); |
39 } | 40 } |
40 | 41 |
41 | 42 |
42 ColorFrameRenderer::ColorFrameRenderer(Orthanc::ImageAccessor* frame, | 43 ColorFrameRenderer::ColorFrameRenderer(const Orthanc::ImageAccessor& frame, |
43 const CoordinateSystem3D& frameSlice, | 44 const CoordinateSystem3D& frameSlice, |
44 double pixelSpacingX, | 45 double pixelSpacingX, |
45 double pixelSpacingY, | 46 double pixelSpacingY, |
46 bool isFullQuality) : | 47 bool isFullQuality) : |
47 FrameRenderer(frameSlice, pixelSpacingX, pixelSpacingY, isFullQuality), | 48 FrameRenderer(frameSlice, pixelSpacingX, pixelSpacingY, isFullQuality), |
48 frame_(frame) | 49 frame_(Orthanc::Image::Clone(frame)) |
49 { | 50 { |
50 if (frame == NULL) | 51 if (frame_.get() == NULL) |
51 { | 52 { |
52 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | 53 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
53 } | 54 } |
54 | 55 |
55 if (frame_->GetFormat() != Orthanc::PixelFormat_RGB24) | 56 if (frame_->GetFormat() != Orthanc::PixelFormat_RGB24) |