diff --git a/ScreenCapture.NET/Model/Colors/ColorBGRA.cs b/ScreenCapture.NET/Model/Colors/ColorBGRA.cs index 1742899..4029709 100644 --- a/ScreenCapture.NET/Model/Colors/ColorBGRA.cs +++ b/ScreenCapture.NET/Model/Colors/ColorBGRA.cs @@ -1,9 +1,11 @@ // ReSharper disable ConvertToAutoProperty +using System.Diagnostics; using System.Runtime.InteropServices; namespace ScreenCapture.NET; +[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")] [StructLayout(LayoutKind.Sequential)] public readonly struct ColorBGRA : IColor { @@ -16,10 +18,12 @@ public readonly struct ColorBGRA : IColor private readonly byte _r; private readonly byte _a; + // ReSharper disable ConvertToAutoPropertyWhenPossible public byte B => _b; public byte G => _g; public byte R => _r; public byte A => _a; + // ReSharper restore ConvertToAutoPropertyWhenPossible #endregion @@ -34,4 +38,10 @@ public readonly struct ColorBGRA : IColor } #endregion + + #region Methods + + public override string ToString() => $"[A: {_a}, R: {_r}, G: {_g}, B: {_b}]"; + + #endregion } \ No newline at end of file diff --git a/ScreenCapture.NET/Model/Image.cs b/ScreenCapture.NET/Model/Image.cs index 6ba2b09..f0d7d8f 100644 --- a/ScreenCapture.NET/Model/Image.cs +++ b/ScreenCapture.NET/Model/Image.cs @@ -96,11 +96,11 @@ public readonly ref struct Image /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Enumerator GetEnumerator() => new(_pixels); + public ImageEnumerator GetEnumerator() => new(_pixels); #endregion - public ref struct Enumerator + public ref struct ImageEnumerator { #region Properties & Fields @@ -120,7 +120,7 @@ public readonly ref struct Image [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal Enumerator(ReadOnlySpan pixels) + internal ImageEnumerator(ReadOnlySpan pixels) { this._pixels = pixels; @@ -189,11 +189,11 @@ public readonly ref struct Image /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Enumerator GetEnumerator() => new(this); + public ImageRowsEnumerator GetEnumerator() => new(this); #endregion - public ref struct Enumerator + public ref struct ImageRowsEnumerator { #region Properties & Fields @@ -213,7 +213,7 @@ public readonly ref struct Image [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal Enumerator(ImageRows rows) + internal ImageRowsEnumerator(ImageRows rows) { this._rows = rows; @@ -281,11 +281,11 @@ public readonly ref struct Image /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Enumerator GetEnumerator() => new(this); + public ImageColumnsEnumerator GetEnumerator() => new(this); #endregion - public ref struct Enumerator + public ref struct ImageColumnsEnumerator { #region Properties & Fields @@ -304,7 +304,7 @@ public readonly ref struct Image #region Constructors [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal Enumerator(ImageColumns columns) + internal ImageColumnsEnumerator(ImageColumns columns) { this._columns = columns; this._position = -1;