CARMA C++
|
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 () |
FrameGrabber & | operator= (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::Table * | table_ |
Image | testImage_ |
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.
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.
carma::antenna::common::FrameGrabber::FrameGrabber | ( | const std::string & | fgdev, |
int | fginput, | ||
bool | emulate, | ||
carma::services::Table * | table = 0 |
||
) |
Constructor.
fgdev | Framegrabber device (e.g. /dev/video0) |
fginput | Framegrabber input from which to grab frames. |
emulate | Emulate using test image. |
carma::antenna::common::FrameGrabber::~FrameGrabber | ( | ) |
Destructor.
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.
b | Unnormalized brightness value from [0,65535]. |
void carma::antenna::common::FrameGrabber::setContrast | ( | short | c | ) |
Set contrast.
c | Unnormalized contrast value [0,65535]. |
void carma::antenna::common::FrameGrabber::setPixelDepth | ( | short | depth | ) |
Set pixel depth.
depth | Pixel depth in bits. |
void carma::antenna::common::FrameGrabber::setResolution | ( | ResolutionType | resolution | ) |
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.