File indexing completed on 2024-05-12 16:23:35
0001 /*************************************************************************** 0002 * Copyright (C) 2005-2008 by Bjoern Erik Nilsen & Fredrik Berg Kjoelstad* 0003 * bjoern.nilsen@bjoernen.com & fredrikbk@hotmail.com * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the * 0017 * Free Software Foundation, Inc., * 0018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 0019 ***************************************************************************/ 0020 #ifndef IMAGEGRABBER_H 0021 #define IMAGEGRABBER_H 0022 0023 /** 0024 * Abstract class for the different video grabbers. 0025 * 0026 * @author Bjoern Erik Nilsen & Fredrik Berg Kjoelstad 0027 */ 0028 class ImageGrabber { 0029 char* path; 0030 ImageGrabber(const ImageGrabber&); // unimplemented 0031 ImageGrabber& operator=(const ImageGrabber&); // unimplemented 0032 public: 0033 /** 0034 * Constructs and initializes the object. 0035 * @param filePath path to the output file grabbed from a device. 0036 * Ownership is not passed. 0037 */ 0038 ImageGrabber(const char* filePath); 0039 virtual ~ImageGrabber() = 0; 0040 0041 /** 0042 * Checks if the process is running in daemon mode. 0043 * @return true if it runs in daemon mode, false otherwise 0044 */ 0045 virtual bool isGrabberProcess() = 0; 0046 0047 virtual bool setPrePollCommand(const char *command) = 0; 0048 virtual bool setStartCommand(const char *command) = 0; 0049 virtual bool setStopCommand(const char *command) = 0; 0050 0051 /** 0052 * Abstract function for initializing the grabber. 0053 * @return true on success, false otherwise 0054 */ 0055 virtual bool init() = 0; 0056 0057 /** 0058 * Abstract function for shutting down the grabber. 0059 * @return true on success, false otherwise 0060 */ 0061 virtual bool tearDown() = 0; 0062 0063 /** 0064 * Abstract function for grabbing an image. 0065 * @return true on success, false otherwise 0066 */ 0067 virtual bool grab() = 0; 0068 0069 /** 0070 * Returns the path used to construct this object. 0071 */ 0072 const char* filePath() const; 0073 }; 0074 0075 #endif