diff OrthancFramework/Sources/Images/ImageAccessor.cpp @ 4300:b30a8de92ad9

abi continued
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 05 Nov 2020 19:33:18 +0100
parents 9279de56a405
children d9473bd5ed43
line wrap: on
line diff
--- a/OrthancFramework/Sources/Images/ImageAccessor.cpp	Thu Nov 05 18:24:50 2020 +0100
+++ b/OrthancFramework/Sources/Images/ImageAccessor.cpp	Thu Nov 05 19:33:18 2020 +0100
@@ -98,6 +98,55 @@
   }
   
 
+  ImageAccessor::ImageAccessor()
+  {
+    AssignEmpty(PixelFormat_Grayscale8);
+  }
+
+  ImageAccessor::~ImageAccessor()
+  {
+  }
+
+  bool ImageAccessor::IsReadOnly() const
+  {
+    return readOnly_;
+  }
+
+  PixelFormat ImageAccessor::GetFormat() const
+  {
+    return format_;
+  }
+
+  unsigned int ImageAccessor::GetBytesPerPixel() const
+  {
+    return ::Orthanc::GetBytesPerPixel(format_);
+  }
+
+  unsigned int ImageAccessor::GetWidth() const
+  {
+    return width_;
+  }
+
+  unsigned int ImageAccessor::GetHeight() const
+  {
+    return height_;
+  }
+
+  unsigned int ImageAccessor::GetPitch() const
+  {
+    return pitch_;
+  }
+
+  unsigned int ImageAccessor::GetSize() const
+  {
+    return GetHeight() * GetPitch();
+  }
+
+  const void *ImageAccessor::GetConstBuffer() const
+  {
+    return buffer_;
+  }
+
   void* ImageAccessor::GetBuffer()
   {
     if (readOnly_)
@@ -172,6 +221,11 @@
     }
   }
 
+  void ImageAccessor::GetReadOnlyAccessor(ImageAccessor &target) const
+  {
+    target.AssignReadOnly(format_, width_, height_, pitch_, buffer_);
+  }
+
 
   void ImageAccessor::AssignWritable(PixelFormat format,
                                      unsigned int width,