interface ISemanticBufferProcessor (Niantic.ARDK.AR.ISemanticBufferProcessor)
Overview
interface ISemanticBufferProcessor: Niantic.ARDK.AR.Awareness.IAwarenessBufferProcessor { // properties ISemanticBuffer AwarenessBuffer; uint ChannelCount; string[] Channels; // methods 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); }; // direct descendants class SemanticBufferProcessor;
Inherited Members
public: // properties InterpolationMode InterpolationMode; float InterpolationPreference; Matrix4x4 SamplerTransform;
Detailed Documentation
Properties
ISemanticBuffer AwarenessBuffer
The CPU copy of the latest awareness buffer.
uint ChannelCount
The number of classes available.
string[] Channels
Returns the possible semantic classes that a pixel can be interpreted.
Methods
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.
注釈
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.
注釈
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.
注釈
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.