diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs
index a7ce0e809..2ad9079e1 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs
@@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return this.BreakPoints.SequenceEqual(other.BreakPoints)
+ return this.BreakPoints.AsSpan().SequenceEqual(other.BreakPoints)
&& this.Segments.SequenceEqual(other.Segments);
}
}
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs
index e15d8a434..6873c5f4d 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs
@@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
return this.CurveType == other.CurveType
- && this.XyzValues.SequenceEqual(other.XyzValues)
+ && this.XyzValues.AsSpan().SequenceEqual(other.XyzValues)
&& this.EqualsResponseArray(other);
}
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs
index 572c4a8f7..d9badf5a8 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -34,7 +33,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
if (base.Equals(other) && other is IccSampledCurveElement segment)
{
- return this.CurveEntries.SequenceEqual(segment.CurveEntries);
+ return this.CurveEntries.AsSpan().SequenceEqual(segment.CurveEntries);
}
return false;
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs
index 13b58161c..e6170f768 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
using SixLabors.ImageSharp.Primitives;
@@ -47,7 +46,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
if (base.Equals(other) && other is IccMatrixProcessElement element)
{
return this.EqualsMatrix(element)
- && this.MatrixOx1.SequenceEqual(element.MatrixOx1);
+ && this.MatrixOx1.AsSpan().SequenceEqual(element.MatrixOx1);
}
return false;
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs
index 2194b8ab4..6df2f556f 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -59,7 +58,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.ColorantNumber.SequenceEqual(other.ColorantNumber);
+ return base.Equals(other) && this.ColorantNumber.AsSpan().SequenceEqual(other.ColorantNumber);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs
index 154afd8ed..40666934f 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -107,7 +106,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.CurveData.SequenceEqual(other.CurveData);
+ return base.Equals(other) && this.CurveData.AsSpan().SequenceEqual(other.CurveData);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs
index a1addaa90..7f034cebf 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
using System.Text;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
@@ -83,7 +82,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data) && this.IsAscii == other.IsAscii;
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data) && this.IsAscii == other.IsAscii;
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs
index b0d9e1ef9..8a7d068f9 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -56,7 +55,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data);
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs
index f6b0582fb..333615524 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -57,7 +56,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data);
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs
index c93781d9e..de6264824 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -68,7 +67,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return base.Equals(other)
&& this.Flags == other.Flags
- && this.Channels.SequenceEqual(other.Channels);
+ && this.Channels.AsSpan().SequenceEqual(other.Channels);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs
index 63a19d6d4..4d9979a4f 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -56,7 +55,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data);
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs
index d082df39a..b0c225d85 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -56,7 +55,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data);
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs
index 2e3efe1c7..c8b95d835 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -56,7 +55,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data);
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs
index 85ae2f9fa..b780183df 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs
@@ -56,7 +56,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data);
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs
index a673abf68..920b9efc0 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -56,7 +55,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data);
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs
index fd38e659b..28759a54c 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -77,8 +76,8 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
return base.Equals(other)
- && this.UcrCurve.SequenceEqual(other.UcrCurve)
- && this.BgCurve.SequenceEqual(other.BgCurve)
+ && this.UcrCurve.AsSpan().SequenceEqual(other.UcrCurve)
+ && this.BgCurve.AsSpan().SequenceEqual(other.BgCurve)
&& string.Equals(this.Description, other.Description);
}
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs
index 0f0a9d218..68a0ff2f4 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -56,7 +55,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return base.Equals(other) && this.Data.SequenceEqual(other.Data);
+ return base.Equals(other) && this.Data.AsSpan().SequenceEqual(other.Data);
}
///
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs
index b776cc4c0..162392326 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
@@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
///
/// Initializes a new instance of the class.
///
- /// The XYZ numbers
+ /// The XYZ numbers.
public IccXyzTagDataEntry(Vector3[] data)
: this(data, IccProfileTag.Unknown)
{
@@ -34,7 +33,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
///
- /// Gets the XYZ numbers
+ /// Gets the XYZ numbers.
///
public Vector3[] Data { get; }
@@ -43,7 +42,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
if (base.Equals(other) && other is IccXyzTagDataEntry entry)
{
- return this.Data.SequenceEqual(entry.Data);
+ return this.Data.AsSpan().SequenceEqual(entry.Data);
}
return false;
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs
index e88115438..3f9d865b7 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs
@@ -130,7 +130,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
&& this.DataType == other.DataType
&& this.InputChannelCount == other.InputChannelCount
&& this.OutputChannelCount == other.OutputChannelCount
- && this.GridPointCount.SequenceEqual(other.GridPointCount);
+ && this.GridPointCount.AsSpan().SequenceEqual(other.GridPointCount);
}
///
@@ -162,7 +162,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
for (int i = 0; i < this.Values.Length; i++)
{
- if (!this.Values[i].SequenceEqual(other.Values[i]))
+ if (!this.Values[i].AsSpan().SequenceEqual(other.Values[i]))
{
return false;
}
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs
index c263ffe27..a84631143 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
@@ -68,7 +67,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return true;
}
- return this.Values.SequenceEqual(other.Values);
+ return this.Values.AsSpan().SequenceEqual(other.Values);
}
}
}
diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs
index 79c647bf1..1c4ac8465 100644
--- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs
+++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs
@@ -2,12 +2,14 @@
// Licensed under the Apache License, Version 2.0.
using System;
+using System.Runtime.InteropServices;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{
///
/// A single channel of a
///
+ [StructLayout(LayoutKind.Sequential)]
internal readonly struct IccScreeningChannel : IEquatable
{
///