Fixed some more code issues

This commit is contained in:
Darth Affe 2024-07-06 19:59:49 +02:00
parent 491e9d3f1c
commit 9f37a41f55
3 changed files with 6 additions and 6 deletions

View File

@ -56,7 +56,7 @@ public static partial class PixelHelper
}; };
} }
internal static Generic3ByteData Average(ReadOnlySpan<Generic3ByteData> data) private static Generic3ByteData Average(ReadOnlySpan<Generic3ByteData> data)
{ {
if (data == null) throw new ArgumentNullException(nameof(data)); if (data == null) throw new ArgumentNullException(nameof(data));
if (data.Length == 0) return default; if (data.Length == 0) return default;
@ -70,7 +70,7 @@ public static partial class PixelHelper
(byte)(sum.L3 / count)); (byte)(sum.L3 / count));
} }
internal static Generic4ByteData Average(ReadOnlySpan<Generic4ByteData> data) private static Generic4ByteData Average(ReadOnlySpan<Generic4ByteData> data)
{ {
if (data == null) throw new ArgumentNullException(nameof(data)); if (data == null) throw new ArgumentNullException(nameof(data));
if (data.Length == 0) return default; if (data.Length == 0) return default;

View File

@ -62,7 +62,7 @@ public static unsafe partial class PixelHelper
}; };
} }
internal static Generic3ByteMinMax MinMax(ReadOnlySpan<Generic3ByteData> data) private static Generic3ByteMinMax MinMax(ReadOnlySpan<Generic3ByteData> data)
{ {
byte minB1 = byte.MaxValue, minB2 = byte.MaxValue, minB3 = byte.MaxValue; byte minB1 = byte.MaxValue, minB2 = byte.MaxValue, minB3 = byte.MaxValue;
byte maxB1 = byte.MinValue, maxB2 = byte.MinValue, maxB3 = byte.MinValue; byte maxB1 = byte.MinValue, maxB2 = byte.MinValue, maxB3 = byte.MinValue;
@ -132,7 +132,7 @@ public static unsafe partial class PixelHelper
return new Generic3ByteMinMax(minB1, maxB1, minB2, maxB2, minB3, maxB3); return new Generic3ByteMinMax(minB1, maxB1, minB2, maxB2, minB3, maxB3);
} }
internal static Generic4ByteMinMax MinMax(ReadOnlySpan<Generic4ByteData> data) private static Generic4ByteMinMax MinMax(ReadOnlySpan<Generic4ByteData> data)
{ {
byte minB1 = byte.MaxValue, minB2 = byte.MaxValue, minB3 = byte.MaxValue, minB4 = byte.MaxValue; byte minB1 = byte.MaxValue, minB2 = byte.MaxValue, minB3 = byte.MaxValue, minB4 = byte.MaxValue;
byte maxB1 = byte.MinValue, maxB2 = byte.MinValue, maxB3 = byte.MinValue, maxB4 = byte.MinValue; byte maxB1 = byte.MinValue, maxB2 = byte.MinValue, maxB3 = byte.MinValue, maxB4 = byte.MinValue;

View File

@ -64,7 +64,7 @@ public static unsafe partial class PixelHelper
}; };
} }
internal static Generic4LongData Sum(ReadOnlySpan<Generic3ByteData> data) private static Generic4LongData Sum(ReadOnlySpan<Generic3ByteData> data)
{ {
long b1Sum = 0, b2Sum = 0, b3Sum = 0; long b1Sum = 0, b2Sum = 0, b3Sum = 0;
@ -180,7 +180,7 @@ public static unsafe partial class PixelHelper
return new Generic4LongData(b1Sum, b2Sum, b3Sum, data.Length * 255); return new Generic4LongData(b1Sum, b2Sum, b3Sum, data.Length * 255);
} }
internal static Generic4LongData Sum(ReadOnlySpan<Generic4ByteData> data) private static Generic4LongData Sum(ReadOnlySpan<Generic4ByteData> data)
{ {
long b1Sum, b2Sum, b3Sum, b4Sum; long b1Sum, b2Sum, b3Sum, b4Sum;
int i = 0; int i = 0;