leutron.h

00001 
00002 /***************************************************************************
00003  *  leutron.h - This header defines a Leutron cam
00004  *
00005  *  Generated: Thu Mar 24 22:33:33 2005
00006  *  Copyright  2005  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #ifndef __FIREVISION_CAMS_LEUTRON_H_
00025 #define __FIREVISION_CAMS_LEUTRON_H_
00026 
00027 #include <cams/camera.h>
00028 
00029 class LvCameraNode;
00030 class LvGrabberNode;
00031 
00032 namespace firevision {
00033 #if 0 /* just to make Emacs auto-indent happy */
00034 }
00035 #endif
00036 
00037 class LeutronCamera : public Camera
00038 {
00039 
00040  public:
00041 
00042   LeutronCamera();
00043   virtual ~LeutronCamera();
00044 
00045   virtual void open();
00046   virtual void start();
00047   virtual void stop();
00048   virtual void close();
00049   virtual void flush();
00050   virtual void capture();
00051 
00052   virtual void print_info();
00053 
00054   virtual bool ready();
00055 
00056   virtual unsigned char* buffer();
00057   virtual unsigned int   buffer_size();
00058   virtual void           dispose_buffer();
00059 
00060   virtual unsigned int   pixel_width();
00061   virtual unsigned int   pixel_height();
00062   virtual colorspace_t   colorspace();
00063 
00064   virtual void           set_image_number(unsigned int n);
00065 
00066  private:
00067   bool opened;
00068   bool started;
00069   bool autodetect;
00070 
00071   const char *camera_name;
00072 
00073   // should be HGRABBER, set to unsigned short to get rid of all the warnings
00074   // by the broken-like-shit dsylib.
00075   unsigned short int camera_handle;
00076   LvCameraNode   *camera;
00077   LvGrabberNode  *grabber;
00078 
00079   unsigned int    width;
00080   unsigned int    height;
00081   unsigned int    scaled_width;
00082   unsigned int    scaled_height;
00083 
00084   colorspace_t cspace;
00085 
00086   unsigned char  *scaled_buffer;
00087 
00088 };
00089 
00090 } // end namespace firevision
00091 
00092 #endif