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

Search Results for

    Edit this page

    Method GetMaskTernary

    | Edit this page View Source

    GetMaskTernary(bool)

    Export occupancy as a ternary mask.

    Declaration
    public byte[] GetMaskTernary(bool flipSign = false)
    Parameters
    Type Name Description
    bool flipSign

    flip outside and inside

    Returns
    Type Description
    byte[]

    (0=outside, 1=inside, 2=boundary)

    | Edit this page View Source

    GetMaskTernary(Span<byte>, bool)

    Export occupancy as a ternary mask into a provided span.

    Declaration
    public void GetMaskTernary(Span<byte> destination, bool flipSign = false)
    Parameters
    Type Name Description
    Span<byte> destination

    destination span (length must be at least NxNyNz)

    bool flipSign

    flip outside and inside

    Remarks

    Example:

    byte[] buf = ArrayPool.Shared.Rent(gridSize);
    grid.GetMaskTernary(buf.AsSpan());
    Exceptions
    Type Condition
    ArgumentException

    if destination span is too small