Inheritance: FrameSource
Esempio n. 1
0
 /// <summary>
 /// Creates instance from cv::Ptr&lt;T&gt; .
 /// ptr is disposed when the wrapper disposes. 
 /// </summary>
 /// <param name="ptr"></param>
 internal static FrameSource FromPtr(IntPtr ptr)
 {
     if (ptr == IntPtr.Zero)
         throw new OpenCvSharpException("Invalid FrameSource pointer");
     var obj = new FrameSourceImpl();
     var ptrObj = new Ptr<FrameSource>(ptr);
     obj.ptrObj = ptrObj;
     obj.ptr = ptr;
     return obj;
 }
Esempio n. 2
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);
        }
Esempio n. 3
0
 /// <summary>
 /// Creates instance from raw pointer T*
 /// </summary>
 /// <param name="ptr"></param>
 internal static FrameSource FromRawPtr(IntPtr ptr)
 {
     if (ptr == IntPtr.Zero)
         throw new OpenCvSharpException("Invalid FrameSource pointer");
     var obj = new FrameSourceImpl
         {
             ptrObj = null,
             ptr = ptr
         };
     return obj;
 }
Esempio n. 4
0
        /// <summary>
        /// Creates instance from cv::Ptr&lt;T&gt; .
        /// ptr is disposed when the wrapper disposes.
        /// </summary>
        /// <param name="ptr"></param>
        internal static FrameSource FromPtr(IntPtr ptr)
        {
            if (ptr == IntPtr.Zero)
            {
                throw new OpenCvSharpException("Invalid FrameSource pointer");
            }
            var obj    = new FrameSourceImpl();
            var ptrObj = new Ptr(ptr);

            obj.ptrObj = ptrObj;
            obj.ptr    = ptr;
            return(obj);
        }
Esempio n. 5
0
        /// <summary>
        /// Creates instance from raw pointer T*
        /// </summary>
        /// <param name="ptr"></param>
        internal static FrameSource FromRawPtr(IntPtr ptr)
        {
            if (ptr == IntPtr.Zero)
            {
                throw new OpenCvSharpException("Invalid FrameSource pointer");
            }
            var obj = new FrameSourceImpl
            {
                ptrObj = null,
                ptr    = ptr
            };

            return(obj);
        }
Esempio n. 6
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));
        }
Esempio n. 7
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));
        }
Esempio n. 8
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));
        }
Esempio n. 9
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static FrameSource CreateEmptySource()
        {
            IntPtr ptr = NativeMethods.superres_createFrameSource_Empty();

            return(FrameSourceImpl.FromPtr(ptr));
        }
Esempio n. 10
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));
 }
Esempio n. 11
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static FrameSource CreateFrameSource_Empty()
 {
     NativeMethods.HandleException(
         NativeMethods.superres_createFrameSource_Empty(out var ptr));
     return(FrameSourceImpl.FromPtr(ptr));
 }