changeset 11:4b7e0244881f

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 26 Oct 2016 12:14:03 +0200
parents 55407926aac3
children 9220cf4a63d5
files Framework/Messaging/MessagingToolbox.cpp Framework/Orthanc/Core/HttpClient.cpp Framework/Orthanc/Core/Images/Image.cpp Framework/Orthanc/Core/Images/Image.h Framework/Orthanc/Core/Images/ImageBuffer.cpp Framework/Orthanc/Core/Images/ImageBuffer.h Framework/Toolbox/DicomFrameConverter.cpp Framework/Volumes/ImageBuffer3D.cpp
diffstat 8 files changed, 20 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Messaging/MessagingToolbox.cpp	Mon Oct 24 14:45:05 2016 +0200
+++ b/Framework/Messaging/MessagingToolbox.cpp	Wed Oct 26 12:14:03 2016 +0200
@@ -413,7 +413,7 @@
 
       // Decode a grayscale JPEG 8bpp image coming from the Web viewer
       std::auto_ptr<Orthanc::ImageAccessor> image
-        (new Orthanc::Image(targetFormat, reader->GetWidth(), reader->GetHeight()));
+        (new Orthanc::Image(targetFormat, reader->GetWidth(), reader->GetHeight(), false));
 
       float scaling = static_cast<float>(stretchHigh - stretchLow) / 255.0f;
       float offset = static_cast<float>(stretchLow) / scaling;
--- a/Framework/Orthanc/Core/HttpClient.cpp	Mon Oct 24 14:45:05 2016 +0200
+++ b/Framework/Orthanc/Core/HttpClient.cpp	Wed Oct 26 12:14:03 2016 +0200
@@ -328,7 +328,8 @@
     pimpl_(new PImpl), 
     verifyPeers_(true),
     pkcs11Enabled_(false),
-    headersToLowerCase_(true)
+    headersToLowerCase_(true),
+    redirectionFollowed_(true)
   {
     Setup();
   }
@@ -338,7 +339,8 @@
                          const std::string& uri) : 
     pimpl_(new PImpl), 
     verifyPeers_(true),
-    headersToLowerCase_(true)
+    headersToLowerCase_(true),
+    redirectionFollowed_(true)
   {
     Setup();
 
--- a/Framework/Orthanc/Core/Images/Image.cpp	Mon Oct 24 14:45:05 2016 +0200
+++ b/Framework/Orthanc/Core/Images/Image.cpp	Wed Oct 26 12:14:03 2016 +0200
@@ -40,8 +40,9 @@
 {
   Image::Image(PixelFormat format,
                unsigned int width,
-               unsigned int height) :
-    image_(format, width, height)
+               unsigned int height,
+               bool forceMinimalPitch) :
+    image_(format, width, height, forceMinimalPitch)
   {
     ImageAccessor accessor = image_.GetAccessor();
     AssignWritable(format, width, height, accessor.GetPitch(), accessor.GetBuffer());
@@ -50,7 +51,7 @@
 
   Image* Image::Clone(const ImageAccessor& source)
   {
-    std::auto_ptr<Image> target(new Image(source.GetFormat(), source.GetWidth(), source.GetHeight()));
+    std::auto_ptr<Image> target(new Image(source.GetFormat(), source.GetWidth(), source.GetHeight(), false));
     ImageProcessing::Copy(*target, source);
     return target.release();
   }
--- a/Framework/Orthanc/Core/Images/Image.h	Mon Oct 24 14:45:05 2016 +0200
+++ b/Framework/Orthanc/Core/Images/Image.h	Wed Oct 26 12:14:03 2016 +0200
@@ -45,7 +45,8 @@
   public:
     Image(PixelFormat format,
           unsigned int width,
-          unsigned int height);
+          unsigned int height,
+          bool forceMinimalPitch);
 
     static Image* Clone(const ImageAccessor& source);
   };
--- a/Framework/Orthanc/Core/Images/ImageBuffer.cpp	Mon Oct 24 14:45:05 2016 +0200
+++ b/Framework/Orthanc/Core/Images/ImageBuffer.cpp	Wed Oct 26 12:14:03 2016 +0200
@@ -87,7 +87,9 @@
 
   ImageBuffer::ImageBuffer(PixelFormat format,
                            unsigned int width,
-                           unsigned int height)
+                           unsigned int height,
+                           bool forceMinimalPitch) :
+    forceMinimalPitch_(forceMinimalPitch)
   {
     Initialize();
     SetWidth(width);
@@ -158,16 +160,6 @@
   }
 
 
-  void ImageBuffer::SetMinimalPitchForced(bool force)
-  {
-    if (force != forceMinimalPitch_)
-    {
-      changed_ = true;
-      forceMinimalPitch_ = force;
-    }
-  }
-
-
   void ImageBuffer::AcquireOwnership(ImageBuffer& other)
   {
     // Remove the content of the current image
--- a/Framework/Orthanc/Core/Images/ImageBuffer.h	Mon Oct 24 14:45:05 2016 +0200
+++ b/Framework/Orthanc/Core/Images/ImageBuffer.h	Wed Oct 26 12:14:03 2016 +0200
@@ -61,7 +61,8 @@
   public:
     ImageBuffer(PixelFormat format,
                 unsigned int width,
-                unsigned int height);
+                unsigned int height,
+                bool forceMinimalPitch);
 
     ImageBuffer()
     {
@@ -108,8 +109,6 @@
       return forceMinimalPitch_;
     }
 
-    void SetMinimalPitchForced(bool force);
-
     void AcquireOwnership(ImageBuffer& other);
   };
 }
--- a/Framework/Toolbox/DicomFrameConverter.cpp	Mon Oct 24 14:45:05 2016 +0200
+++ b/Framework/Toolbox/DicomFrameConverter.cpp	Wed Oct 26 12:14:03 2016 +0200
@@ -132,7 +132,8 @@
     // This is the case of a grayscale frame. Convert it to Float32.
     std::auto_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, 
                                                                source->GetWidth(), 
-                                                               source->GetHeight()));
+                                                               source->GetHeight(),
+                                                               false));
     Orthanc::ImageProcessing::Convert(*converted, *source);
 
     source.reset(NULL);  // We don't need the source frame anymore
--- a/Framework/Volumes/ImageBuffer3D.cpp	Mon Oct 24 14:45:05 2016 +0200
+++ b/Framework/Volumes/ImageBuffer3D.cpp	Wed Oct 26 12:14:03 2016 +0200
@@ -94,7 +94,7 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
     }
 
-    std::auto_ptr<Orthanc::Image> result(new Orthanc::Image(format_, height_, depth_));
+    std::auto_ptr<Orthanc::Image> result(new Orthanc::Image(format_, height_, depth_, false));
 
     unsigned int bytesPerPixel = Orthanc::GetBytesPerPixel(format_);
 
@@ -121,7 +121,7 @@
                                unsigned int width,
                                unsigned int height,
                                unsigned int depth) :
-    image_(format, width, height * depth),
+    image_(format, width, height * depth, false),
     format_(format),
     width_(width),
     height_(height),