• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

v4l1_base.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005 by Jasem Mutlaq
00003 
00004     Some code based on qastrocam
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Lesser General Public
00008     License as published by the Free Software Foundation; either
00009     version 2.1 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Lesser General Public License for more details.
00015 
00016     You should have received a copy of the GNU Lesser General Public
00017     License along with this library; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 
00020 */
00021 
00022 #ifndef V4L1_BASE_H
00023 #define V4L1_BASE_H
00024 
00025 #include <stdio.h>
00026 #include <stdlib.h>
00027 #include "videodev.h"
00028 #include "../eventloop.h"
00029 
00030 class V4L1_Base
00031 {
00032   public:
00033    V4L1_Base();
00034    virtual ~V4L1_Base();
00035 
00036   /* Connection */
00037   virtual int connectCam(const char * devpath, char *errmsg);
00038   virtual void disconnectCam();
00039   char * getDeviceName();
00040 
00041   /* Image settings */
00042   int  getBrightness();
00043   int  getContrast();
00044   int  getColor();
00045   int  getHue();
00046   int  getWhiteness();
00047   void setContrast(int val);
00048   void setBrightness(int val);
00049   void setColor(int val);
00050   void setHue(int val);
00051   void setWhiteness(int val);
00052 
00053   /* Updates */
00054   static void updateFrame(int d, void * p);
00055   void newFrame();
00056   void setPictureSettings();
00057   void getPictureSettings();
00058 
00059   /* Image Size */
00060   int getWidth();
00061   int getHeight();
00062   void checkSize(int & x, int & y);
00063   virtual bool setSize(int x, int y);
00064   virtual void getMaxMinSize(int & xmax, int & ymax, int & xmin, int & ymin);
00065 
00066   /* Frame rate */
00067   void setFPS(int fps);
00068   int  getFPS();
00069 
00070   void init(int preferedPalette);
00071   void allocBuffers();
00072   int  mmapInit();
00073   void mmapCapture();
00074   void mmapSync();
00075 
00076   unsigned char * mmapFrame();
00077   unsigned char * getY();
00078   unsigned char * getU();
00079   unsigned char * getV();
00080   unsigned char * getColorBuffer();
00081 
00082   int start_capturing(char *errmsg);
00083   int stop_capturing(char *errmsg);
00084   void registerCallback(WPF *fp, void *ud);
00085 
00086   protected:
00087 
00088   int fd;
00089   WPF *callback;
00090   void *uptr;
00091   unsigned long options;
00092 
00093   struct video_capability capability;
00094   struct video_window window;
00095   struct video_picture picture_format;
00096   struct video_mbuf mmap_buffer;
00097 
00098   unsigned char * buffer_start;
00099   
00100   long mmap_sync_buffer;
00101   long mmap_capture_buffer;  
00102   
00103   int frameRate;
00104   bool streamActive;
00105   int  selectCallBackID;
00106   unsigned char * YBuf,*UBuf,*VBuf, *colorBuffer;
00107 
00108 };
00109    
00110 #endif

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal