diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs
index a7ce0e809f..2ad9079e13 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 e15d8a4345..6873c5f4d6 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 572c4a8f7d..d9badf5a80 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 13b58161c6..e6170f7680 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 2194b8ab44..6df2f556f0 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 154afd8ed6..40666934f4 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 a1addaa900..7f034cebfe 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 b0d9e1ef90..8a7d068f98 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 f6b0582fbf..3336155242 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 c93781d9e3..de6264824f 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 63a19d6d49..4d9979a4fc 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 d082df39a5..b0c225d85a 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 2e3efe1c72..c8b95d8354 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 85ae2f9fab..b780183df2 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 a673abf68c..920b9efc03 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 fd38e659b4..28759a54cd 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 0f0a9d2182..68a0ff2f43 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 b776cc4c0c..1623923261 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 e88115438c..3f9d865b77 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 c263ffe27b..a846311439 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 79c647bf16..1c4ac8465c 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
{
///