Skip to content

Commit 997884c

Browse files
Merge pull request #2337 from stefannikolei/stefannikolei/nullable/pixelimplementations
Remove nullable disable from pixelimplementations
2 parents cb68906 + 34add6a commit 997884c

28 files changed

+30
-58
lines changed

src/ImageSharp/PixelFormats/PixelImplementations/A8.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -140,7 +139,7 @@ public void ToRgba32(ref Rgba32 dest)
140139
/// </summary>
141140
/// <param name="obj">The object to compare.</param>
142141
/// <returns>True if the object is equal to the packed vector.</returns>
143-
public override readonly bool Equals(object obj) => obj is A8 other && this.Equals(other);
142+
public override readonly bool Equals(object? obj) => obj is A8 other && this.Equals(other);
144143

145144
/// <summary>
146145
/// Compares another A8 packed vector with the packed vector.

src/ImageSharp/PixelFormats/PixelImplementations/Abgr32.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -335,7 +334,7 @@ public void FromRgba64(Rgba64 source)
335334
}
336335

337336
/// <inheritdoc/>
338-
public override readonly bool Equals(object obj) => obj is Abgr32 abgr32 && this.Equals(abgr32);
337+
public override readonly bool Equals(object? obj) => obj is Abgr32 abgr32 && this.Equals(abgr32);
339338

340339
/// <inheritdoc/>
341340
[MethodImpl(InliningOptions.ShortMethod)]

src/ImageSharp/PixelFormats/PixelImplementations/Argb32.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -334,7 +333,7 @@ public void FromRgba64(Rgba64 source)
334333
}
335334

336335
/// <inheritdoc/>
337-
public override readonly bool Equals(object obj) => obj is Argb32 argb32 && this.Equals(argb32);
336+
public override readonly bool Equals(object? obj) => obj is Argb32 argb32 && this.Equals(argb32);
338337

339338
/// <inheritdoc/>
340339
[MethodImpl(InliningOptions.ShortMethod)]

src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -232,7 +231,7 @@ public void FromRgba64(Rgba64 source)
232231
public readonly bool Equals(Bgr24 other) => this.R.Equals(other.R) && this.G.Equals(other.G) && this.B.Equals(other.B);
233232

234233
/// <inheritdoc/>
235-
public override readonly bool Equals(object obj) => obj is Bgr24 other && this.Equals(other);
234+
public override readonly bool Equals(object? obj) => obj is Bgr24 other && this.Equals(other);
236235

237236
/// <inheritdoc />
238237
public override readonly string ToString() => $"Bgr24({this.B}, {this.G}, {this.R})";

src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -151,7 +150,7 @@ public void FromVector4(Vector4 vector)
151150
(this.PackedValue & 0x1F) * (1F / 31F));
152151

153152
/// <inheritdoc />
154-
public override readonly bool Equals(object obj) => obj is Bgr565 other && this.Equals(other);
153+
public override readonly bool Equals(object? obj) => obj is Bgr565 other && this.Equals(other);
155154

156155
/// <inheritdoc />
157156
[MethodImpl(InliningOptions.ShortMethod)]

src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -287,7 +286,7 @@ public void FromRgba64(Rgba64 source)
287286
}
288287

289288
/// <inheritdoc/>
290-
public override readonly bool Equals(object obj) => obj is Bgra32 other && this.Equals(other);
289+
public override readonly bool Equals(object? obj) => obj is Bgra32 other && this.Equals(other);
291290

292291
/// <inheritdoc/>
293292
public readonly bool Equals(Bgra32 other) => this.Bgra.Equals(other.Bgra);

src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -143,7 +142,7 @@ public readonly Vector4 ToVector4()
143142
public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4());
144143

145144
/// <inheritdoc />
146-
public override readonly bool Equals(object obj) => obj is Bgra4444 other && this.Equals(other);
145+
public override readonly bool Equals(object? obj) => obj is Bgra4444 other && this.Equals(other);
147146

148147
/// <inheritdoc />
149148
[MethodImpl(InliningOptions.ShortMethod)]

src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -141,7 +140,7 @@ public Byte4(float x, float y, float z, float w)
141140
public void FromRgba64(Rgba64 source) => this.FromScaledVector4(source.ToScaledVector4());
142141

143142
/// <inheritdoc />
144-
public override readonly bool Equals(object obj) => obj is Byte4 byte4 && this.Equals(byte4);
143+
public override readonly bool Equals(object? obj) => obj is Byte4 byte4 && this.Equals(byte4);
145144

146145
/// <inheritdoc />
147146
[MethodImpl(InliningOptions.ShortMethod)]

src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -140,7 +139,7 @@ public readonly Vector4 ToScaledVector4()
140139
public readonly float ToSingle() => HalfTypeHelper.Unpack(this.PackedValue);
141140

142141
/// <inheritdoc />
143-
public override readonly bool Equals(object obj) => obj is HalfSingle other && this.Equals(other);
142+
public override readonly bool Equals(object? obj) => obj is HalfSingle other && this.Equals(other);
144143

145144
/// <inheritdoc />
146145
[MethodImpl(InliningOptions.ShortMethod)]

src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Numerics;
65
using System.Runtime.CompilerServices;
@@ -157,7 +156,7 @@ public readonly Vector2 ToVector2()
157156
}
158157

159158
/// <inheritdoc />
160-
public override readonly bool Equals(object obj) => obj is HalfVector2 other && this.Equals(other);
159+
public override readonly bool Equals(object? obj) => obj is HalfVector2 other && this.Equals(other);
161160

162161
/// <inheritdoc />
163162
[MethodImpl(InliningOptions.ShortMethod)]

0 commit comments

Comments
 (0)