Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ImageStreamDriver Class Reference

description of ImageStreamDriver More...

#include <ImageStreamDriver.h>

Inheritance diagram for ImageStreamDriver:

Detailed Description

description of ImageStreamDriver

Definition at line 9 of file ImageStreamDriver.h.

List of all members.

Public Types

enum  format_t { FORMAT_YUV = 0, FORMAT_PNG, FORMAT_JPEG, FORMAT_TEKKOTSU }
 

enumerates the available formats for input to the driver

More...

Public Member Functions

 ImageStreamDriver (const std::string &name)
virtual std::string getClassName () const
 Returns the name of the class (aka its type).
virtual void getImageSources (std::map< std::string, DataSource * > &sources)
virtual void plistValueChanged (const plist::PrimitiveBase &pl)

Public Attributes

plist::NamedEnumeration< format_tformat
 The type of format to expect from the comm port.

Static Public Attributes

static const size_t NUM_FORMATS = 4
 number of entries in format_t
static const char * formatNames [NUM_FORMATS+1] = { "yuv", "png", "jpeg", "tekkotsu", NULL }
 human-readable names for the supported formats, see format_t

Protected Member Functions

virtual bool readData (std::istream &is)
 Called when data should be read from the specified data stream and then provided to the framework.
RCRegionreadImage (std::istream &is)
virtual void connect (CommPort *comm)
 called when connection initialization is required (opens comm port, etc.)
virtual void disconnect (CommPort *comm)
 called when connection destruction is required (closes comm port, etc.)
void setSID (unsigned short imageSID)

Static Protected Member Functions

static void copyImage (char *buf, unsigned int width, unsigned int height, unsigned int channels, const char *chan, unsigned int lwidth, unsigned int lheight, unsigned int lchan)

Protected Attributes

size_t payloadSize
 caches size of last decompressed (yuv) image to assume next image will be the same size
unsigned short sid

Private Member Functions

 ImageStreamDriver (const ImageStreamDriver &)
 no call
ImageStreamDriver operator= (const ImageStreamDriver &)
 no call

Static Private Attributes

static const std::string autoRegisterDriver = DeviceDriver::getRegistry().registerType<ImageStreamDriver>("ImageStream")
 holds the class name, set via registration with the DeviceDriver registry

Member Enumeration Documentation

enum format_t

enumerates the available formats for input to the driver

Enumerator:
FORMAT_YUV 

raw interleaved YUV data, CameraResolutionX wide by CameraResolutionY high (defined in target's RobotInfo namespace)

FORMAT_PNG 

PNG compressed image.

FORMAT_JPEG 

JPEG compressed iamge.

FORMAT_TEKKOTSU 

the format used by the Tekkotsu streaming video

Definition at line 29 of file ImageStreamDriver.h.


Constructor & Destructor Documentation

ImageStreamDriver ( const std::string &  name  )  [explicit]

Definition at line 11 of file ImageStreamDriver.h.

ImageStreamDriver ( const ImageStreamDriver  )  [private]

no call


Member Function Documentation

void connect ( CommPort comm  )  [protected, virtual]

called when connection initialization is required (opens comm port, etc.)

Reimplemented from DataStreamDriver.

Definition at line 410 of file ImageStreamDriver.cc.

Referenced by plistValueChanged().

void copyImage ( char *  buf,
unsigned int  width,
unsigned int  height,
unsigned int  channels,
const char *  chan,
unsigned int  lwidth,
unsigned int  lheight,
unsigned int  lchan 
) [static, protected]

Definition at line 362 of file ImageStreamDriver.cc.

Referenced by readImage().

void disconnect ( CommPort comm  )  [protected, virtual]

called when connection destruction is required (closes comm port, etc.)

Reimplemented from DataStreamDriver.

Definition at line 415 of file ImageStreamDriver.cc.

Referenced by plistValueChanged().

virtual std::string getClassName (  )  const [virtual]

Returns the name of the class (aka its type).

Suggested implementation is to declare a static string member, set it to the result of calling the registry's registerType, and then return that member here

Implements DeviceDriver.

Definition at line 19 of file ImageStreamDriver.h.

virtual void getImageSources ( std::map< std::string, DataSource * > &  sources  )  [virtual]

Reimplemented from DeviceDriver.

Definition at line 21 of file ImageStreamDriver.h.

ImageStreamDriver operator= ( const ImageStreamDriver  )  [private]

no call

void plistValueChanged ( const plist::PrimitiveBase pl  )  [virtual]

Reimplemented from DataStreamDriver.

Reimplemented in ImageSubscription, DepthSubscription, and Subscription< ImageStreamDriver >.

Definition at line 21 of file ImageStreamDriver.cc.

bool readData ( std::istream &  is  )  [protected, virtual]

Called when data should be read from the specified data stream and then provided to the framework.

If paceInput is set, your implementation should use readsome() to skim through to the last available data packet, and provide only that data to the framework

Implements DataStreamDriver.

Definition at line 33 of file ImageStreamDriver.cc.

RCRegion * readImage ( std::istream &  is  )  [protected]

Definition at line 63 of file ImageStreamDriver.cc.

Referenced by readData().

void setSID ( unsigned short  imageSID  )  [protected]

Definition at line 52 of file ImageStreamDriver.h.

Referenced by DepthSubscription::DepthSubscription().


Member Data Documentation

const std::string autoRegisterDriver = DeviceDriver::getRegistry().registerType<ImageStreamDriver>("ImageStream") [static, private]

holds the class name, set via registration with the DeviceDriver registry

Reimplemented from DataStreamDriver.

Definition at line 59 of file ImageStreamDriver.h.

Referenced by getClassName().

The type of format to expect from the comm port.

'YUV' expects interleaved components 'CameraResolutionX' wide and 'CameraResolutionY' high (defined in target's RobotInfo namespace)

Definition at line 42 of file ImageStreamDriver.h.

Referenced by connect(), DepthSubscription::DepthSubscription(), disconnect(), ImageStreamDriver(), ImageSubscription::ImageSubscription(), ImageSubscription::plistValueChanged(), DepthSubscription::plistValueChanged(), plistValueChanged(), and readImage().

const char * formatNames = { "yuv", "png", "jpeg", "tekkotsu", NULL } [static]

human-readable names for the supported formats, see format_t

Definition at line 38 of file ImageStreamDriver.h.

const size_t NUM_FORMATS = 4 [static]

number of entries in format_t

Definition at line 36 of file ImageStreamDriver.h.

size_t payloadSize [protected]

caches size of last decompressed (yuv) image to assume next image will be the same size

Definition at line 54 of file ImageStreamDriver.h.

Referenced by readImage().

unsigned short sid [protected]

Definition at line 55 of file ImageStreamDriver.h.

Referenced by readImage(), and setSID().


The documentation for this class was generated from the following files:

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:41 2016 by Doxygen 1.6.3