summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/video4linux
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/video4linux')
-rw-r--r--2005/i/robert/src/video4linux/test_video4linux.cc12
-rw-r--r--2005/i/robert/src/video4linux/video4linux.hh2
2 files changed, 10 insertions, 4 deletions
diff --git a/2005/i/robert/src/video4linux/test_video4linux.cc b/2005/i/robert/src/video4linux/test_video4linux.cc
index 9abdf4a..6373407 100644
--- a/2005/i/robert/src/video4linux/test_video4linux.cc
+++ b/2005/i/robert/src/video4linux/test_video4linux.cc
@@ -38,9 +38,9 @@ main (int argc, char **argv)
{
try
{
- if (argc != 3)
+ if ((argc != 3) && (argc != 4))
throw std::runtime_error ("Syntaxe : fichier "
- "{rgb|bgr|yuv|yuv422}");
+ "{rgb|bgr|yuv|yuv422} [luminosité]");
std::string format (argv[2]);
Image::PixelFormat pf;
if (format == "rgb")
@@ -53,7 +53,13 @@ main (int argc, char **argv)
pf = Image::yuv422;
else
throw std::invalid_argument ("Syntaxe : fichier {rgb|yuv422}");
- Video4Linux vid ("/dev/video", pf);
+ int lum = 58000;
+ if (argc == 4)
+ {
+ std::istringstream isLum (argv[3]);
+ isLum >> lum;
+ }
+ Video4Linux vid ("/dev/video", pf, lum);
vid.calibrate ();
int w, h;
vid.getParam (w, h, pf);
diff --git a/2005/i/robert/src/video4linux/video4linux.hh b/2005/i/robert/src/video4linux/video4linux.hh
index 1a38056..bce8fe6 100644
--- a/2005/i/robert/src/video4linux/video4linux.hh
+++ b/2005/i/robert/src/video4linux/video4linux.hh
@@ -45,7 +45,7 @@ class Video4Linux : public ImageReader
~Video4Linux (void);
/// Récupère les paramètres de l'image.
void getParam (int &width, int &height,
- Image::PixelFormat &pixelFormat) const
+ Image::PixelFormat &pixelFormat)
{ width = width_; height = height_; pixelFormat = pixelFormat_; }
/// Lit une image, lance une exception en cas d'erreur.
void read (uint8_t *buf, unsigned size);