Esempio n. 1
0
        public VideoFrameRef ReadFrame()
        {
            IntPtr newFrame;

            OpenNI.ThrowIfError(VideoStream_readFrame(this.Handle, out newFrame));
            return(new VideoFrameRef(newFrame));
        }
Esempio n. 2
0
        public static Recorder Create(string fileName)
        {
            IntPtr handle;

            OpenNI.ThrowIfError(Recorder_create(out handle, Marshal.StringToHGlobalAnsi(fileName)));
            Recorder rec = new Recorder(handle);

            return(rec);
        }
Esempio n. 3
0
        public static Device Open(string uri, string mode = "")
        {
            IntPtr handle;

            OpenNI.ThrowIfError(
                mode != string.Empty
                    ? Device__openEx(out handle, Marshal.StringToHGlobalAnsi(uri), Marshal.StringToHGlobalAnsi(mode))
                    : Device_open(out handle, Marshal.StringToHGlobalAnsi(uri)));

            return(new Device(handle));
        }
Esempio n. 4
0
        internal static VideoStream InternalCreate(Device device, Device.SensorType sensorType)
        {
            IntPtr handle;

            OpenNI.ThrowIfError(VideoStream_create(out handle, device.Handle, sensorType));
            VideoStream vs = new VideoStream(handle)
            {
                ParentDevice = device
            };

            vs.handlerEvents = VideoStream_RegisterListener(handle, vs.internalNewFrame);
            return(vs);
        }