Browse Source

Added class empty class ColorImage.
Fixed namespace related problems.

Daniel Kauth 11 years ago
parent
commit
7b4ac903ee

+ 12 - 0
bbiwarg/DataSource/ColorImage.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace bbiwarg.DataSource
+{
+    class ColorImage
+    {
+    }
+}

+ 1 - 1
bbiwarg/DataSource/DepthImage.cs

@@ -4,7 +4,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace bbiwarg
+namespace bbiwarg.DataSource
 {
     /**
      * Represents an depth image where the depth is given in distance to the camera in millimeters. 

+ 0 - 4
bbiwarg/DataSource/IVideoDataSource.cs

@@ -58,10 +58,6 @@ namespace bbiwarg.DataSource
          * The depth is given by the distance to the camera in millimeters. 
          */
         DepthImage getDepthImage();
-
-        /**
-         * 
-         */
         ColorImage getColorImage();
         /*
          * all handIndices have to be 1 or 2

+ 15 - 0
bbiwarg/DataSource/IisuDataSource.cs

@@ -26,6 +26,7 @@ namespace bbiwarg.DataSource
         private IDataHandle<Iisu.Data.Vector3[]>[] fingerTipPositions3D = new IDataHandle<Iisu.Data.Vector3[]>[2];
         private IDataHandle<int>[] handSides = new IDataHandle<int>[2];
         private IDataHandle<Iisu.Data.IImageData> depthImage;
+        private IDataHandle<Iisu.Data.IImageData> colorImage;
 
         /*
          * Creates an Iisu data source.
@@ -58,6 +59,8 @@ namespace bbiwarg.DataSource
             
             // data
             depthImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.DEPTH.Image");
+
+            colorImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.COLOR.Image");
             
             handOpen[0] = device.RegisterDataHandle<bool>("CI.HAND1.IsOpen");
             handOpen[1] = device.RegisterDataHandle<bool>("CI.HAND2.IsOpen");
@@ -134,6 +137,18 @@ namespace bbiwarg.DataSource
             return new DepthImage(width, height, depthData);
         }
 
+        public ColorImage getColorImage()
+        {
+            Iisu.Data.IImageInfos imageInfos = depthImage.Value.ImageInfos;
+            int width = (int)imageInfos.Width;
+            int height = (int)imageInfos.Height;
+            int numBytes = (int)imageInfos.BytesRaw;
+
+            Console.WriteLine("width: " + width + " height: " + height + " numBytes: " + numBytes);
+
+            return new ColorImage();
+        }
+
         private void checkHandIndex(uint handIndex) 
         {
             if (handIndex < 1 || handIndex > 2)

+ 1 - 1
bbiwarg/OutputTest.cs

@@ -10,7 +10,7 @@ namespace bbiwarg
     {
         static void Main(string[] args)
         {
-            IVideoDataSource source = new IIsuDataSource("..\\..\\videos\\1.skv");
+            DataSource.IVideoDataSource source = new DataSource.IIsuDataSource("..\\..\\videos\\1.skv");
 
             source.init();
             source.start();

+ 3 - 3
bbiwarg/TestDataSource.cs

@@ -21,9 +21,9 @@ namespace bbiwarg
 
                 if ((i % 30) == 0)
                 {
-                    DataSource.DepthImage image = source.getDepthImage();
+                    DataSource.ColorImage image = source.getColorImage();
 
-                    Bitmap bm = new Bitmap(image.getWidth(), image.getHeight());
+                    /*Bitmap bm = new Bitmap(image.getWidth(), image.getHeight());
                     for (int x = 0; x < image.getWidth(); ++x)
                     {
                         for (int y = 0; y < image.getHeight(); ++y) 
@@ -34,7 +34,7 @@ namespace bbiwarg
                     }
 
                     bm.Save("test." + j + ".png");
-                    j++;
+                    j++;*/
                 }
 
                 source.releaseFrame();

+ 5 - 2
bbiwarg/bbiwarg.csproj

@@ -56,10 +56,13 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="OutputTest.cs" />
-    <Compile Include="DepthImage.cs" />
+    <Compile Include="DataSource\ColorImage.cs" />
+    <Compile Include="DataSource\DepthImage.cs" />
     <Compile Include="DataSource\IisuDataSource.cs" />
     <Compile Include="DataSource\IVideoDataSource.cs" />
+    <Compile Include="OutputTest.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="TestDataSource.cs" />
   </ItemGroup>