funcoesHAIRCAPTURE.h

Go to the documentation of this file.
00001 // Autor: Alessandro de Oliveira Faria <alessandrofaria@netitec.com.br>
00002 // http://www.netitec.com.br/alessandro
00003 
00004 #define LIBNAME         "libNETi::CAPTURE" 
00005 #define VERSAOCAPTURE   "0.99-20060816"
00006 #define VHS             1
00007 #define SVHS            2
00008 #define MAX_BUTTON      12
00009 
00010 #ifndef VIDEO_MODE_PALM
00011    #define VIDEO_MODE_PALM 4
00012 #endif
00013 
00014 #define DEBUG           printf(" > Debug: %s line: %d \n",  __FILE__, __LINE__)
00015 
00016 enum TypeSurface { DRAW, TEXTS, ZOOM, VIDEO };
00017 enum TypeImage   { JPG,  PPM};
00018 
00019 #include <unistd.h>
00020 #include <fcntl.h>
00021 #include <sys/ioctl.h>
00022 #include <sys/mman.h>
00023 #include <pthread.h>
00024 
00025 #include "SDL/SDL.h"
00026 #include "SDL/SDL_ttf.h"
00027 #include "SDL/SDL_gfxPrimitives.h"
00028 #include "SDL/SDL_rotozoom.h"
00029 #include "SDL/SDL_image.h"
00030 #include <smpeg/smpeg.h>
00031 
00032 #include <linux/videodev.h>
00033 #include <string>
00034 
00035 //! Extrac Base Name
00036 extern char *BaseName(char *lcharFULLNAME);
00037 
00038 //! Convert an integer number in string
00039 extern std::string ToString(int Cnumero);
00040 
00041 //! Convert a float number in string
00042 extern std::string ToString(float Cnumero);
00043 
00044 //! Test for FileExist
00045 extern bool FileExist(char *lcharFILE);
00046 
00047 namespace HAIR
00048 {
00049 
00050 //****************************************************************************  
00051 //!SUMMARY.....: Class for manipulates video capture
00052 /*!
00053  * TYPE........: Object Class \n
00054  * NAME........: CAPTURE - Linux Capture \n
00055  * CREATED.....: Jun-10-2004\n
00056  * MODIFIED....: Ago-10-2006  */
00057 //****************************************************************************  
00058    class CAPTURE
00059    {
00060       private:
00061          //! Capability of the video
00062          struct   video_capability  capability;
00063          //! Capability of the buffer
00064          struct   video_mbuf        buffers;
00065          //! Capability of the suport for Frame Buffer
00066          struct   video_buffer      fbuffers;
00067          //! Capability of the video windows
00068          struct   video_window      videowin;
00069          //! Memory mapped buffer
00070          struct   video_mmap        map_buffer;
00071          //! Video input channel
00072          struct   video_channel     vch;
00073          //! Tuner properties 
00074          struct   video_tuner       vtuner;
00075          //! Image properties 
00076          struct   video_picture     pic;
00077          //! Audio properties
00078          struct   video_audio       audio;
00079          //! Witdh of Windows
00080          int      widthWin;
00081          //! Height of Windows
00082          int      heightWin;
00083          //! Witdh of video source 
00084          int      width;
00085          //! Height of video source
00086          int      height;
00087          //! Top of video source
00088          int      top;
00089          //! Left of video source
00090          int      left;
00091          // Depth of video source  and window
00092          int      depth;
00093          //! Size font
00094          int      size_font;
00095          //! Capture device name
00096          char     *device;
00097          //! X position text
00098          int      xText;
00099          //! Y position text
00100          int      yText;
00101          //! Angle for rotation text surface
00102          int      RotateText;
00103          //! Angle for rotation video live surface
00104          int      RotateVideo;
00105          //! Surface show screen 
00106          SDL_Surface    *screen;
00107          //! Surface offscreenRGB
00108          SDL_Surface    *offscreen;
00109          //! Surface offscreen YUV 
00110          SDL_Overlay    *offscreenOVL;
00111          //! Keyboard event
00112          SDL_Event      event; 
00113          //! Code keyboard
00114          SDLKey         key;
00115          //! Truetype font name 
00116          TTF_Font       *NameFont;
00117          //! Suface of text and graphics
00118          SDL_Surface    *text_surface;
00119          //! Surface of graphics BMP
00120          SDL_Surface    *draw_surface;
00121          //! Surface of ZoomOut
00122          SDL_Surface    *zoomout_surface;
00123          //! Surface of mpeg
00124          SDL_Surface    *video_surface;
00125  
00126          //! Color font
00127          SDL_Color   colorFont;
00128 
00129          //! Color font video
00130          SDL_Color   colorFontVideo;
00131 
00132          //! Transparent color video
00133          Uint32      colorTransparent;
00134          //! Transparent color video
00135          SDL_Color   SRCcolorTransparent;
00136 
00137          //! Thread video live                  
00138          pthread_t   *thread;
00139          //! Memory map
00140          unsigned char   *map;
00141          unsigned char   *last_map;
00142          //! Map for convertion YUV
00143          unsigned char   *v4l_convert_buf;
00144          //! PPM file name 
00145          char            *arqPPM;
00146          //! Font file name
00147          char            *fontName;
00148          //! MPEG video file name
00149          char            *mpegName;
00150         //! Action ZoomOutOn
00151          SDLKey          KeyZoomOutOn;
00152          //! Action ZoomOutOff
00153          SDLKey          KeyZoomOutOff;
00154          //! Action Play Mpeg Video
00155          SDLKey          KeyVideoOn;
00156          //! Action FullScreen
00157          SDLKey          KeyFullScreeen;
00158          //! Action SaveFrame
00159          SDLKey          KeySaveFrame;
00160          //! Action exit
00161          SDLKey          KeyQuit;
00162          //! Mpeg video
00163          SMPEG           *mpeg;
00164          //! Action invert video
00165          SDLKey          KeyInvert;
00166          //! Information mpeg file
00167          SMPEG_Info      info;
00168          //! Position virtual buttons
00169          SDL_Rect        gButtons[MAX_BUTTON];
00170          //! Mutex for GetLastButton function
00171          SDL_mutex       *mutex;
00172          //! Condicinal for GetLastButton function
00173          SDL_cond        *cond;
00174          //! Rect temp for work
00175          SDL_Rect        TempRect;
00176          SDL_Rect        TempRectImage;
00177 
00178          //! Scan Keuboard
00179          int             Lastkey;
00180          //! Scan Buttons
00181          bool            ScanButtons;
00182          //! Ajust Picture
00183          int             adjustVIDEO;
00184          //! Flag for imageAdjust
00185          bool            imageAdjust;
00186          //! Inverte show video
00187          bool            Invert;
00188          //! Internal Format Video
00189          int             lintVideoFormat;
00190          //! Internal Video Mode
00191          int             lintVideoMode;
00192          //! Internal Tuner Mode
00193          long            llongTuners;
00194          //! Max length for string input TouchScreen; 
00195          int             MaxTextTouch; 
00196          SDL_Color       temp;
00197 
00198      public: 
00199          //! File device video
00200          int             fd;
00201          //! Display debug msg 
00202          bool            debug;
00203          //! Enable audio
00204          bool            AudioEnabled;
00205          //! Show surface video mpeg?
00206          bool            UseVideo;
00207          //! Show surface draw?
00208          bool            UseDraw;
00209          //! Show surface zoomout?
00210          bool            UseZoomOut;
00211          //! Show surface text?
00212          bool            UseText;
00213          //! Function GrabZoom
00214          bool            GrabZoom;
00215          //! LastButton code
00216          int             LastButton;
00217          //! IMAGE file name
00218          std::string     imageFile;
00219          //! Type image file
00220          TypeImage       typeImageFile;
00221          //! Internal variable for conversion X and Y
00222          int             lintTouchX, lintTouchY;
00223 
00224       //****************************************************************************
00225       //!SUMMARY.....: Construtor.\n
00226       /* TYPE........: Method \n
00227        * CREATED.....: Jun-04-2004 \n
00228        * MODIFIED....: Nov-10-2005 \n */
00229       //****************************************************************************
00230       CAPTURE() 
00231       { 
00232          //Defauls values
00233          this->top            = 0;
00234          this->left           = 0;
00235          this->MaxTextTouch   = 6;
00236          this->Lastkey        = -1;
00237          this->width          = 320;
00238          this->height         = 240;
00239          this->widthWin       = 320;
00240          this->heightWin      = 240;
00241          this->depth          = 24;
00242          this->RotateText     = 0;
00243          this->RotateVideo    = 0;
00244          this->size_font      = 10;
00245          this->xText          = 0;
00246          this->yText          = 110;
00247          this->colorFont.r    = 255;
00248          this->colorFont.g    = 255;
00249          this->colorFont.b    = 255;
00250          this->colorFontVideo.r = 0;
00251          this->colorFontVideo.g = 255;
00252          this->colorFontVideo.b = 0;
00253          this->fd             = -1;
00254          this->debug          = true;
00255          this->AudioEnabled   = false;
00256          this->device         = "/dev/video";
00257          this->vch.channel    = 0;
00258          this->vch.norm       = VIDEO_MODE_NTSC;
00259          this->vch.tuners     = 1;
00260          this->lintVideoMode  = VIDEO_MODE_NTSC;
00261          this->llongTuners    = 1;
00262          this->map_buffer.format = 0;
00263          this->lintVideoFormat   = 0;
00264          this->pic.palette       = 0;
00265          this->pic.depth      = 24;
00266          this->pic.brightness = 60000;
00267          this->pic.contrast   = 60000;
00268          this->pic.whiteness  = 30000;
00269          this->pic.colour     = 30000;
00270          this->pic.hue        = 30000;
00271          this->SRCcolorTransparent.r = 0;
00272          this->SRCcolorTransparent.g = 0;
00273          this->SRCcolorTransparent.b = 0;
00274          this->KeyZoomOutOn   = SDLK_SPACE;
00275          this->KeyZoomOutOff  = SDLK_c;
00276          this->KeyFullScreeen = SDLK_f;
00277          this->KeySaveFrame   = SDLK_s;
00278          this->KeyQuit        = SDLK_q;
00279          this->KeyVideoOn     = SDLK_v;
00280          this->KeyInvert      = SDLK_i;
00281          this->fontName       = "VeraMono.ttf";
00282          this->mpegName       = "video.mpg";
00283          this->UseVideo       = false;
00284          this->UseDraw        = false; 
00285          this->UseZoomOut     = false;
00286          this->UseText        = false;
00287          this->GrabZoom       = false;
00288          this->ScanButtons    = false;
00289          this->Invert         = false;
00290          this->adjustVIDEO    = 0;
00291          this->imageAdjust    = false;
00292          this->imageFile      = "/tmp/image_cap.jpg";
00293          this->typeImageFile  = JPG;
00294          this->lintTouchX     = 0;
00295          this->lintTouchY     = 0; 
00296       }
00297       //****************************************************************************
00298       //!SUMMARY.....: Destrutor.\n
00299       /* TYPE........: Method \n
00300        * CREATED.....: Jun-04-2004 \n
00301        * MODIFIED....: Nov-10-2005 \n */
00302       //****************************************************************************
00303 
00304       ~CAPTURE() {} 
00305       //****************************************************************************    
00306       // TYPE........: Prototipos Method
00307       //****************************************************************************    
00308 
00309       //! Set color bit video.
00310       /*!
00311        *\param depth Depth video. 
00312        *Example: video1.ColorBit(24); 
00313        */
00314       void ColorBit(int depth); 
00315 
00316       //! Define resolution video.
00317       /*!
00318        *\param width Witdh of video source.
00319        *\param height Height of video source.
00320        *Example: video1.Resolution(320,240);
00321        */
00322       void Resolution(int width, int height); 
00323 
00324       //! Define window resolution.
00325       /*!
00326        *\param width Witdh of window.
00327        *\param height Height of window.
00328        *Example: video1.ResolutionWin(800,600);
00329        */
00330       void ResolutionWin(int width, int height);
00331 
00332       //! Define video live position.
00333       /*!
00334        *\param y define top of window video live.
00335        *\param x define left of window video live.
00336        *Example: video1.SetVideoPos(160,120);
00337        */
00338       void SetVideoPos(int x, int y);
00339 
00340       //! Define the angle for rotation text.
00341       /*!
00342        *\param lintAngle Angle for rotation.
00343        *Example: video1.SetAngleText(270);
00344        */
00345       void SetAngleText(int lintAngle);
00346 
00347       //! Define the angle for rotation text surface.
00348       /*!
00349        *\param lintAngle Angle for rotation text surface.
00350        *Example: video1.SetAngleVideo(270);
00351        */
00352       void SetAngleVideo(int lintAngle);
00353 
00354       //! Convert frame YUV to RGB.
00355       /*!
00356        *\param forDISK Convert frame for write in disk.
00357        *Example: video1.convertYUV420PtoRGB(true);
00358        */
00359       void convertYUV420PtoRGB(bool forDISK); 
00360 
00361       //! Write memory map in the screen
00362       /*!
00363        *\param tmap Memory map.
00364        *Example: video1.WriteScreen(map+buffers.offsets[frame]); 
00365        */
00366       void WriteScreen(unsigned char* tmap);
00367 
00368       //! Open device video.
00369       //Example: video1.Open();
00370       void Open(void);
00371  
00372       //! Create device video.
00373       //Example video1.VideoCreate(); 
00374       void VideoCreate(void);
00375 
00376       //! Terminate screen video capture.
00377       //Example: video1.VideoTerminate();
00378       void VideoTerminate(void);
00379 
00380       //! Inicialize screen main.
00381       //Example: video1.InicializeWin();
00382       void InicializeWin(void);
00383  
00384       //! Inicialize screen of the video capture.
00385       //Example: video1.VideoInicialize();
00386       void VideoInicialize(void);
00387 
00388       //! Show live video.
00389       //Example: video1.Show();
00390       void Show(void); 
00391 
00392       //! Write text over live video.
00393       /*!
00394        *\param lintx position x in the screen.       
00395        *\param linty position y in the screen.
00396        *\param lcharText Message.
00397        *\param lintSIZE Size font.
00398        *\param lboolSHADOW Enable/Disable shadow font (true/false).
00399        *Example: video1.WriteText(10,20,"NETi TECNOLOGIA",30,true);
00400        */
00401       void WriteText(int lintx, int linty, char *lcharText,int lintSIZE,bool lboolSHADOW);
00402 
00403       //! Write text over live video.
00404       /*!
00405        *\param lintx position x in the screen.
00406        *\param linty position y in the screen.
00407        *\param lcharText      Message.
00408        *Example: video1.WriteText(10,20,"NETi TECNOLOGIA");
00409        */
00410       void WriteText(int lintx, int linty, char *lcharText);
00411 
00412       //! Draw line over live video.
00413       /*!
00414        *\param lintx1 position x1 in the screen.
00415        *\param linty1 position y1 in the screen.
00416        *\param lintx2 position x2 in the screen.
00417        *\param linty2 position y2 in the screen.
00418        *\param lintR Color red in RGB.
00419        *\param lintG Color red in RGB.
00420        *\param lintB Color red in RGB.
00421        *\param lsurfaceScreen The type surface for work.
00422        *Example: video1.Line(10,30,60,90,255,0,0); 
00423        */
00424       void Line(int lintx1, int linty1,int lintx2, int linty2,  int lintR, int lintG,int lintB, TypeSurface lsurfaceScreen=TEXTS);
00425 
00426       //! Draw a circle over live video.
00427       /*!
00428        *\param lintx position x in the screen.
00429        *\param linty position y in the screen.
00430        *\param lintrad radius of the circle.
00431        *\param lintR Color red in RGB.
00432        *\param lintG Color red in RGB.
00433        *\param lintB Color red in RGB.
00434        *\param lsurfaceScreen The type surface for work.
00435        *Example: video1.Circel(10,30,5,0,255,0,DRAW);
00436        */
00437        void Circle(int lintx, int linty,int lintrad,  int lintR, int lintG,int lintB, TypeSurface lsurfaceScreen=TEXTS);
00438 
00439       //! Draw rectangle over live video.
00440       /*!
00441        *\param lintx1 position x1 in the screen.
00442        *\param linty1 position y1 in the screen.
00443        *\param lintx2 position x2 in the screen.
00444        *\param linty2 position y2 in the screen.
00445        *\param lintR Color red in RGB.
00446        *\param lintG Color red in RGB.
00447        *\param lintB Color red in RGB.
00448        *\param lsurfaceScreen The type surface for work.
00449        *Example: video1.Rectangle(30,20,70,80,255,0,0);
00450        */
00451       void Rectangle(int lintx1, int linty1,int lintx2, int linty2,  int lintR, int lintG,int lintB, TypeSurface lsurfaceScreen=TEXTS);
00452 
00453       //! Draw rectangle fill over live video.
00454       /*!
00455        *\param lintx1 position x1 in the screen.
00456        *\param linty1 position y1 in the screen.
00457        *\param lintx2 position x2 in the screen.
00458        *\param linty2 position y2 in the screen.
00459        *\param lintR Color red in RGB.
00460        *\param lintG Color red in RGB.
00461        *\param lintB Color red in RGB.
00462        *\param lsurfaceScreen The type surface for work.
00463        *Example: video1.RectangelFill(20,30,60,80,255,0,0);
00464        */
00465      void RectangleFill(int lintx1, int linty1,int lintx2, int linty2,  int lintR, int lintG,int lintB, TypeSurface lsurfaceScreen=TEXTS);
00466 
00467       //! Draw rectangle over surface zoomout.
00468       /*!
00469        *\param lintx1 position x1 in the screen.
00470        *\param linty1 position y1 in the screen.
00471        *\param lintx2 position x2 in the screen.
00472        *\param linty2 position y2 in the screen.
00473        *\param lintR Color red in RGB.
00474        *\param lintG Color red in RGB.
00475        *\param lintB Color red in RGB.
00476        *Example: video1.RectangelZoom(20,50,70,10,255,0,0);
00477        */
00478      void RectangleZoom(int lintx1, int linty1,int lintx2, int linty2,  int lintR, int lintG,int lintB );
00479 
00480       //! Read read a bitmap file over live video.
00481       /*!
00482        *\param lcharBMP BMP image file name.
00483        *Example: video1.LoadBMP("/tmp/image.bmp");
00484        */
00485       void LoadBMP(char * lcharBMP);
00486 
00487       //! On/Off show zoomout.
00488       /*!
00489        *\param lboolStatus On/Off zoomout.
00490        *Example: video1.ZoomOut(true);
00491        */
00492       void ZoomOut(bool lboolStatus);
00493 
00494       //! Thread of video live (Internal method ).
00495       // video1.Live();
00496       void Live(void);
00497 
00498       //! Wait the ending thread (live  video -Internal method ).
00499       //Example: video1.WaitForVideo();
00500       void WaitForVideo(void);
00501 
00502       //! Save frame in PPM format file.
00503       /*!
00504        *\param name PPM image file name.
00505        *Example: video1.SavePPM("/tmp/image.ppm");
00506        */
00507       void SavePPM(char *name); 
00508 
00509       //! Save frame in the disk.
00510       // video1.VideoCapture();
00511       void VideoCapture(void);
00512 
00513       //! Define truetype model font.
00514       /*!
00515        *\param lfontName TTF file name.
00516        *Example: video1.SetFont("Mono.ttf");
00517        */
00518       void SetFont(char *lfontName);
00519 
00520       //! Define font size.
00521       /*!
00522        *\param lintSize Font size.
00523        *Example: video1.SetFontSize(30);
00524        */
00525       void SetFontSize(int lintSize);
00526 
00527       //! Define image file and type.
00528       /*!
00529        *\param lcharImageFile Name for image file.
00530        *\param ltypeimageType Type for image file.
00531        *Example: video1.SetImageFile("/tmp/image.jpg",JPG);
00532        */
00533       void SetImageFile(char *lcharImageFile, TypeImage ltypeimageType);
00534 
00535       //! Define video device.
00536       /*!
00537        *\param lDevice device name
00538        *Example: video1.SetDevice("/dev/video1");
00539        */
00540       void SetDevice(char *lDevice);
00541 
00542       //! Define format video palete.
00543       /*!
00544        *\param lFormat Format palete.
00545        *Example: video1.SetFormatPalette(VIDEO_PALETTE_RGB24);
00546        */
00547       void SetFormatPalette(int lFormat);
00548 
00549       //! Define mode input television.
00550       /*!
00551        *\param lVideoMode Mode input television.
00552        *Example: video1.SetInputTelevision(VIDEO_MODE_PALM);
00553        */
00554       void SetInputTelevision(int lVideoMode);
00555 
00556       //! Define mode input camera.
00557       /*!
00558        *\param lInput Index camera.
00559        *\param lVideoMode Video mode.
00560        *Example video1.SetInputCamera(0,VIDEO_MODE_PALM);
00561        */
00562       void SetInputCamera(int lInput, int lVideoMode);
00563 
00564       //! Define  transparent color.
00565       /*!
00566        *\param lintR Color red in RGB.
00567        *\param lintG Color red in RGB.
00568        *\param lintB Color red in RGB.
00569        *Example video1.SetTransparent(255,0,255) 
00570        */
00571       void SetTransparent(int lintR, int lintG,int lintB );
00572 
00573       //! Define function On-ZoomOut key.
00574       /*!
00575        *\param Lkey Key On-ZoomOut.
00576        *Example: video1.SetKeyZoomOutOn(SDLK_SPACE);
00577        */
00578       void SetKeyZoomOutOn(SDLKey Lkey);
00579 
00580       //! Define function Off-ZoomOut key.
00581       /*!
00582        *\param Lkey Key On-ZoomOut.
00583        *Example: video1.SetKeyZoomOutOff(SDLK_c);
00584        */
00585       void SetKeyZoomOutOff(SDLKey Lkey);
00586 
00587       //! Define Full Screen key.
00588       /*!
00589        *\param Lkey Key Full Screen.
00590        *Example: video1.SetKeyFullScreen(SDLK_f)
00591        */
00592       void SetKeyFullScreeen(SDLKey Lkey);
00593 
00594       //! Define save frame key.
00595       /*!
00596        *\param Lkey Key save frame.
00597        *Example: video1.SetKeySaveFrame(SDLK_s);
00598        */
00599       void SetKeySaveFrame(SDLKey Lkey);
00600 
00601       //! Define quit key.
00602       /*!
00603        *\param Lkey Key quit.
00604        *Example: video1.SetKeyQuit(SDLK_q);
00605        */
00606       void SetKeyQuit(SDLKey Lkey);
00607 
00608       //! Save frame in JPEG format file
00609       /*!
00610        *\param name JPEG image file name.
00611        *\param lboolFRAMEGRAY Frame in grayscale.
00612        *Example: video1.SaveJPG("/tmp/image.jpg");
00613        */
00614        bool SaveJPG(char *name,bool lboolFRAMEGRAY=false);
00615 
00616       //! Load frame in JPEG format file
00617       /*!
00618        *\param name JPEG image file name.
00619        *\param lintX Position X in screen
00620        *\param lintY Position Y in screen
00621        *\param lfloatSCALE escale.
00622        *\param lsurfaceScreen The type surface for work.
00623        *\param lintAngleRotate The angle for rotation.
00624        *Example: video1.LoadJPG("/tmp/image.jpg",10,20,.50,DRAW);
00625        */
00626       void LoadJPG(char *name,int lintX=0 , int lintY=0, float lfloatSCALE=0.5, TypeSurface lsurfaceScreen=TEXTS,int lintAngleRotate=0);
00627 
00628       //! Define JPEG background
00629       /*!
00630        *\param name JPEG image file name.
00631        *Example: video1.Background("/tmp/sun.jpg"); 
00632        */
00633       void Background(char *name);
00634 
00635       //! Show the last frame saved.
00636       //Example: video1.ViewLastFram(10,20,.50,DRAW);
00637       void ViewLastMap(int lintX, int lintY, float lfloatSCALE, TypeSurface lsurfaceScreen=TEXTS);
00638 
00639       //! Play MPEG video file.
00640       /*!
00641        *\param name JPEG image file name.
00642        *Example: video1.PlayMPEG("u2.mpg");
00643        */
00644       void PlayMPEG(char *name);
00645 
00646       //!Set key for play mpeg video
00647       /*!
00648        *\param Lkey Key quit.
00649        *Example: video1.SetKeyVideoOn(SDLK_v);
00650        */
00651       void SetKeyVideoOn(SDLKey Lkey);
00652 
00653       //! Clear surface position
00654       /*!
00655        *\param lsurfaceScreen this SDL_Surface to clear.
00656        *\param lintX Position X in screen
00657        *\param lintY Position Y in screen
00658        *\param lintW Width of the area
00659        *\param lintH height of the area
00660        *Example: video1.ClearSurface(TEXTS,10,20,40,30); 
00661        */
00662       void ClearSurface(TypeSurface lsurfaceScreen ,int lintX, int lintY, int lintW, int lintH);
00663 
00664       //! Clear all surface.
00665       /*!
00666        *\param lsurfaceScreen this SDL_Surface to clear.
00667        *\param lboolSurface Enable or disable the use.
00668        *Example: video1.ClearSurface(TEXTS);
00669        */
00670       void ClearSurface(TypeSurface lsurfaceScreen ,bool lboolSurface=false );
00671 
00672       //! Hide mouse cursor.
00673       //Example: video1.HideMouse();
00674       void HideMouse(void);
00675 
00676       //! Hide mouse cursor.
00677       //Example: video1.ShowMouse();
00678       void ShowMouse(void);
00679 
00680       //! Define the position button.
00681       /*!
00682        *\param lintBUTTON Index of button
00683        *\param lintX Position X in screen
00684        *\param lintY Position Y in screen
00685        *\param lintW Width of the button
00686        *\param lintH height of the button
00687        *Example: video1.DefinePositionButton(0,10,30,50,40);
00688        */
00689       void DefinePositionButton(int lintBUTTON,int lintX, int lintY, int lintW, int lintH);
00690 
00691       //! Scan a Button 
00692       /*!
00693        *\param lintX Position X in screen
00694        *\param lintY Position Y in screen
00695        *Example: video1.FindButton(10,200);
00696        */
00697       int FindButton(int lintX, int lintY);
00698 
00699       //! Get last Button 
00700       //Example: video1.GetLastButton();
00701       int GetLastButton(void);
00702 
00703       //! On/Off Touch Screen Display
00704       /*!
00705        *\param lboolSTATUS Status touch screen
00706        *Example: video1.TouchScreen(true);
00707        */
00708       int TouchScreen(bool lboolSTATUS);
00709 
00710       //!Draw progress bar 
00711       /*!
00712        *\param lcharText String for information
00713        *\param lintPROGRESS value for progression
00714        *\param lintTOTAL max value
00715        *Example: video1.Progress("Verificando",30,90);
00716        */
00717       void Progress(char *lcharText,int lintPROGRESS, int lintTOTAL);
00718 
00719       //! Adjust video live
00720       /*!
00721        *\param lintMOVEMENT + or -
00722        *Example: video1.AdjustVideo(1);
00723        */
00724       void AdjustVideo(int lintMOVEMENT);
00725 
00726       //! Select Adjust video live
00727       /*!
00728        *\param lintMOVEMENT + or -
00729        *Example: video1.SelectAdjust(DRAW) 
00730        */
00731       void SelectAdjust(int lintMOVEMENT);
00732 
00733       //! Define the color font
00734       /*!
00735        *\param lintR Color red in RGB.
00736        *\param lintG Color red in RGB.
00737        *\param lintB Color red in RGB.
00738        *Example: video1.SetColorFont(255,0,255);
00739        */
00740       void SetColorFont( int lintR, int lintG,int lintB );
00741 
00742       //! Convert map image to RGB
00743       //Example: video1.swap_rgb24();
00744       void swap_rgb24(void);
00745 
00746       //! Wait the reading of the virtual keyboard, and write the text.
00747       /*!
00748        *\param lintX Position X in screen
00749        *\param lintY Position Y in screen
00750        *\param linSize_font Fonte size for text
00751        *\param lboolShadow Draw shadow in text
00752        *Example: video1.GetTouch(20,50);
00753        */
00754       std::string GetTouch(int lintX, int lintY ,int linSize_font=30 , bool lboolShadow=true);
00755 
00756       //! Select the function contrast
00757       /*!
00758        *\param lintVALUE Value for contrast function
00759        */ 
00760       //Example: video1.SelectContrast(32000);
00761       void SelectContrast(int lintVALUE);
00762 
00763       //! Select the function brightness
00764       /*!
00765        *\param lintVALUE Value for brightness function
00766        */
00767       //Example: video1.SelectBrightness();
00768       void SelectBrightness(int lintVALUE);
00769 
00770       //! Select the function color
00771        /*!
00772        *\param lintVALUE Value for color function
00773        */
00774      //Example: video1.SelectColor();
00775       void SelectColor(int lintVALUE);
00776 
00777       //! Select the function hue
00778       //Example: video1.SelectHue();
00779       void SelectHue(void);
00780 
00781       //! Convert map image YUV to GrayScale 
00782       //Example: video1.convertYUV420PtoGray();
00783       void convertYUV420PtoGray(void);
00784 
00785       //! Set the property for operation in webcam.
00786       //Example: video1.SetHardwareWebCam();
00787       void SetHardwareWebCam(void);
00788 
00789       //! Set the property for operation in Capture Card.
00790       //Example: video1.SetHardwareCaptureCard();
00791       void SetHardwareCaptureCard(void);
00792 
00793       //! Set input channel.
00794       /*!
00795        *\param lintVALUE Value for channel
00796        */
00797       //Example: video1.SetInputChannel(465000000);
00798       void SetInputChannel(int lintVALUE);
00799 
00800       //! Return the Max witdth of the main window. 
00801       //Example: video1.MaxWidth();
00802       int MaxWidth(void);
00803 
00804       //! Return the Max height of the main window. 
00805       //Example: video1.MaxHeight();
00806       int MaxHeight(void);
00807 
00808      //! Set the max lenght for input touchscreen.
00809       /*!
00810        *\param lintVALUE Value for max character.
00811        */
00812       //Example: video1.SetMaxTouch(6);
00813       void SetMaxTextTouch(int lintVALUE);
00814 
00815       //! Enable/Disable full Screen mode.
00816       //Example: video1.FullScreen();
00817       void FullScreen(void);
00818 
00819    }; //class CAPTURE
00820 }

Generated on Tue Apr 3 11:59:07 2007 for NETi TECNOLOGIA - libHAIRCAPTURE by  doxygen 1.5.0-1