Tilt Five™ Unity API  1.4.1
TiltFive.CameraImage Class Reference

The Camera Frame API and runtime. More...

Inheritance diagram for TiltFive.CameraImage:
TiltFive.Singleton< CameraImage >

Classes

class  CameraImageCore
 Internal Camera Image core. More...
 

Static Public Member Functions

static bool TryGetFilledCameraImageBuffer (PlayerIndex playerIndex, ref T5_CamImage camImage)
 Attempt to request a new filled buffer from the camera image stream. If an empty buffer has been submitted, the oldest available image will be placed in to camImage. If no image is available, camImage will not be modified. If a new image is available, camImage will wrap the previously provided buffer, now containing the frame data. More...
 
static bool TrySubmitEmptyCameraImageBuffer (PlayerIndex playerIndex, IntPtr imageBuffer, UInt32 bufferSize)
 Submit a camera image buffer to be used by the camera image stream. As images become available the buffers will be filled and returned on subsequent calls to TryGetFilledCameraImageBuffer(). It's recommended to begin with at least 3 buffers when submitting buffers to the stream, and after an image is finished being processed, resubmitting that buffer back to the camera image stream. More...
 
static bool TryCancelCameraImageBuffer (PlayerIndex playerIndex, byte[] imageBuffer)
 Specify an image buffer to be released from the Tilt Five Service. If true is returned, the provided buffer is no longer in use by the service, and is available to be freed. Canceled buffers should not be utilized outside of freeing or resubmitting to the service, their data is not guaranteed to be in a specific state. More...
 
static bool TryConfigureCameraImageStream (PlayerIndex playerIndex, T5_CameraStreamConfig config)
 Attempt to configure the Camera Stream More...
 

Private Attributes

Dictionary< GlassesHandle, CameraImageCorecameraImageCores = new Dictionary<GlassesHandle, CameraImageCore>()
 The glasses core runtimes. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TiltFive.Singleton< CameraImage >
 Singleton ()
 
- Properties inherited from TiltFive.Singleton< CameraImage >
static T Instance [get]
 

Detailed Description

The Camera Frame API and runtime.

Definition at line 30 of file CameraImage.cs.

Member Function Documentation

◆ TryCancelCameraImageBuffer()

static bool TiltFive.CameraImage.TryCancelCameraImageBuffer ( PlayerIndex  playerIndex,
byte[]  imageBuffer 
)
static

Specify an image buffer to be released from the Tilt Five Service. If true is returned, the provided buffer is no longer in use by the service, and is available to be freed. Canceled buffers should not be utilized outside of freeing or resubmitting to the service, their data is not guaranteed to be in a specific state.

Returns
true if buffer has been canceled, false otherwise.

Definition at line 116 of file CameraImage.cs.

117  {
118  if(!Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
119  {
120  return false;
121  }
122 
123  return TryCancelCameraImageBuffer(glassesHandle, imageBuffer);
124  }
static bool TryCancelCameraImageBuffer(PlayerIndex playerIndex, byte[] imageBuffer)
Specify an image buffer to be released from the Tilt Five Service. If true is returned,...
Definition: CameraImage.cs:116
Provides access to player settings and functionality.
Definition: Player.cs:31

◆ TryConfigureCameraImageStream()

static bool TiltFive.CameraImage.TryConfigureCameraImageStream ( PlayerIndex  playerIndex,
T5_CameraStreamConfig  config 
)
static

Attempt to configure the Camera Stream

Returns
true if stream has been conffigured, false otherwise.

Definition at line 142 of file CameraImage.cs.

143  {
144  if(!Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
145  {
146  return false;
147  }
148 
149  return TryConfigureCameraImageStream(glassesHandle, config);
150  }
static bool TryConfigureCameraImageStream(PlayerIndex playerIndex, T5_CameraStreamConfig config)
Attempt to configure the Camera Stream
Definition: CameraImage.cs:142

◆ TryGetFilledCameraImageBuffer()

static bool TiltFive.CameraImage.TryGetFilledCameraImageBuffer ( PlayerIndex  playerIndex,
ref T5_CamImage  camImage 
)
static

Attempt to request a new filled buffer from the camera image stream. If an empty buffer has been submitted, the oldest available image will be placed in to camImage. If no image is available, camImage will not be modified. If a new image is available, camImage will wrap the previously provided buffer, now containing the frame data.

Returns
true if a filled buffer was available and camImage has been set, false otherwise.

Definition at line 58 of file CameraImage.cs.

59  {
60  if(!Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
61  {
62  return false;
63  }
64 
65  return TryGetFilledCameraImageBuffer(glassesHandle, ref camImage);
66  }
static bool TryGetFilledCameraImageBuffer(PlayerIndex playerIndex, ref T5_CamImage camImage)
Attempt to request a new filled buffer from the camera image stream. If an empty buffer has been subm...
Definition: CameraImage.cs:58

◆ TrySubmitEmptyCameraImageBuffer()

static bool TiltFive.CameraImage.TrySubmitEmptyCameraImageBuffer ( PlayerIndex  playerIndex,
IntPtr  imageBuffer,
UInt32  bufferSize 
)
static

Submit a camera image buffer to be used by the camera image stream. As images become available the buffers will be filled and returned on subsequent calls to TryGetFilledCameraImageBuffer(). It's recommended to begin with at least 3 buffers when submitting buffers to the stream, and after an image is finished being processed, resubmitting that buffer back to the camera image stream.

Returns
true if buffer was accepted, false otherwise.

Definition at line 87 of file CameraImage.cs.

88  {
89  if(!Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
90  {
91  return false;
92  }
93 
94  return TrySubmitEmptyCameraImageBuffer(glassesHandle, imageBuffer, bufferSize);
95  }
static bool TrySubmitEmptyCameraImageBuffer(PlayerIndex playerIndex, IntPtr imageBuffer, UInt32 bufferSize)
Submit a camera image buffer to be used by the camera image stream. As images become available the bu...
Definition: CameraImage.cs:87

Member Data Documentation

◆ cameraImageCores

Dictionary<GlassesHandle, CameraImageCore> TiltFive.CameraImage.cameraImageCores = new Dictionary<GlassesHandle, CameraImageCore>()
private

The glasses core runtimes.

Definition at line 36 of file CameraImage.cs.


The documentation for this class was generated from the following file: