Example #1
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, APIOnImageAvailable callback)
        {
            int  returnValue = API.TangoService_connectOnImageAvailable(cameraId, IntPtr.Zero, callback);
            bool success     = returnValue == Common.ErrorType.TANGO_SUCCESS;

            Debug.LogFormat("{0}.SetCallback(OnImageAvailable) Callback was {1}set.",
                            CLASS_NAME, success ? string.Empty : "not ");
        }
        /// <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, APIOnImageAvailable 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!");
            }
        }
 /// <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, APIOnImageAvailable 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!");
     }
 }
Example #4
0
 public static int TangoService_connectOnImageAvailable(
     TangoEnums.TangoCameraId cameraId, IntPtr context,
     [In, Out] APIOnImageAvailable callback)
 {
     return(Common.ErrorType.TANGO_SUCCESS);
 }
Example #5
0
 public static extern int TangoService_connectOnImageAvailable(
     TangoEnums.TangoCameraId cameraId, IntPtr context,
     [In, Out] APIOnImageAvailable callback);