diff --git a/src/ImageSharp.Drawing/Processing/GradientBrushBase{TPixel}.cs b/src/ImageSharp.Drawing/Processing/GradientBrushBase{TPixel}.cs
index 897b3f384..00141a8d8 100644
--- a/src/ImageSharp.Drawing/Processing/GradientBrushBase{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Processing/GradientBrushBase{TPixel}.cs
@@ -130,7 +130,7 @@ namespace SixLabors.ImageSharp.Processing
onLocalGradient);
TPixel resultColor = default;
- resultColor.PackFromVector4(result);
+ resultColor.FromVector4(result);
return resultColor;
}
}
diff --git a/src/ImageSharp.Drawing/Processing/RecolorBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/RecolorBrush{TPixel}.cs
index 87e1dc146..2968b68b5 100644
--- a/src/ImageSharp.Drawing/Processing/RecolorBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Processing/RecolorBrush{TPixel}.cs
@@ -95,9 +95,9 @@ namespace SixLabors.ImageSharp.Processing
// Lets hack a min max extremes for a color space by letting the IPackedPixel clamp our values to something in the correct spaces :)
var maxColor = default(TPixel);
- maxColor.PackFromVector4(new Vector4(float.MaxValue));
+ maxColor.FromVector4(new Vector4(float.MaxValue));
var minColor = default(TPixel);
- minColor.PackFromVector4(new Vector4(float.MinValue));
+ minColor.FromVector4(new Vector4(float.MinValue));
this.threshold = Vector4.DistanceSquared(maxColor.ToVector4(), minColor.ToVector4()) * threshold;
}
diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs
index 3ce14cdea..3c197673d 100644
--- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs
+++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs
@@ -37,10 +37,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLch sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -70,10 +70,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLchuv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -103,10 +103,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLuv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -136,10 +136,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyy sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -171,10 +171,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyz sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -203,10 +203,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Cmyk sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -236,10 +236,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsl sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -268,10 +268,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -301,10 +301,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref HunterLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -334,10 +334,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Lms sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -367,10 +367,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref LinearRgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -400,10 +400,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Rgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
@@ -433,10 +433,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref YCbCr sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs
index 3c9e6658c..0a8607e3b 100644
--- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs
+++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs
@@ -4,6 +4,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+
using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation;
namespace SixLabors.ImageSharp.ColorSpaces.Conversion
@@ -37,10 +38,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -70,10 +71,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLchuv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -103,10 +104,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLuv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -136,10 +137,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyy sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -169,10 +170,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyz sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -201,10 +202,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Cmyk sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -234,10 +235,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsl sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -267,10 +268,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -300,10 +301,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref HunterLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -333,10 +334,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref LinearRgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -366,10 +367,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Lms sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -399,10 +400,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Rgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
@@ -432,10 +433,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref YCbCr sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs
index 01de79488..3a779ee72 100644
--- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs
+++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs
@@ -4,6 +4,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+
using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation;
namespace SixLabors.ImageSharp.ColorSpaces.Conversion
@@ -35,10 +36,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -68,10 +69,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLch sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -103,10 +104,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLuv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -136,10 +137,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyy sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -169,10 +170,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyz sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -202,10 +203,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Cmyk sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -235,10 +236,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsl sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -268,10 +269,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -301,10 +302,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref HunterLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -334,10 +335,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref LinearRgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -367,10 +368,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Lms sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -400,10 +401,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Rgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -432,10 +433,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref YCbCr sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLchuv destRef = ref MemoryMarshal.GetReference(destination);
diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs
index 0b469e065..90eb8e34d 100644
--- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs
+++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs
@@ -4,6 +4,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+
using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation;
namespace SixLabors.ImageSharp.ColorSpaces.Conversion
@@ -31,10 +32,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -63,10 +64,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLch sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -98,10 +99,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLchuv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -130,10 +131,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyy sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -165,10 +166,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyz sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -197,10 +198,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Cmyk sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -229,10 +230,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsl sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -261,10 +262,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -293,10 +294,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref HunterLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -325,10 +326,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Lms sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -357,10 +358,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref LinearRgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -389,10 +390,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Rgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
@@ -421,10 +422,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref YCbCr sourceRef = ref MemoryMarshal.GetReference(source);
ref CieLuv destRef = ref MemoryMarshal.GetReference(destination);
diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyy.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyy.cs
index b77f48325..d03c10a01 100644
--- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyy.cs
+++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyy.cs
@@ -4,6 +4,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+
using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation;
namespace SixLabors.ImageSharp.ColorSpaces.Conversion
@@ -32,10 +33,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -65,10 +66,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLch sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -98,10 +99,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLchuv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -131,10 +132,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieLuv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -159,10 +160,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref CieXyz sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -192,10 +193,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Cmyk sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -225,10 +226,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsl sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -258,10 +259,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Hsv sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -291,10 +292,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref HunterLab sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -324,10 +325,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref LinearRgb sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -357,10 +358,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan source, Span destination)
{
- Guard.SpansMustBeSizedAtLeast(source, nameof(source), destination, nameof(destination), count);
+ Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination));
+ int count = source.Length;
ref Lms sourceRef = ref MemoryMarshal.GetReference(source);
ref CieXyy destRef = ref MemoryMarshal.GetReference(destination);
@@ -390,10 +391,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion
///
/// The span to the source colors
/// The span to the destination colors
- /// The number of colors to convert.
- public void Convert(ReadOnlySpan source, Span destination, int count)
+ public void Convert(ReadOnlySpan