imagebase.h
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2000 Brian Gerkey et al
* gerkey@usc.edu
*
* 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
*
*/
//
// Desc: base driver for image processing and transform drivers
// Author: Toby Collett
// Date: 15 Feb 2004
// CVS: $Id: imagebase.h 8003 2009-07-13 10:34:37Z thjc $
//
#include <libplayercore/playercore.h>
// Driver for detecting laser retro-reflectors.
class ImageBase : public ThreadedDriver
{
public:
// Constructor
ImageBase(ConfigFile *cf, int section, bool overwrite_cmds, size_t queue_maxlen, int interf);
ImageBase(ConfigFile *cf, int section, bool overwrite_cmds = true, size_t queue_maxlen = PLAYER_MSGQUEUE_DEFAULT_MAXLEN);
virtual ~ImageBase()
{
if (stored_data.image) delete [](stored_data.image);
PLAYER_WARN("image deleted from the memory");
}
// Process incoming messages from clients
int ProcessMessage (QueuePointer &resp_queue, player_msghdr * hdr, void * data);
private:
ImageBase(); // no default constructor
ImageBase(const ImageBase &); // no copy constructor
protected:
virtual int ProcessFrame() = 0;
// Main functions for device thread.
virtual void Main();
virtual int MainSetup();
virtual void MainQuit();
// Input camera stuff
Device *camera_driver;
player_devaddr_t camera_addr;
player_camera_data_t stored_data;
bool HaveData;
};
ConfigFile
Class for loading configuration file information.
Definition: configfile.h:196
ImageBase::ProcessMessage
int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
Definition: imagebase.cc:112
player_msghdr
Generic message header.
Definition: player.h:157
PLAYER_MSGQUEUE_DEFAULT_MAXLEN
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:72
player_camera_data::image
uint8_t * image
Compressed image data (byte-aligned, row major order).
Definition: player_interfaces.h:2956
ImageBase::MainQuit
virtual void MainQuit()
Cleanup method for driver thread (called when main exits)
Definition: imagebase.cc:104
player_devaddr
A device address.
Definition: player.h:141
ThreadedDriver
Base class for drivers which oeprate with a thread.
Definition: driver.h:544
Device
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:74
QueuePointer
An autopointer for the message queue.
Definition: message.h:73
ImageBase
Definition: imagebase.h:61
PLAYER_WARN
#define PLAYER_WARN(msg)
Warning message macros.
Definition: error.h:89
ImageBase::Main
virtual void Main()
Main method for driver thread.
Definition: imagebase.cc:187
player_camera_data
Data: state (PLAYER_CAMERA_DATA_STATE)
Definition: player_interfaces.h:2934
ImageBase::MainSetup
virtual int MainSetup()
Sets up the resources needed by the driver thread.
Definition: imagebase.cc:83

Last updated 12 September 2005 21:38:45