FromPtr() static private method

Creates instance from cv::Ptr<T> . ptr is disposed when the wrapper disposes.
static private FromPtr ( IntPtr ptr ) : FrameSource
ptr System.IntPtr
return FrameSource
Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static FrameSource CreateFrameSource_Video_CUDA(string fileName)
        {
            if (string.IsNullOrEmpty("fileName"))
                throw new ArgumentNullException(nameof(fileName));
            if (!File.Exists(fileName))
                throw new FileNotFoundException("", fileName);

            IntPtr ptr = NativeMethods.superres_createFrameSource_Video_CUDA(fileName);
            return FrameSourceImpl.FromPtr(ptr);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static FrameSource CreateVideoSource(string fileName)
        {
            if (String.IsNullOrEmpty("fileName"))
            {
                throw new ArgumentNullException("fileName");
            }
            if (!File.Exists(fileName))
            {
                throw new FileNotFoundException("", fileName);
            }
            IntPtr ptr = NativeMethods.superres_createFrameSource_Video(fileName);

            return(FrameSourceImpl.FromPtr(ptr));
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static FrameSource CreateFrameSource_Video_CUDA(string fileName)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException(nameof(fileName));
            }
            if (!File.Exists(fileName))
            {
                throw new FileNotFoundException("", fileName);
            }

            NativeMethods.HandleException(
                NativeMethods.superres_createFrameSource_Video_CUDA(fileName, out var ptr));
            return(FrameSourceImpl.FromPtr(ptr));
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="deviceId"></param>
        /// <returns></returns>
        public static FrameSource CreateCameraSource(int deviceId)
        {
            IntPtr ptr = NativeMethods.superres_createFrameSource_Camera(deviceId);

            return(FrameSourceImpl.FromPtr(ptr));
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static FrameSource CreateEmptySource()
        {
            IntPtr ptr = NativeMethods.superres_createFrameSource_Empty();

            return(FrameSourceImpl.FromPtr(ptr));
        }
Exemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="deviceId"></param>
 /// <returns></returns>
 public static FrameSource CreateFrameSource_Camera(int deviceId)
 {
     NativeMethods.HandleException(
         NativeMethods.superres_createFrameSource_Camera(deviceId, out var ptr));
     return(FrameSourceImpl.FromPtr(ptr));
 }
Exemplo n.º 7
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static FrameSource CreateFrameSource_Empty()
 {
     NativeMethods.HandleException(
         NativeMethods.superres_createFrameSource_Empty(out var ptr));
     return(FrameSourceImpl.FromPtr(ptr));
 }