本文整理汇总了C#中TangoEnums类的典型用法代码示例。如果您正苦于以下问题:C# TangoEnums类的具体用法?C# TangoEnums怎么用?C# TangoEnums使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TangoEnums类属于命名空间,在下文中一共展示了TangoEnums类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderLatestFrame
/// <summary>
/// Renders the latest frame.
/// </summary>
/// <param name="cameraId">Camera identifier.</param>
public static void RenderLatestFrame(TangoEnums.TangoCameraId cameraId)
{
double timestamp = 0.0f;
int returnValue = VideoOverlayAPI.TangoService_updateTexture(cameraId, ref timestamp);
if (returnValue != Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log("VideoOverlayProvider.UpdateTexture() Texture was not updated by camera!");
}
}
示例2: GetIntrinsics
/// <summary>
/// Get the camera/sensor intrinsics.
/// </summary>
/// <param name="cameraId">Camera identifier.</param>
/// <param name="intrinsics">Camera intrinsics data.</param>
public static void GetIntrinsics(TangoEnums.TangoCameraId cameraId, [Out] TangoCameraIntrinsics intrinsics)
{
int returnValue = VideoOverlayAPI.TangoService_getCameraIntrinsics(cameraId, intrinsics);
if (returnValue != Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log("IntrinsicsProviderAPI.TangoService_getCameraIntrinsics() failed!");
}
}
示例3: ConnectTexture
/// <summary>
/// Connects the texture.
/// </summary>
/// <param name="cameraId">Camera identifier.</param>
/// <param name="textureId">Texture identifier.</param>
public static void ConnectTexture(TangoEnums.TangoCameraId cameraId, int textureId)
{
int returnValue = VideoOverlayAPI.TangoService_connectTextureId(cameraId, textureId);
if (returnValue != Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log("VideoOverlayProvider.ConnectTexture() Texture was not connected to camera!");
}
}
示例4: ExperimentalConnectTexture
public static void ExperimentalConnectTexture(TangoEnums.TangoCameraId cameraId, int textureId, TangoService_onUnityFrameAvailable onUnityFrameAvailable)
{
int returnValue = VideoOverlayAPI.TangoService_Experimental_connectTextureIdUnity(cameraId, (uint)textureId, callbackContext, onUnityFrameAvailable);
if (returnValue != Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log("VideoOverlayProvider.ConnectTexture() Texture was not connected to camera!");
}
}
示例5: SetCallback
/// <summary>
/// Sets the callback for notifications when image data is ready.
/// </summary>
/// <param name="cameraId">Camera identifier.</param>
/// <param name="onImageAvailable">On image available callback handler.</param>
public static void SetCallback(TangoEnums.TangoCameraId cameraId, TangoService_onImageAvailable onImageAvailable)
{
int returnValue = VideoOverlayAPI.TangoService_connectOnFrameAvailable(cameraId, callbackContext, onImageAvailable);
if(returnValue == Tango.Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log(CLASS_NAME + ".SetCallback() Callback was set.");
}
else
{
Debug.Log(CLASS_NAME + ".SetCallback() Callback was not set!");
}
}
示例6: TangoService_Experimental_connectTextureIdUnity
public static extern int TangoService_Experimental_connectTextureIdUnity(TangoEnums.TangoCameraId id,
uint tex,
IntPtr context,
TangoService_onUnityFrameAvailable onUnityFrameAvailable);
示例7: TangoService_Experimental_connectTextureIdUnity
public static int TangoService_Experimental_connectTextureIdUnity(
TangoEnums.TangoCameraId id, UInt32 texture_y, UInt32 texture_Cb, UInt32 texture_Cr,
IntPtr context, APIOnTextureAvailable callback)
{
return Common.ErrorType.TANGO_SUCCESS;
}
示例8: TangoService_getCameraIntrinsics
public static int TangoService_getCameraIntrinsics(
TangoEnums.TangoCameraId cameraId, [Out] TangoCameraIntrinsics intrinsics)
{
return Common.ErrorType.TANGO_SUCCESS;
}
示例9: TangoService_updateTexture
public static int TangoService_updateTexture(TangoEnums.TangoCameraId cameraId, ref double timestamp)
{
return Common.ErrorType.TANGO_SUCCESS;
}
示例10: TangoService_connectOnTextureAvailable
public static extern int TangoService_connectOnTextureAvailable(
TangoEnums.TangoCameraId cameraId, IntPtr ContextMenu, APIOnTextureAvailable callback);
示例11: TangoService_connectOnFrameAvailable
public static int TangoService_connectOnFrameAvailable(TangoEnums.TangoCameraId cameraId,
IntPtr context,
[In,Out] TangoService_onImageAvailable onImageAvailable)
{
return Tango.Common.ErrorType.TANGO_SUCCESS;
}
示例12: TangoService_connectTextureId
public static int TangoService_connectTextureId(TangoEnums.TangoCameraId cameraId, int textureHandle)
{
return Tango.Common.ErrorType.TANGO_SUCCESS;
}
示例13: SetCallback
/// <summary>
/// Connect a callback to a camera for texture updates.
/// </summary>
/// <param name="cameraId">
/// The ID of the camera to connect this texture to. Only <code>TANGO_CAMERA_COLOR</code> and
/// <code>TANGO_CAMERA_FISHEYE</code> are supported.
/// </param>
/// <param name="callback">Function called when a new frame is available from the camera.</param>
internal static void SetCallback(TangoEnums.TangoCameraId cameraId, APIOnTextureAvailable callback)
{
int returnValue = API.TangoService_connectOnTextureAvailable(cameraId, IntPtr.Zero, callback);
if (returnValue == Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log(CLASS_NAME + ".SetCallback(OnTextureAvailable) Callback was set.");
}
else
{
Debug.Log(CLASS_NAME + ".SetCallback(OnTextureAvailable) Callback was not set!");
}
}
示例14: ClearCallback
/// <summary>
/// Clear all camera callbacks.
/// </summary>
/// <param name="cameraId">Camera identifier.</param>
internal static void ClearCallback(TangoEnums.TangoCameraId cameraId)
{
int returnValue = API.TangoService_Experimental_connectTextureIdUnity(cameraId, 0, 0, 0,
IntPtr.Zero, null);
if (returnValue == Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log(CLASS_NAME + ".ClearCallback() Unity callback was cleared.");
}
else
{
Debug.Log(CLASS_NAME + ".ClearCallback() Unity callback was not cleared!");
}
returnValue = API.TangoService_connectOnFrameAvailable(cameraId, IntPtr.Zero, null);
if (returnValue == Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log(CLASS_NAME + ".ClearCallback() Frame callback was cleared.");
}
else
{
Debug.Log(CLASS_NAME + ".ClearCallback() Frame callback was not cleared!");
}
returnValue = API.TangoService_connectOnTextureAvailable(cameraId, IntPtr.Zero, null);
if (returnValue == Common.ErrorType.TANGO_SUCCESS)
{
Debug.Log(CLASS_NAME + ".ClearCallback() Texture callback was cleared.");
}
else
{
Debug.Log(CLASS_NAME + ".ClearCallback() Texture callback was not cleared!");
}
}
示例15: _OnImageAvailable
/// <summary>
/// Handle the callback sent by the Tango Service
/// when a new image is sampled.
/// </summary>
/// <param name="cameraId">Camera identifier.</param>
/// <param name="callbackContext">Callback context.</param>
/// <param name="imageBuffer">Image buffer.</param>
protected void _OnImageAvailable(IntPtr callbackContext,
TangoEnums.TangoCameraId cameraId,
TangoImageBuffer imageBuffer)
{
m_previousCameraId = cameraId;
if(m_previousImageBuffer.data == null)
{
m_previousImageBuffer.data = new byte[imageBuffer.width * imageBuffer.height * 2];
}
m_previousImageBuffer.width = imageBuffer.width;
m_previousImageBuffer.height = imageBuffer.height;
m_previousImageBuffer.stride = imageBuffer.stride;
m_previousImageBuffer.timestamp = imageBuffer.timestamp;
m_previousImageBuffer.format = imageBuffer.format;
m_previousImageBuffer.frame_number = imageBuffer.frame_number;
Marshal.Copy(imageBuffer.data, m_previousImageBuffer.data, 0, m_previousImageBuffer.data.Length);
m_shouldSendEvent = true;
}