Fixed some code issues

This commit is contained in:
DarthAffe committed 2024-07-06 19:50:47 +02:00
1 parent 3ccb62538d
commit 9c67e49293
6 files changed
+10 -21

No files matched your search

+6 -4
View File
@@ -145,7 +145,7 @@ public readonly ref struct RefImage<TColor>
private int _position;
/// <inheritdoc cref="System.Collections.Generic.IEnumerator{T}.Current"/>
public TColor Current
public readonly TColor Current
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => _pixels[_position];
@@ -194,7 +194,7 @@ public readonly ref struct RefImage<TColor>
#region Indexer
public readonly ReadOnlyRefEnumerable<TColor> this[int row]
public ReadOnlyRefEnumerable<TColor> this[int row]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
@@ -212,6 +212,7 @@ public readonly ref struct RefImage<TColor>
#region Constructors
// ReSharper disable once ConvertToPrimaryConstructor - Not possible with ref types
public ImageRows(ReadOnlySpan<TColor> pixels, int x, int y, int width, int height, int stride)
{
this._pixels = pixels;
@@ -240,7 +241,7 @@ public readonly ref struct RefImage<TColor>
private int _position;
/// <inheritdoc cref="System.Collections.Generic.IEnumerator{T}.Current"/>
public ReadOnlyRefEnumerable<TColor> Current
public readonly ReadOnlyRefEnumerable<TColor> Current
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => _rows[_position];
@@ -306,6 +307,7 @@ public readonly ref struct RefImage<TColor>
#region Constructors
// ReSharper disable once ConvertToPrimaryConstructor - Not possible with ref types
public ImageColumns(ReadOnlySpan<TColor> pixels, int x, int y, int width, int height, int stride)
{
this._pixels = pixels;
@@ -334,7 +336,7 @@ public readonly ref struct RefImage<TColor>
private int _position;
/// <inheritdoc cref="System.Collections.Generic.IEnumerator{T}.Current"/>
public ReadOnlyRefEnumerable<TColor> Current
public readonly ReadOnlyRefEnumerable<TColor> Current
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => _columns[_position];
+1
View File
@@ -1,5 +1,6 @@
namespace HPPH;
// ReSharper disable once RedundantUnsafeContext
public static unsafe partial class PixelHelper
{
#region Methods
+1 -1
View File
@@ -28,7 +28,7 @@ internal struct ColorCube<T>
#region Methods
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal Span<T> Slice(Span<T> fullColorList) => fullColorList.Slice(_offset, _length);
internal readonly Span<T> Slice(Span<T> fullColorList) => fullColorList.Slice(_offset, _length);
internal void Split(Span<T> fullColorList, out ColorCube<T> a, out ColorCube<T> b)
{