TLIB documentation
 

tlDigitizerV4L.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This file is part of the TLIB computer vision library.
00004 //  Copyright (C) 2003-2008 Terry Fong, Sebastien Grange
00005 //  Copyright (C) 2003-2007 VRAI Group, EPFL
00006 //  All rights reserved.
00007 // 
00008 //  This library is free software; you can redistribute it and/or modify
00009 //  it under the terms of the GNU General Public License("GPL") version 2
00010 //  as published by the Free Software Foundation.
00011 // 
00012 //  <http://imtsg14.epfl.ch/tlib>
00013 //
00014 /////////////////////////////////////////////////////////////////////////////////
00015 
00016 
00017 #ifndef __TLDIGITIZERV4L_H__
00018 #define __TLDIGITIZERV4L_H__
00019 
00020 /* LINUX is defined in the makefile */
00021 #if    !LINUX
00022 #error THIS IS A LINUX VERSION 
00023 #endif
00024 
00025 #define TLDIGITIZER_V4L_BASE_NAME "/dev/video"
00026 
00027 #include <sys/types.h>
00028 #include <linux/videodev.h>
00029 
00030 #include "tlVision.h"
00031 #include "tlDigitizer.h"
00032 
00033 
00034 // interface
00035 class tlDigitizerV4L : public tlDigitizer
00036 {
00037 private:
00038   int               ifd;
00039   unsigned char     *mmbuf;
00040   struct video_mbuf mbuf;
00041   struct video_mmap vbuf;
00042   unsigned char     *rgbImage;
00043   struct            video_capability vcap;
00044   int               grabQueuedInit;
00045 
00046 public:
00047   tlDigitizerV4L  ();
00048   tlDigitizerV4L  (int width, int height);
00049   tlDigitizerV4L  (int width, int height, int channel, unsigned short input = TL_SOURCE_AUTO);
00050   virtual ~tlDigitizerV4L ();
00051 
00052   virtual int open         (int index = 0);
00053   virtual int open         (int width, int height, int index = 0);
00054   int         open         (int width, int height, int index, int channel, unsigned short input = TL_SOURCE_AUTO);
00055   virtual int close        ();
00056 
00057   virtual int setChannel   (int channel, unsigned short input);
00058   virtual int setInput     (unsigned short input);
00059   virtual int setFrameRate (int fps);
00060   virtual int setSize      (int width, int height);
00061   
00062   virtual int grab         (tlImage *image);
00063   virtual int grab         (tlImage *image, tlRect *rect);
00064   virtual int grabQueued   (tlImage *image);
00065   virtual int grabQueued   (tlImage *image, tlRect *rect);
00066 };
00067 
00068 
00069 #endif
00070 


TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.