// dumpimage.cc // buzz - Programme du robot Efrei Robotique I1-I2 2003 // Copyright (C) 2003 Nicolas Schodet // #include "camera.h" #include "date/date.h" #include #include 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; }