changeset 6085:8b7354bd8654

added support for more image types in ImageProcessing::ShiftScale2()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 05 Apr 2025 13:24:29 +0200
parents 8964b391fe92
children ff1b0e0b4988
files OrthancFramework/Sources/Images/ImageProcessing.cpp
diffstat 1 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Images/ImageProcessing.cpp	Sat Apr 05 12:56:02 2025 +0200
+++ b/OrthancFramework/Sources/Images/ImageProcessing.cpp	Sat Apr 05 13:24:29 2025 +0200
@@ -1541,6 +1541,39 @@
 
         switch (source.GetFormat())
         {
+          case PixelFormat_Grayscale8:
+            if (useRound)
+            {
+              ShiftScaleIntegerInternal<uint8_t, uint8_t, true, false>(target, source, a, b);
+            }
+            else
+            {
+              ShiftScaleIntegerInternal<uint8_t, uint8_t, false, false>(target, source, a, b);
+            }
+            return;
+
+          case PixelFormat_Grayscale16:
+            if (useRound)
+            {
+              ShiftScaleIntegerInternal<uint8_t, uint16_t, true, false>(target, source, a, b);
+            }
+            else
+            {
+              ShiftScaleIntegerInternal<uint8_t, uint16_t, false, false>(target, source, a, b);
+            }
+            return;
+
+          case PixelFormat_SignedGrayscale16:
+            if (useRound)
+            {
+              ShiftScaleIntegerInternal<uint8_t, int16_t, true, false>(target, source, a, b);
+            }
+            else
+            {
+              ShiftScaleIntegerInternal<uint8_t, int16_t, false, false>(target, source, a, b);
+            }
+            return;
+
           case PixelFormat_Float32:
             if (useRound)
             {