ZLab.Discrete ZLab.Discrete
ZLab.Discrete ZLab.Discrete
Developed by Zeke Zhang

Search Results for

    Edit this page

    Class GridBuffer<T>

    A contiguous, typed buffer of per-voxel data associated with a grid.

    Inheritance
    object
    GridBuffer<T>
    Implements
    IGridBuffer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ZLab.Discrete.Grids
    Assembly: ZLab.Discrete.dll
    Syntax
    public sealed class GridBuffer<T> : IGridBuffer where T : unmanaged
    Type Parameters
    Name Description
    T

    The type of data stored in the buffer. Must be an unmanaged type.

    Constructors

    Name Description
    GridBuffer(string, int)

    Constructs an empty buffer with the specified name and element count.

    GridBuffer(string, ReadOnlySpan<T>)

    Constructs a new buffer from an existing span of data.

    Properties

    Name Description
    Count

    The number of elements in the buffer.

    ElementType

    The type of data stored in the buffer.

    Name

    The name of the buffer, used for identification and retrieval within a grid.

    SizeInBytes

    The size of the buffer's data in bytes.

    Methods

    Name Description
    Clone()

    Creates a deep duplicate of the buffer.

    GetBuffer()

    Retrieves a mutable span of the internal array.

    GetRawArrayUnsafe()

    Retrieves raw array of the internal buffer.

    GetReadOnlyBuffer()

    Retrieves a read-only span of the internal array.

    GetValue(int)

    Retrieves the value at the specified linear index.

    SetFromBytes(ReadOnlySpan<byte>)

    Populates the buffer from a byte span. Length must exactly match SizeInBytes.

    SetValue(int, T)

    Sets the value at the specified linear index.

    SetValue(ReadOnlySpan<T>)

    Sets the values of the buffer using a read-only span. Span length must match in bytes.

    WriteTo(Span<byte>)

    Writes the contents of the buffer to a byte span.