예제 #1
0
		/// <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!");
			}

		}
예제 #2
0
        /// <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!");
            }
        }
예제 #3
0
        /// <summary>
        /// Connect a callback to a camera for access to the pixels.
        ///
        /// This is not recommended for display but for applications requiring access to the
        /// <code>HAL_PIXEL_FORMAT_YV12</code> pixel data.  The camera is selected via TangoCameraId.  Currently only
        /// <code>TANGO_CAMERA_COLOR</code> and <code>TANGO_CAMERA_FISHEYE</code> are supported.
        ///
        /// The <i>onImageAvailable</i> 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.
        /// </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, TangoService_onImageAvailable callback)
        {
            int returnValue = API.TangoService_connectOnFrameAvailable(cameraId, IntPtr.Zero, callback);

            if (returnValue == Common.ErrorType.TANGO_SUCCESS)
            {
                Debug.Log(CLASS_NAME + ".SetCallback(OnImageAvailable) Callback was set.");
            }
            else
            {
                Debug.Log(CLASS_NAME + ".SetCallback(OnImageAvailable) Callback was not set!");
            }
        }
예제 #4
0
 public static int TangoService_connectOnFrameAvailable(TangoEnums.TangoCameraId cameraId,
                                                        IntPtr context,
                                                        [In, Out] TangoService_onImageAvailable onImageAvailable)
 {
     return(Tango.Common.ErrorType.TANGO_SUCCESS);
 }
예제 #5
0
 public static extern int TangoService_connectOnFrameAvailable(TangoEnums.TangoCameraId cameraId,
                                                               IntPtr context,
                                                               [In, Out] TangoService_onImageAvailable onImageAvailable);