class SemanticBufferProcessor (Niantic.ARDK.AR.Awareness.Semantics.SemanticBufferProcessor)

Overview

class SemanticBufferProcessor:
    Niantic.ARDK.AR.Awareness.AwarenessBufferProcessor,
    Niantic.ARDK.AR.ISemanticBufferProcessor {
public:
    // properties

    uint??? ChannelCount;
    string[]? Channels;

    // methods

    void AssignViewport(RenderTarget target);

    void CopyToAlignedTextureARGB32(
        int channel,
        ref Texture2D texture,
        ScreenOrientation orientation
    );

    void CopyToAlignedTextureARGB32(
        int[] channels,
        ref Texture2D texture,
        ScreenOrientation orientation
    );

    bool DoesChannelExistAt(int viewportX, int viewportY, int channelIndex);
    bool DoesChannelExistAt(int viewportX, int viewportY, string channelName);
    int[] GetChannelIndicesAt(int viewportX, int viewportY);
    string[] GetChannelNamesAt(int viewportX, int viewportY);
    uint GetSemantics(int viewportX, int viewportY);
    SemanticBufferProcessor();
    SemanticBufferProcessor(RenderTarget viewport);
};

Inherited Members

public:
    // properties

    TBuffer AwarenessBuffer;
    ArdkEventHandler<ContextAwarenessArgs<TBuffer>> AwarenessStreamBegan;
    Vector2Int CurrentViewportResolution;
    InterpolationMode InterpolationMode;
    float InterpolationPreference;
    Matrix4x4 SamplerTransform;
    InterpolationMode InterpolationMode;
    float InterpolationPreference;
    Matrix4x4 SamplerTransform;
    ISemanticBuffer AwarenessBuffer;
    uint ChannelCount;
    string[] Channels;

    // events

    event AwarenessStreamUpdated();

    // methods

    void Dispose();

    void CopyToAlignedTextureARGB32(
        int channel,
        ref Texture2D texture,
        ScreenOrientation orientation
    );

    void CopyToAlignedTextureARGB32(
        int[] channels,
        ref Texture2D texture,
        ScreenOrientation orientation
    );

    bool DoesChannelExistAt(int viewportX, int viewportY, int channelIndex);
    bool DoesChannelExistAt(int viewportX, int viewportY, string channelName);
    int[] GetChannelIndicesAt(int viewportX, int viewportY);
    string[] GetChannelNamesAt(int viewportX, int viewportY);
    uint GetSemantics(int viewportX, int viewportY);

Detailed Documentation

Properties

uint??? ChannelCount

The number of classes available.

string[]? Channels

Returns the possible semantic classes that a pixel can be interpreted.

Methods

void AssignViewport(RenderTarget target)

Assigns a new render target descriptor for the semantics processor. The render target defines the viewport attributes to correctly fit the semantics buffer.

void CopyToAlignedTextureARGB32(
    int channel,
    ref Texture2D texture,
    ScreenOrientation orientation
)

Pushes the current state of the semantics buffer to the specified target texture. The resulting texture will contain a display aligned representation of the specified channel.

Note

Only use this call if you absolutely need the texture to be display aligned. It is faster to create a texture from the awareness buffer itself.

Parameters:

channel

The semantic channel index to create a texture of.

texture

The target texture. If this texture does not exist, it will be created. It is the responsibility of the caller to release this texture.

orientation

The target orientation of the texture. This determines the resolution of the container. This has to be either landscape or portrait.

void CopyToAlignedTextureARGB32(
    int[] channels,
    ref Texture2D texture,
    ScreenOrientation orientation
)

Pushes the current state of the semantics buffer to the specified target texture. The resulting texture will contain a display aligned representation of the specified channels.

Parameters:

channels

The semantic channel indices to create a texture of.

texture

The target texture. If this texture does not exist, it will be created. It is the responsibility of the caller to release this texture.

orientation

The target orientation of the texture. This determines the resolution of the container. This has to be either landscape or portrait.

bool DoesChannelExistAt(int viewportX, int viewportY, int channelIndex)

Check if a pixel is of a certain semantics class.

Parameters:

viewportX

Horizontal coordinate in viewport space.

viewportY

Vertical coordinate in viewport space.

channelIndex

Channel index of the semantic class to look for.

Returns:

True if the semantic channel exists at the given coordinates.

bool DoesChannelExistAt(int viewportX, int viewportY, string channelName)

Check if a pixel is of a certain semantics class.

Parameters:

viewportX

Horizontal coordinate in viewport space.

viewportY

Vertical coordinate in viewport space.

channelName

Name of the semantic class to look for.

Returns:

True if the semantic channel exists at the given coordinates.

int[] GetChannelIndicesAt(int viewportX, int viewportY)

Returns an array of channel indices that are present for the specified pixel.

Note

This query allocates garbage.

Parameters:

viewportX

Horizontal coordinate in viewport space.

viewportY

Vertical coordinate in viewport space.

Returns:

An array of channel indices present for the pixel.

string[] GetChannelNamesAt(int viewportX, int viewportY)

Returns an array of channel names that are present for the specified pixel.

Note

This query allocates garbage.

Parameters:

viewportX

Horizontal coordinate in viewport space.

viewportY

Vertical coordinate in viewport space.

Returns:

An array of channel names present for the pixel.

uint GetSemantics(int viewportX, int viewportY)

Returns the semantics of the specified pixel.

Parameters:

viewportX

Horizontal coordinate in viewport space.

viewportY

Vertical coordinate in viewport space.

Returns:

The result is a 32-bit packed unsigned integer where each bit is a binary indicator for a class.

SemanticBufferProcessor()

Allocates a new semantic buffer processor. By default, the awareness buffer will be fit to the main camera’s viewport.

SemanticBufferProcessor(RenderTarget viewport)

Allocates a new semantic buffer processor.

Parameters:

viewport

Determines the target viewport to fit the awareness buffer to.