changeset 304:d959cf2a8d5c

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Feb 2022 08:02:06 +0100
parents fb7d62e3235e
children af985076f647 2978317b9bca
files Plugin/DecodedImageAdapter.cpp Plugin/DecodedImageAdapter.h
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Plugin/DecodedImageAdapter.cpp	Mon Feb 21 17:16:10 2022 +0100
+++ b/Plugin/DecodedImageAdapter.cpp	Tue Feb 22 08:02:06 2022 +0100
@@ -186,7 +186,7 @@
 
   bool DecodedImageAdapter::GetCornerstoneMetadata(Json::Value& result,
                                                    const Json::Value& tags,
-                                                   OrthancImage& image)
+                                                   const OrthancImage& image)
   {
     float windowCenter, windowWidth;
 
@@ -307,7 +307,7 @@
 
 
   bool  DecodedImageAdapter::EncodeUsingDeflate(Json::Value& result,
-                                                OrthancImage& image)
+                                                const OrthancImage& image)
   {
     Orthanc::ImageAccessor accessor;
     accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetPixelFormat()), image.GetWidth(),
@@ -421,7 +421,7 @@
 
 
   bool  DecodedImageAdapter::EncodeUsingJpeg(Json::Value& result,
-                                             OrthancImage& image,
+                                             const OrthancImage& image,
                                              uint8_t quality /* between 0 and 100 */)
   {
     Orthanc::ImageAccessor accessor;
--- a/Plugin/DecodedImageAdapter.h	Mon Feb 21 17:16:10 2022 +0100
+++ b/Plugin/DecodedImageAdapter.h	Tue Feb 22 08:02:06 2022 +0100
@@ -25,6 +25,8 @@
 #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
 #include "Cache/ICacheFactory.h"
 
+#include <Compatibility.h>
+
 #include <stdint.h>
 #include <json/value.h>
 
@@ -48,13 +50,13 @@
 
     static bool GetCornerstoneMetadata(Json::Value& result,
                                        const Json::Value& tags,
-                                       OrthancImage& image);
+                                       const OrthancImage& image);
 
     static bool EncodeUsingDeflate(Json::Value& result,
-                                   OrthancImage& image);
+                                   const OrthancImage& image);
 
     static bool EncodeUsingJpeg(Json::Value& result,
-                                OrthancImage& image,
+                                const OrthancImage& image,
                                 uint8_t quality /* between 0 and 100 */);
 
     OrthancPluginContext* context_;
@@ -66,6 +68,6 @@
     }
 
     virtual bool Create(std::string& content,
-                        const std::string& uri);  
+                        const std::string& uri) ORTHANC_OVERRIDE;
   };
 }