Skip to content

Commit 3a3ff89

Browse files
Make CreatePixelOperations static
1 parent 7b93ee7 commit 3a3ff89

33 files changed

+34
-34
lines changed

src/ImageSharp/PixelFormats/IPixel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ namespace SixLabors.ImageSharp.PixelFormats;
1414
public interface IPixel<TSelf> : IPixel, IEquatable<TSelf>
1515
where TSelf : unmanaged, IPixel<TSelf>
1616
{
17+
#pragma warning disable CA1000 // Do not declare static members on generic types
1718
/// <summary>
1819
/// Creates a <see cref="PixelOperations{TPixel}"/> instance for this pixel type.
1920
/// This method is not intended to be consumed directly. Use <see cref="PixelOperations{TPixel}.Instance"/> instead.
2021
/// </summary>
2122
/// <returns>The <see cref="PixelOperations{TPixel}"/> instance.</returns>
22-
PixelOperations<TSelf> CreatePixelOperations();
23+
static abstract PixelOperations<TSelf> CreatePixelOperations();
2324

24-
#pragma warning disable CA1000 // Do not declare static members on generic types
2525
/// <summary>
2626
/// Initializes the pixel instance from a generic scaled <see cref="Vector4"/>.
2727
/// </summary>

src/ImageSharp/PixelFormats/PixelImplementations/A8.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
7575
PixelAlphaRepresentation.Unassociated);
7676

7777
/// <inheritdoc />
78-
public readonly PixelOperations<A8> CreatePixelOperations() => new PixelOperations();
78+
public static PixelOperations<A8> CreatePixelOperations() => new PixelOperations();
7979

8080
/// <inheritdoc/>
8181
[MethodImpl(MethodImplOptions.AggressiveInlining)]

src/ImageSharp/PixelFormats/PixelImplementations/Abgr32.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
192192
PixelAlphaRepresentation.Unassociated);
193193

194194
/// <inheritdoc />
195-
public readonly PixelOperations<Abgr32> CreatePixelOperations() => new PixelOperations();
195+
public static PixelOperations<Abgr32> CreatePixelOperations() => new PixelOperations();
196196

197197
/// <inheritdoc/>
198198
[MethodImpl(MethodImplOptions.AggressiveInlining)]

src/ImageSharp/PixelFormats/PixelImplementations/Argb32.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
185185
PixelAlphaRepresentation.Unassociated);
186186

187187
/// <inheritdoc />
188-
public readonly PixelOperations<Argb32> CreatePixelOperations() => new PixelOperations();
188+
public static PixelOperations<Argb32> CreatePixelOperations() => new PixelOperations();
189189

190190
/// <inheritdoc/>
191191
[MethodImpl(MethodImplOptions.AggressiveInlining)]

src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
9595
PixelAlphaRepresentation.None);
9696

9797
/// <inheritdoc/>
98-
public readonly PixelOperations<Bgr24> CreatePixelOperations() => new PixelOperations();
98+
public static PixelOperations<Bgr24> CreatePixelOperations() => new PixelOperations();
9999

100100
/// <inheritdoc/>
101101
[MethodImpl(MethodImplOptions.AggressiveInlining)]

src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
7373
PixelAlphaRepresentation.None);
7474

7575
/// <inheritdoc />
76-
public readonly PixelOperations<Bgr565> CreatePixelOperations() => new PixelOperations();
76+
public static PixelOperations<Bgr565> CreatePixelOperations() => new PixelOperations();
7777

7878
/// <inheritdoc />
7979
public readonly Rgba32 ToRgba32() => Rgba32.FromScaledVector4(this.ToScaledVector4());

src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
134134
PixelAlphaRepresentation.Unassociated);
135135

136136
/// <inheritdoc/>
137-
public readonly PixelOperations<Bgra32> CreatePixelOperations() => new PixelOperations();
137+
public static PixelOperations<Bgra32> CreatePixelOperations() => new PixelOperations();
138138

139139
/// <inheritdoc/>
140140
[MethodImpl(MethodImplOptions.AggressiveInlining)]

src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
8686
PixelAlphaRepresentation.Unassociated);
8787

8888
/// <inheritdoc />
89-
public readonly PixelOperations<Bgra4444> CreatePixelOperations() => new PixelOperations();
89+
public static PixelOperations<Bgra4444> CreatePixelOperations() => new PixelOperations();
9090

9191
/// <inheritdoc/>
9292
[MethodImpl(MethodImplOptions.AggressiveInlining)]

src/ImageSharp/PixelFormats/PixelImplementations/Bgra5551.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
8484
PixelAlphaRepresentation.Unassociated);
8585

8686
/// <inheritdoc />
87-
public readonly PixelOperations<Bgra5551> CreatePixelOperations() => new PixelOperations();
87+
public static PixelOperations<Bgra5551> CreatePixelOperations() => new PixelOperations();
8888

8989
/// <inheritdoc/>
9090
[MethodImpl(MethodImplOptions.AggressiveInlining)]

src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static PixelTypeInfo GetPixelTypeInfo()
8686
PixelAlphaRepresentation.Unassociated);
8787

8888
/// <inheritdoc />
89-
public readonly PixelOperations<Byte4> CreatePixelOperations() => new PixelOperations();
89+
public static PixelOperations<Byte4> CreatePixelOperations() => new PixelOperations();
9090

9191
/// <inheritdoc/>
9292
[MethodImpl(MethodImplOptions.AggressiveInlining)]

0 commit comments

Comments
 (0)