summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/camera/dumpimage.cc
diff options
context:
space:
mode:
authorschodet2004-02-07 16:55:41 +0000
committerschodet2004-02-07 16:55:41 +0000
commit9fdd6704947174fae292dfc6e14cc1029a7f7a6c (patch)
tree40a4fe775845ececdaf27e82d99d6a06f6b3803e /2004/i/nono/src/camera/dumpimage.cc
parentb673946d76e436c067d24e535b1e0a167b9dfc47 (diff)
Initial revision
Diffstat (limited to '2004/i/nono/src/camera/dumpimage.cc')
-rw-r--r--2004/i/nono/src/camera/dumpimage.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/2004/i/nono/src/camera/dumpimage.cc b/2004/i/nono/src/camera/dumpimage.cc
new file mode 100644
index 0000000..90909af
--- /dev/null
+++ b/2004/i/nono/src/camera/dumpimage.cc
@@ -0,0 +1,36 @@
+// dumpimage.cc
+// buzz - Programme du robot Efrei Robotique I1-I2 2003
+// Copyright (C) 2003 Nicolas Schodet
+//
+#include "camera.h"
+#include "date/date.h"
+
+#include <iomanip>
+#include <unistd.h>
+
+int
+main (int argc, char **argv)
+{
+ Camera cam;
+ Date date;
+ int w, h, d;
+ cam.getSize (w, h, d);
+ unsigned char *image = new unsigned char[w * h * d];
+ cout << hex;
+ int j = 0;
+ int pixel;
+ while (1)
+ {
+ cout << dec << "\n- " << j++ << hex << " ---------";
+ while (cam.read (image) == 0);
+ 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;
+}