Typedefs | Functions
Tango Service: Camera Interface

Functions for getting input from the device's cameras. Use no more than one of TangoService_connectTextureId() or TangoService_connectOnTextureAvailable(). More...

Typedefs

typedef int64_t TangoBufferId
typedef void(* TangoService_OnTextureAvailable )(void *, TangoCameraId)
 Callback for when a new camera texture is available.

Functions

TangoErrorType TangoService_connectOnFrameAvailable (TangoCameraId id, void *context, void(*onFrameAvailable)(void *context, TangoCameraId id, const TangoImageBuffer *buffer))
TangoErrorType TangoService_connectOnImageAvailable (TangoCameraId id, void *context, void(*onImageAvailable)(void *context, TangoCameraId id, const TangoImage *image, const TangoCameraMetadata *metadata))
TangoErrorType TangoService_connectOnTextureAvailable (TangoCameraId id, void *context, TangoService_OnTextureAvailable callback)
TangoErrorType TangoService_connectTextureId (TangoCameraId id, unsigned int tex, void *context, TangoService_OnTextureAvailable callback)
TangoErrorType TangoService_disconnectCamera (TangoCameraId id)
TangoErrorType TangoService_getCameraIntrinsics (TangoCameraId camera_id, TangoCameraIntrinsics *intrinsics)
TangoErrorType TangoService_lockCameraBuffer (TangoCameraId id, double *timestamp, TangoBufferId *buffer)
void TangoService_unlockCameraBuffer (TangoCameraId id, TangoBufferId buffer)
TangoErrorType TangoService_updateTexture (TangoCameraId id, double *timestamp)
TangoErrorType TangoService_updateTextureExternalOes (TangoCameraId id, unsigned int tex, double *timestamp)
TangoErrorType TangoService_updateTextureExternalOesForBuffer (TangoCameraId id, unsigned int texture_id, TangoBufferId buffer)

Detailed Description

Functions for getting input from the device's cameras. Use no more than one of TangoService_connectTextureId() or TangoService_connectOnTextureAvailable().


Typedef Documentation

typedef int64_t TangoBufferId

Definition at line 941 of file tango_client_api.h.

Callback for when a new camera texture is available.

Definition at line 871 of file tango_client_api.h.


Function Documentation

TangoErrorType TangoService_connectOnFrameAvailable ( TangoCameraId  id,
void *  context,
void(*)(void *context, TangoCameraId id, const TangoImageBuffer *buffer)  onFrameAvailable 
)

Connect a callback to a camera for access to the pixels. This is not recommended for display but for applications requiring access to the pixel data as an array of bytes. The camera is selected via TangoCameraId. Currently only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. The onFrameAvailable callback will be called when a new frame is available from the camera. The TangoConfig flag config_enable_color_camera (see Configuration Parameters ) must be set to true for TangoService_connectOnFrameAvailable() to succeed after TangoService_connect() is called.

Parameters:
idThe ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported.
contextThe context returned during the onFrameAvailable callback.
onFrameAvailableFunction called when a new frame is available from the camera.
TangoErrorType TangoService_connectOnImageAvailable ( TangoCameraId  id,
void *  context,
void(*)(void *context, TangoCameraId id, const TangoImage *image, const TangoCameraMetadata *metadata)  onImageAvailable 
)

Connect a callback to a camera for access to the pixels. This is not recommended for display but for applications requiring access to the pixel data as an array of bytes. The camera is selected via TangoCameraId. Currently only TANGO_CAMERA_COLOR is supported. The onImageAvailable callback will be called when a new image is available from the camera. The TangoConfig flag config_enable_color_camera (see Configuration Parameters ) must be set to true in order to receive callbacks after TangoService_connect() is called.

Parameters:
idThe ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR is supported.
contextThe context returned during the onImageAvailable callback.
onImageAvailableFunction called when a new image is available from the camera.

Connect a callback to a camera.

Currently only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. The TangoConfig flag config_enable_color_camera must be set to true for connectOnTextureAvailable to succeed after TangoService_connect() is called.

Parameters:
idThe ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported.
contextThe context returned during the onTextureAvailable callback.
callbackThe callback called when a new texture is available.
Returns:
TANGO_INVALID if the camera ID is not valid, or TANGO_ERROR if an internal error occurred.
TangoErrorType TangoService_connectTextureId ( TangoCameraId  id,
unsigned int  tex,
void *  context,
TangoService_OnTextureAvailable  callback 
)

Connect a Texture ID to a camera; the camera is selected by specifying a TangoCameraId. Currently only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. The texture must be the ID of a texture that has been allocated and initialized by the calling application. The TangoConfig flag config_enable_color_camera must be set to true for connectTextureId to succeed after TangoService_connect() is called.

Parameters:
idThe ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported.
contextThe context returned during the onFrameAvailable callback.
texThe texture ID of the texture to connect the camera to. Must be a valid texture in the applicaton.
Returns:
TANGO_INVALID if the camera ID is not valid, or TANGO_ERROR if an internal error occurred.

Disconnect a camera. The camera is selected via TangoCameraId. Currently only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. This call disconnects callbacks that have been registered with TangoService_connectTextureId() or TangoService_connectOnFrameAvailable().

Get the intrinsic calibration parameters for a given camera. The intrinsics are as specified by the TangoCameraIntrinsics struct and are accessed via the API.

Parameters:
camera_idThe camera ID to retrieve the calibration intrinsics for.
intrinsicsA TangoCameraIntrinsics struct that must be allocated before calling, and is filled with calibration intrinsics for the camera camera_id upon successful return.
Returns:
TANGO_SUCCESS on successfully retrieving calibration intrinsics, TANGO_INVALID if the camera_id is out of range or if intrinsics argument was NULL, or TANGO_ERROR if an internal error occurs while getting intrinsics.
TangoErrorType TangoService_lockCameraBuffer ( TangoCameraId  id,
double *  timestamp,
TangoBufferId buffer 
)

Keep the most recent image buffer of a camera around so that it can be available to update in the future.

This is useful to get the timestamp for a camera image outside of the render thread and then update the image in the render thread.

Parameters:
idThe ID of the camera to lock the most recent image.
timestampUpon return, if not NULL upon calling, timestamp contains the timestamp of the image buffer locked.
bufferUpon return, buffer contains a handle that can be passed to TangoService_updateTextureExternalOesForBuffer to update a GL texture in the render thread.
Returns:
TANGO_INVALID if id is out of range or buffer is NULL; TANGO_ERROR if too many buffers are currently locked; TANGO_SUCCESS otherwise.

Stop keeping a specific camera buffer around.

Call this after you have issues all the necessary render commands for a texture. This must be called in the render thread.

Parameters:
idThe ID of the camera whose buffer to unlock.
bufferThe buffer to unlock.
TangoErrorType TangoService_updateTexture ( TangoCameraId  id,
double *  timestamp 
)

Update the texture that has been connected to camera referenced by TangoCameraId. The texture is updated with the latest image from the camera. If timestamp is not NULL, it will be filled with the image timestamp.

Parameters:
idThe ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported.
timestampUpon return, if not NULL upon calling, timestamp contains the timestamp of the image that has been pushed to the connected texture.
Returns:
TANGO_INVALID if id is out of range or if a texture ID was never associated with the camera; TANGO_SUCCESS otherwise.
TangoErrorType TangoService_updateTextureExternalOes ( TangoCameraId  id,
unsigned int  tex,
double *  timestamp 
)

Update a GL_TEXTURE_EXTERNAL_OES texture to the latest camera image available.

If timestamp is not NULL, it will be filled with the image timestamp. The texture passed in must be of type GL_TEXTURE_EXTERNAL_OES. This is not checked.

Parameters:
idThe ID of the camera to use for the update. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported.
texTexture to update. This texture must be of type GL_TEXTURE_EXTERNAL_OES.
timestampUpon return, if not NULL upon calling, timestamp contains the timestamp of the image that has been pushed to the texture.
Returns:
TANGO_INVALID if id is out of range or if tex is not a texture ID; TANGO_SUCCESS otherwise.

Update a GL_TEXTURE_EXTERNAL_OES texture to a previously locked buffer. This must be called in the render thread.

The texture passed in must be of type GL_TEXTURE_EXTERNAL_OES. This is not checked.

Parameters:
idThe ID of the camera to use for the update. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported.
texture_idTexture to update. This texture must be of type GL_TEXTURE_EXTERNAL_OES.
bufferA previously locked buffer returned from TangoService_lockCameraBuffer.
Returns:
TANGO_INVALID if id is out of range, if tex is not a texture ID, or buffer is not a locked buffer; TANGO_SUCCESS otherwise.


tango_client_api
Author(s):
autogenerated on Thu Jun 6 2019 19:49:50