From 6f762f7ad62ef1973284f7f66dcd7bf592425bb8 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 14 Jul 2024 22:50:53 +0200 Subject: [PATCH] Added special case check for converison into the same format as the source --- HPPH/PixelHelper.Convert.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/HPPH/PixelHelper.Convert.cs b/HPPH/PixelHelper.Convert.cs index c156a1f..fcd0f88 100644 --- a/HPPH/PixelHelper.Convert.cs +++ b/HPPH/PixelHelper.Convert.cs @@ -74,6 +74,12 @@ public static unsafe partial class PixelHelper { if (source.Length == 0) return; + if (sourceFormat == targetFormat) + { + source.CopyTo(target); + return; + } + switch (sourceFormat.BytesPerPixel) { case 3 when (targetFormat.BytesPerPixel == 3):