diff OrthancFramework/Sources/Images/PngReader.cpp @ 5054:255b02c68908

Added support for RGBA64 images in tools/create-dicom and /preview (Contribution from James Manners - Pliny)
author Alain Mazy <am@osimis.io>
date Fri, 08 Jul 2022 15:26:52 +0200
parents 43e613a7756b
children 0ea402b4d901
line wrap: on
line diff
--- a/OrthancFramework/Sources/Images/PngReader.cpp	Fri Jul 08 07:24:10 2022 +0200
+++ b/OrthancFramework/Sources/Images/PngReader.cpp	Fri Jul 08 15:26:52 2022 +0200
@@ -175,6 +175,16 @@
       format = PixelFormat_RGBA32;
       pitch = 4 * width;
     }
+    else if (color_type == PNG_COLOR_TYPE_RGBA && bit_depth == 16)
+    {
+      format = PixelFormat_RGBA64;
+      pitch = 8 * width;
+
+      if (Toolbox::DetectEndianness() == Endianness_Little)
+      {
+        png_set_swap(rabi.png_);
+      }
+    }
     else
     {
       throw OrthancException(ErrorCode_NotImplemented);