C# Class Tango.VideoOverlayProvider

Video Overlay Provider class provide video functions to get frame textures.
Exibir arquivo Open project: ashomk/beerpong Class Usage Examples

Public Methods

Method Description
ConnectTexture ( TangoEnums cameraId, int textureId ) : void

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 first scan-line of the color image is reserved for metadata instead of image pixels.

GetIntrinsics ( TangoEnums cameraId, [ intrinsics ) : void

Get the intrinsic calibration parameters for a given camera. The intrinsics are as specified by the TangoCameraIntrinsics struct. Intrinsics are read from the on-device intrinsics file (typically /sdcard/config/calibration.xml, but to ensure compatibility applications should only access these parameters via the API), or default internal model parameters corresponding to the device are used if the calibration.xml file is not found.

RenderLatestFrame ( TangoEnums cameraId ) : double

Update the texture that has been connected to camera referenced by TangoCameraId with the latest image from the camera.

Private Methods

Method Description
ExperimentalConnectTexture ( TangoEnums cameraId, YUVTexture textures, TangoService_onUnityFrameAvailable onUnityFrameAvailable ) : void

Experimental API only, subject to change. Connect a Texture IDs to a camera. The camera is selected via TangoCameraId. Currently only TANGO_CAMERA_COLOR is supported. The texture handles will be regenerated by the API on startup after which the application can use them, and will be packed RGBA8888 data containing bytes of the image (so a single RGBA8888 will pack 4 neighbouring pixels). If the config flag experimental_image_pixel_format is set to HAL_PIXEL_FORMAT_YCrCb_420_SP, texture_y will pack 1280x720 pixels into a 320x720 RGBA8888 texture. texture_Cb and texture_Cr will contain copies of the 2x2 downsampled interleaved UV planes packed similarly. If experimental_image_pixel_format is set to HAL_PIXEL_FORMAT_YV12 then texture_y will have a stride of 1536 containing 1280 columns of data, packed similarly in a RGBA8888 texture. texture_Cb and texture_Cr will be 2x2 downsampled versions of the same. See YV12 and NV21 formats for details. Note: The first scan-line of the color image is reserved for metadata instead of image pixels.

SetCallback ( TangoEnums cameraId, TangoService_onImageAvailable onImageAvailable ) : void

Connect a callback to a camera for access to the pixels. This is not recommended for display but for applications requiring access to the HAL_PIXEL_FORMAT_YV12 pixel data. The camera is selected via TangoCameraId. Currently only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported. The onImageAvailable callback will be called when a new frame is available from the camera. The Enable Video Overlay option must be enabled for this to succeed. Note: The first scan-line of the color image is reserved for metadata instead of image pixels.

Method Details

ConnectTexture() public static method

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 first scan-line of the color image is reserved for metadata instead of image pixels.
public static ConnectTexture ( TangoEnums cameraId, int textureId ) : void
cameraId TangoEnums /// The ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are /// supported. ///
textureId int /// The texture ID of the texture to connect the camera to. Must be a valid texture in the applicaton. ///
return void

GetIntrinsics() public static method

Get the intrinsic calibration parameters for a given camera. The intrinsics are as specified by the TangoCameraIntrinsics struct. Intrinsics are read from the on-device intrinsics file (typically /sdcard/config/calibration.xml, but to ensure compatibility applications should only access these parameters via the API), or default internal model parameters corresponding to the device are used if the calibration.xml file is not found.
public static GetIntrinsics ( TangoEnums cameraId, [ intrinsics ) : void
cameraId TangoEnums The camera ID to retrieve the calibration intrinsics for.
intrinsics [ A TangoCameraIntrinsics filled with calibration intrinsics for the camera.
return void

RenderLatestFrame() public static method

Update the texture that has been connected to camera referenced by TangoCameraId with the latest image from the camera.
public static RenderLatestFrame ( TangoEnums cameraId ) : double
cameraId TangoEnums /// The ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and /// TANGO_CAMERA_FISHEYE are supported. ///
return double