Public Member Functions | |
XCgrabber (OptionManager &mgr, const std::string &descrName="XC Frame Grabber Driver", const std::string &tagName="XCFrameGrabber", const ParamFlag flags=USE_MY_VAL) | |
Constructor. | |
virtual | ~XCgrabber () |
Destructor. | |
virtual GenericFrameSpec | peekFrameSpec () |
Return the specifications of the next frame to be returned. | |
virtual SimTime | getNaturalFrameTime () const |
Get the inter-frame time that matches our video mode. | |
void | WhiteBalance () |
White balance. | |
virtual GenericFrame | readFrame () |
Get the next frame from the frame-grabber. | |
xclib::pxbuffer_t | getCurrBufID () |
Protected Member Functions | |
VideoFrame | grabRaw () |
Grab raw data (the raw bayer format data). | |
virtual void | start1 () |
get started | |
virtual void | stop2 () |
get stopped | |
Protected Attributes | |
OModelParam< int > | itsChannel |
framegrabber channel | |
OModelParam< Dims > | itsDims |
captured image dims, may be smaller than native | |
OModelParam< Dims > | itsOffset |
captured image offset if dims smaller than native | |
OModelParam< int > | itsNbuf |
Number of grab buffers to use. | |
OModelParam< VideoFormat > | itsGrabMode |
grab mode that the hardware should use | |
OModelParam< bool > | itsByteSwap |
determines whether byte swapping is done during conversion to RGB | |
OModelParam< int > | itsWhiteBalTarR |
for white balance | |
OModelParam< int > | itsWhiteBalTarG |
for white balance | |
OModelParam< int > | itsWhiteBalTarB |
for white balance | |
OModelParam< int > | itsWhiteBalRefR |
for white balance | |
OModelParam< int > | itsWhiteBalRefG |
for white balance | |
OModelParam< int > | itsWhiteBalRefB |
for white balance | |
OModelParam< float > | itsGamma |
gamma correction, dependent on your driver | |
OModelParam< float > | itsFPS |
frames per second | |
int | itsBitDepth |
Bit depth (per component). | |
int | itsNumComp |
Number of components. | |
pthread_mutex_t | qmutex_buf |
OModelParam< std::string > | itsFormatFile |
bool | itsCameraOk |
xclib::pxbuffer_t | itsLastBuf |
byte * | itsImgBuf |
struct xclib::xclibs | itsXclib |
int | itsStateid |
int | itsUnitMap |
struct xclib::pximage ** | itsPximg |
Definition at line 67 of file XCgrabber.H.
XCgrabber::XCgrabber | ( | OptionManager & | mgr, | |
const std::string & | descrName = "XC Frame Grabber Driver" , |
|||
const std::string & | tagName = "XCFrameGrabber" , |
|||
const ParamFlag | flags = USE_MY_VAL | |||
) |
Constructor.
Definition at line 59 of file XCgrabber.C.
XCgrabber::~XCgrabber | ( | ) | [virtual] |
Destructor.
Definition at line 319 of file XCgrabber.C.
SimTime XCgrabber::getNaturalFrameTime | ( | ) | const [virtual] |
Get the inter-frame time that matches our video mode.
Reimplemented from FrameIstream.
Definition at line 335 of file XCgrabber.C.
References OModelParam< T >::getVal(), SimTime::HERTZ(), and itsFPS.
VideoFrame XCgrabber::grabRaw | ( | ) | [protected] |
Grab raw data (the raw bayer format data).
Don't call this directly; use readFrame() instead.
Definition at line 347 of file XCgrabber.C.
References ASSERT, OModelParam< T >::getVal(), itsBitDepth, itsByteSwap, itsDims, itsGrabMode, itsNbuf, itsNumComp, and Dims::sz().
Referenced by readFrame().
GenericFrameSpec XCgrabber::peekFrameSpec | ( | ) | [virtual] |
Return the specifications of the next frame to be returned.
Implements FrameIstream.
Definition at line 323 of file XCgrabber.C.
References OModelParam< T >::getVal(), itsByteSwap, itsDims, and itsGrabMode.
GenericFrame XCgrabber::readFrame | ( | ) | [virtual] |
Get the next frame from the frame-grabber.
Returns grabbed frame. This call will block until a frame is ready and has been grabbed.
Beware that the integrity of the GenericFrame object may not last "very long"; basically, try to be finished using the GenericFrame object before you attempt to grab the next frame in the stream. If you need it for longer than that, then you should use GenericFrame::deepCopyOf() to make a copy of the frame that can be safely held indefinitely.
Implements FrameIstream.
Definition at line 341 of file XCgrabber.C.
References grabRaw().
void XCgrabber::start1 | ( | ) | [protected, virtual] |
get started
show some info of pxvidstate structure
Reimplemented from ModelComponent.
Definition at line 90 of file XCgrabber.C.
References rutz::format(), OModelParam< T >::getVal(), Dims::h(), itsBitDepth, itsChannel, itsDims, itsGrabMode, itsNbuf, itsNumComp, itsOffset, Dims::sz(), and Dims::w().
void XCgrabber::stop2 | ( | ) | [protected, virtual] |
get stopped
Reimplemented from ModelComponent.
Definition at line 300 of file XCgrabber.C.
References OModelParam< T >::getVal(), and itsNbuf.
void XCgrabber::WhiteBalance | ( | ) |
White balance.
int XCgrabber::itsBitDepth [protected] |
Bit depth (per component).
Definition at line 139 of file XCgrabber.H.
OModelParam<bool> XCgrabber::itsByteSwap [protected] |
determines whether byte swapping is done during conversion to RGB
Definition at line 128 of file XCgrabber.H.
Referenced by grabRaw(), and peekFrameSpec().
OModelParam<int> XCgrabber::itsChannel [protected] |
OModelParam<Dims> XCgrabber::itsDims [protected] |
captured image dims, may be smaller than native
Definition at line 116 of file XCgrabber.H.
Referenced by grabRaw(), peekFrameSpec(), and start1().
OModelParam<float> XCgrabber::itsFPS [protected] |
OModelParam<float> XCgrabber::itsGamma [protected] |
gamma correction, dependent on your driver
Definition at line 136 of file XCgrabber.H.
OModelParam<VideoFormat> XCgrabber::itsGrabMode [protected] |
grab mode that the hardware should use
Grabbed frames will internally be converted to Image< PixRGB<byte> > whatever that mode is, but playing with it may influence image quality, maximum achievable framerate, and amounts of CPU doing those conversions to RGB.
Definition at line 125 of file XCgrabber.H.
Referenced by grabRaw(), peekFrameSpec(), and start1().
OModelParam<int> XCgrabber::itsNbuf [protected] |
Number of grab buffers to use.
Definition at line 118 of file XCgrabber.H.
int XCgrabber::itsNumComp [protected] |
Number of components.
Definition at line 140 of file XCgrabber.H.
OModelParam<Dims> XCgrabber::itsOffset [protected] |
captured image offset if dims smaller than native
Definition at line 117 of file XCgrabber.H.
Referenced by start1().
OModelParam<int> XCgrabber::itsWhiteBalRefB [protected] |
for white balance
Definition at line 135 of file XCgrabber.H.
OModelParam<int> XCgrabber::itsWhiteBalRefG [protected] |
for white balance
Definition at line 134 of file XCgrabber.H.
OModelParam<int> XCgrabber::itsWhiteBalRefR [protected] |
for white balance
Definition at line 133 of file XCgrabber.H.
OModelParam<int> XCgrabber::itsWhiteBalTarB [protected] |
for white balance
Definition at line 132 of file XCgrabber.H.
OModelParam<int> XCgrabber::itsWhiteBalTarG [protected] |
for white balance
Definition at line 131 of file XCgrabber.H.
OModelParam<int> XCgrabber::itsWhiteBalTarR [protected] |
for white balance
Definition at line 130 of file XCgrabber.H.