Skip to content

Commit 2bf8d78

Browse files
committed
Fix Analyzer errors
1 parent 1d223f7 commit 2bf8d78

33 files changed

+127
-2
lines changed

src/ImageSharp.ruleset

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RuleSet Name="ImageSharp" ToolsVersion="17.0">
33
<Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" />
4+
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.NetAnalyzers" RuleNamespace="Microsoft.CodeAnalysis.CSharp.NetAnalyzers">
5+
<Rule Id="CA1000" Action="None"/>
6+
</Rules>
47
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
58
<Rule Id="SA1011" Action="None" />
69
</Rules>

src/ImageSharp/Formats/PixelTypeInfo.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace SixLabors.ImageSharp.Formats;
1515
public readonly struct PixelTypeInfo
1616
{
1717
/// <summary>
18-
/// Initializes a new instance of the <see cref="PixelTypeInfo"/> class.
18+
/// Initializes a new instance of the <see cref="PixelTypeInfo"/> struct.
1919
/// </summary>
2020
/// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param>
2121
public PixelTypeInfo(int bitsPerPixel)
@@ -26,6 +26,9 @@ public PixelTypeInfo(int bitsPerPixel)
2626
/// </summary>
2727
public int BitsPerPixel { get; init; }
2828

29+
/// <summary>
30+
/// Gets the count of the color components
31+
/// </summary>
2932
public byte ComponentCount { get; init; }
3033

3134
/// <summary>

src/ImageSharp/PixelFormats/IPixel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ namespace SixLabors.ImageSharp.PixelFormats;
1515
public interface IPixel<TSelf> : IPixel, IEquatable<TSelf>
1616
where TSelf : unmanaged, IPixel<TSelf>
1717
{
18+
/// <summary>
19+
/// Gets the The pixel type information.
20+
/// </summary>
21+
/// <returns>PixelTypeInfo</returns>
1822
static abstract PixelTypeInfo GetPixelTypeInfo();
1923

2024
/// <summary>

src/ImageSharp/PixelFormats/PixelImplementations/A8.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public partial struct A8 : IPixel<A8>, IPackedVector<byte>
5656
[MethodImpl(InliningOptions.ShortMethod)]
5757
public static bool operator !=(A8 left, A8 right) => !left.Equals(right);
5858

59+
/// <summary>
60+
/// Gets the The pixel type information.
61+
/// </summary>
62+
/// <returns>PixelTypeInfo</returns>
5963
public static PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<A8>(1, PixelAlphaRepresentation.Unassociated);
6064

6165
/// <inheritdoc />

src/ImageSharp/PixelFormats/PixelImplementations/Abgr32.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ public uint PackedValue
184184
[MethodImpl(InliningOptions.ShortMethod)]
185185
public static bool operator !=(Abgr32 left, Abgr32 right) => !left.Equals(right);
186186

187+
/// <summary>
188+
/// Gets the The pixel type information.
189+
/// </summary>
190+
/// <returns>PixelTypeInfo</returns>
187191
public static PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Abgr32>(4, PixelAlphaRepresentation.Unassociated);
188192

189193
/// <inheritdoc />

src/ImageSharp/PixelFormats/PixelImplementations/Argb32.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ public uint PackedValue
184184
[MethodImpl(InliningOptions.ShortMethod)]
185185
public static bool operator !=(Argb32 left, Argb32 right) => !left.Equals(right);
186186

187+
/// <summary>
188+
/// Gets the The pixel type information.
189+
/// </summary>
190+
/// <returns>PixelTypeInfo</returns>
187191
public static PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Argb32>(4, PixelAlphaRepresentation.Unassociated);
188192

189193
/// <inheritdoc />

src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ public Bgr24(byte r, byte g, byte b)
8888
[MethodImpl(InliningOptions.ShortMethod)]
8989
public static bool operator !=(Bgr24 left, Bgr24 right) => !left.Equals(right);
9090

91+
/// <summary>
92+
/// Gets the The pixel type information.
93+
/// </summary>
94+
/// <returns>PixelTypeInfo</returns>
9195
public static PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgr24>(3, PixelAlphaRepresentation.None);
9296

9397
/// <inheritdoc/>

src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public Bgr565(float x, float y, float z)
6060
[MethodImpl(InliningOptions.ShortMethod)]
6161
public static bool operator !=(Bgr565 left, Bgr565 right) => !left.Equals(right);
6262

63+
/// <summary>
64+
/// Gets the The pixel type information.
65+
/// </summary>
66+
/// <returns>PixelTypeInfo</returns>
6367
public static PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgr565>(3, PixelAlphaRepresentation.None);
6468

6569
/// <inheritdoc />

src/ImageSharp/PixelFormats/PixelImplementations/Bgra32.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ public uint PackedValue
137137
[MethodImpl(InliningOptions.ShortMethod)]
138138
public static bool operator !=(Bgra32 left, Bgra32 right) => !left.Equals(right);
139139

140+
/// <summary>
141+
/// Gets the The pixel type information.
142+
/// </summary>
143+
/// <returns>PixelTypeInfo</returns>
140144
public static PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgra32>(4, PixelAlphaRepresentation.Unassociated);
141145

142146
/// <inheritdoc/>

src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public Bgra4444(float x, float y, float z, float w)
5858
[MethodImpl(InliningOptions.ShortMethod)]
5959
public static bool operator !=(Bgra4444 left, Bgra4444 right) => !left.Equals(right);
6060

61+
/// <summary>
62+
/// Gets the The pixel type information.
63+
/// </summary>
64+
/// <returns>PixelTypeInfo</returns>
6165
public static PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgra4444>(4, PixelAlphaRepresentation.Unassociated);
6266

6367
/// <inheritdoc />

0 commit comments

Comments
 (0)