diff 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
line wrap: on
line diff
--- a/Framework/Layers/ColorFrameRenderer.cpp	Mon Nov 05 16:18:27 2018 +0100
+++ b/Framework/Layers/ColorFrameRenderer.cpp	Tue Nov 06 14:21:02 2018 +0100
@@ -22,6 +22,7 @@
 #include "ColorFrameRenderer.h"
 
 #include <Core/OrthancException.h>
+#include <Core/Images/Image.h>
 #include <Core/Images/ImageProcessing.h>
 
 namespace OrthancStone
@@ -39,15 +40,15 @@
   }
 
 
-  ColorFrameRenderer::ColorFrameRenderer(Orthanc::ImageAccessor* frame,
+  ColorFrameRenderer::ColorFrameRenderer(const Orthanc::ImageAccessor& frame,
                                          const CoordinateSystem3D& frameSlice,
                                          double pixelSpacingX,
                                          double pixelSpacingY,
                                          bool isFullQuality) :
     FrameRenderer(frameSlice, pixelSpacingX, pixelSpacingY, isFullQuality),
-    frame_(frame)
+    frame_(Orthanc::Image::Clone(frame))
   {
-    if (frame == NULL)
+    if (frame_.get() == NULL)
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
     }