Functions for getting input from the device's cameras. Use no more than one of TangoService_connectTextureId() or TangoService_connectOnTextureAvailable().
More...
|
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) |
|
Functions for getting input from the device's cameras. Use no more than one of TangoService_connectTextureId() or TangoService_connectOnTextureAvailable().
typedef void(* TangoService_OnTextureAvailable) (void *, TangoCameraId) |
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
-
id | The ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. |
context | The context returned during the onFrameAvailable callback. |
onFrameAvailable | Function called when a new frame is available from the camera. |
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
-
id | The ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR is supported. |
context | The context returned during the onImageAvailable callback. |
onImageAvailable | Function 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
-
id | The ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. |
context | The context returned during the onTextureAvailable callback. |
callback | The 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.
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
-
id | The ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. |
context | The context returned during the onFrameAvailable callback. |
tex | The 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.
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_id | The camera ID to retrieve the calibration intrinsics for. |
intrinsics | A 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.
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
-
id | The ID of the camera to lock the most recent image. |
timestamp | Upon return, if not NULL upon calling, timestamp contains the timestamp of the image buffer locked. |
buffer | Upon 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
-
id | The ID of the camera whose buffer to unlock. |
buffer | The buffer to unlock. |
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
-
id | The ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. |
timestamp | Upon 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.
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
-
id | The ID of the camera to use for the update. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. |
tex | Texture to update. This texture must be of type GL_TEXTURE_EXTERNAL_OES . |
timestamp | Upon 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
-
id | The ID of the camera to use for the update. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. |
texture_id | Texture to update. This texture must be of type GL_TEXTURE_EXTERNAL_OES . |
buffer | A 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.