Go to the documentation of this file.00001 #include <stdlib.h>
00002 #include <stdio.h>
00003 #include <assert.h>
00004 #include <FCam/N900.h>
00005
00008
00009 namespace Plat = FCam::N900;
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 int main(int argc, char ** argv) {
00020
00021
00022 Plat::Sensor sensor;
00023 Plat::Flash flash;
00024 sensor.attach(&flash);
00025
00026
00027
00028 std::vector<FCam::Shot> shot(2);
00029
00030
00031 shot[0].exposure = 80000;
00032 shot[0].gain = 1.0f;
00033 shot[0].image = FCam::Image(2592, 1968, FCam::UYVY);
00034
00035
00036 shot[1].exposure = 80000;
00037 shot[1].gain = 1.0f;
00038 shot[1].image = FCam::Image(2592, 1968, FCam::UYVY);
00039
00040
00041 Plat::Flash::FireAction fire(&flash);
00042 fire.duration = flash.minDuration();
00043 fire.time = shot[0].exposure - fire.duration;
00044 fire.brightness = flash.maxBrightness();
00045
00046
00047 shot[0].addAction(fire);
00048
00049
00050 sensor.capture(shot);
00051 assert(sensor.shotsPending() == 2);
00052
00053
00054 FCam::Frame frame = sensor.getFrame();
00055 assert(sensor.shotsPending() == 1);
00056 assert(frame.shot().id == shot[0].id);
00057
00058
00059 if (argc > 1) FCam::saveJPEG(frame, argv[1]);
00060
00061
00062 frame = sensor.getFrame();
00063 assert(frame.shot().id == shot[1].id);
00064
00065
00066 if (argc > 2) FCam::saveJPEG(frame, argv[2]);
00067
00068
00069 assert(sensor.framesPending() == 0);
00070 assert(sensor.shotsPending() == 0);
00071 }