mirror of
https://github.com/DarthAffe/HPPH.git
synced 2025-12-12 21:38:59 +00:00
Added extensions for generic image
This commit is contained in:
parent
2d30dc98ec
commit
0731472c24
@ -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)
|
public static T Average<T>(this RefImage<T> image)
|
||||||
where T : struct, IColor
|
where T : struct, IColor
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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)
|
public static IMinMax MinMax<T>(this RefImage<T> image)
|
||||||
where T : struct, IColor
|
where T : struct, IColor
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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)
|
public static T[] CreateColorPalette<T>(this RefImage<T> image, int paletteSize)
|
||||||
where T : unmanaged, IColor
|
where T : unmanaged, IColor
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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)
|
public static ISum Sum<T>(this RefImage<T> image)
|
||||||
where T : struct, IColor
|
where T : struct, IColor
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user