changeset 3236:872efde28e58

more constness
author Alain Mazy <alain@mazy.be>
date Fri, 15 Feb 2019 11:08:18 +0100
parents 6055bea6a6dc
children e1a4bfd14e66
files Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Plugins/Samples/Common/OrthancPluginCppWrapper.h
diffstat 2 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Fri Feb 15 10:38:17 2019 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Fri Feb 15 11:08:18 2019 +0100
@@ -891,7 +891,7 @@
   }
 
 
-  void OrthancImage::CheckImageAvailable()
+  void OrthancImage::CheckImageAvailable() const
   {
     if (image_ == NULL)
     {
@@ -985,42 +985,42 @@
   }
 
 
-  OrthancPluginPixelFormat OrthancImage::GetPixelFormat()
+  OrthancPluginPixelFormat OrthancImage::GetPixelFormat() const
   {
     CheckImageAvailable();
     return OrthancPluginGetImagePixelFormat(GetGlobalContext(), image_);
   }
 
 
-  unsigned int OrthancImage::GetWidth()
+  unsigned int OrthancImage::GetWidth() const
   {
     CheckImageAvailable();
     return OrthancPluginGetImageWidth(GetGlobalContext(), image_);
   }
 
 
-  unsigned int OrthancImage::GetHeight()
+  unsigned int OrthancImage::GetHeight() const
   {
     CheckImageAvailable();
     return OrthancPluginGetImageHeight(GetGlobalContext(), image_);
   }
 
 
-  unsigned int OrthancImage::GetPitch()
+  unsigned int OrthancImage::GetPitch() const
   {
     CheckImageAvailable();
     return OrthancPluginGetImagePitch(GetGlobalContext(), image_);
   }
 
 
-  const void* OrthancImage::GetBuffer()
+  const void* OrthancImage::GetBuffer() const
   {
     CheckImageAvailable();
     return OrthancPluginGetImageBuffer(GetGlobalContext(), image_);
   }
 
 
-  void OrthancImage::CompressPngImage(MemoryBuffer& target)
+  void OrthancImage::CompressPngImage(MemoryBuffer& target) const
   {
     CheckImageAvailable();
 
@@ -1033,7 +1033,7 @@
 
 
   void OrthancImage::CompressJpegImage(MemoryBuffer& target,
-                                       uint8_t quality)
+                                       uint8_t quality) const
   {
     CheckImageAvailable();
 
@@ -1045,7 +1045,7 @@
   }
 
 
-  void OrthancImage::AnswerPngImage(OrthancPluginRestOutput* output)
+  void OrthancImage::AnswerPngImage(OrthancPluginRestOutput* output) const
   {
     CheckImageAvailable();
     OrthancPluginCompressAndAnswerPngImage(GetGlobalContext(), output, GetPixelFormat(),
@@ -1054,7 +1054,7 @@
 
 
   void OrthancImage::AnswerJpegImage(OrthancPluginRestOutput* output,
-                                     uint8_t quality)
+                                     uint8_t quality) const
   {
     CheckImageAvailable();
     OrthancPluginCompressAndAnswerJpegImage(GetGlobalContext(), output, GetPixelFormat(),
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Fri Feb 15 10:38:17 2019 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Fri Feb 15 11:08:18 2019 +0100
@@ -335,7 +335,7 @@
 
     void Clear();
 
-    void CheckImageAvailable();
+    void CheckImageAvailable() const;
 
   public:
     OrthancImage();
@@ -368,30 +368,30 @@
                           size_t size,
                           unsigned int frame);
 
-    OrthancPluginPixelFormat GetPixelFormat();
+    OrthancPluginPixelFormat GetPixelFormat() const;
 
-    unsigned int GetWidth();
+    unsigned int GetWidth() const;
 
-    unsigned int GetHeight();
+    unsigned int GetHeight() const;
 
-    unsigned int GetPitch();
+    unsigned int GetPitch() const;
     
-    const void* GetBuffer();
+    const void* GetBuffer() const;
 
     const OrthancPluginImage* GetObject() const
     {
       return image_;
     }
 
-    void CompressPngImage(MemoryBuffer& target);
+    void CompressPngImage(MemoryBuffer& target) const;
 
     void CompressJpegImage(MemoryBuffer& target,
-                           uint8_t quality);
+                           uint8_t quality) const;
 
-    void AnswerPngImage(OrthancPluginRestOutput* output);
+    void AnswerPngImage(OrthancPluginRestOutput* output) const;
 
     void AnswerJpegImage(OrthancPluginRestOutput* output,
-                         uint8_t quality);
+                         uint8_t quality) const;
   };