Added extensions for generic image

This commit is contained in:
DarthAffe committed 2024-07-14 21:01:47 +02:00
1 parent 2d30dc98ec
commit 0731472c24
4 files changed
+16

No files matched your search

+4
View File
@@ -26,6 +26,10 @@ public static partial class PixelHelper
}
}
public static T Average<T>(this IImage<T> image)
where T : struct, IColor
=> image.AsRefImage().Average();
public static T Average<T>(this RefImage<T> image)
where T : struct, IColor
{
+4
View File
@@ -27,6 +27,10 @@ public static unsafe partial class PixelHelper
}
}
public static IMinMax MinMax<T>(this IImage<T> image)
where T : struct, IColor
=> image.AsRefImage().MinMax();
public static IMinMax MinMax<T>(this RefImage<T> image)
where T : struct, IColor
{
+4
View File
@@ -25,6 +25,10 @@ public static partial class PixelHelper
}
}
public static T[] CreateColorPalette<T>(this IImage<T> image, int paletteSize)
where T : unmanaged, IColor
=> image.AsRefImage().CreateColorPalette(paletteSize);
public static T[] CreateColorPalette<T>(this RefImage<T> image, int paletteSize)
where T : unmanaged, IColor
{
+4
View File
@@ -28,6 +28,10 @@ public static unsafe partial class PixelHelper
}
}
public static ISum Sum<T>(this IImage<T> image)
where T : struct, IColor
=> image.AsRefImage().Sum();
public static ISum Sum<T>(this RefImage<T> image)
where T : struct, IColor
{