public void TestConstrutor()
 {
     LongExposureInfraredFrameData data = new LongExposureInfraredFrameData();
     bool pass = data.DataPointer != IntPtr.Zero;
     data.Dispose();
     Assert.AreEqual(true, pass);
 }
 public void TestSize()
 {
     LongExposureInfraredFrameData data = new LongExposureInfraredFrameData();
     int expected = 512 * 424 * 2;
     bool pass = data.SizeInBytes == expected;
     data.Dispose();
     Assert.AreEqual(pass, true);
 }
        public void TestDisposeAccess()
        {
            LongExposureInfraredFrameData data = new LongExposureInfraredFrameData();
            data.Dispose();

            //Should throw exception
            var pointer = data.DataPointer;
        }
        public void TestMultipleDispose()
        {
            LongExposureInfraredFrameData data = new LongExposureInfraredFrameData();
            data.Dispose();
            //Second call to dispose should do nothing
            data.Dispose();

            Assert.AreEqual(data.DataPointer, IntPtr.Zero);
        }
 public void TestCopy()
 {
     using (LongExposureInfraredFrameData frame = new LongExposureInfraredFrameData())
     {
         using (DynamicLongExposureInfraredTexture texture = new DynamicLongExposureInfraredTexture(device))
         {
             texture.Copy(device.ImmediateContext, frame);
         }
     }
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sensor">Kinect sensor</param>
        public KinectSensorLongExposureInfraredFrameProvider(KinectSensor sensor)
        {
            if (sensor == null)
                throw new ArgumentNullException("sensor");

            this.sensor = sensor;
            this.reader = this.sensor.LongExposureInfraredFrameSource.OpenReader();
            this.reader.FrameArrived += FrameArrived;
            this.frameData = new LongExposureInfraredFrameData();
        }
 /// <summary>
 /// Copy depth frame to graphics card
 /// </summary>
 /// <param name="context">Device context</param>
 /// <param name="data">Long exposure frame data</param>
 public void Copy(DeviceContext context, LongExposureInfraredFrameData data)
 {
     this.texture.Upload(context, data.DataPointer, data.SizeInBytes);
 }
 public void TestDisposedSize()
 {
     LongExposureInfraredFrameData data = new LongExposureInfraredFrameData();
     data.Dispose();
     Assert.AreEqual(data.SizeInBytes, 0);
 }
 public void TestDispose()
 {
     LongExposureInfraredFrameData data = new LongExposureInfraredFrameData();
     data.Dispose();
     Assert.AreEqual(data.DataPointer, IntPtr.Zero);
 }
Exemplo n.º 10
0
 public void LongInfraredTestConstructor()
 {
     using (LongExposureInfraredFrameData depthFrame = new LongExposureInfraredFrameData())
     {
         LongExposureInfraredFrameDataEventArgs args = new LongExposureInfraredFrameDataEventArgs(depthFrame);
         Assert.AreEqual(depthFrame, args.FrameData);
     }
 }