Skip to content

Commit d1c231b

Browse files
Rename property, use int.
1 parent c80a791 commit d1c231b

32 files changed

+35
-35
lines changed

src/ImageSharp/Color/Color.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public static Color FromPixel<TPixel>(TPixel pixel)
127127
}
128128

129129
PixelTypeInfo info = TPixel.GetPixelTypeInfo();
130-
if (info.ComponentPrecision <= PixelComponentPrecision.Byte)
130+
if (info.MaxComponentPrecision <= PixelComponentPrecision.Byte)
131131
{
132132
Rgba32 p = default;
133133
pixel.ToRgba32(ref p);

src/ImageSharp/Formats/PixelTypeInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public readonly struct PixelTypeInfo(int bitsPerPixel)
2626
/// <summary>
2727
/// Gets the count of the color components
2828
/// </summary>
29-
public byte ComponentCount { get; init; }
29+
public int ComponentCount { get; init; }
3030

3131
/// <summary>
32-
/// Gets the pixel component precision.
32+
/// Gets the maximum precision of components within the pixel.
3333
/// </summary>
34-
public PixelComponentPrecision? ComponentPrecision { get; init; }
34+
public PixelComponentPrecision? MaxComponentPrecision { get; init; }
3535

3636
/// <summary>
3737
/// Gets the pixel alpha transparency behavior.
@@ -48,7 +48,7 @@ internal static PixelTypeInfo Create<TPixel>(
4848
{
4949
BitsPerPixel = Unsafe.SizeOf<TPixel>() * 8,
5050
ComponentCount = componentCount,
51-
ComponentPrecision = componentPrecision,
51+
MaxComponentPrecision = componentPrecision,
5252
AlphaRepresentation = pixelAlphaRepresentation
5353
};
5454
}

src/ImageSharp/PixelFormats/PixelComponentPrecision.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace SixLabors.ImageSharp.PixelFormats;
55

66
/// <summary>
7-
/// Provides enumeration of the maximum precision of individual components within a pixel format.
7+
/// Provides enumeration of the precision of individual components within a pixel format.
88
/// </summary>
99
public enum PixelComponentPrecision
1010
{

tests/ImageSharp.Tests/PixelFormats/A8Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ public void A8_PixelInformation()
118118
Assert.Equal(Unsafe.SizeOf<A8>() * 8, info.BitsPerPixel);
119119
Assert.Equal(1, info.ComponentCount);
120120
Assert.Equal(PixelAlphaRepresentation.Unassociated, info.AlphaRepresentation);
121-
Assert.Equal(PixelComponentPrecision.Byte, info.ComponentPrecision);
121+
Assert.Equal(PixelComponentPrecision.Byte, info.MaxComponentPrecision);
122122
}
123123
}

tests/ImageSharp.Tests/PixelFormats/Abgr32Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ public void Abgr32_PixelInformation()
153153
Assert.Equal(Unsafe.SizeOf<Abgr32>() * 8, info.BitsPerPixel);
154154
Assert.Equal(4, info.ComponentCount);
155155
Assert.Equal(PixelAlphaRepresentation.Unassociated, info.AlphaRepresentation);
156-
Assert.Equal(PixelComponentPrecision.Byte, info.ComponentPrecision);
156+
Assert.Equal(PixelComponentPrecision.Byte, info.MaxComponentPrecision);
157157
}
158158
}

tests/ImageSharp.Tests/PixelFormats/Argb32Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,6 @@ public void Argb32_PixelInformation()
151151
Assert.Equal(Unsafe.SizeOf<Argb32>() * 8, info.BitsPerPixel);
152152
Assert.Equal(4, info.ComponentCount);
153153
Assert.Equal(PixelAlphaRepresentation.Unassociated, info.AlphaRepresentation);
154-
Assert.Equal(PixelComponentPrecision.Byte, info.ComponentPrecision);
154+
Assert.Equal(PixelComponentPrecision.Byte, info.MaxComponentPrecision);
155155
}
156156
}

tests/ImageSharp.Tests/PixelFormats/Bgr24Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,6 @@ public void Bgr24_PixelInformation()
136136
Assert.Equal(Unsafe.SizeOf<Bgr24>() * 8, info.BitsPerPixel);
137137
Assert.Equal(3, info.ComponentCount);
138138
Assert.Equal(PixelAlphaRepresentation.None, info.AlphaRepresentation);
139-
Assert.Equal(PixelComponentPrecision.Byte, info.ComponentPrecision);
139+
Assert.Equal(PixelComponentPrecision.Byte, info.MaxComponentPrecision);
140140
}
141141
}

tests/ImageSharp.Tests/PixelFormats/Bgr565Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,6 @@ public void Bgr565_PixelInformation()
258258
Assert.Equal(Unsafe.SizeOf<Bgr565>() * 8, info.BitsPerPixel);
259259
Assert.Equal(3, info.ComponentCount);
260260
Assert.Equal(PixelAlphaRepresentation.None, info.AlphaRepresentation);
261-
Assert.Equal(PixelComponentPrecision.Byte, info.ComponentPrecision);
261+
Assert.Equal(PixelComponentPrecision.Byte, info.MaxComponentPrecision);
262262
}
263263
}

tests/ImageSharp.Tests/PixelFormats/Bgra32Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ public void Bgra32_PixelInformation()
153153
Assert.Equal(Unsafe.SizeOf<Bgra32>() * 8, info.BitsPerPixel);
154154
Assert.Equal(4, info.ComponentCount);
155155
Assert.Equal(PixelAlphaRepresentation.Unassociated, info.AlphaRepresentation);
156-
Assert.Equal(PixelComponentPrecision.Byte, info.ComponentPrecision);
156+
Assert.Equal(PixelComponentPrecision.Byte, info.MaxComponentPrecision);
157157
}
158158
}

tests/ImageSharp.Tests/PixelFormats/Bgra4444Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,6 @@ public void Bgra4444_PixelInformation()
254254
Assert.Equal(Unsafe.SizeOf<Bgra4444>() * 8, info.BitsPerPixel);
255255
Assert.Equal(4, info.ComponentCount);
256256
Assert.Equal(PixelAlphaRepresentation.Unassociated, info.AlphaRepresentation);
257-
Assert.Equal(PixelComponentPrecision.Byte, info.ComponentPrecision);
257+
Assert.Equal(PixelComponentPrecision.Byte, info.MaxComponentPrecision);
258258
}
259259
}

0 commit comments

Comments
 (0)