From 34add6aebfc0c7d4f5117ab7bbbd6cdf87071b5c Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Tue, 31 Jan 2023 18:00:44 +0100 Subject: [PATCH] Remove nullable disable from pixelimplementations #2231 --- src/ImageSharp/PixelFormats/PixelImplementations/A8.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Abgr32.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Argb32.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.cs | 3 +-- .../PixelFormats/PixelImplementations/Bgra4444.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs | 3 +-- .../PixelFormats/PixelImplementations/HalfSingle.cs | 3 +-- .../PixelFormats/PixelImplementations/HalfVector2.cs | 3 +-- .../PixelFormats/PixelImplementations/HalfVector4.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/L16.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/L8.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/La16.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/La32.cs | 3 +-- .../PixelFormats/PixelImplementations/NormalizedByte2.cs | 3 +-- .../PixelFormats/PixelImplementations/NormalizedByte4.cs | 3 +-- .../PixelFormats/PixelImplementations/NormalizedShort2.cs | 3 +-- .../PixelFormats/PixelImplementations/NormalizedShort4.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Rg32.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Rgb48.cs | 3 +-- .../PixelFormats/PixelImplementations/Rgba1010102.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs | 7 +++---- src/ImageSharp/PixelFormats/PixelImplementations/Rgba64.cs | 3 +-- .../PixelFormats/PixelImplementations/RgbaVector.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Short2.cs | 3 +-- src/ImageSharp/PixelFormats/PixelImplementations/Short4.cs | 3 +-- 28 files changed, 30 insertions(+), 58 deletions(-) diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/A8.cs b/src/ImageSharp/PixelFormats/PixelImplementations/A8.cs index 1da564583..025690712 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/A8.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/A8.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; @@ -140,7 +139,7 @@ public partial struct A8 : IPixel, IPackedVector /// /// The object to compare. /// True if the object is equal to the packed vector. - public override readonly bool Equals(object obj) => obj is A8 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is A8 other && this.Equals(other); /// /// Compares another A8 packed vector with the packed vector. diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Abgr32.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Abgr32.cs index 28b6899b2..ca68c5aaf 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Abgr32.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Abgr32.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; @@ -335,7 +334,7 @@ public partial struct Abgr32 : IPixel, IPackedVector } /// - public override readonly bool Equals(object obj) => obj is Abgr32 abgr32 && this.Equals(abgr32); + public override readonly bool Equals(object? obj) => obj is Abgr32 abgr32 && this.Equals(abgr32); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Argb32.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Argb32.cs index 935751afc..0c99adb52 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Argb32.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Argb32.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; @@ -334,7 +333,7 @@ public partial struct Argb32 : IPixel, IPackedVector } /// - public override readonly bool Equals(object obj) => obj is Argb32 argb32 && this.Equals(argb32); + public override readonly bool Equals(object? obj) => obj is Argb32 argb32 && this.Equals(argb32); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs index 751e0bfe8..65b36059b 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.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; @@ -232,7 +231,7 @@ public partial struct Bgr24 : IPixel public readonly bool Equals(Bgr24 other) => this.R.Equals(other.R) && this.G.Equals(other.G) && this.B.Equals(other.B); /// - public override readonly bool Equals(object obj) => obj is Bgr24 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Bgr24 other && this.Equals(other); /// public override readonly string ToString() => $"Bgr24({this.B}, {this.G}, {this.R})"; diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs index 21766431c..ac3b6f829 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.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; @@ -151,7 +150,7 @@ public partial struct Bgr565 : IPixel, IPackedVector (this.PackedValue & 0x1F) * (1F / 31F)); /// - public override readonly bool Equals(object obj) => obj is Bgr565 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Bgr565 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.cs index 204919392..6b859cda6 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.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; @@ -287,7 +286,7 @@ public partial struct Bgra32 : IPixel, IPackedVector } /// - public override readonly bool Equals(object obj) => obj is Bgra32 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Bgra32 other && this.Equals(other); /// public readonly bool Equals(Bgra32 other) => this.Bgra.Equals(other.Bgra); diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs index e342d1845..8ba32c8ac 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.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; @@ -143,7 +142,7 @@ public partial struct Bgra4444 : IPixel, IPackedVector public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4()); /// - public override readonly bool Equals(object obj) => obj is Bgra4444 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Bgra4444 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs index 9d9b7c87f..e699e5fe5 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Byte4.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 Byte4 : IPixel, IPackedVector public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4()); /// - public override readonly bool Equals(object obj) => obj is Byte4 byte4 && this.Equals(byte4); + public override readonly bool Equals(object? obj) => obj is Byte4 byte4 && this.Equals(byte4); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.cs b/src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.cs index a99462c8b..db1e02adc 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.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; @@ -140,7 +139,7 @@ public partial struct HalfSingle : IPixel, IPackedVector public readonly float ToSingle() => HalfTypeHelper.Unpack(this.PackedValue); /// - public override readonly bool Equals(object obj) => obj is HalfSingle other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is HalfSingle other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs index 2f2117c26..9caae58c9 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.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; @@ -157,7 +156,7 @@ public partial struct HalfVector2 : IPixel, IPackedVector } /// - public override readonly bool Equals(object obj) => obj is HalfVector2 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is HalfVector2 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector4.cs index 859ba7e32..609fec3bd 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector4.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector4.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; @@ -149,7 +148,7 @@ public partial struct HalfVector4 : IPixel, IPackedVector public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4()); /// - public override readonly bool Equals(object obj) => obj is HalfVector4 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is HalfVector4 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/L16.cs b/src/ImageSharp/PixelFormats/PixelImplementations/L16.cs index 5d2539ce1..c6ee8744d 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/L16.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/L16.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 partial struct L16 : IPixel, IPackedVector public void FromRgba64(Rgba64 source) => this.PackedValue = ColorNumerics.Get16BitBT709Luminance(source.R, source.G, source.B); /// - public override readonly bool Equals(object obj) => obj is L16 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is L16 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/L8.cs b/src/ImageSharp/PixelFormats/PixelImplementations/L8.cs index 25a79e58f..383e09b27 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/L8.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/L8.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; @@ -143,7 +142,7 @@ public partial struct L8 : IPixel, IPackedVector ColorNumerics.DownScaleFrom16BitTo8Bit(source.B)); /// - public override readonly bool Equals(object obj) => obj is L8 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is L8 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/La16.cs b/src/ImageSharp/PixelFormats/PixelImplementations/La16.cs index 21e66ed49..7597677a2 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/La16.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/La16.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; @@ -80,7 +79,7 @@ public partial struct La16 : IPixel, IPackedVector public readonly bool Equals(La16 other) => this.PackedValue.Equals(other.PackedValue); /// - public override readonly bool Equals(object obj) => obj is La16 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is La16 other && this.Equals(other); /// public override readonly string ToString() => $"La16({this.L}, {this.A})"; diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/La32.cs b/src/ImageSharp/PixelFormats/PixelImplementations/La32.cs index cf53d2217..cb8fad228 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/La32.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/La32.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; @@ -82,7 +81,7 @@ public partial struct La32 : IPixel, IPackedVector public readonly bool Equals(La32 other) => this.PackedValue.Equals(other.PackedValue); /// - public override readonly bool Equals(object obj) => obj is La32 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is La32 other && this.Equals(other); /// public override readonly string ToString() => $"La32({this.L}, {this.A})"; diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs index d9d0a53bd..92b9e6148 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.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; @@ -162,7 +161,7 @@ public partial struct NormalizedByte2 : IPixel, IPackedVector> 8) & 0xFF) / MaxPos); /// - public override readonly bool Equals(object obj) => obj is NormalizedByte2 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is NormalizedByte2 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs index 5a18d00a2..f87bb5a60 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.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; @@ -154,7 +153,7 @@ public partial struct NormalizedByte4 : IPixel, IPackedVector this.FromScaledVector4(source.ToScaledVector4()); /// - public override readonly bool Equals(object obj) => obj is NormalizedByte4 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is NormalizedByte4 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs index 84e5e4362..f77dd69b7 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.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; @@ -163,7 +162,7 @@ public partial struct NormalizedShort2 : IPixel, IPackedVector (short)(this.PackedValue >> 0x10) / MaxPos); /// - public override readonly bool Equals(object obj) => obj is NormalizedShort2 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is NormalizedShort2 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort4.cs index f8139c547..989edbd2b 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort4.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort4.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; @@ -155,7 +154,7 @@ public partial struct NormalizedShort4 : IPixel, IPackedVector public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4()); /// - public override readonly bool Equals(object obj) => obj is NormalizedShort4 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is NormalizedShort4 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Rg32.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Rg32.cs index 69f39c883..0a13a15ed 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Rg32.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Rg32.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; @@ -146,7 +145,7 @@ public partial struct Rg32 : IPixel, IPackedVector public readonly Vector2 ToVector2() => new Vector2(this.PackedValue & 0xFFFF, (this.PackedValue >> 16) & 0xFFFF) / Max; /// - public override readonly bool Equals(object obj) => obj is Rg32 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Rg32 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs index 5f6634157..105618cd9 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.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; @@ -241,7 +240,7 @@ public partial struct Rgb24 : IPixel } /// - public override readonly bool Equals(object obj) => obj is Rgb24 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Rgb24 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Rgb48.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Rgb48.cs index 16673fca2..1cf63eb24 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Rgb48.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Rgb48.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; @@ -210,7 +209,7 @@ public partial struct Rgb48 : IPixel public void FromRgb48(Rgb48 source) => this = source; /// - public override readonly bool Equals(object obj) => obj is Rgb48 rgb48 && this.Equals(rgb48); + public override readonly bool Equals(object? obj) => obj is Rgb48 rgb48 && this.Equals(rgb48); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Rgba1010102.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Rgba1010102.cs index 2c59741bf..7bac1d920 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Rgba1010102.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Rgba1010102.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 Rgba1010102 : IPixel, IPackedVector public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4()); /// - public override readonly bool Equals(object obj) => obj is Rgba1010102 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Rgba1010102 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs index 0d18ac343..a652c2b33 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Buffers.Binary; using System.Globalization; @@ -267,7 +266,7 @@ public partial struct Rgba32 : IPixel, IPackedVector /// The . /// [MethodImpl(InliningOptions.ShortMethod)] - public static bool TryParseHex(string hex, out Rgba32 result) + public static bool TryParseHex(string? hex, out Rgba32 result) { result = default; if (string.IsNullOrWhiteSpace(hex)) @@ -437,7 +436,7 @@ public partial struct Rgba32 : IPixel, IPackedVector } /// - public override readonly bool Equals(object obj) => obj is Rgba32 rgba32 && this.Equals(rgba32); + public override readonly bool Equals(object? obj) => obj is Rgba32 rgba32 && this.Equals(rgba32); /// [MethodImpl(InliningOptions.ShortMethod)] @@ -514,7 +513,7 @@ public partial struct Rgba32 : IPixel, IPackedVector /// /// A rrggbbaa hex value. /// - private static string ToRgbaHex(string hex) + private static string? ToRgbaHex(string hex) { if (hex[0] == '#') { diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Rgba64.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Rgba64.cs index 756089212..81c959148 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Rgba64.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Rgba64.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; @@ -444,7 +443,7 @@ public partial struct Rgba64 : IPixel, IPackedVector } /// - public override readonly bool Equals(object obj) => obj is Rgba64 rgba64 && this.Equals(rgba64); + public override readonly bool Equals(object? obj) => obj is Rgba64 rgba64 && this.Equals(rgba64); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/RgbaVector.cs b/src/ImageSharp/PixelFormats/PixelImplementations/RgbaVector.cs index 3a0426a8e..899987b71 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/RgbaVector.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/RgbaVector.cs @@ -1,6 +1,5 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. -#nullable disable using System.Globalization; using System.Numerics; @@ -193,7 +192,7 @@ public partial struct RgbaVector : IPixel } /// - public override readonly bool Equals(object obj) => obj is RgbaVector other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is RgbaVector other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Short2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Short2.cs index 8eb33afd3..832e8c770 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Short2.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Short2.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; @@ -164,7 +163,7 @@ public partial struct Short2 : IPixel, IPackedVector public readonly Vector2 ToVector2() => new((short)(this.PackedValue & 0xFFFF), (short)(this.PackedValue >> 0x10)); /// - public override readonly bool Equals(object obj) => obj is Short2 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Short2 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)] diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Short4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Short4.cs index b964c9ec5..c4dc324a1 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Short4.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Short4.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; @@ -164,7 +163,7 @@ public partial struct Short4 : IPixel, IPackedVector public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4()); /// - public override readonly bool Equals(object obj) => obj is Short4 other && this.Equals(other); + public override readonly bool Equals(object? obj) => obj is Short4 other && this.Equals(other); /// [MethodImpl(InliningOptions.ShortMethod)]