public OverlapRegion(RectangleF absBounds, KinectFieldImage imageA, RectangleF boundsA, KinectFieldImage imageB, RectangleF boundsB) { m_AbsoluteBounds = absBounds; m_ImageA = imageA; m_BoundsA = boundsA; m_ImageB = imageB; m_BoundsB = boundsB; }
private void FillRectangle(KinectFieldImage image, RectangleF rectangle, Vector2 direction) { int yOffset = (int)rectangle.Top; int xOffset = (int)rectangle.Left; float diff = rectangle.Width; float rowStartValue, inc, value; if (direction.X > 0) { rowStartValue = 1; inc = -1f / diff; } else { rowStartValue = 0; inc = 1f / diff; } for (int y = 0; y < rectangle.Height; y++) { int rowOffset = ((yOffset + y) * image.Stride) + xOffset; value = rowStartValue; for (int x = 0; x < rectangle.Width; x++) { image.BlendingMap[rowOffset + x] *= value > 1 ? 1 : value < 0 ? 0 : value; value += inc; } } }
public void RegisterDevice(KinectDevice device) { KinectFieldImage image = new KinectFieldImage(this, device); Images.Add(image); }