public void TestDispose()
        {
            CameraRGBAFrameData data = new CameraRGBAFrameData();

            data.Dispose();
            Assert.AreEqual(data.DataPointer, IntPtr.Zero);
        }
        public void TestDisposedSize()
        {
            CameraRGBAFrameData data = new CameraRGBAFrameData();

            data.Dispose();
            Assert.AreEqual(data.SizeInBytes, 0);
        }
        public void TestConstrutor()
        {
            CameraRGBAFrameData data = new CameraRGBAFrameData();
            bool pass = data.DataPointer != IntPtr.Zero;

            data.Dispose();
            Assert.AreEqual(true, pass);
        }
        public void TestSize()
        {
            CameraRGBAFrameData data = new CameraRGBAFrameData();
            int  expected            = 512 * 424 * 16;
            bool pass = data.SizeInBytes == expected;

            data.Dispose();
            Assert.AreEqual(pass, true);
        }
        public void TestDisposeAccess()
        {
            CameraRGBAFrameData data = new CameraRGBAFrameData();

            data.Dispose();

            //Should throw exception
            var pointer = data.DataPointer;
        }
        public void TestMultipleDispose()
        {
            CameraRGBAFrameData data = new CameraRGBAFrameData();

            data.Dispose();
            //Second call to dispose should do nothing
            data.Dispose();

            Assert.AreEqual(data.DataPointer, IntPtr.Zero);
        }
 /// <summary>
 /// Copies frame data to GPU
 /// </summary>
 /// <param name="context">Device context</param>
 /// <param name="frame">Frame data</param>
 public void Copy(DeviceContext context, CameraRGBAFrameData frame)
 {
     this.texture.Upload(context, frame.DataPointer, frame.SizeInBytes);
 }