public void Save(DepthDataFrame frame, string path) { using (var fileStream = new FileStream(path, FileMode.Create)) { this.Save(frame, fileStream); } }
public void Index_Access_Returns_The_Right_Value() { var frame = new DepthDataFrame(2, 2, new ushort[] { 1, 2, 3, 4 }); Assert.AreEqual(1, frame[0, 0]); Assert.AreEqual(2, frame[1, 0]); Assert.AreEqual(3, frame[0, 1]); Assert.AreEqual(4, frame[1, 1]); }
public void Test_With_And_Height_Properties() { int width = 20; int height = 10; var frame = new DepthDataFrame(width, height); Assert.AreEqual(width, frame.Width); Assert.AreEqual(height, frame.Height); Assert.AreEqual(frame.Size.Width, frame.Width); Assert.AreEqual(frame.Size.Height, frame.Height); }
public void Saved_Frame_Can_Be_Restored() { var repository = new DepthDataFrameRepository(new IntSize(20, 10)); var frame = new DepthDataFrame(20, 10); int anIndex = 1; ushort aValue = 2; frame.Data[anIndex] = aValue; var path = Path.GetTempFileName(); repository.Save(frame, path); var loadedFrame = repository.Load(path); File.Delete(path); Assert.AreEqual(aValue, loadedFrame.Data[anIndex]); }
public void DepthImage_Colors_Fade_With_Distance() { var bitmap = new Bitmap(20, 10); var factory = new DepthBitmapFactory(200); var frame = new DepthDataFrame(20, 10); for (int index = 0; index < frame.Data.Length; index++) { frame.Data[index] = (ushort) index; } var pointerFactory = new ArrayToPointerFactory(); var pointer = pointerFactory.CreatePointer(frame.Data); try { factory.CreateImage(bitmap, pointer); AssertColorsFade(bitmap); } finally { pointerFactory.Destroy(pointer); } }
public void Max_Depth_Returns_The_Maximum_Depth() { var frame = new DepthDataFrame(2, 2, new ushort[] { 1, 2, 3, 4 }); Assert.AreEqual(4, frame.MaxDepth); }
private unsafe IntPtr GetPointer(DepthDataFrame frame) { return this.pointerFactory.CreatePointer(frame.Data); }
public DepthFramePointerDataSource(DepthDataFrame frame) { this.frame = frame; this.pointerFactory = new ArrayToPointerFactory(); this.CurrentValue = this.GetPointer(frame); }
private void AddNewDepthFrame(DepthDataFrame depthDataFrame) { var testFrame = new TestDepthFrame(depthDataFrame); this.AddFrame(testFrame); }
public void Setup() { this.depthDataFrame = new DepthDataFrame(20, 10); this.depthDataFrame.Data[1] = 1; this.dataSource = new DepthFramePointerDataSource(this.depthDataFrame); }
public void Save(DepthDataFrame frame, Stream outputStream) { this.Save(frame.Data, outputStream); }
private unsafe IntPtr GetPointer(DepthDataFrame frame) { return(this.pointerFactory.CreatePointer(frame.Data)); }
public TestDepthFrame(DepthDataFrame frame) : this() { this.Frame = frame; }
public TestDepthFrame(string id, DepthDataFrame frame, IEnumerable<HandDataViewModel> hands) { this.Id = id; this.Frame = frame; this.Hands = new BindingList<HandDataViewModel>(hands.ToList()); }
void VideoPresenter_NewFrameCaptured(DepthDataFrame depthDataFrame) { this.AddNewDepthFrame(depthDataFrame); }