TLIB documentation
 

tlDigitizer.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 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://www.tuyphon.com/tlib>
00013 //
00014 /////////////////////////////////////////////////////////////////////////////////
00015 
00016 
00017 #ifndef __TLDIGITIZER_H__
00018 #define __TLDIGITIZER_H__
00019 
00020 
00021 #include "tlVision.h"
00022 #include "tlSource.h"
00023 
00024 
00025 // auto settings
00026 #define TL_SOURCE_AUTO        0x1
00027 
00028 // input format (can be cumulated)
00029 #define TL_SOURCE_COMPOSITE   0x2
00030 #define TL_SOURCE_SVIDEO      0x4
00031 #define TL_SOURCE_TVTUNER     0x8
00032 #define TL_SOURCE_DIGITAL     0x16
00033 #define TL_SOURCE_NTSC        0x32
00034 #define TL_SOURCE_NTSCJ       0x64
00035 #define TL_SOURCE_PAL         0x128
00036 #define TL_SOURCE_PALM        0x256
00037 #define TL_SOURCE_PALN        0x512
00038 #define TL_SOURCE_SECAM       0x1024
00039 
00040 
00041 // debug verbosity
00042 extern int tlVerbose;
00043 
00044 
00045 // interface
00046 class tlDigitizer : public tlSource
00047 {
00048 protected:
00049   bool           isOpen;
00050   unsigned short input;
00051   int            channel;
00052   int            fps;
00053 
00054 public:
00055   tlDigitizer ();
00056   tlDigitizer (int width, int height);
00057   virtual ~tlDigitizer ();
00058 
00059   virtual int open  (int index = 0)                        = 0;
00060   virtual int open  (int width, int height, int index = 0);
00061   virtual int close ()                                     = 0;
00062 
00063   unsigned short
00064       getInput      () { return input;  };
00065   int getChannel    () { return channel; };
00066   int getFrameRate  () { return fps;     };
00067 
00068   virtual int setChannel    (int channel, unsigned short input);
00069   virtual int setInput      (unsigned short input);
00070   virtual int setFrameRate  (int fps);
00071   virtual int setSize       (int width, int height);
00072 
00073   virtual int grab        (tlImage *image)                 = 0;
00074   virtual int grab        (tlImage *image, tlRect *rect)   = 0;
00075   virtual int grabQueued  (tlImage *image)                 = 0;
00076   virtual int grabQueued  (tlImage *image, tlRect *rect)   = 0;
00077 };
00078 
00079 
00080 //
00081 // default digitizer shortcuts
00082 //
00083 
00084 #ifndef _TLIB_BUILD_
00085 
00086 #ifdef WIN32
00087 #include "tlDigitizerDX.h"
00088 #define TL_DIGITIZER tlDigitizerDX
00089 #endif
00090 
00091 #ifdef LINUX
00092 #include "tlDigitizerV4L2.h"
00093 #define TL_DIGITIZER tlDigitizerV4L2
00094 #endif
00095 
00096 #endif
00097 
00098 #endif


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.