Ejemplo n.º 1
0
        /// <summary>
        /// Contructor
        /// </summary>
        /// <param name="frameData">Frame data</param>
        public InfraredFrameDataEventArgs(InfraredFrameData frameData)
        {
            if (frameData == null)
                throw new ArgumentNullException("frameData");

            this.frameData = frameData;
        }
Ejemplo n.º 2
0
 public void TestConstrutor()
 {
     InfraredFrameData data = new InfraredFrameData();
     bool pass = data.DataPointer != IntPtr.Zero;
     data.Dispose();
     Assert.AreEqual(true, pass);
 }
Ejemplo n.º 3
0
 public void TestSize()
 {
     InfraredFrameData data = new InfraredFrameData();
     int expected = 512 * 424 * 2;
     bool pass = data.SizeInBytes == expected;
     data.Dispose();
     Assert.AreEqual(pass, true);
 }
Ejemplo n.º 4
0
        public void TestDisposeAccess()
        {
            InfraredFrameData data = new InfraredFrameData();
            data.Dispose();

            //Should throw exception
            var pointer = data.DataPointer;
        }
Ejemplo n.º 5
0
 public void InfraredTestConstructor()
 {
     using (InfraredFrameData depthFrame = new InfraredFrameData())
     {
         InfraredFrameDataEventArgs args = new InfraredFrameDataEventArgs(depthFrame);
         Assert.AreEqual(depthFrame, args.FrameData);
     }
 }
Ejemplo n.º 6
0
        public void TestMultipleDispose()
        {
            InfraredFrameData data = new InfraredFrameData();
            data.Dispose();
            //Second call to dispose should do nothing
            data.Dispose();

            Assert.AreEqual(data.DataPointer, IntPtr.Zero);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sensor">Kinect sensor</param>
        public KinectSensorInfraredFrameProvider(KinectSensor sensor)
        {
            if (sensor == null)
                throw new ArgumentNullException("sensor");

            this.sensor = sensor;
            this.reader = this.sensor.InfraredFrameSource.OpenReader();
            this.reader.FrameArrived += FrameArrived;
            this.frameData = new InfraredFrameData();
        }
 public void TestCopy()
 {
     using (InfraredFrameData frame = new InfraredFrameData())
     {
         using (DynamicInfraredTexture texture = new DynamicInfraredTexture(device))
         {
             texture.Copy(device.ImmediateContext, frame);
         }
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Creates a dynamic depth texture, allocates GPU resources
        /// </summary>
        /// <param name="device">Direct3D Device</param>
        /// <param name="frameData">Initial frame data</param>
        public ImmutableInfraredTexture(Device device, InfraredFrameData frameData)
        {
            if (device == null)
                throw new ArgumentNullException("device");
            if (frameData == null)
                throw new ArgumentNullException("frameData");

            DataRectangle rect = new DataRectangle(frameData.DataPointer, Consts.DepthWidth * sizeof(ushort));

            this.texture = new Texture2D(device, InfraredTextureDescriptors.DynamicResource,rect);
            this.shaderView = new ShaderResourceView(device, this.texture);
        }
Ejemplo n.º 10
0
 public void TestDisposedSize()
 {
     InfraredFrameData data = new InfraredFrameData();
     data.Dispose();
     Assert.AreEqual(data.SizeInBytes, 0);
 }
Ejemplo n.º 11
0
 public void TestDispose()
 {
     InfraredFrameData data = new InfraredFrameData();
     data.Dispose();
     Assert.AreEqual(data.DataPointer, IntPtr.Zero);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Copy depth frame to graphics card
 /// </summary>
 /// <param name="context">Device context</param>
 /// <param name="data">Infrared frame data</param>
 public void Copy(DeviceContext context, InfraredFrameData data)
 {
     this.texture.Upload(context, data.DataPointer, data.SizeInBytes);
 }