diff --git a/src/ImageSharp/Color/Color.Conversions.cs b/src/ImageSharp/Color/Color.Conversions.cs index ec25be5d61..bbb848867d 100644 --- a/src/ImageSharp/Color/Color.Conversions.cs +++ b/src/ImageSharp/Color/Color.Conversions.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; diff --git a/src/ImageSharp/ColorSpaces/CieLab.cs b/src/ImageSharp/ColorSpaces/CieLab.cs index 831555d12d..2346b395c0 100644 --- a/src/ImageSharp/ColorSpaces/CieLab.cs +++ b/src/ImageSharp/ColorSpaces/CieLab.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -124,7 +123,7 @@ public readonly struct CieLab : IEquatable public override string ToString() => FormattableString.Invariant($"CieLab({this.L:#0.##}, {this.A:#0.##}, {this.B:#0.##})"); /// - public override bool Equals(object obj) => obj is CieLab other && this.Equals(other); + public override bool Equals(object? obj) => obj is CieLab other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/CieLch.cs b/src/ImageSharp/ColorSpaces/CieLch.cs index 78aeeb807c..48e8e2c6d9 100644 --- a/src/ImageSharp/ColorSpaces/CieLch.cs +++ b/src/ImageSharp/ColorSpaces/CieLch.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -128,7 +127,7 @@ public readonly struct CieLch : IEquatable /// [MethodImpl(InliningOptions.ShortMethod)] - public override bool Equals(object obj) => obj is CieLch other && this.Equals(other); + public override bool Equals(object? obj) => obj is CieLch other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/CieLchuv.cs b/src/ImageSharp/ColorSpaces/CieLchuv.cs index 6c116f5811..4d47be5aa3 100644 --- a/src/ImageSharp/ColorSpaces/CieLchuv.cs +++ b/src/ImageSharp/ColorSpaces/CieLchuv.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -125,7 +124,7 @@ public readonly struct CieLchuv : IEquatable public override string ToString() => FormattableString.Invariant($"CieLchuv({this.L:#0.##}, {this.C:#0.##}, {this.H:#0.##})"); /// - public override bool Equals(object obj) => obj is CieLchuv other && this.Equals(other); + public override bool Equals(object? obj) => obj is CieLchuv other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/CieLuv.cs b/src/ImageSharp/ColorSpaces/CieLuv.cs index 9cbb9d6ac6..04bc96cfa2 100644 --- a/src/ImageSharp/ColorSpaces/CieLuv.cs +++ b/src/ImageSharp/ColorSpaces/CieLuv.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -125,7 +124,7 @@ public readonly struct CieLuv : IEquatable public override string ToString() => FormattableString.Invariant($"CieLuv({this.L:#0.##}, {this.U:#0.##}, {this.V:#0.##})"); /// - public override bool Equals(object obj) => obj is CieLuv other && this.Equals(other); + public override bool Equals(object? obj) => obj is CieLuv other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/CieXyy.cs b/src/ImageSharp/ColorSpaces/CieXyy.cs index fdfc52ce6c..6b7d2e6cbd 100644 --- a/src/ImageSharp/ColorSpaces/CieXyy.cs +++ b/src/ImageSharp/ColorSpaces/CieXyy.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -89,7 +88,7 @@ public readonly struct CieXyy : IEquatable public override string ToString() => FormattableString.Invariant($"CieXyy({this.X:#0.##}, {this.Y:#0.##}, {this.Yl:#0.##})"); /// - public override bool Equals(object obj) => obj is CieXyy other && this.Equals(other); + public override bool Equals(object? obj) => obj is CieXyy other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/CieXyz.cs b/src/ImageSharp/ColorSpaces/CieXyz.cs index bfe71a8946..2ac9c9f286 100644 --- a/src/ImageSharp/ColorSpaces/CieXyz.cs +++ b/src/ImageSharp/ColorSpaces/CieXyz.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -92,7 +91,7 @@ public readonly struct CieXyz : IEquatable public override string ToString() => FormattableString.Invariant($"CieXyz({this.X:#0.##}, {this.Y:#0.##}, {this.Z:#0.##})"); /// - public override bool Equals(object obj) => obj is CieXyz other && this.Equals(other); + public override bool Equals(object? obj) => obj is CieXyz other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/Cmyk.cs b/src/ImageSharp/ColorSpaces/Cmyk.cs index 63009ddae6..a5aacf38ad 100644 --- a/src/ImageSharp/ColorSpaces/Cmyk.cs +++ b/src/ImageSharp/ColorSpaces/Cmyk.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -96,7 +95,7 @@ public readonly struct Cmyk : IEquatable public override string ToString() => FormattableString.Invariant($"Cmyk({this.C:#0.##}, {this.M:#0.##}, {this.Y:#0.##}, {this.K:#0.##})"); /// - public override bool Equals(object obj) => obj is Cmyk other && this.Equals(other); + public override bool Equals(object? obj) => obj is Cmyk other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieXyChromaticityCoordinates.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieXyChromaticityCoordinates.cs index fa09a230bc..2cc785d53b 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieXyChromaticityCoordinates.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieXyChromaticityCoordinates.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Runtime.CompilerServices; @@ -74,7 +73,7 @@ public readonly struct CieXyChromaticityCoordinates : IEquatable FormattableString.Invariant($"CieXyChromaticityCoordinates({this.X:#0.##}, {this.Y:#0.##})"); /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is CieXyChromaticityCoordinates other && this.Equals(other); /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/RGBPrimariesChromaticityCoordinates.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/RGBPrimariesChromaticityCoordinates.cs index 85258d7a63..625e6c551a 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/RGBPrimariesChromaticityCoordinates.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/RGBPrimariesChromaticityCoordinates.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.ColorSpaces.Conversion; @@ -73,7 +72,7 @@ public readonly struct RgbPrimariesChromaticityCoordinates : IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is RgbPrimariesChromaticityCoordinates other && this.Equals(other); } diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/GammaWorkingSpace.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/GammaWorkingSpace.cs index 87b0ce8065..e95f1f2b47 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/GammaWorkingSpace.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/GammaWorkingSpace.cs @@ -34,7 +34,7 @@ public sealed class GammaWorkingSpace : RgbWorkingSpace public override float Expand(float channel) => GammaCompanding.Expand(channel, this.Gamma); /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is null) { diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/RgbWorkingSpace.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/RgbWorkingSpace.cs index 685032cbdb..f22f2ff1fa 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/RgbWorkingSpace.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/RgbWorkingSpace.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.ColorSpaces.Conversion; @@ -53,7 +52,7 @@ public abstract class RgbWorkingSpace public abstract float Compress(float channel); /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is null) { diff --git a/src/ImageSharp/ColorSpaces/Hsl.cs b/src/ImageSharp/ColorSpaces/Hsl.cs index d539a7a805..cf18c70c78 100644 --- a/src/ImageSharp/ColorSpaces/Hsl.cs +++ b/src/ImageSharp/ColorSpaces/Hsl.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -90,7 +89,7 @@ public readonly struct Hsl : IEquatable public override string ToString() => FormattableString.Invariant($"Hsl({this.H:#0.##}, {this.S:#0.##}, {this.L:#0.##})"); /// - public override bool Equals(object obj) => obj is Hsl other && this.Equals(other); + public override bool Equals(object? obj) => obj is Hsl other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/Hsv.cs b/src/ImageSharp/ColorSpaces/Hsv.cs index d6240cb130..87c16c0b6a 100644 --- a/src/ImageSharp/ColorSpaces/Hsv.cs +++ b/src/ImageSharp/ColorSpaces/Hsv.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -88,7 +87,7 @@ public readonly struct Hsv : IEquatable public override string ToString() => FormattableString.Invariant($"Hsv({this.H:#0.##}, {this.S:#0.##}, {this.V:#0.##})"); /// - public override bool Equals(object obj) => obj is Hsv other && this.Equals(other); + public override bool Equals(object? obj) => obj is Hsv other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/HunterLab.cs b/src/ImageSharp/ColorSpaces/HunterLab.cs index 6f9294bf8d..516574b098 100644 --- a/src/ImageSharp/ColorSpaces/HunterLab.cs +++ b/src/ImageSharp/ColorSpaces/HunterLab.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -123,7 +122,7 @@ public readonly struct HunterLab : IEquatable public override string ToString() => FormattableString.Invariant($"HunterLab({this.L:#0.##}, {this.A:#0.##}, {this.B:#0.##})"); /// - public override bool Equals(object obj) => obj is HunterLab other && this.Equals(other); + public override bool Equals(object? obj) => obj is HunterLab other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/LinearRgb.cs b/src/ImageSharp/ColorSpaces/LinearRgb.cs index 0727f38123..49c7814a0e 100644 --- a/src/ImageSharp/ColorSpaces/LinearRgb.cs +++ b/src/ImageSharp/ColorSpaces/LinearRgb.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -132,7 +131,7 @@ public readonly struct LinearRgb : IEquatable public override string ToString() => FormattableString.Invariant($"LinearRgb({this.R:#0.##}, {this.G:#0.##}, {this.B:#0.##})"); /// - public override bool Equals(object obj) => obj is LinearRgb other && this.Equals(other); + public override bool Equals(object? obj) => obj is LinearRgb other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/Lms.cs b/src/ImageSharp/ColorSpaces/Lms.cs index a33ad189a0..99210ff6e4 100644 --- a/src/ImageSharp/ColorSpaces/Lms.cs +++ b/src/ImageSharp/ColorSpaces/Lms.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -93,7 +92,7 @@ public readonly struct Lms : IEquatable public override string ToString() => FormattableString.Invariant($"Lms({this.L:#0.##}, {this.M:#0.##}, {this.S:#0.##})"); /// - public override bool Equals(object obj) => obj is Lms other && this.Equals(other); + public override bool Equals(object? obj) => obj is Lms other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/Rgb.cs b/src/ImageSharp/ColorSpaces/Rgb.cs index 2b6485baf6..55052a710e 100644 --- a/src/ImageSharp/ColorSpaces/Rgb.cs +++ b/src/ImageSharp/ColorSpaces/Rgb.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -153,7 +152,7 @@ public readonly struct Rgb : IEquatable public override string ToString() => FormattableString.Invariant($"Rgb({this.R:#0.##}, {this.G:#0.##}, {this.B:#0.##})"); /// - public override bool Equals(object obj) => obj is Rgb other && this.Equals(other); + public override bool Equals(object? obj) => obj is Rgb other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/ColorSpaces/YCbCr.cs b/src/ImageSharp/ColorSpaces/YCbCr.cs index 035306a7b3..acb59388fb 100644 --- a/src/ImageSharp/ColorSpaces/YCbCr.cs +++ b/src/ImageSharp/ColorSpaces/YCbCr.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -89,7 +88,7 @@ public readonly struct YCbCr : IEquatable public override string ToString() => FormattableString.Invariant($"YCbCr({this.Y}, {this.Cb}, {this.Cr})"); /// - public override bool Equals(object obj) => obj is YCbCr other && this.Equals(other); + public override bool Equals(object? obj) => obj is YCbCr other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/Formats/Gif/Sections/GifGraphicControlExtension.cs b/src/ImageSharp/Formats/Gif/Sections/GifGraphicControlExtension.cs index 0352d7447f..52052021fc 100644 --- a/src/ImageSharp/Formats/Gif/Sections/GifGraphicControlExtension.cs +++ b/src/ImageSharp/Formats/Gif/Sections/GifGraphicControlExtension.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -107,7 +106,7 @@ internal readonly struct GifGraphicControlExtension : IGifExtension, IEquatable< return value; } - public override bool Equals(object obj) => obj is GifGraphicControlExtension extension && this.Equals(extension); + public override bool Equals(object? obj) => obj is GifGraphicControlExtension extension && this.Equals(extension); public bool Equals(GifGraphicControlExtension other) => this.BlockSize == other.BlockSize diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs index 7edf6ba6a2..3bd5d28e74 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -471,7 +470,7 @@ internal partial struct Block8x8F : IEquatable && this.V7R == other.V7R; /// - public override bool Equals(object obj) => this.Equals((Block8x8F)obj); + public override bool Equals(object? obj) => this.Equals((Block8x8F?)obj); /// public override int GetHashCode() diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs index 44ad92311d..c9ee55cd77 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder; @@ -90,7 +89,7 @@ internal readonly struct AdobeMarker : IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is AdobeMarker other && this.Equals(other); } diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs index 7ee50ce9a4..42dcf7200a 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using SixLabors.ImageSharp.Metadata; @@ -110,7 +109,7 @@ internal readonly struct JFifMarker : IEquatable && this.YDensity == other.YDensity; /// - public override bool Equals(object obj) => obj is JFifMarker other && this.Equals(other); + public override bool Equals(object? obj) => obj is JFifMarker other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Formats/Png/PngTextData.cs b/src/ImageSharp/Formats/Png/PngTextData.cs index bf30013140..8ef4f1821d 100644 --- a/src/ImageSharp/Formats/Png/PngTextData.cs +++ b/src/ImageSharp/Formats/Png/PngTextData.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Formats.Png; @@ -99,7 +98,7 @@ public readonly struct PngTextData : IEquatable /// true if and this instance are the same type and represent the /// same value; otherwise, false. /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is PngTextData other && this.Equals(other); /// diff --git a/src/ImageSharp/Formats/Tiff/TiffBitsPerSample.cs b/src/ImageSharp/Formats/Tiff/TiffBitsPerSample.cs index ffb5ee02cc..fb35ef2de3 100644 --- a/src/ImageSharp/Formats/Tiff/TiffBitsPerSample.cs +++ b/src/ImageSharp/Formats/Tiff/TiffBitsPerSample.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Formats.Tiff; @@ -126,7 +125,7 @@ public readonly struct TiffBitsPerSample : IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is TiffBitsPerSample sample && this.Equals(sample); /// diff --git a/src/ImageSharp/Memory/RowInterval.cs b/src/ImageSharp/Memory/RowInterval.cs index 4601ef9ff4..90a88d735a 100644 --- a/src/ImageSharp/Memory/RowInterval.cs +++ b/src/ImageSharp/Memory/RowInterval.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Memory; @@ -69,7 +68,7 @@ public readonly struct RowInterval : IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return !ReferenceEquals(null, obj) && obj is RowInterval other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/Exif/Tags/ExifTag.cs b/src/ImageSharp/Metadata/Profiles/Exif/Tags/ExifTag.cs index 4f0c18d543..ea0b8060d5 100644 --- a/src/ImageSharp/Metadata/Profiles/Exif/Tags/ExifTag.cs +++ b/src/ImageSharp/Metadata/Profiles/Exif/Tags/ExifTag.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Exif; @@ -34,7 +33,7 @@ public abstract partial class ExifTag : IEquatable public static bool operator !=(ExifTag left, ExifTag right) => !Equals(left, right); /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is ExifTag value) { @@ -45,7 +44,7 @@ public abstract partial class ExifTag : IEquatable } /// - public bool Equals(ExifTag other) + public bool Equals(ExifTag? other) { if (other is null) { diff --git a/src/ImageSharp/Metadata/Profiles/Exif/Values/EncodedString.cs b/src/ImageSharp/Metadata/Profiles/Exif/Values/EncodedString.cs index b588344784..cd5d1dc626 100644 --- a/src/ImageSharp/Metadata/Profiles/Exif/Values/EncodedString.cs +++ b/src/ImageSharp/Metadata/Profiles/Exif/Values/EncodedString.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Exif; @@ -101,7 +100,7 @@ public readonly struct EncodedString : IEquatable public static bool operator !=(EncodedString left, EncodedString right) => !(left == right); /// - public override bool Equals(object obj) => obj is EncodedString other && this.Equals(other); + public override bool Equals(object? obj) => obj is EncodedString other && this.Equals(other); /// public bool Equals(EncodedString other) => this.Text == other.Text && this.Code == other.Code; diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccCurveSegment.cs b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccCurveSegment.cs index 5c5f719a11..cebc58a259 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccCurveSegment.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccCurveSegment.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -22,7 +21,7 @@ internal abstract class IccCurveSegment : IEquatable public IccCurveSegmentSignature Signature { get; } /// - public virtual bool Equals(IccCurveSegment other) + public virtual bool Equals(IccCurveSegment? other) { if (other is null) { @@ -38,7 +37,7 @@ internal abstract class IccCurveSegment : IEquatable } /// - public override bool Equals(object obj) => this.Equals(obj as IccCurveSegment); + public override bool Equals(object? obj) => this.Equals(obj as IccCurveSegment); /// public override int GetHashCode() => this.Signature.GetHashCode(); diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccFormulaCurveElement.cs b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccFormulaCurveElement.cs index 3d503a9eeb..068a4d11a1 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccFormulaCurveElement.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccFormulaCurveElement.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -67,7 +66,7 @@ internal sealed class IccFormulaCurveElement : IccCurveSegment, IEquatable - public override bool Equals(IccCurveSegment other) + public override bool Equals(IccCurveSegment? other) { if (base.Equals(other) && other is IccFormulaCurveElement segment) { @@ -84,10 +83,10 @@ internal sealed class IccFormulaCurveElement : IccCurveSegment, IEquatable - public bool Equals(IccFormulaCurveElement other) => this.Equals((IccCurveSegment)other); + public bool Equals(IccFormulaCurveElement? other) => this.Equals((IccCurveSegment?)other); /// - public override bool Equals(object obj) => this.Equals(obj as IccFormulaCurveElement); + public override bool Equals(object? obj) => this.Equals(obj as IccFormulaCurveElement); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccOneDimensionalCurve.cs b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccOneDimensionalCurve.cs index 2a785c6eb4..30935ebbe5 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccOneDimensionalCurve.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccOneDimensionalCurve.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -37,7 +36,7 @@ internal sealed class IccOneDimensionalCurve : IEquatable - public bool Equals(IccOneDimensionalCurve other) + public bool Equals(IccOneDimensionalCurve? other) { if (other is null) { @@ -54,7 +53,7 @@ internal sealed class IccOneDimensionalCurve : IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) => this.Equals(obj as IccOneDimensionalCurve); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccParametricCurve.cs b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccParametricCurve.cs index f9573439d2..0f1f4511d3 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccParametricCurve.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccParametricCurve.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -122,7 +121,7 @@ internal sealed class IccParametricCurve : IEquatable public float F { get; } /// - public bool Equals(IccParametricCurve other) + public bool Equals(IccParametricCurve? other) { if (other is null) { @@ -145,7 +144,7 @@ internal sealed class IccParametricCurve : IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccParametricCurve other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccResponseCurve.cs b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccResponseCurve.cs index bd56bfec7a..45139aae2a 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccResponseCurve.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccResponseCurve.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; @@ -46,7 +45,7 @@ internal sealed class IccResponseCurve : IEquatable public IccResponseNumber[][] ResponseArrays { get; } /// - public bool Equals(IccResponseCurve other) + public bool Equals(IccResponseCurve? other) { if (other is null) { @@ -64,7 +63,7 @@ internal sealed class IccResponseCurve : IEquatable } /// - public override bool Equals(object obj) => obj is IccResponseCurve other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccResponseCurve other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccSampledCurveElement.cs b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccSampledCurveElement.cs index 96d913b3b3..4a66b58c13 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccSampledCurveElement.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Curves/IccSampledCurveElement.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -28,7 +27,7 @@ internal sealed class IccSampledCurveElement : IccCurveSegment, IEquatable - public override bool Equals(IccCurveSegment other) + public override bool Equals(IccCurveSegment? other) { if (base.Equals(other) && other is IccSampledCurveElement segment) { @@ -39,11 +38,11 @@ internal sealed class IccSampledCurveElement : IccCurveSegment, IEquatable - public bool Equals(IccSampledCurveElement other) - => this.Equals((IccCurveSegment)other); + public bool Equals(IccSampledCurveElement? other) + => this.Equals((IccCurveSegment?)other); /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => this.Equals(obj as IccSampledCurveElement); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/IccTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/IccTagDataEntry.cs index fd740d7a3a..12228f3f58 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/IccTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/IccTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -41,13 +40,13 @@ public abstract class IccTagDataEntry : IEquatable public IccProfileTag TagSignature { get; set; } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccTagDataEntry entry && this.Equals(entry); } /// - public virtual bool Equals(IccTagDataEntry other) + public virtual bool Equals(IccTagDataEntry? other) { if (other is null) { diff --git a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs index 3efe7e5852..e9ca7277b2 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -20,10 +19,10 @@ internal sealed class IccBAcsProcessElement : IccMultiProcessElement, IEquatable } /// - public bool Equals(IccBAcsProcessElement other) => base.Equals(other); + public bool Equals(IccBAcsProcessElement? other) => base.Equals(other); /// - public override bool Equals(object obj) => this.Equals(obj as IccBAcsProcessElement); + public override bool Equals(object? obj) => this.Equals(obj as IccBAcsProcessElement); /// public override int GetHashCode() => base.GetHashCode(); diff --git a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs index 596e526e51..67497fdf95 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -23,7 +22,7 @@ internal sealed class IccClutProcessElement : IccMultiProcessElement, IEquatable public IccClut ClutValue { get; } /// - public override bool Equals(IccMultiProcessElement other) + public override bool Equals(IccMultiProcessElement? other) { if (base.Equals(other) && other is IccClutProcessElement element) { @@ -34,10 +33,10 @@ internal sealed class IccClutProcessElement : IccMultiProcessElement, IEquatable } /// - public bool Equals(IccClutProcessElement other) => this.Equals((IccMultiProcessElement)other); + public bool Equals(IccClutProcessElement? other) => this.Equals((IccMultiProcessElement?)other); /// - public override bool Equals(object obj) => this.Equals(obj as IccClutProcessElement); + public override bool Equals(object? obj) => this.Equals(obj as IccClutProcessElement); /// public override int GetHashCode() => base.GetHashCode(); diff --git a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs index 52edc84b0e..a90ceb8a6f 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -23,7 +22,7 @@ internal sealed class IccCurveSetProcessElement : IccMultiProcessElement, IEquat public IccOneDimensionalCurve[] Curves { get; } /// - public override bool Equals(IccMultiProcessElement other) + public override bool Equals(IccMultiProcessElement? other) { if (base.Equals(other) && other is IccCurveSetProcessElement element) { @@ -34,10 +33,10 @@ internal sealed class IccCurveSetProcessElement : IccMultiProcessElement, IEquat } /// - public bool Equals(IccCurveSetProcessElement other) => this.Equals((IccMultiProcessElement)other); + public bool Equals(IccCurveSetProcessElement? other) => this.Equals((IccMultiProcessElement?)other); /// - public override bool Equals(object obj) => this.Equals(obj as IccCurveSetProcessElement); + public override bool Equals(object? obj) => this.Equals(obj as IccCurveSetProcessElement); /// public override int GetHashCode() => base.GetHashCode(); diff --git a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs index 3e88094554..99c27f2bb9 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -20,9 +19,9 @@ internal sealed class IccEAcsProcessElement : IccMultiProcessElement, IEquatable } /// - public bool Equals(IccEAcsProcessElement other) => base.Equals(other); + public bool Equals(IccEAcsProcessElement? other) => base.Equals(other); - public override bool Equals(object obj) => this.Equals(obj as IccEAcsProcessElement); + public override bool Equals(object? obj) => this.Equals(obj as IccEAcsProcessElement); /// public override int GetHashCode() => base.GetHashCode(); diff --git a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs index 694ab0531f..4c2923bce2 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -38,7 +37,7 @@ internal sealed class IccMatrixProcessElement : IccMultiProcessElement, IEquatab public float[] MatrixOx1 { get; } /// - public override bool Equals(IccMultiProcessElement other) + public override bool Equals(IccMultiProcessElement? other) { if (base.Equals(other) && other is IccMatrixProcessElement element) { @@ -50,11 +49,11 @@ internal sealed class IccMatrixProcessElement : IccMultiProcessElement, IEquatab } /// - public bool Equals(IccMatrixProcessElement other) - => this.Equals((IccMultiProcessElement)other); + public bool Equals(IccMatrixProcessElement? other) + => this.Equals((IccMultiProcessElement?)other); /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => this.Equals(obj as IccMatrixProcessElement); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs index daaf774e1b..1699271282 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -41,7 +40,7 @@ internal abstract class IccMultiProcessElement : IEquatable - public virtual bool Equals(IccMultiProcessElement other) + public virtual bool Equals(IccMultiProcessElement? other) { if (other is null) { @@ -58,7 +57,7 @@ internal abstract class IccMultiProcessElement : IEquatable this.Equals(obj as IccMultiProcessElement); + public override bool Equals(object? obj) => this.Equals(obj as IccMultiProcessElement); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs index 865c3e2012..cc44762919 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -78,10 +77,10 @@ internal sealed class IccChromaticityTagDataEntry : IccTagDataEntry, IEquatable< public double[][] ChannelValues { get; } /// - public override bool Equals(IccTagDataEntry other) => other is IccChromaticityTagDataEntry entry && this.Equals(entry); + public override bool Equals(IccTagDataEntry? other) => other is IccChromaticityTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccChromaticityTagDataEntry other) + public bool Equals(IccChromaticityTagDataEntry? other) { if (other is null) { @@ -97,7 +96,7 @@ internal sealed class IccChromaticityTagDataEntry : IccTagDataEntry, IEquatable< } /// - public override bool Equals(object obj) => obj is IccChromaticityTagDataEntry other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccChromaticityTagDataEntry other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs index cfe24ae04b..f5d15897bf 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -39,13 +38,13 @@ internal sealed class IccColorantOrderTagDataEntry : IccTagDataEntry, IEquatable public byte[] ColorantNumber { get; } /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccColorantOrderTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccColorantOrderTagDataEntry other) + public bool Equals(IccColorantOrderTagDataEntry? other) { if (other is null) { @@ -61,7 +60,7 @@ internal sealed class IccColorantOrderTagDataEntry : IccTagDataEntry, IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccColorantOrderTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs index e5bd9dc019..92b353067e 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -40,10 +39,10 @@ internal sealed class IccColorantTableTagDataEntry : IccTagDataEntry, IEquatable public IccColorantTableEntry[] ColorantData { get; } /// - public override bool Equals(IccTagDataEntry other) => other is IccColorantTableTagDataEntry entry && this.Equals(entry); + public override bool Equals(IccTagDataEntry? other) => other is IccColorantTableTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccColorantTableTagDataEntry other) + public bool Equals(IccColorantTableTagDataEntry? other) { if (other is null) { @@ -59,7 +58,7 @@ internal sealed class IccColorantTableTagDataEntry : IccTagDataEntry, IEquatable } /// - public override bool Equals(object obj) => obj is IccColorantTableTagDataEntry other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccColorantTableTagDataEntry other && this.Equals(other); /// public override int GetHashCode() => HashCode.Combine(this.Signature, this.ColorantData); diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs index abf7e989c6..75176057d9 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -85,11 +84,11 @@ internal sealed class IccCrdInfoTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) => other is IccCrdInfoTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccCrdInfoTagDataEntry other) + public bool Equals(IccCrdInfoTagDataEntry? other) { if (other is null) { @@ -110,7 +109,7 @@ internal sealed class IccCrdInfoTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccCrdInfoTagDataEntry other && this.Equals(other); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs index 815fabddc8..5605d92559 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -87,13 +86,13 @@ internal sealed class IccCurveTagDataEntry : IccTagDataEntry, IEquatable this.CurveData.Length == 1; /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccCurveTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccCurveTagDataEntry other) + public bool Equals(IccCurveTagDataEntry? other) { if (other is null) { @@ -109,7 +108,7 @@ internal sealed class IccCurveTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccCurveTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs index 7502d4e192..3d83ccfee0 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Text; @@ -58,14 +57,14 @@ internal sealed class IccDataTagDataEntry : IccTagDataEntry, IEquatable decoded as 7bit ASCII. /// If is false, returns null /// - public string AsciiString => this.IsAscii ? Encoding.ASCII.GetString(this.Data, 0, this.Data.Length) : null; + public string? AsciiString => this.IsAscii ? Encoding.ASCII.GetString(this.Data, 0, this.Data.Length) : null; /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) => other is IccDataTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccDataTagDataEntry other) + public bool Equals(IccDataTagDataEntry? other) { if (other is null) { @@ -81,7 +80,7 @@ internal sealed class IccDataTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccDataTagDataEntry other && this.Equals(other); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs index fca82dfe21..cd3fdcd1b1 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -35,13 +34,13 @@ internal sealed class IccDateTimeTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccDateTimeTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccDateTimeTagDataEntry other) + public bool Equals(IccDateTimeTagDataEntry? other) { if (other is null) { @@ -57,7 +56,7 @@ internal sealed class IccDateTimeTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccDateTimeTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs index 42e3c6f6d5..d72c382a7e 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -35,13 +34,13 @@ internal sealed class IccFix16ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccFix16ArrayTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccFix16ArrayTagDataEntry other) + public bool Equals(IccFix16ArrayTagDataEntry? other) { if (other is null) { @@ -57,7 +56,7 @@ internal sealed class IccFix16ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccFix16ArrayTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs index 7bcd86e300..9ddd0ce13d 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; @@ -110,10 +109,10 @@ internal sealed class IccLut16TagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) => other is IccLut16TagDataEntry entry && this.Equals(entry); + public override bool Equals(IccTagDataEntry? other) => other is IccLut16TagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccLut16TagDataEntry other) + public bool Equals(IccLut16TagDataEntry? other) { if (other is null) { @@ -133,7 +132,7 @@ internal sealed class IccLut16TagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) => obj is IccLut16TagDataEntry other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccLut16TagDataEntry other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs index 70af3cca17..0c07dc3b7a 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; @@ -113,10 +112,10 @@ internal sealed class IccLut8TagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) => other is IccLut8TagDataEntry entry && this.Equals(entry); + public override bool Equals(IccTagDataEntry? other) => other is IccLut8TagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccLut8TagDataEntry other) + public bool Equals(IccLut8TagDataEntry? other) { if (other is null) { @@ -136,7 +135,7 @@ internal sealed class IccLut8TagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) => obj is IccLut8TagDataEntry other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccLut8TagDataEntry other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs index cd67197939..5e20579a35 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; @@ -71,13 +70,13 @@ internal sealed class IccMeasurementTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccMeasurementTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccMeasurementTagDataEntry other) + public bool Equals(IccMeasurementTagDataEntry? other) { if (other is null) { @@ -98,7 +97,7 @@ internal sealed class IccMeasurementTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccMeasurementTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs index 35b870dc30..eb2cfcf6c1 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -36,13 +35,13 @@ internal sealed class IccMultiLocalizedUnicodeTagDataEntry : IccTagDataEntry, IE public IccLocalizedString[] Texts { get; } /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccMultiLocalizedUnicodeTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccMultiLocalizedUnicodeTagDataEntry other) + public bool Equals(IccMultiLocalizedUnicodeTagDataEntry? other) { if (other is null) { @@ -58,7 +57,7 @@ internal sealed class IccMultiLocalizedUnicodeTagDataEntry : IccTagDataEntry, IE } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccMultiLocalizedUnicodeTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs index 76b4752bce..1739eb66eb 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -54,11 +53,11 @@ internal sealed class IccMultiProcessElementsTagDataEntry : IccTagDataEntry, IEq public IccMultiProcessElement[] Data { get; } /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) => other is IccMultiProcessElementsTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccMultiProcessElementsTagDataEntry other) + public bool Equals(IccMultiProcessElementsTagDataEntry? other) { if (other is null) { @@ -77,7 +76,7 @@ internal sealed class IccMultiProcessElementsTagDataEntry : IccTagDataEntry, IEq } /// - public override bool Equals(object obj) => obj is IccMultiProcessElementsTagDataEntry other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccMultiProcessElementsTagDataEntry other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs index 70cf336d13..bf4e49ee0e 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -72,7 +71,7 @@ internal sealed class IccNamedColor2TagDataEntry : IccTagDataEntry, IEquatableSuffix /// The named colors /// Tag Signature - public IccNamedColor2TagDataEntry(int vendorFlags, string prefix, string suffix, IccNamedColor[] colors, IccProfileTag tagSignature) + public IccNamedColor2TagDataEntry(int vendorFlags, string? prefix, string? suffix, IccNamedColor[] colors, IccProfileTag tagSignature) : base(IccTypeSignature.NamedColor2, tagSignature) { Guard.NotNull(colors, nameof(colors)); @@ -100,12 +99,12 @@ internal sealed class IccNamedColor2TagDataEntry : IccTagDataEntry, IEquatable /// Gets the prefix /// - public string Prefix { get; } + public string? Prefix { get; } /// /// Gets the suffix /// - public string Suffix { get; } + public string? Suffix { get; } /// /// Gets the vendor specific flags @@ -118,11 +117,11 @@ internal sealed class IccNamedColor2TagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) => other is IccNamedColor2TagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccNamedColor2TagDataEntry other) + public bool Equals(IccNamedColor2TagDataEntry? other) { if (other is null) { @@ -143,7 +142,7 @@ internal sealed class IccNamedColor2TagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccNamedColor2TagDataEntry other && this.Equals(other); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs index b9db9c256c..3a03ba8559 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -36,13 +35,13 @@ internal sealed class IccParametricCurveTagDataEntry : IccTagDataEntry, IEquatab public IccParametricCurve Curve { get; } /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccParametricCurveTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccParametricCurveTagDataEntry other) + public bool Equals(IccParametricCurveTagDataEntry? other) { if (other is null) { @@ -58,7 +57,7 @@ internal sealed class IccParametricCurveTagDataEntry : IccTagDataEntry, IEquatab } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccParametricCurveTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs index d3f89a9cce..92754088bd 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -35,11 +34,11 @@ internal sealed class IccProfileSequenceDescTagDataEntry : IccTagDataEntry, IEqu public IccProfileDescription[] Descriptions { get; } /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) => other is IccProfileSequenceDescTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccProfileSequenceDescTagDataEntry other) + public bool Equals(IccProfileSequenceDescTagDataEntry? other) { if (other is null) { @@ -55,7 +54,7 @@ internal sealed class IccProfileSequenceDescTagDataEntry : IccTagDataEntry, IEqu } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccProfileSequenceDescTagDataEntry other && this.Equals(other); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs index 9dbf16711b..ea1062d118 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -36,13 +35,13 @@ internal sealed class IccProfileSequenceIdentifierTagDataEntry : IccTagDataEntry public IccProfileSequenceIdentifier[] Data { get; } /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccProfileSequenceIdentifierTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccProfileSequenceIdentifierTagDataEntry other) + public bool Equals(IccProfileSequenceIdentifierTagDataEntry? other) { if (other is null) { @@ -58,7 +57,7 @@ internal sealed class IccProfileSequenceIdentifierTagDataEntry : IccTagDataEntry } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccProfileSequenceIdentifierTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs index 5f6ff297ca..1c1680ded7 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -49,10 +48,10 @@ internal sealed class IccResponseCurveSet16TagDataEntry : IccTagDataEntry, IEqua public IccResponseCurve[] Curves { get; } /// - public override bool Equals(IccTagDataEntry other) => other is IccResponseCurveSet16TagDataEntry entry && this.Equals(entry); + public override bool Equals(IccTagDataEntry? other) => other is IccResponseCurveSet16TagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccResponseCurveSet16TagDataEntry other) + public bool Equals(IccResponseCurveSet16TagDataEntry? other) { if (other is null) { @@ -70,7 +69,7 @@ internal sealed class IccResponseCurveSet16TagDataEntry : IccTagDataEntry, IEqua } /// - public override bool Equals(object obj) => obj is IccResponseCurveSet16TagDataEntry other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccResponseCurveSet16TagDataEntry other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs index 4b11828297..d014782455 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -44,13 +43,13 @@ internal sealed class IccScreeningTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccScreeningTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccScreeningTagDataEntry other) + public bool Equals(IccScreeningTagDataEntry? other) { if (other is null) { @@ -68,7 +67,7 @@ internal sealed class IccScreeningTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccScreeningTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs index 23fdafa6a2..4d58a0978c 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -34,11 +33,11 @@ internal sealed class IccSignatureTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) => other is IccSignatureTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccSignatureTagDataEntry other) + public bool Equals(IccSignatureTagDataEntry? other) { if (other is null) { @@ -55,7 +54,7 @@ internal sealed class IccSignatureTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccSignatureTagDataEntry other && this.Equals(other); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs index 05a2c2aaf9..5fd32e3592 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -33,11 +32,11 @@ internal sealed class IccTextTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) => other is IccTextTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccTextTagDataEntry other) + public bool Equals(IccTextTagDataEntry? other) { if (other is null) { @@ -53,7 +52,7 @@ internal sealed class IccTextTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccTextTagDataEntry other && this.Equals(other); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs index 057b5cbb1e..8e63153e18 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -35,13 +34,13 @@ internal sealed class IccUFix16ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccUFix16ArrayTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccUFix16ArrayTagDataEntry other) + public bool Equals(IccUFix16ArrayTagDataEntry? other) { if (other is null) { @@ -57,7 +56,7 @@ internal sealed class IccUFix16ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccUFix16ArrayTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs index 5130d06449..43d3be683e 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -35,13 +34,13 @@ internal sealed class IccUInt16ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccUInt16ArrayTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccUInt16ArrayTagDataEntry other) + public bool Equals(IccUInt16ArrayTagDataEntry? other) { if (other is null) { @@ -57,7 +56,7 @@ internal sealed class IccUInt16ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccUInt16ArrayTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs index 7de731aea5..06ff8fd6c5 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -35,13 +34,13 @@ internal sealed class IccUInt32ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccUInt32ArrayTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccUInt32ArrayTagDataEntry other) + public bool Equals(IccUInt32ArrayTagDataEntry? other) { if (other is null) { @@ -57,7 +56,7 @@ internal sealed class IccUInt32ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccUInt32ArrayTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs index cca385233e..4381bceaab 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -32,10 +31,10 @@ internal sealed class IccUInt64ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) => other is IccUInt64ArrayTagDataEntry entry && this.Equals(entry); + public override bool Equals(IccTagDataEntry? other) => other is IccUInt64ArrayTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccUInt64ArrayTagDataEntry other) + public bool Equals(IccUInt64ArrayTagDataEntry? other) { if (other is null) { @@ -51,7 +50,7 @@ internal sealed class IccUInt64ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) => obj is IccUInt64ArrayTagDataEntry other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccUInt64ArrayTagDataEntry other && this.Equals(other); /// public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data); diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs index edae1bd9ee..7a339ce824 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -35,13 +34,13 @@ internal sealed class IccUInt8ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccUInt8ArrayTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccUInt8ArrayTagDataEntry other) + public bool Equals(IccUInt8ArrayTagDataEntry? other) { if (other is null) { @@ -57,7 +56,7 @@ internal sealed class IccUInt8ArrayTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccUInt8ArrayTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs index 16892b7bc2..dde42a8952 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -52,11 +51,11 @@ internal sealed class IccUcrBgTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) => other is IccUcrBgTagDataEntry entry && this.Equals(entry); /// - public bool Equals(IccUcrBgTagDataEntry other) + public bool Equals(IccUcrBgTagDataEntry? other) { if (other is null) { @@ -75,7 +74,7 @@ internal sealed class IccUcrBgTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccUcrBgTagDataEntry other && this.Equals(other); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs index 23eb790e9e..fab61c7289 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -35,13 +34,13 @@ internal sealed class IccUnknownTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccUnknownTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccUnknownTagDataEntry other) + public bool Equals(IccUnknownTagDataEntry? other) { if (other is null) { @@ -57,7 +56,7 @@ internal sealed class IccUnknownTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccUnknownTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs index 99e39161c6..113ae2577f 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; @@ -53,13 +52,13 @@ internal sealed class IccViewingConditionsTagDataEntry : IccTagDataEntry, IEquat public IccStandardIlluminant Illuminant { get; } /// - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { return other is IccViewingConditionsTagDataEntry entry && this.Equals(entry); } /// - public bool Equals(IccViewingConditionsTagDataEntry other) + public bool Equals(IccViewingConditionsTagDataEntry? other) { if (other is null) { @@ -78,7 +77,7 @@ internal sealed class IccViewingConditionsTagDataEntry : IccTagDataEntry, IEquat } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccViewingConditionsTagDataEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs index a90066417b..c150034b40 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; @@ -35,7 +34,7 @@ internal sealed class IccXyzTagDataEntry : IccTagDataEntry, IEquatable - public override bool Equals(IccTagDataEntry other) + public override bool Equals(IccTagDataEntry? other) { if (base.Equals(other) && other is IccXyzTagDataEntry entry) { @@ -46,11 +45,11 @@ internal sealed class IccXyzTagDataEntry : IccTagDataEntry, IEquatable - public bool Equals(IccXyzTagDataEntry other) - => this.Equals((IccTagDataEntry)other); + public bool Equals(IccXyzTagDataEntry? other) + => this.Equals((IccTagDataEntry?)other); /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => this.Equals(obj as IccXyzTagDataEntry); public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccClut.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccClut.cs index 726035cc85..26a882810e 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccClut.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccClut.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -112,7 +111,7 @@ internal sealed class IccClut : IEquatable public byte[] GridPointCount { get; } /// - public bool Equals(IccClut other) + public bool Equals(IccClut? other) { if (other is null) { @@ -132,7 +131,7 @@ internal sealed class IccClut : IEquatable } /// - public override bool Equals(object obj) => obj is IccClut other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccClut other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccColorantTableEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccColorantTableEntry.cs index b30139c6bc..a47e19cb6b 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccColorantTableEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccColorantTableEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -84,7 +83,7 @@ internal readonly struct IccColorantTableEntry : IEquatable - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccColorantTableEntry other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccLocalizedString.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccLocalizedString.cs index cb2c162eb5..09294a2c6a 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccLocalizedString.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccLocalizedString.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Globalization; @@ -51,7 +50,7 @@ internal readonly struct IccLocalizedString : IEquatable /// public override string ToString() => $"{this.Culture.Name}: {this.Text}"; - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccLocalizedString iccLocalizedString && this.Equals(iccLocalizedString); public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccLut.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccLut.cs index 8beed8a350..5f07e55890 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccLut.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccLut.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -67,7 +66,7 @@ internal readonly struct IccLut : IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccLut iccLut && this.Equals(iccLut); /// diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccNamedColor.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccNamedColor.cs index aa3f5e815d..6e4e089c54 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccNamedColor.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccNamedColor.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -66,7 +65,7 @@ internal readonly struct IccNamedColor : IEquatable public static bool operator !=(IccNamedColor left, IccNamedColor right) => !left.Equals(right); /// - public override bool Equals(object obj) => obj is IccNamedColor other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccNamedColor other && this.Equals(other); /// public bool Equals(IccNamedColor other) diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccPositionNumber.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccPositionNumber.cs index 03a01534a5..27b6f83ac1 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccPositionNumber.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccPositionNumber.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -61,7 +60,7 @@ internal readonly struct IccPositionNumber : IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccPositionNumber other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileDescription.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileDescription.cs index 9091bd7b0c..f20b0fab55 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileDescription.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileDescription.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -74,7 +73,7 @@ internal readonly struct IccProfileDescription : IEquatable - public override bool Equals(object obj) => obj is IccProfileDescription other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccProfileDescription other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileId.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileId.cs index cc7a45652b..ce38d527d0 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileId.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileId.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Globalization; @@ -81,7 +80,7 @@ public readonly struct IccProfileId : IEquatable public static bool operator !=(IccProfileId left, IccProfileId right) => !left.Equals(right); /// - public override bool Equals(object obj) => obj is IccProfileId other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccProfileId other && this.Equals(other); /// public bool Equals(IccProfileId other) => diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs index aef9a65128..93db530ebc 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -36,7 +35,7 @@ internal readonly struct IccProfileSequenceIdentifier : IEquatable - public override bool Equals(object obj) => obj is IccProfileSequenceIdentifier other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccProfileSequenceIdentifier other && this.Equals(other); /// public override int GetHashCode() => HashCode.Combine(this.Id, this.Description); diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccResponseNumber.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccResponseNumber.cs index c670768567..3d3f8862e9 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccResponseNumber.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccResponseNumber.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -61,7 +60,7 @@ internal readonly struct IccResponseNumber : IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccResponseNumber other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccScreeningChannel.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccScreeningChannel.cs index 15bd522285..f6c39c28a9 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccScreeningChannel.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccScreeningChannel.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Runtime.InteropServices; @@ -77,7 +76,7 @@ internal readonly struct IccScreeningChannel : IEquatable this.SpotShape == other.SpotShape; /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is IccScreeningChannel other && this.Equals(other); } diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccTagTableEntry.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccTagTableEntry.cs index 2284b30112..e7d7461d5d 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccTagTableEntry.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccTagTableEntry.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -68,7 +67,7 @@ internal readonly struct IccTagTableEntry : IEquatable } /// - public override bool Equals(object obj) => obj is IccTagTableEntry other && this.Equals(other); + public override bool Equals(object? obj) => obj is IccTagTableEntry other && this.Equals(other); /// public bool Equals(IccTagTableEntry other) => diff --git a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccVersion.cs b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccVersion.cs index 7cbf10f971..63e8abeb5b 100644 --- a/src/ImageSharp/Metadata/Profiles/ICC/Various/IccVersion.cs +++ b/src/ImageSharp/Metadata/Profiles/ICC/Various/IccVersion.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -56,7 +55,7 @@ public readonly struct IccVersion : IEquatable => !(left == right); /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is IccVersion iccVersion && this.Equals(iccVersion); /// diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Bgra5551.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Bgra5551.cs index bf00569e31..c282f03d89 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Bgra5551.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Bgra5551.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -141,7 +140,7 @@ public partial struct Bgra5551 : IPixel, IPackedVector public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4()); /// - public override bool Equals(object obj) => obj is Bgra5551 other && this.Equals(other); + public override bool Equals(object? obj) => obj is Bgra5551 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/Primitives/ColorMatrix.cs b/src/ImageSharp/Primitives/ColorMatrix.cs index 7aa9338dca..e06dc1f6a5 100644 --- a/src/ImageSharp/Primitives/ColorMatrix.cs +++ b/src/ImageSharp/Primitives/ColorMatrix.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable #pragma warning disable SA1117 // Parameters should be on same line or separate lines using System.Globalization; @@ -391,7 +390,7 @@ public struct ColorMatrix : IEquatable public static bool operator !=(ColorMatrix value1, ColorMatrix value2) => !value1.Equals(value2); /// - public override bool Equals(object obj) => obj is ColorMatrix matrix && this.Equals(matrix); + public override bool Equals(object? obj) => obj is ColorMatrix matrix && this.Equals(matrix); /// public bool Equals(ColorMatrix other) => diff --git a/src/ImageSharp/Primitives/Complex64.cs b/src/ImageSharp/Primitives/Complex64.cs index 4ed92acbf4..4baedd9bae 100644 --- a/src/ImageSharp/Primitives/Complex64.cs +++ b/src/ImageSharp/Primitives/Complex64.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -78,7 +77,7 @@ internal readonly struct Complex64 : IEquatable } /// - public override bool Equals(object obj) => obj is Complex64 other && this.Equals(other); + public override bool Equals(object? obj) => obj is Complex64 other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Primitives/ComplexVector4.cs b/src/ImageSharp/Primitives/ComplexVector4.cs index 6e5da06adb..39bd2c2bab 100644 --- a/src/ImageSharp/Primitives/ComplexVector4.cs +++ b/src/ImageSharp/Primitives/ComplexVector4.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Numerics; using System.Runtime.CompilerServices; @@ -49,7 +48,7 @@ internal struct ComplexVector4 : IEquatable } /// - public override bool Equals(object obj) => obj is ComplexVector4 other && this.Equals(other); + public override bool Equals(object? obj) => obj is ComplexVector4 other && this.Equals(other); /// public override int GetHashCode() diff --git a/src/ImageSharp/Primitives/DenseMatrix{T}.cs b/src/ImageSharp/Primitives/DenseMatrix{T}.cs index 31fb86be91..9849e0211f 100644 --- a/src/ImageSharp/Primitives/DenseMatrix{T}.cs +++ b/src/ImageSharp/Primitives/DenseMatrix{T}.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Diagnostics; using System.Runtime.CompilerServices; @@ -249,7 +248,7 @@ public readonly struct DenseMatrix : IEquatable> } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is DenseMatrix other && this.Equals(other); /// diff --git a/src/ImageSharp/Primitives/LongRational.cs b/src/ImageSharp/Primitives/LongRational.cs index 429a72ddea..e92875a98b 100644 --- a/src/ImageSharp/Primitives/LongRational.cs +++ b/src/ImageSharp/Primitives/LongRational.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Globalization; using System.Text; @@ -67,7 +66,7 @@ internal readonly struct LongRational : IEquatable public bool IsZero => this.Denominator == 1 && this.Numerator == 0; /// - public override bool Equals(object obj) + public override bool Equals(object? obj) => obj is LongRational longRational && this.Equals(longRational); /// diff --git a/src/ImageSharp/Primitives/Number.cs b/src/ImageSharp/Primitives/Number.cs index fd47737643..fae67bbea1 100644 --- a/src/ImageSharp/Primitives/Number.cs +++ b/src/ImageSharp/Primitives/Number.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Globalization; using System.Runtime.InteropServices; @@ -146,7 +145,7 @@ public struct Number : IEquatable, IComparable } /// - public override bool Equals(object obj) => obj is Number other && this.Equals(other); + public override bool Equals(object? obj) => obj is Number other && this.Equals(other); /// public bool Equals(Number other) diff --git a/src/ImageSharp/Primitives/Point.cs b/src/ImageSharp/Primitives/Point.cs index f83124c06f..8ace7ffacf 100644 --- a/src/ImageSharp/Primitives/Point.cs +++ b/src/ImageSharp/Primitives/Point.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.ComponentModel; using System.Numerics; @@ -275,7 +274,7 @@ public struct Point : IEquatable public override string ToString() => $"Point [ X={this.X}, Y={this.Y} ]"; /// - public override bool Equals(object obj) => obj is Point other && this.Equals(other); + public override bool Equals(object? obj) => obj is Point other && this.Equals(other); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/ImageSharp/Primitives/PointF.cs b/src/ImageSharp/Primitives/PointF.cs index a446b61df5..de363e2bd3 100644 --- a/src/ImageSharp/Primitives/PointF.cs +++ b/src/ImageSharp/Primitives/PointF.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.ComponentModel; using System.Numerics; @@ -284,7 +283,7 @@ public struct PointF : IEquatable public override string ToString() => $"PointF [ X={this.X}, Y={this.Y} ]"; /// - public override bool Equals(object obj) => obj is PointF pointF && this.Equals(pointF); + public override bool Equals(object? obj) => obj is PointF pointF && this.Equals(pointF); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/ImageSharp/Primitives/Rational.cs b/src/ImageSharp/Primitives/Rational.cs index 2352f29a05..59f34331a7 100644 --- a/src/ImageSharp/Primitives/Rational.cs +++ b/src/ImageSharp/Primitives/Rational.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Globalization; @@ -123,7 +122,7 @@ public readonly struct Rational : IEquatable public static Rational FromDouble(double value, bool bestPrecision) => new Rational(value, bestPrecision); /// - public override bool Equals(object obj) => obj is Rational other && this.Equals(other); + public override bool Equals(object? obj) => obj is Rational other && this.Equals(other); /// public bool Equals(Rational other) diff --git a/src/ImageSharp/Primitives/Rectangle.cs b/src/ImageSharp/Primitives/Rectangle.cs index 70021d858e..baffbc7f49 100644 --- a/src/ImageSharp/Primitives/Rectangle.cs +++ b/src/ImageSharp/Primitives/Rectangle.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.ComponentModel; using System.Numerics; @@ -444,7 +443,7 @@ public struct Rectangle : IEquatable public override string ToString() => $"Rectangle [ X={this.X}, Y={this.Y}, Width={this.Width}, Height={this.Height} ]"; /// - public override bool Equals(object obj) => obj is Rectangle other && this.Equals(other); + public override bool Equals(object? obj) => obj is Rectangle other && this.Equals(other); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/ImageSharp/Primitives/RectangleF.cs b/src/ImageSharp/Primitives/RectangleF.cs index dc6bc9d68f..68add77d09 100644 --- a/src/ImageSharp/Primitives/RectangleF.cs +++ b/src/ImageSharp/Primitives/RectangleF.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.ComponentModel; using System.Numerics; @@ -379,7 +378,7 @@ public struct RectangleF : IEquatable => $"RectangleF [ X={this.X}, Y={this.Y}, Width={this.Width}, Height={this.Height} ]"; /// - public override bool Equals(object obj) => obj is RectangleF other && this.Equals(other); + public override bool Equals(object? obj) => obj is RectangleF other && this.Equals(other); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/ImageSharp/Primitives/SignedRational.cs b/src/ImageSharp/Primitives/SignedRational.cs index 9aec26ec50..d56ea825e6 100644 --- a/src/ImageSharp/Primitives/SignedRational.cs +++ b/src/ImageSharp/Primitives/SignedRational.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Globalization; @@ -135,7 +134,7 @@ public readonly struct SignedRational : IEquatable } /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is SignedRational other && this.Equals(other); } diff --git a/src/ImageSharp/Primitives/Size.cs b/src/ImageSharp/Primitives/Size.cs index 8191007ace..945b680daa 100644 --- a/src/ImageSharp/Primitives/Size.cs +++ b/src/ImageSharp/Primitives/Size.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.ComponentModel; using System.Numerics; @@ -269,7 +268,7 @@ public struct Size : IEquatable public override string ToString() => $"Size [ Width={this.Width}, Height={this.Height} ]"; /// - public override bool Equals(object obj) => obj is Size other && this.Equals(other); + public override bool Equals(object? obj) => obj is Size other && this.Equals(other); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/ImageSharp/Primitives/SizeF.cs b/src/ImageSharp/Primitives/SizeF.cs index 849fcd7e64..36cf9eb8ef 100644 --- a/src/ImageSharp/Primitives/SizeF.cs +++ b/src/ImageSharp/Primitives/SizeF.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.ComponentModel; using System.Numerics; @@ -215,7 +214,7 @@ public struct SizeF : IEquatable public override string ToString() => $"SizeF [ Width={this.Width}, Height={this.Height} ]"; /// - public override bool Equals(object obj) => obj is SizeF && this.Equals((SizeF)obj); + public override bool Equals(object? obj) => obj is SizeF && this.Equals((SizeF)obj); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/ImageSharp/Primitives/ValueSize.cs b/src/ImageSharp/Primitives/ValueSize.cs index 55fd65d5ab..f572dd658f 100644 --- a/src/ImageSharp/Primitives/ValueSize.cs +++ b/src/ImageSharp/Primitives/ValueSize.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable namespace SixLabors.ImageSharp; @@ -115,7 +114,7 @@ internal readonly struct ValueSize : IEquatable public override string ToString() => $"{this.Value} - {this.Type}"; /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { return obj is ValueSize size && this.Equals(size); }