Skip to content

Commit

Permalink
Merge pull request #63 from nenoNaninu/elements_as_memory
Browse files Browse the repository at this point in the history
add ElementsAsMemory method to HomographyMatrix
  • Loading branch information
nenoNaninu committed Feb 5, 2023
2 parents 540c999 + 0778710 commit 67b86a7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions HomographySharp/Double/DoubleHomographyMatrix.cs
Expand Up @@ -26,6 +26,9 @@ internal DoubleHomographyMatrix(double[] elements)
/// <inheritdoc/>
public override ReadOnlySpan<double> ElementsAsSpan() => _elements;

/// <inheritdoc/>
public override ReadOnlyMemory<double> ElementsAsMemory() => _elements;

public override int RowCount => 3;

public override int ColumnCount => 3;
Expand Down
15 changes: 10 additions & 5 deletions HomographySharp/HomographyMatrix.cs
Expand Up @@ -17,11 +17,6 @@ internal HomographyMatrix()
/// </summary>
public abstract IReadOnlyList<T> Elements { get; }

/// <summary>
/// Row-major order
/// </summary>
public abstract ReadOnlySpan<T> ElementsAsSpan();

public abstract T this[int row, int column] { get; }

public abstract int RowCount { get; }
Expand All @@ -32,6 +27,16 @@ internal HomographyMatrix()

public abstract Matrix<T> ToMathNetMatrix();

/// <summary>
/// Row-major order
/// </summary>
public abstract ReadOnlySpan<T> ElementsAsSpan();

/// <summary>
/// Row-major order
/// </summary>
public abstract ReadOnlyMemory<T> ElementsAsMemory();

public abstract string ToString(IFormatProvider? provider);

public abstract string ToString(string? format);
Expand Down
3 changes: 3 additions & 0 deletions HomographySharp/Single/SingleHomographyMatrix.cs
Expand Up @@ -26,6 +26,9 @@ internal SingleHomographyMatrix(float[] elements)
/// <inheritdoc/>
public override ReadOnlySpan<float> ElementsAsSpan() => _elements;

/// <inheritdoc/>
public override ReadOnlyMemory<float> ElementsAsMemory() => _elements;

public override int RowCount => 3;

public override int ColumnCount => 3;
Expand Down

0 comments on commit 67b86a7

Please sign in to comment.