mirror of
https://github.com/DarthAffe/ScreenCapture.NET.git
synced 2025-12-13 05:48:39 +00:00
Small fixes
This commit is contained in:
parent
db1e37f1d9
commit
52d37b996e
@ -1,9 +1,11 @@
|
|||||||
// ReSharper disable ConvertToAutoProperty
|
// ReSharper disable ConvertToAutoProperty
|
||||||
|
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace ScreenCapture.NET;
|
namespace ScreenCapture.NET;
|
||||||
|
|
||||||
|
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public readonly struct ColorBGRA : IColor
|
public readonly struct ColorBGRA : IColor
|
||||||
{
|
{
|
||||||
@ -16,10 +18,12 @@ public readonly struct ColorBGRA : IColor
|
|||||||
private readonly byte _r;
|
private readonly byte _r;
|
||||||
private readonly byte _a;
|
private readonly byte _a;
|
||||||
|
|
||||||
|
// ReSharper disable ConvertToAutoPropertyWhenPossible
|
||||||
public byte B => _b;
|
public byte B => _b;
|
||||||
public byte G => _g;
|
public byte G => _g;
|
||||||
public byte R => _r;
|
public byte R => _r;
|
||||||
public byte A => _a;
|
public byte A => _a;
|
||||||
|
// ReSharper restore ConvertToAutoPropertyWhenPossible
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -34,4 +38,10 @@ public readonly struct ColorBGRA : IColor
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
public override string ToString() => $"[A: {_a}, R: {_r}, G: {_g}, B: {_b}]";
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
@ -96,11 +96,11 @@ public readonly ref struct Image<TColor>
|
|||||||
|
|
||||||
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
|
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public Enumerator GetEnumerator() => new(_pixels);
|
public ImageEnumerator GetEnumerator() => new(_pixels);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public ref struct Enumerator
|
public ref struct ImageEnumerator
|
||||||
{
|
{
|
||||||
#region Properties & Fields
|
#region Properties & Fields
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ public readonly ref struct Image<TColor>
|
|||||||
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
internal Enumerator(ReadOnlySpan<TColor> pixels)
|
internal ImageEnumerator(ReadOnlySpan<TColor> pixels)
|
||||||
{
|
{
|
||||||
this._pixels = pixels;
|
this._pixels = pixels;
|
||||||
|
|
||||||
@ -189,11 +189,11 @@ public readonly ref struct Image<TColor>
|
|||||||
|
|
||||||
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
|
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public Enumerator GetEnumerator() => new(this);
|
public ImageRowsEnumerator GetEnumerator() => new(this);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public ref struct Enumerator
|
public ref struct ImageRowsEnumerator
|
||||||
{
|
{
|
||||||
#region Properties & Fields
|
#region Properties & Fields
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ public readonly ref struct Image<TColor>
|
|||||||
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
internal Enumerator(ImageRows rows)
|
internal ImageRowsEnumerator(ImageRows rows)
|
||||||
{
|
{
|
||||||
this._rows = rows;
|
this._rows = rows;
|
||||||
|
|
||||||
@ -281,11 +281,11 @@ public readonly ref struct Image<TColor>
|
|||||||
|
|
||||||
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
|
/// <inheritdoc cref="System.Collections.IEnumerable.GetEnumerator"/>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public Enumerator GetEnumerator() => new(this);
|
public ImageColumnsEnumerator GetEnumerator() => new(this);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public ref struct Enumerator
|
public ref struct ImageColumnsEnumerator
|
||||||
{
|
{
|
||||||
#region Properties & Fields
|
#region Properties & Fields
|
||||||
|
|
||||||
@ -304,7 +304,7 @@ public readonly ref struct Image<TColor>
|
|||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
internal Enumerator(ImageColumns columns)
|
internal ImageColumnsEnumerator(ImageColumns columns)
|
||||||
{
|
{
|
||||||
this._columns = columns;
|
this._columns = columns;
|
||||||
this._position = -1;
|
this._position = -1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user