|
@@ -29,7 +29,7 @@ namespace bbiwarg.DataSource
|
|
private IDataHandle<Iisu.Data.IImageData> depthImage;
|
|
private IDataHandle<Iisu.Data.IImageData> depthImage;
|
|
private IDataHandle<Iisu.Data.IImageData> colorImage;
|
|
private IDataHandle<Iisu.Data.IImageData> colorImage;
|
|
private IDataHandle<Iisu.Data.IImageData> confidenceImage;
|
|
private IDataHandle<Iisu.Data.IImageData> confidenceImage;
|
|
- private IDataHandle<Iisu.Data.Vertex[]> vertexArray;
|
|
|
|
|
|
+ private IDataHandle<Iisu.Data.IImageData> uvImage;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Creates an Iisu data source.
|
|
* Creates an Iisu data source.
|
|
@@ -68,7 +68,8 @@ namespace bbiwarg.DataSource
|
|
depthImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.DEPTH.Image");
|
|
depthImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.DEPTH.Image");
|
|
colorImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.COLOR.Image");
|
|
colorImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.COLOR.Image");
|
|
confidenceImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.CONFIDENCE.Image");
|
|
confidenceImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.CONFIDENCE.Image");
|
|
-
|
|
|
|
|
|
+ uvImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.COLOR.REGISTRATION.UV.Image");
|
|
|
|
+
|
|
handOpen[0] = device.RegisterDataHandle<bool>("CI.HAND1.IsOpen");
|
|
handOpen[0] = device.RegisterDataHandle<bool>("CI.HAND1.IsOpen");
|
|
handOpen[1] = device.RegisterDataHandle<bool>("CI.HAND2.IsOpen");
|
|
handOpen[1] = device.RegisterDataHandle<bool>("CI.HAND2.IsOpen");
|
|
|
|
|
|
@@ -100,8 +101,6 @@ namespace bbiwarg.DataSource
|
|
private void onDeviceStatusChanged(string eventName, DeviceStatus status)
|
|
private void onDeviceStatusChanged(string eventName, DeviceStatus status)
|
|
{
|
|
{
|
|
active = status.HasFlag(Iisu.DeviceStatus.Playing);
|
|
active = status.HasFlag(Iisu.DeviceStatus.Playing);
|
|
- if (vertexArray != null && !vertexArray.Valid && active)
|
|
|
|
- vertexArray = device.RegisterDataHandle<Iisu.Data.Vertex[]>("SCENE.VertexArray");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public void start()
|
|
public void start()
|
|
@@ -179,28 +178,19 @@ namespace bbiwarg.DataSource
|
|
return new ConfidenceImage(width, height, confidenceData);
|
|
return new ConfidenceImage(width, height, confidenceData);
|
|
}
|
|
}
|
|
|
|
|
|
- public VertexArray getVertexArray()
|
|
|
|
|
|
+ public VertexArray getUVImage()
|
|
{
|
|
{
|
|
- if (vertexArray != null && vertexArray.Valid)
|
|
|
|
- {
|
|
|
|
- int numVertices = vertexArray.Value.Length;
|
|
|
|
|
|
+ Iisu.Data.IImageInfos imageInfos = uvImage.Value.ImageInfos;
|
|
|
|
+ int width = (int)imageInfos.Width;
|
|
|
|
+ int height = (int)imageInfos.Height;
|
|
|
|
+ int numBytes = (int)imageInfos.BytesRaw;
|
|
|
|
|
|
- Vector[] positions = new Vector[numVertices];
|
|
|
|
- Color4[] colors = new Color4[numVertices];
|
|
|
|
|
|
+ IntPtr imageData = uvImage.Value.Raw;
|
|
|
|
|
|
- for (int i = 0; i < numVertices; ++i)
|
|
|
|
- {
|
|
|
|
- positions[i] = new DenseVector(vertexArray.Value[i].Position.ToArray());
|
|
|
|
- Iisu.Data.Color4C color = vertexArray.Value[i].Color;
|
|
|
|
- colors[i] = new Color4(color.A, color.R, color.G, color.B);
|
|
|
|
- }
|
|
|
|
|
|
+ float[] uvData = new float[width * height];
|
|
|
|
+ Marshal.Copy(imageData, uvData, 0, width * height);
|
|
|
|
|
|
- return new VertexArray(positions, colors);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- return new VertexArray(new DenseVector[0], new Color4[0]);
|
|
|
|
- }
|
|
|
|
|
|
+ return new UVImage(width, height, uvData);
|
|
}
|
|
}
|
|
|
|
|
|
private void checkHandIndex(uint handIndex)
|
|
private void checkHandIndex(uint handIndex)
|