diff --git a/src/ImageSharp/Common/Helpers/Guard.cs b/src/ImageSharp/Common/Helpers/Guard.cs index e0a4e9bca..9f0a46f80 100644 --- a/src/ImageSharp/Common/Helpers/Guard.cs +++ b/src/ImageSharp/Common/Helpers/Guard.cs @@ -230,7 +230,7 @@ namespace SixLabors.ImageSharp } /// - /// Verifies, that the `target` span has the length of 'minSpan', or longer. + /// Verifies, that the `source` span has the length of 'minSpan', or longer. /// /// The element type of the spans /// The source span. @@ -248,18 +248,18 @@ namespace SixLabors.ImageSharp } /// - /// Verifies, that the `target` span has the length of 'minSpan', or longer. + /// Verifies, that the `source` span has the length of 'minSpan', or longer. /// /// The element type of the spans - /// The target span. + /// The target span. /// The minimum length. /// The name of the parameter that is to be checked. /// - /// is true + /// is true /// - public static void MustBeSizedAtLeast(Span dest, int minLength, string parameterName) + public static void MustBeSizedAtLeast(Span source, int minLength, string parameterName) { - if (dest.Length < minLength) + if (source.Length < minLength) { throw new ArgumentException($"Span-s must be at least of length {minLength}!", parameterName); } diff --git a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs index e6238bf5a..6d25fe9f4 100644 --- a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs +++ b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs @@ -25,14 +25,14 @@ namespace SixLabors.ImageSharp.PixelFormats /// Bulk version of /// /// The to the source vectors. - /// The to the destination colors. + /// The to the destination colors. /// The number of pixels to convert. - internal virtual void PackFromVector4(ReadOnlySpan sourceVectors, Span destColors, int count) + internal virtual void PackFromVector4(ReadOnlySpan sourceVectors, Span destinationColors, int count) { - GuardSpans(sourceVectors, nameof(sourceVectors), destColors, nameof(destColors), count); + GuardSpans(sourceVectors, nameof(sourceVectors), destinationColors, nameof(destinationColors), count); ref Vector4 sourceRef = ref MemoryMarshal.GetReference(sourceVectors); - ref TPixel destRef = ref MemoryMarshal.GetReference(destColors); + ref TPixel destRef = ref MemoryMarshal.GetReference(destinationColors); for (int i = 0; i < count; i++) { @@ -46,14 +46,14 @@ namespace SixLabors.ImageSharp.PixelFormats /// Bulk version of . /// /// The to the source colors. - /// The to the destination vectors. + /// The to the destination vectors. /// The number of pixels to convert. - internal virtual void ToVector4(ReadOnlySpan sourceColors, Span destVectors, int count) + internal virtual void ToVector4(ReadOnlySpan sourceColors, Span destinationVectors, int count) { - GuardSpans(sourceColors, nameof(sourceColors), destVectors, nameof(destVectors), count); + GuardSpans(sourceColors, nameof(sourceColors), destinationVectors, nameof(destinationVectors), count); ref TPixel sourceRef = ref MemoryMarshal.GetReference(sourceColors); - ref Vector4 destRef = ref MemoryMarshal.GetReference(destVectors); + ref Vector4 destRef = ref MemoryMarshal.GetReference(destinationVectors); for (int i = 0; i < count; i++) { @@ -64,25 +64,25 @@ namespace SixLabors.ImageSharp.PixelFormats } /// - /// Verifies that the given 'source' and 'dest' spans are at least of 'minLength' size. + /// Verifies that the given 'source' and 'destination' spans are at least of 'minLength' size. /// Throwing an if the condition is not met. /// /// The source element type /// The destination element type /// The source span /// The source parameter name - /// The destination span - /// The destination parameter name + /// The destination span + /// The destination parameter name /// The minimum length protected internal static void GuardSpans( ReadOnlySpan source, string sourceParamName, - Span dest, - string destParamName, + Span destination, + string destinationParamName, int minLength) { - Guard.MustBeSizedAtLeast(source, minLength, sourceParamName); - Guard.MustBeSizedAtLeast(dest, minLength, destParamName); + Guard.MustBeSizedAtLeast(source, minLength, sourceParamName); + Guard.MustBeSizedAtLeast(destination, minLength, destinationParamName); } } } \ No newline at end of file