Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
prosilica::Camera Class Reference

#include <prosilica.h>

Public Member Functions

 Camera (unsigned long guid, size_t bufferSize=DEFAULT_BUFFER_SIZE)
 
 Camera (const char *ip_address, size_t bufferSize=DEFAULT_BUFFER_SIZE)
 
void getAttribute (const std::string &name, tPvUint32 &value)
 
void getAttribute (const std::string &name, tPvFloat32 &value)
 
void getAttribute (const std::string &name, std::string &value)
 
void getAttributeEnum (const std::string &name, std::string &value)
 General get/set attribute functions. More...
 
unsigned long getMaxDataRate ()
 
tPvFramegrab (unsigned long timeout_ms=PVINFINITE)
 
unsigned long guid ()
 
tPvHandle handle ()
 Get raw PvApi camera handle. More...
 
bool hasAttribute (const std::string &name)
 Returns true if camera supports the attribute. More...
 
void readUserMemory (char *data, size_t size)
 
void removeEvents ()
 remove callback More...
 
void runCommand (const std::string &name)
 
void setAttribute (const std::string &name, tPvUint32 value)
 
void setAttribute (const std::string &name, tPvFloat32 value)
 
void setAttribute (const std::string &name, const std::string &value)
 
void setAttributeEnum (const std::string &name, const std::string &value)
 
void setBinning (unsigned int binning_x=1, unsigned int binning_y=1)
 
void setExposure (unsigned int val, AutoSetting isauto=Manual)
 
void setFrameCallback (boost::function< void(tPvFrame *)> callback)
 Must be used before calling start() in a non-triggered mode. More...
 
void setFrameRate (tPvFloat32 frame_rate)
 
void setGain (unsigned int val, AutoSetting isauto=Manual)
 
void setKillCallback (boost::function< void(unsigned long)> callback)
 
void setRoi (unsigned int x, unsigned int y, unsigned int width, unsigned int height)
 
void setRoiToWholeFrame ()
 
void setWhiteBalance (unsigned int blue, unsigned int red, AutoSetting isauto=Manual)
 
void start (FrameStartTriggerMode=Freerun, tPvFloat32 frame_rate=30, AcquisitionMode=Continuous)
 Start capture. More...
 
void stop ()
 Stop capture. More...
 
void writeUserMemory (const char *data, size_t size)
 
 ~Camera ()
 

Static Public Attributes

static const size_t DEFAULT_BUFFER_SIZE = 4
 
static const unsigned long GIGE_MAX_DATA_RATE = 115000000
 
static const size_t USER_MEMORY_SIZE = 512
 Data must have size <= USER_MEMORY_SIZE bytes. More...
 

Private Member Functions

void setup ()
 

Static Private Member Functions

static void frameDone (tPvFrame *frame)
 
static void kill (void *Context, tPvInterface Interface, tPvLinkEvent Event, unsigned long UniqueId)
 

Private Attributes

boost::mutex aliveMutex_
 
AcquisitionMode Amode_
 
size_t bufferIndex_
 
size_t bufferSize_
 
boost::mutex frameMutex_
 
tPvFrameframes_
 
tPvUint32 frameSize_
 
FrameStartTriggerMode FSTmode_
 
tPvHandle handle_
 
boost::function< void(unsigned long UniqueId)> killCallback_
 
boost::function< void(tPvFrame *)> userCallback_
 

Detailed Description

Definition at line 114 of file prosilica.h.

Constructor & Destructor Documentation

prosilica::Camera::Camera ( unsigned long  guid,
size_t  bufferSize = DEFAULT_BUFFER_SIZE 
)

Definition at line 175 of file prosilica.cpp.

prosilica::Camera::Camera ( const char *  ip_address,
size_t  bufferSize = DEFAULT_BUFFER_SIZE 
)

Definition at line 184 of file prosilica.cpp.

prosilica::Camera::~Camera ( )

Definition at line 231 of file prosilica.cpp.

Member Function Documentation

void prosilica::Camera::frameDone ( tPvFrame frame)
staticprivate

Definition at line 562 of file prosilica.cpp.

void prosilica::Camera::getAttribute ( const std::string name,
tPvUint32 &  value 
)

Definition at line 465 of file prosilica.cpp.

void prosilica::Camera::getAttribute ( const std::string name,
tPvFloat32 &  value 
)

Definition at line 473 of file prosilica.cpp.

void prosilica::Camera::getAttribute ( const std::string name,
std::string value 
)

Definition at line 480 of file prosilica.cpp.

void prosilica::Camera::getAttributeEnum ( const std::string name,
std::string value 
)

General get/set attribute functions.

Definition at line 459 of file prosilica.cpp.

unsigned long prosilica::Camera::getMaxDataRate ( )

Definition at line 528 of file prosilica.cpp.

tPvFrame * prosilica::Camera::grab ( unsigned long  timeout_ms = PVINFINITE)

Capture a single frame from the camera. Must be called after start(Software Triggered).

recommanding after an error seems to cause a sequence error if next command is too fast

Definition at line 319 of file prosilica.cpp.

unsigned long prosilica::Camera::guid ( )

Definition at line 520 of file prosilica.cpp.

tPvHandle prosilica::Camera::handle ( )

Get raw PvApi camera handle.

Definition at line 594 of file prosilica.cpp.

bool prosilica::Camera::hasAttribute ( const std::string name)

Returns true if camera supports the attribute.

Definition at line 437 of file prosilica.cpp.

void prosilica::Camera::kill ( void *  Context,
tPvInterface  Interface,
tPvLinkEvent  Event,
unsigned long  UniqueId 
)
staticprivate

Definition at line 581 of file prosilica.cpp.

void prosilica::Camera::readUserMemory ( char *  data,
size_t  size 
)

Definition at line 550 of file prosilica.cpp.

void prosilica::Camera::removeEvents ( )

remove callback

Definition at line 313 of file prosilica.cpp.

void prosilica::Camera::runCommand ( const std::string name)

Definition at line 514 of file prosilica.cpp.

void prosilica::Camera::setAttribute ( const std::string name,
tPvUint32  value 
)

Definition at line 493 of file prosilica.cpp.

void prosilica::Camera::setAttribute ( const std::string name,
tPvFloat32  value 
)

Definition at line 500 of file prosilica.cpp.

void prosilica::Camera::setAttribute ( const std::string name,
const std::string value 
)

Definition at line 507 of file prosilica.cpp.

void prosilica::Camera::setAttributeEnum ( const std::string name,
const std::string value 
)

Definition at line 486 of file prosilica.cpp.

void prosilica::Camera::setBinning ( unsigned int  binning_x = 1,
unsigned int  binning_y = 1 
)

Definition at line 425 of file prosilica.cpp.

void prosilica::Camera::setExposure ( unsigned int  val,
AutoSetting  isauto = Manual 
)

Definition at line 347 of file prosilica.cpp.

void prosilica::Camera::setFrameCallback ( boost::function< void(tPvFrame *)>  callback)

Must be used before calling start() in a non-triggered mode.

Definition at line 246 of file prosilica.cpp.

void prosilica::Camera::setFrameRate ( tPvFloat32  frame_rate)

Definition at line 250 of file prosilica.cpp.

void prosilica::Camera::setGain ( unsigned int  val,
AutoSetting  isauto = Manual 
)
Todo:
Here and in setWhiteBalance, would be better to split off setGainMode etc. I didn't take into account there are cameras that don't support auto gain, auto white balance.

Definition at line 357 of file prosilica.cpp.

void prosilica::Camera::setKillCallback ( boost::function< void(unsigned long)>  callback)

Definition at line 255 of file prosilica.cpp.

void prosilica::Camera::setRoi ( unsigned int  x,
unsigned int  y,
unsigned int  width,
unsigned int  height 
)

Definition at line 395 of file prosilica.cpp.

void prosilica::Camera::setRoiToWholeFrame ( )

Definition at line 408 of file prosilica.cpp.

void prosilica::Camera::setup ( )
private

Definition at line 195 of file prosilica.cpp.

void prosilica::Camera::setWhiteBalance ( unsigned int  blue,
unsigned int  red,
AutoSetting  isauto = Manual 
)

Definition at line 372 of file prosilica.cpp.

void prosilica::Camera::start ( FrameStartTriggerMode  fmode = Freerun,
tPvFloat32  frame_rate = 30,
AcquisitionMode  amode = Continuous 
)

Start capture.

Todo:
verify this assert again
Todo:
take this one also as an argument

Definition at line 260 of file prosilica.cpp.

void prosilica::Camera::stop ( )

Stop capture.

Definition at line 302 of file prosilica.cpp.

void prosilica::Camera::writeUserMemory ( const char *  data,
size_t  size 
)

Definition at line 538 of file prosilica.cpp.

Member Data Documentation

boost::mutex prosilica::Camera::aliveMutex_
private

Definition at line 188 of file prosilica.h.

AcquisitionMode prosilica::Camera::Amode_
private

Definition at line 184 of file prosilica.h.

size_t prosilica::Camera::bufferIndex_
private

Definition at line 189 of file prosilica.h.

size_t prosilica::Camera::bufferSize_
private

Definition at line 182 of file prosilica.h.

const size_t prosilica::Camera::DEFAULT_BUFFER_SIZE = 4
static

Definition at line 117 of file prosilica.h.

boost::mutex prosilica::Camera::frameMutex_
private

Definition at line 187 of file prosilica.h.

tPvFrame* prosilica::Camera::frames_
private

Definition at line 180 of file prosilica.h.

tPvUint32 prosilica::Camera::frameSize_
private

Definition at line 181 of file prosilica.h.

FrameStartTriggerMode prosilica::Camera::FSTmode_
private

Definition at line 183 of file prosilica.h.

const unsigned long prosilica::Camera::GIGE_MAX_DATA_RATE = 115000000
static

Definition at line 168 of file prosilica.h.

tPvHandle prosilica::Camera::handle_
private

Definition at line 179 of file prosilica.h.

boost::function<void (unsigned long UniqueId)> prosilica::Camera::killCallback_
private

Definition at line 186 of file prosilica.h.

const size_t prosilica::Camera::USER_MEMORY_SIZE = 512
static

Data must have size <= USER_MEMORY_SIZE bytes.

Definition at line 171 of file prosilica.h.

boost::function<void (tPvFrame*)> prosilica::Camera::userCallback_
private

Definition at line 185 of file prosilica.h.


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


prosilica_camera
Author(s): Maintained by William Woodall - wwoodall@willowgarage.com, Contributions by Allison Thackston - allison.thackston@nasa.gov
autogenerated on Mon Jun 10 2019 14:20:19