Explorar o código

changed Int16 to short in whole project

Alexander Hendrich %!s(int64=11) %!d(string=hai) anos
pai
achega
7ff9257e0e

+ 3 - 3
bbiwarg/Graphics/GraphicElements2D/Point2D.cs

@@ -24,9 +24,9 @@ namespace bbiwarg.Graphics.GraphicElements2D
         public void draw(short[] textureData, int width)
         {
             int index = (3 * ((int)position.y() * width + (int)position.x()));
-            textureData[index + 0] = (short) ((Int16.MaxValue / byte.MaxValue) * color.R);
-            textureData[index + 1] = (short) ((Int16.MaxValue / byte.MaxValue) * color.G);
-            textureData[index + 2] = (short) ((Int16.MaxValue / byte.MaxValue) * color.B);
+            textureData[index + 0] = (short) ((short.MaxValue / byte.MaxValue) * color.R);
+            textureData[index + 1] = (short) ((short.MaxValue / byte.MaxValue) * color.G);
+            textureData[index + 2] = (short) ((short.MaxValue / byte.MaxValue) * color.B);
         }
     }
 }

+ 2 - 2
bbiwarg/Graphics/Output2D.cs

@@ -82,9 +82,9 @@ namespace bbiwarg.Graphics
             int index = 0;
             for (int y = 0; y < depthImage.getHeight(); ++y) {
                 for (int x = 0; x < depthImage.getWidth(); ++x) {
-                    // 0 --> 0 / 2000 -> Int16.MaxValue
+                    // 0 --> 0 / 2000 -> short.MaxValue
                     int d = depthImage.getDepth(x, y);
-                    short depth = (short) (d * Int16.MaxValue / 2000);
+                    short depth = (short) (d * short.MaxValue / 2000);
                     textureData[index] = textureData[index + 1] = textureData[index + 2] = depth;
                     index += 3;
                 }

+ 2 - 2
bbiwarg/Images/DepthImage.cs

@@ -18,14 +18,14 @@ namespace bbiwarg.Images
     class DepthImage
     {
         private int width, height;
-        private Image<Gray, Int16> image;
+        private Image<Gray, short> image;
 
         public DepthImage(int width, int height, short[] data)
         {
             this.width = width;
             this.height = height;
             
-            image = new Image<Gray, Int16>(width, height);
+            image = new Image<Gray, short>(width, height);
             for (int i = 0; i < data.Length; ++i)
                 setDepth(i % width, i / width, data[i]);
         }