Skip to content

Commit 52d37b9

Browse files
committed
Small fixes
1 parent db1e37f commit 52d37b9

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

ScreenCapture.NET/Model/Colors/ColorBGRA.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// ReSharper disable ConvertToAutoProperty
22

3+
using System.Diagnostics;
34
using System.Runtime.InteropServices;
45

56
namespace ScreenCapture.NET;
67

8+
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
79
[StructLayout(LayoutKind.Sequential)]
810
public readonly struct ColorBGRA : IColor
911
{
@@ -16,10 +18,12 @@ namespace ScreenCapture.NET;
1618
private readonly byte _r;
1719
private readonly byte _a;
1820

21+
// ReSharper disable ConvertToAutoPropertyWhenPossible
1922
public byte B => _b;
2023
public byte G => _g;
2124
public byte R => _r;
2225
public byte A => _a;
26+
// ReSharper restore ConvertToAutoPropertyWhenPossible
2327

2428
#endregion
2529

@@ -34,4 +38,10 @@ public ColorBGRA(byte b, byte g, byte r, byte a)
3438
}
3539

3640
#endregion
41+
42+
#region Methods
43+
44+
public override string ToString() => $"[A: {_a}, R: {_r}, G: {_g}, B: {_b}]";
45+
46+
#endregion
3747
}

ScreenCapture.NET/Model/Image.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ public TColor[] ToArray()
9696

9797
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
9898
[MethodImpl(MethodImplOptions.AggressiveInlining)]
99-
public Enumerator GetEnumerator() => new(_pixels);
99+
public ImageEnumerator GetEnumerator() => new(_pixels);
100100

101101
#endregion
102102

103-
public ref struct Enumerator
103+
public ref struct ImageEnumerator
104104
{
105105
#region Properties & Fields
106106

@@ -120,7 +120,7 @@ public TColor Current
120120

121121

122122
[MethodImpl(MethodImplOptions.AggressiveInlining)]
123-
internal Enumerator(ReadOnlySpan<TColor> pixels)
123+
internal ImageEnumerator(ReadOnlySpan<TColor> pixels)
124124
{
125125
this._pixels = pixels;
126126

@@ -189,11 +189,11 @@ public ImageRows(ReadOnlySpan<TColor> pixels, int x, int y, int width, int heigh
189189

190190
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
191191
[MethodImpl(MethodImplOptions.AggressiveInlining)]
192-
public Enumerator GetEnumerator() => new(this);
192+
public ImageRowsEnumerator GetEnumerator() => new(this);
193193

194194
#endregion
195195

196-
public ref struct Enumerator
196+
public ref struct ImageRowsEnumerator
197197
{
198198
#region Properties & Fields
199199

@@ -213,7 +213,7 @@ public ReadOnlyRefEnumerable<TColor> Current
213213

214214

215215
[MethodImpl(MethodImplOptions.AggressiveInlining)]
216-
internal Enumerator(ImageRows rows)
216+
internal ImageRowsEnumerator(ImageRows rows)
217217
{
218218
this._rows = rows;
219219

@@ -281,11 +281,11 @@ public ImageColumns(ReadOnlySpan<TColor> pixels, int x, int y, int width, int he
281281

282282
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
283283
[MethodImpl(MethodImplOptions.AggressiveInlining)]
284-
public Enumerator GetEnumerator() => new(this);
284+
public ImageColumnsEnumerator GetEnumerator() => new(this);
285285

286286
#endregion
287287

288-
public ref struct Enumerator
288+
public ref struct ImageColumnsEnumerator
289289
{
290290
#region Properties & Fields
291291

@@ -304,7 +304,7 @@ public ReadOnlyRefEnumerable<TColor> Current
304304
#region Constructors
305305

306306
[MethodImpl(MethodImplOptions.AggressiveInlining)]
307-
internal Enumerator(ImageColumns columns)
307+
internal ImageColumnsEnumerator(ImageColumns columns)
308308
{
309309
this._columns = columns;
310310
this._position = -1;

0 commit comments

Comments
 (0)