Added special case check for converison into the same format as the source

This commit is contained in:
Darth Affe 2024-07-14 22:50:53 +02:00
parent dd5f742b48
commit 6f762f7ad6

View File

@ -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):