From 9f313f77fbe0ed91ae847e8c1172e6b07ed5cdba Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Thu, 11 Jul 2024 00:19:03 +0200 Subject: [PATCH] Added Span-overload for MinMax --- HPPH/PixelHelper.MinMax.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/HPPH/PixelHelper.MinMax.cs b/HPPH/PixelHelper.MinMax.cs index 4fb332f..b1d8054 100644 --- a/HPPH/PixelHelper.MinMax.cs +++ b/HPPH/PixelHelper.MinMax.cs @@ -43,6 +43,9 @@ public static unsafe partial class PixelHelper ArrayPool.Shared.Return(array); } } + public static IMinMax MinMax(this Span colors) + where T : struct, IColor + => T.ColorFormat.MinMax(MemoryMarshal.AsBytes(colors)); public static IMinMax MinMax(this ReadOnlySpan colors) where T : struct, IColor