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
00006 #include "SoundPlayer.h"
00007
00010
00011 namespace Plat = FCam::N900;
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 int main(int argc, char ** argv) {
00024
00025
00026 Plat::Sensor sensor;
00027 Plat::Flash flash;
00028
00029
00030
00031 SoundPlayer audio;
00032
00033 sensor.attach(&flash);
00034 sensor.attach(&audio);
00035
00036
00037 FCam::Shot shot1;
00038 shot1.exposure = 400000;
00039 shot1.gain = 1.0f;
00040 shot1.image = FCam::Image(2592, 1968, FCam::UYVY);
00041
00042
00043 FCam::Flash::FireAction fire(&flash);
00044 fire.time = 0;
00045 fire.duration = 60000;
00046 fire.brightness = flash.maxBrightness();
00047
00048
00049 SoundPlayer::SoundAction click(&audio);
00050 click.time = 0;
00051 click.setWavFile("/usr/share/sounds/camera_snd_title_1.wav");
00052
00053
00054 shot1.addAction(fire);
00055 shot1.addAction(click);
00056
00057
00058
00059 sensor.capture(shot1);
00060 assert(sensor.shotsPending() == 1);
00061
00062
00063 FCam::Frame frame = sensor.getFrame();
00064 assert(frame.shot().id == shot1.id);
00065
00066
00067 if (argc > 1) FCam::saveJPEG(frame, argv[1]);
00068
00069
00070 assert(sensor.framesPending() == 0);
00071 assert(sensor.shotsPending() == 0);
00072 }