Fawkes API  Fawkes Development Version
firevision::ViscaControl Class Reference

Visca control protocol implementation over a serial line. More...

#include <>>

Public Member Functions

 ViscaControl (bool blocking=true)
 Constructor. More...
 
void open (const char *port)
 Open serial port. More...
 
void close ()
 Close port. More...
 
void set_address (unsigned int num_cameras)
 Set addresses of cameras. More...
 
void clear ()
 Clear. More...
 
void send ()
 Send outbound queue. More...
 
void recv (unsigned int max_wait_ms=10)
 Receive data. More...
 
void recv_ack (unsigned int *socket=NULL)
 Receive ACK packet. More...
 
void send_with_reply ()
 Send and wait for reply, blocking. More...
 
void send_nonblocking (unsigned int *socket=NULL)
 Send non-blocking. More...
 
void cancel_command (unsigned int socket)
 Cancel a running command. More...
 
bool data_available ()
 Check data availability. More...
 
void process ()
 Process incoming data. More...
 
void resetPanTilt ()
 Reset pan/tilt. More...
 
void startGetPanTilt ()
 Query for pan/tilt but do not wait until finished This will send an inquire to the camera that asks for pan/tilt values but it does not wait for the data! A later call to getPanTilt will then block and wait until the results arrive. More...
 
void setPanTilt (int pan, int tilt)
 Set pan tilt. More...
 
void getPanTilt (int *pan, int *tilt)
 Get pan and tilt values. More...
 
void setPanTiltLimit (int pan_left, int pan_right, int tilt_up, int tilt_down)
 Set pan tilt limit. More...
 
void resetPanTiltLimit ()
 Reset pan/tilt limit. More...
 
void resetZoom ()
 Reset zoom. More...
 
void setZoom (unsigned int zoom)
 Set zoom. More...
 
void getZoom (unsigned int *zoom)
 Get zoom. More...
 
void setZoomSpeedTele (unsigned int speed)
 Set zoom speed in tele. More...
 
void setZoomSpeedWide (unsigned int speed)
 Set zoom speed in wide angle. More...
 
void setZoomDigitalEnabled (bool enabled)
 Enable or disable digital zoome. More...
 
void resetEffect ()
 Reset effects. More...
 
void applyEffect (unsigned char effect)
 Apply effect. More...
 
void applyEffectPastel ()
 Apply pastel effect. More...
 
void applyEffectNegArt ()
 Apply negative art effect. More...
 
void applyEffectSepia ()
 Apply sepia effect. More...
 
void applyEffectBnW ()
 Apply B/W effect. More...
 
void applyEffectSolarize ()
 Apply solarize effect. More...
 
void applyEffectMosaic ()
 Apply mosaic effect. More...
 
void applyEffectSlim ()
 Apply slim effect. More...
 
void applyEffectStretch ()
 Apply stretch effect. More...
 
unsigned int getWhiteBalanceMode ()
 Get white balance mode. More...
 

Static Public Attributes

static const unsigned int VISCA_WHITEBLANCE_AUTO = VISCA_WB_AUTO
 Automatic white balance. More...
 
static const unsigned int VISCA_WHITEBALANCE_INDOOR = VISCA_WB_INDOOR
 Indoor white balance preset. More...
 
static const unsigned int VISCA_WHITEBALANCE_OUTDOOR = VISCA_WB_OUTDOOR
 Outdoor white balance preset. More...
 
static const unsigned int VISCA_WHITEBALANCE_ONE_PUSH = VISCA_WB_ONE_PUSH
 One push white balance preset. More...
 
static const unsigned int VISCA_WHITEBALANCE_ATW = VISCA_WB_ATW
 ATW white balance preset. More...
 
static const unsigned int VISCA_WHITEBALANCE_MANUAL = VISCA_WB_MANUAL
 Manual white balance. More...
 

Detailed Description

Visca control protocol implementation over a serial line.

Author
Tim Niemueller

Definition at line 56 of file visca.h.

Constructor & Destructor Documentation

◆ ViscaControl()

firevision::ViscaControl::ViscaControl ( bool  blocking = true)

Constructor.

Parameters
blockingif true, operate in blocking mode, false to operate in non-blocking mode.

Definition at line 94 of file visca.cpp.

Member Function Documentation

◆ applyEffect()

void firevision::ViscaControl::applyEffect ( unsigned char  filter)

Apply effect.

Parameters
filterfilter

Definition at line 976 of file visca.cpp.

References fawkes::Exception::append().

◆ applyEffectBnW()

void firevision::ViscaControl::applyEffectBnW ( )

Apply B/W effect.

Definition at line 1047 of file visca.cpp.

References fawkes::Exception::append().

◆ applyEffectMosaic()

void firevision::ViscaControl::applyEffectMosaic ( )

Apply mosaic effect.

Definition at line 1073 of file visca.cpp.

References fawkes::Exception::append().

◆ applyEffectNegArt()

void firevision::ViscaControl::applyEffectNegArt ( )

Apply negative art effect.

Definition at line 1021 of file visca.cpp.

References fawkes::Exception::append().

◆ applyEffectPastel()

void firevision::ViscaControl::applyEffectPastel ( )

Apply pastel effect.

Definition at line 1008 of file visca.cpp.

References fawkes::Exception::append().

◆ applyEffectSepia()

void firevision::ViscaControl::applyEffectSepia ( )

Apply sepia effect.

Definition at line 1034 of file visca.cpp.

References fawkes::Exception::append().

◆ applyEffectSlim()

void firevision::ViscaControl::applyEffectSlim ( )

Apply slim effect.

Definition at line 1086 of file visca.cpp.

References fawkes::Exception::append().

◆ applyEffectSolarize()

void firevision::ViscaControl::applyEffectSolarize ( )

Apply solarize effect.

Definition at line 1060 of file visca.cpp.

References fawkes::Exception::append().

◆ applyEffectStretch()

void firevision::ViscaControl::applyEffectStretch ( )

Apply stretch effect.

Definition at line 1099 of file visca.cpp.

References fawkes::Exception::append().

◆ cancel_command()

void firevision::ViscaControl::cancel_command ( unsigned int  socket)

Cancel a running command.

Parameters
socketsocket that the command was send on

Definition at line 482 of file visca.cpp.

References fawkes::Exception::append(), and firevision::ViscaControlException::ViscaControlException().

◆ clear()

void firevision::ViscaControl::clear ( )

◆ close()

void firevision::ViscaControl::close ( )

Close port.

Definition at line 192 of file visca.cpp.

◆ data_available()

bool firevision::ViscaControl::data_available ( )

Check data availability.

Returns
true if data is available, false otherwise

Definition at line 276 of file visca.cpp.

◆ getPanTilt()

void firevision::ViscaControl::getPanTilt ( int *  pan,
int *  tilt 
)

Get pan and tilt values.

If you used startGetPanTilt() to initiate the query the result is received and returned, otherwise a request is sent and the method blocks until the answer has been received.

Parameters
pancontains pan upon return
tiltcontains tilt upon return

Definition at line 615 of file visca.cpp.

References firevision::ViscaControlException::ViscaControlException().

◆ getWhiteBalanceMode()

unsigned int firevision::ViscaControl::getWhiteBalanceMode ( )

Get white balance mode.

Returns
white balance mode

Definition at line 1114 of file visca.cpp.

References fawkes::Exception::append(), and firevision::ViscaControlException::ViscaControlException().

◆ getZoom()

void firevision::ViscaControl::getZoom ( unsigned int *  zoom)

Get zoom.

Parameters
zoomcontains zoom upon return.

Definition at line 916 of file visca.cpp.

References fawkes::Exception::append(), and firevision::ViscaControlException::ViscaControlException().

◆ open()

void firevision::ViscaControl::open ( const char *  port)

Open serial port.

Parameters
portport to open.

Definition at line 111 of file visca.cpp.

References firevision::ViscaControlException::ViscaControlException().

◆ process()

void firevision::ViscaControl::process ( )

Process incoming data.

Definition at line 508 of file visca.cpp.

◆ recv()

void firevision::ViscaControl::recv ( unsigned int  max_wait_ms = 10)

Receive data.

Parameters
max_wait_msmaximum wait time in miliseconds

Definition at line 288 of file visca.cpp.

References fawkes::Exception::append(), and firevision::ViscaControlException::ViscaControlException().

◆ recv_ack()

void firevision::ViscaControl::recv_ack ( unsigned int *  socket = NULL)

Receive ACK packet.

Parameters
socketcontains the socket that the ACK was received on upon return

Definition at line 325 of file visca.cpp.

References fawkes::Exception::append(), and firevision::ViscaControlException::ViscaControlException().

◆ resetEffect()

void firevision::ViscaControl::resetEffect ( )

Reset effects.

Definition at line 995 of file visca.cpp.

References fawkes::Exception::append().

◆ resetPanTilt()

void firevision::ViscaControl::resetPanTilt ( )

Reset pan/tilt.

Definition at line 805 of file visca.cpp.

References fawkes::Exception::append().

◆ resetPanTiltLimit()

void firevision::ViscaControl::resetPanTiltLimit ( )

Reset pan/tilt limit.

Definition at line 723 of file visca.cpp.

References fawkes::Exception::append().

◆ resetZoom()

void firevision::ViscaControl::resetZoom ( )

Reset zoom.

Definition at line 823 of file visca.cpp.

References fawkes::Exception::append().

◆ send()

void firevision::ViscaControl::send ( )

Send outbound queue.

Definition at line 248 of file visca.cpp.

References firevision::ViscaControlException::ViscaControlException().

◆ send_nonblocking()

void firevision::ViscaControl::send_nonblocking ( unsigned int *  socket = NULL)

Send non-blocking.

Does a non-blocking send.

Parameters
socketthe socket that was used to send the request.

Definition at line 360 of file visca.cpp.

References fawkes::Exception::append().

◆ send_with_reply()

void firevision::ViscaControl::send_with_reply ( )

Send and wait for reply, blocking.

Definition at line 375 of file visca.cpp.

References fawkes::Exception::append(), and firevision::ViscaControlException::ViscaControlException().

◆ set_address()

void firevision::ViscaControl::set_address ( unsigned int  num_cameras)

Set addresses of cameras.

Parameters
num_camerasnumber of cameras on bus

Definition at line 205 of file visca.cpp.

References fawkes::Exception::append().

◆ setPanTilt()

void firevision::ViscaControl::setPanTilt ( int  pan,
int  tilt 
)

Set pan tilt.

Parameters
panpan
tilttilt

Definition at line 530 of file visca.cpp.

References fawkes::Exception::append().

◆ setPanTiltLimit()

void firevision::ViscaControl::setPanTiltLimit ( int  pan_left,
int  pan_right,
int  tilt_up,
int  tilt_down 
)

Set pan tilt limit.

Parameters
pan_leftmost left pan value
pan_rightmost right pan value
tilt_upmost up tilt value
tilt_downmost down tilt value

Definition at line 760 of file visca.cpp.

References fawkes::Exception::append().

◆ setZoom()

void firevision::ViscaControl::setZoom ( unsigned int  zoom)

Set zoom.

Parameters
zoomzoom value

Definition at line 890 of file visca.cpp.

References fawkes::Exception::append().

◆ setZoomDigitalEnabled()

void firevision::ViscaControl::setZoomDigitalEnabled ( bool  enabled)

Enable or disable digital zoome.

Parameters
enabledtrue to enable digital zoom, false to disable

Definition at line 951 of file visca.cpp.

References fawkes::Exception::append().

◆ setZoomSpeedTele()

void firevision::ViscaControl::setZoomSpeedTele ( unsigned int  speed)

Set zoom speed in tele.

Parameters
speedspeed

Definition at line 844 of file visca.cpp.

References fawkes::Exception::append().

◆ setZoomSpeedWide()

void firevision::ViscaControl::setZoomSpeedWide ( unsigned int  speed)

Set zoom speed in wide angle.

Parameters
speedspeed

Definition at line 867 of file visca.cpp.

References fawkes::Exception::append().

◆ startGetPanTilt()

void firevision::ViscaControl::startGetPanTilt ( )

Query for pan/tilt but do not wait until finished This will send an inquire to the camera that asks for pan/tilt values but it does not wait for the data! A later call to getPanTilt will then block and wait until the results arrive.

Initiate a pan/tilt request, but do not wait for the reply.

Not that you can not run another inquire (get*) method until this call has finished! You will get VISCA_E_INQRUNNING as error message.

Definition at line 586 of file visca.cpp.

References fawkes::Exception::append(), and firevision::ViscaControlInquiryRunningException::ViscaControlInquiryRunningException().

Member Data Documentation

◆ VISCA_WHITEBALANCE_ATW

const unsigned int firevision::ViscaControl::VISCA_WHITEBALANCE_ATW = VISCA_WB_ATW
static

ATW white balance preset.

Definition at line 63 of file visca.h.

Referenced by firevision::ViscaControlInquiryRunningException::ViscaControlInquiryRunningException().

◆ VISCA_WHITEBALANCE_INDOOR

const unsigned int firevision::ViscaControl::VISCA_WHITEBALANCE_INDOOR = VISCA_WB_INDOOR
static

Indoor white balance preset.

Definition at line 60 of file visca.h.

Referenced by firevision::ViscaControlInquiryRunningException::ViscaControlInquiryRunningException().

◆ VISCA_WHITEBALANCE_MANUAL

const unsigned int firevision::ViscaControl::VISCA_WHITEBALANCE_MANUAL = VISCA_WB_MANUAL
static

Manual white balance.

Definition at line 64 of file visca.h.

Referenced by firevision::ViscaControlInquiryRunningException::ViscaControlInquiryRunningException().

◆ VISCA_WHITEBALANCE_ONE_PUSH

const unsigned int firevision::ViscaControl::VISCA_WHITEBALANCE_ONE_PUSH = VISCA_WB_ONE_PUSH
static

One push white balance preset.

Definition at line 62 of file visca.h.

Referenced by firevision::ViscaControlInquiryRunningException::ViscaControlInquiryRunningException().

◆ VISCA_WHITEBALANCE_OUTDOOR

const unsigned int firevision::ViscaControl::VISCA_WHITEBALANCE_OUTDOOR = VISCA_WB_OUTDOOR
static

Outdoor white balance preset.

Definition at line 61 of file visca.h.

Referenced by firevision::ViscaControlInquiryRunningException::ViscaControlInquiryRunningException().

◆ VISCA_WHITEBLANCE_AUTO

const unsigned int firevision::ViscaControl::VISCA_WHITEBLANCE_AUTO = VISCA_WB_AUTO
static

Automatic white balance.

Definition at line 59 of file visca.h.

Referenced by firevision::ViscaControlInquiryRunningException::ViscaControlInquiryRunningException().


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