AURobotServers
4
|
#include <ucamdevgige.h>
Public Member Functions | |
void | cameraEventCB (void *Context, tPvInterface Interface, tPvLinkEvent Event, unsigned long UniqueId) |
virtual void | closeDevice () |
virtual bool | deviceExist () |
void | frameDoneCB (tPvFrame *pFrame) |
bool | frameToImage (UImage *destination, tPvFrame *frame) |
bool | getCamFeatures () |
void | getCamInfo () |
virtual int | getFrameRate () |
virtual int | getGain (bool probe, bool *dataValid=NULL, bool *isOnAuto=NULL) |
virtual bool | getImageSnapshot (UImage *image) |
virtual int | getShutter (bool probe, bool *dataValid=NULL, bool *isOnAuto=NULL) |
virtual bool | getWhiteBalance (bool probe, int *red=NULL, int *blue=NULL, int *mode=NULL) |
virtual bool | openDevice () |
virtual bool | openDeviceDefault () |
bool | setCamDeviceNode (int portNum, int camNum) |
virtual bool | setDevice (const int width, const int height, const int framesPerSec) |
virtual bool | setGain (int agc) |
virtual bool | setShutter (int value) |
UCamDevGigE () | |
~UCamDevGigE () | |
Public Member Functions inherited from UCamDevBase | |
virtual void | callGotNewDataWithObject () |
virtual void | createVars () |
virtual int | getBrightness (bool) |
char * | getCameraName () |
int | getCamFd () |
virtual int | getColour (bool) |
virtual int | getCompPref (bool) |
virtual int | getContour (bool) |
virtual int | getContrast (bool) |
virtual int | getDataChannel () |
virtual const char * | getDataChannelName () |
int | getDeviceNumber () |
virtual bool | getExternalTrigger (bool *supported) |
virtual int | getGamma (bool) |
unsigned int | getHeight () |
unsigned long | getImageNumber () |
bool | getLockedNewImage (UImage **raw) |
char * | getName () |
double | getPixelSize () |
int | getWBModeFromString (const char *mode) |
unsigned int | getWidth () |
void | gotNewImage (UImage *rgb) |
void | imageSizeChanged (double iResFactor) |
void | imgUpdated () |
bool | isCameraOpen () |
bool | isLog () |
bool | isReplay () |
virtual bool | isThisA (USupportedCamTypes thisType) |
virtual bool | makeTriggerPulse () |
bool | needNewPushData () |
virtual bool | setBrightness (int brightness) |
void | setCam (UCamBase *camRef) |
virtual bool | setColour (int colour) |
virtual bool | setCompPref (int value) |
virtual bool | setContour (int value=0x1000) |
virtual bool | setContrast (int contrast) |
virtual bool | setDataChannel (int) |
void | setDeviceNumber (int deviceNum) |
virtual bool | setExternalTrigger (bool, bool *supported) |
virtual bool | setGamma (int gamma) |
void | setImageNumber (unsigned long serial) |
void | setInitialized (bool value) |
void | setLog (bool value) |
virtual void | setPushBuffer (UImage *) |
void | setReplay (bool value) |
void | setTypeName (const char *newName) |
void | setVarPool (UVarPool *vpd) |
virtual bool | setVideoCap (int, int, int, int) |
virtual bool | setWhiteBalance (int, int, int) |
UCamDevBase () | |
virtual | ~UCamDevBase () |
Public Member Functions inherited from ULock | |
bool | lock () |
void | lockInit () |
void | post () |
bool | tryLock () |
bool | tryWait () |
ULock () | |
void | unlock () |
bool | wait () |
~ULock () | |
Protected Member Functions | |
bool | CameraStart (tCamera *Camera) |
int | getBayerPattern () |
int | getGigEIdx () |
void | resetTimestamp () |
Protected Attributes | |
tCamera | Camera |
GigE camera info. More... | |
ULock | captureDo |
ULock | captureDone |
UImage * | captureImage |
int | frameFormat |
unsigned int | roiHeight |
unsigned int | roiLeft |
unsigned int | roiTop |
unsigned int | roiWidth |
long unsigned int | timestampFrequency |
UTime | timestampRefTime |
bool | whitebalAuto |
int | whitebalBlue |
int | whitebalRed |
Protected Attributes inherited from UCamDevBase | |
UCamBase * | cam |
int | cam_fd |
bool | cameraOpen |
char | camName [MAX_CAM_DEV_NAME_LENGTH] |
USupportedCamTypes | camType |
int | devNum |
file descriptor for camera device More... | |
int | frameHeight |
int | frameRate |
int | frameWidth |
unsigned long | imageNumber |
int | imCnt |
UImage * | imgBuff [RAW_IMAGEBUFFER_MAX_CNT] |
int | imgBuffNext |
bool | initialized |
UVariable * | varCamName |
camera name from camera More... | |
UVariable * | varLog |
Variable for log flag. More... | |
UVariable * | varReplay |
Variable for replay. More... | |
UVarPool * | vars |
int | vbrightness |
int | vcolour |
int | vcompressionPref |
int | vcontour |
int | vcontrast |
int | vgain |
int | vgamma |
int | vshutter |
Additional Inherited Members | |
Public Types inherited from UCamDevBase | |
enum | camTypes { CAM_DEV_REPLAY, CAM_DEV_PWC, CAM_DEV_IEEE1394, CAM_DEV_GRAPPER, CAM_DEV_GIGE } |
typedef enum UCamDevBase::camTypes | USupportedCamTypes |
Static Public Member Functions inherited from UCamDevBase | |
static char * | getWBModeAsString (int mode, char *strBuff) |
Static Public Attributes inherited from UCamDevBase | |
static const int | MAX_CAM_DEV_NAME_LENGTH = 100 |
static const int | MAX_IMAGE_WIDTH = 640 |
Static Protected Attributes inherited from UCamDevBase | |
static const int | RAW_IMAGEBUFFER_MAX_CNT = 5 |
Camera device type that controls GigE camera Device number is from 15 to 19 - defined in URob4/UCamPool
@author Christian Andersen <jca@oersted.dtu.dk>
UCamDevGigE::UCamDevGigE | ( | ) |
Constructor
References UCamDevBase::CAM_DEV_GIGE, UCamDevBase::camType, captureDo, captureDone, frameFormat, UCamDevBase::frameRate, UCamDevBase::imgBuff, UCamDevBase::imgBuffNext, and ULock::tryWait().
UCamDevGigE::~UCamDevGigE | ( | ) |
Constructor
References CameraUnsetup(), closeDevice(), getGigEIdx(), and UCamDevBase::initialized.
void UCamDevGigE::cameraEventCB | ( | void * | Context, |
tPvInterface | Interface, | ||
tPvLinkEvent | Event, | ||
unsigned long | UniqueId | ||
) |
callback called when the camera is plugged/unplugged
|
protected |
setup and start streaming
Referenced by deviceExist().
|
virtual |
close if the device is open
Reimplemented from UCamDevBase.
References UCamDevBase::cameraOpen, and UCamDevBase::getDeviceNumber().
Referenced by openDeviceDefault(), and ~UCamDevGigE().
|
virtual |
Test if souch device exist and can be opened. If camera is available initialize to a state where it can be opened right away. true if device can be opened (a device exists).
Reimplemented from UCamDevBase.
References CameraGet(), UCamDevBase::cameraOpen, CameraSetup(), CameraStart(), CameraStop(), CameraUnsetup(), tCamera::Filename, getGigEIdx(), UCamDevBase::initialized, UCamDevBase::setTypeName(), and WaitForCamera().
void UCamDevGigE::frameDoneCB | ( | tPvFrame * | pFrame | ) |
Call back function when frame is finished
bool UCamDevGigE::frameToImage | ( | UImage * | destination, |
tPvFrame * | frame | ||
) |
Copy this frame to the destination image.
destination | is the image-pool image for the frame. |
frame | is the frame from the camera. |
References UImage::cam, UImage::camDevice, UImage::getBufferSize(), UImage::getData(), UImage::getDataSize(), UCamDevBase::getDeviceNumber(), UTime::getTimeAsString(), UCamDevBase::imageNumber, UImage::imageNumber, img, UImage::imgTime, PIX_PLANES_BGGR, PIX_PLANES_BGR, PIX_PLANES_BGRA, PIX_PLANES_BW, PIX_PLANES_BW16S, PIX_PLANES_GBRG, PIX_PLANES_GRBG, PIX_PLANES_RGB, PIX_PLANES_RGBA, PIX_PLANES_RGGB, PIX_PLANES_YUV, UImage::setColorType(), UImage::setSize(), timestampFrequency, timestampRefTime, and UImage::valid.
|
protected |
Get the bayer pattern from the camera. Result is one of the PIX_PLANEX_BGGR integers.
bool UCamDevGigE::getCamFeatures | ( | ) |
Get full camera feature set
void UCamDevGigE::getCamInfo | ( | ) |
Get basic camera info
|
virtual |
|
virtual |
Set actual gain value (in the range -1 (auto) or manual 0..0xFFFF).
Reimplemented from UCamDevBase.
References bool2str(), and UCamDevBase::vgain.
|
inlineprotected |
Get index of gige cameras
References FIRST_GIGE_DEVICE_NUMBER, MAX_GIGE_DEVS, maxi(), and mini().
Referenced by deviceExist(), and ~UCamDevGigE().
|
virtual |
Get new image - the newest available to the provided image buffer. if 'image' == NULL, then get and discard an image.
Reimplemented from UCamDevBase.
References bool2str(), captureDo, captureDone, captureImage, UCamDevBase::devNum, UCamDevBase::isCameraOpen(), openDevice(), ULock::post(), ULock::tryWait(), UImage::valid, and Wait().
|
virtual |
Set actual gain value.
Reimplemented from UCamDevBase.
References bool2str(), and UCamDevBase::vshutter.
|
virtual |
Get white balance values if 'probe' the the camera is asked, otherwise previous value is returned unchecked. If one or more of the following pointers are non-zero the integer value is returned.
Reimplemented from UCamDevBase.
References AU_WB_AUTO, AU_WB_MANUAL, bool2str(), whitebalAuto, whitebalBlue, and whitebalRed.
|
inlinevirtual |
Open devise to get default camera parameters. Returns true iff successful.
Reimplemented from UCamDevBase.
Referenced by getImageSnapshot().
|
virtual |
Open devise to get default camera parameters. Returns true iff successful.
Reimplemented from UCamDevBase.
References bool2str(), UImage::camDevice, UCamDevBase::cameraOpen, CameraStop(), closeDevice(), UCamDevBase::devNum, UCamDevBase::frameHeight, UCamDevBase::frameWidth, UCamDevBase::imgBuff, UCamDevBase::imgBuffNext, resetTimestamp(), UImage::setSize(), and UImage::valid.
|
protected |
reset timestamp - and time reference
Referenced by openDeviceDefault().
bool UCamDevGigE::setCamDeviceNode | ( | int | portNum, |
int | camNum | ||
) |
Set camera node info
|
virtual |
implement these settings and leave the device open.
Reimplemented from UCamDevBase.
References UCamDevBase::frameHeight, UCamDevBase::frameRate, UCamDevBase::frameWidth, UCamDevBase::imageSizeChanged(), UCamDevBase::MAX_IMAGE_WIDTH, maxi(), and mini().
|
virtual |
Set gain value. A negative value (-1) sets automatic gain. A positive value in range 0..0xFFFF is video gain in camera. 0 is low gain (but not zero). true if set successful - i.e. the function is supported by camera.
Reimplemented from UCamDevBase.
|
virtual |
Set shutter value. A negative value (-1) sets automatic gain. A positive value in range 0..0xFFFF is shutter setting in camera. 0 is short gain (but not zero). true if set successful - i.e. the function is supported by camera.
Reimplemented from UCamDevBase.
|
protected |
GigE camera info.
|
protected |
Capture lock to be unlocked (posted) when a snapshot image is needed. Should be posted by the thread needing the image, and will be accepted (locked by a tryPost() or tryLock()) by the frame read thread.
Referenced by getImageSnapshot(), and UCamDevGigE().
|
protected |
Capture finished post, posted by the read thread and the thread needing the image may wait on this lock.
Referenced by getImageSnapshot(), and UCamDevGigE().
|
protected |
Image pointer for single image capture
Referenced by getImageSnapshot().
|
protected |
Format of last received frame
Referenced by UCamDevGigE().
|
protected |
|
protected |
|
protected |
|
protected |
ROI settings
|
protected |
Timestamp frequency
Referenced by frameToImage().
|
protected |
Time stamp reference
Referenced by frameToImage().
|
protected |
White balance mode
Referenced by getWhiteBalance().
|
protected |
White ballance blue
Referenced by getWhiteBalance().
|
protected |
White balance red
Referenced by getWhiteBalance().