|
|
|
@ -7,12 +7,12 @@ using System.Linq; |
|
|
|
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Description of a profile within a sequence
|
|
|
|
/// Description of a profile within a sequence.
|
|
|
|
/// </summary>
|
|
|
|
internal sealed class IccProfileSequenceIdentifier : IEquatable<IccProfileSequenceIdentifier> |
|
|
|
internal readonly struct IccProfileSequenceIdentifier : IEquatable<IccProfileSequenceIdentifier> |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="IccProfileSequenceIdentifier"/> class.
|
|
|
|
/// Initializes a new instance of the <see cref="IccProfileSequenceIdentifier"/> struct.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">ID of the profile</param>
|
|
|
|
/// <param name="description">Description of the profile</param>
|
|
|
|
@ -25,44 +25,23 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the ID of the profile
|
|
|
|
/// Gets the ID of the profile.
|
|
|
|
/// </summary>
|
|
|
|
public IccProfileId Id { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the description of the profile
|
|
|
|
/// Gets the description of the profile.
|
|
|
|
/// </summary>
|
|
|
|
public IccLocalizedString[] Description { get; } |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public bool Equals(IccProfileSequenceIdentifier other) |
|
|
|
{ |
|
|
|
if (ReferenceEquals(null, other)) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (ReferenceEquals(this, other)) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
return this.Id.Equals(other.Id) && this.Description.SequenceEqual(other.Description); |
|
|
|
} |
|
|
|
public bool Equals(IccProfileSequenceIdentifier other) => |
|
|
|
this.Id.Equals(other.Id) && |
|
|
|
this.Description.SequenceEqual(other.Description); |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public override bool Equals(object obj) |
|
|
|
{ |
|
|
|
if (obj == null) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (ReferenceEquals(this, obj)) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
return obj is IccProfileSequenceIdentifier other && this.Equals(other); |
|
|
|
} |
|
|
|
|
|
|
|
|