2003-03-26 19:57:29 +08:00
|
|
|
//
|
|
|
|
// ZoneMinder Camera Class Interface, $Date$, $Revision$
|
|
|
|
// Copyright (C) 2003 Philip Coombes
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ZM_CAMERA_H
|
|
|
|
#define ZM_CAMERA_H
|
|
|
|
|
2003-04-13 00:17:17 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <linux/videodev.h>
|
|
|
|
|
2003-03-26 19:57:29 +08:00
|
|
|
#include "zm_image.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// Abstract base class for cameras. This is intended just to express
|
|
|
|
// common attributes
|
|
|
|
//
|
|
|
|
class Camera
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
typedef enum { LOCAL, REMOTE } SourceType;
|
|
|
|
|
|
|
|
SourceType type;
|
|
|
|
unsigned int width;
|
|
|
|
unsigned int height;
|
2003-04-13 00:17:17 +08:00
|
|
|
unsigned int palette;
|
2003-03-26 19:57:29 +08:00
|
|
|
unsigned int colours;
|
|
|
|
bool capture;
|
|
|
|
|
|
|
|
public:
|
2003-04-13 00:17:17 +08:00
|
|
|
Camera( SourceType p_type, int p_width, int p_height, int p_palette, bool p_capture=true );
|
2003-04-07 18:43:12 +08:00
|
|
|
virtual ~Camera();
|
2003-03-26 19:57:29 +08:00
|
|
|
|
|
|
|
SourceType Type() const { return( type ); }
|
|
|
|
bool IsLocal() const { return( type == LOCAL ); }
|
|
|
|
bool IsRemote() const { return( type == REMOTE ); }
|
|
|
|
unsigned int Width() const { return( width ); }
|
|
|
|
unsigned int Height() const { return( height ); }
|
2003-04-13 00:17:17 +08:00
|
|
|
unsigned int Palette() const { return( palette ); }
|
2003-03-26 19:57:29 +08:00
|
|
|
unsigned int Colours() const { return( colours ); }
|
|
|
|
unsigned int ImageSize() const { return( colours*width*height ); }
|
|
|
|
|
|
|
|
virtual int PreCapture()=0;
|
|
|
|
virtual int PostCapture( Image &image )=0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ZM_CAMERA_H
|