summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/camera/dumpimage.cc
diff options
context:
space:
mode:
authorschodet2003-05-22 18:05:25 +0000
committerschodet2003-05-22 18:05:25 +0000
commit028befd70da61c3468149a1f1afa3d9eaf4369c7 (patch)
tree253d937265197995715102411af4e3af883f6875 /2003/i/buzz/src/camera/dumpimage.cc
parentd201c6b9e46b79b6dabb5a7cd753b95c108c0915 (diff)
Ajout de Dumpimage
R├ęglage des param├Ętres de la camera.
Diffstat (limited to '2003/i/buzz/src/camera/dumpimage.cc')
-rw-r--r--2003/i/buzz/src/camera/dumpimage.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/2003/i/buzz/src/camera/dumpimage.cc b/2003/i/buzz/src/camera/dumpimage.cc
new file mode 100644
index 0000000..6692c26
--- /dev/null
+++ b/2003/i/buzz/src/camera/dumpimage.cc
@@ -0,0 +1,34 @@
+// dumpimage.cc
+// buzz - Programme du robot Efrei Robotique I1-I2 2003
+// Copyright (C) 2003 Nicolas Schodet
+//
+#include "camera.h"
+
+#include <iomanip>
+#include <unistd.h>
+
+int
+main (int argc, char **argv)
+{
+ Camera cam;
+ int w, h;
+ cam.getSize (w, h);
+ unsigned char *image = new unsigned char[w * h];
+ cout << hex;
+ int j = 0;
+ int pixel;
+ while (1)
+ {
+ cout << dec << "\n- " << j++ << hex << " ---------";
+ cam.read (image);
+ for (int i = 0; i < 256; ++i)
+ {
+ if (!(i % 16))
+ cout << endl;
+ pixel = image[i];
+ cout << setw (2) << setfill ('0') << pixel << ' ';
+ }
+ }
+ delete image;
+ return 0;
+}