CARMA C++
carma::antenna::common::FrameGrabber Class Reference

Encapsulate hardware access to framegrabber device. More...

#include <carma/antenna/common/FrameGrabber.h>

Public Types

enum  ResolutionType { HI_RES, MID_RES, LO_RES, RES_COUNT }
 Supported resolution types. More...
 

Public Member Functions

void createCaptureBuffer ()
 
 FrameGrabber (const std::string &fgdev, int fginput, bool emulate, carma::services::Table *table=0)
 Constructor. More...
 
 FrameGrabber (carma::services::Table *table)
 
 FrameGrabber (const FrameGrabber &)
 
::std::pair< short, short > getResolution () const
 
static::std::pair< short, short > getResolution (ResolutionType res)
 
Image grabFrame (int numFrames=1, std::vector< float > *data=0)
 Grab a frame. More...
 
void initializeCaptureBuffer ()
 
FrameGrabberoperator= (const FrameGrabber &)
 
void setBrightness (short b)
 Set brightness. More...
 
void setContrast (short c)
 Set contrast. More...
 
void setDebug (carma::services::Table *table)
 
void setPixelDepth (short depth)
 Set pixel depth. More...
 
void setResolution (ResolutionType resolution)
 Set resolution. More...
 
void setTestImage (const Image &image)
 Set test image when emulating. More...
 
void unmapCaptureBuffer ()
 
 ~FrameGrabber ()
 Destructor. More...
 

Public Attributes

unsigned bufLen_
 
unsigned bufOffset_
 
bool emulate_
 
void * imageBuffer_
 
carma::util::PthreadMutex mutex_
 
::std::auto_ptr
< FrameGrabberPimpl > 
pimpl_
 
::std::pair< short, short > resolution_
 
carma::services::Tabletable_
 
Image testImage_
 

Detailed Description

Encapsulate hardware access to framegrabber device.

This class is purely for controlling and accessing the frame grabber device. No extra image processing (e.g. rotation, cropping, etc) is done within this class.

Definition at line 32 of file FrameGrabber.h.

Member Enumeration Documentation

Supported resolution types.

Enumerator
HI_RES 

768x480

MID_RES 

640x400

LO_RES 

320x200

RES_COUNT 

Number of supported resolutions.

Definition at line 76 of file FrameGrabber.h.

Constructor & Destructor Documentation

carma::antenna::common::FrameGrabber::FrameGrabber ( const std::string &  fgdev,
int  fginput,
bool  emulate,
carma::services::Table table = 0 
)

Constructor.

Parameters
fgdevFramegrabber device (e.g. /dev/video0)
fginputFramegrabber input from which to grab frames.
emulateEmulate using test image.
See Also
FrameGrabber::setTestImage
carma::antenna::common::FrameGrabber::~FrameGrabber ( )

Destructor.

Member Function Documentation

Image carma::antenna::common::FrameGrabber::grabFrame ( int  numFrames = 1,
std::vector< float > *  data = 0 
)

Grab a frame.

Number of frames to integrate.

void carma::antenna::common::FrameGrabber::setBrightness ( short  b)

Set brightness.

Parameters
bUnnormalized brightness value from [0,65535].
void carma::antenna::common::FrameGrabber::setContrast ( short  c)

Set contrast.

Parameters
cUnnormalized contrast value [0,65535].
void carma::antenna::common::FrameGrabber::setPixelDepth ( short  depth)

Set pixel depth.

Parameters
depthPixel depth in bits.
void carma::antenna::common::FrameGrabber::setResolution ( ResolutionType  resolution)

Set resolution.

Parameters
resolutionResolution.
See Also
ResolutionType
void carma::antenna::common::FrameGrabber::setTestImage ( const Image &  image)

Set test image when emulating.

If image size does not match the current resolution, it will be internally resized.


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