Fawkes API  Fawkes Development Version
firevision::V4L2Camera Class Reference

#include <>>

Inheritance diagram for firevision::V4L2Camera:

Public Member Functions

 V4L2Camera (const char *device_name="/dev/video0")
 Constructor. More...
 
 V4L2Camera (const CameraArgumentParser *cap)
 Constructor. More...
 
virtual ~V4L2Camera ()
 Destructor. More...
 
virtual void open ()
 
virtual void start ()
 
virtual void stop ()
 
virtual void close ()
 
virtual void flush ()
 
virtual void capture ()
 
virtual void print_info ()
 
virtual bool ready ()
 
virtual unsigned char * buffer ()
 
virtual unsigned int buffer_size ()
 
virtual void dispose_buffer ()
 
virtual unsigned int pixel_width ()
 
virtual unsigned int pixel_height ()
 
virtual colorspace_t colorspace ()
 
virtual fawkes::Timecapture_time ()
 Get the Time of the last successfully captured image. More...
 
virtual void set_image_number (unsigned int n)
 
virtual bool auto_gain ()
 
virtual void set_auto_gain (bool enabled)
 
virtual bool auto_white_balance ()
 
virtual void set_auto_white_balance (bool enabled)
 
virtual unsigned int exposure_auto ()
 
virtual void set_exposure_auto (unsigned int exposure_auto)
 
virtual int red_balance ()
 
virtual void set_red_balance (int red_balance)
 
virtual int blue_balance ()
 
virtual void set_blue_balance (int blue_balance)
 
virtual int u_balance ()
 
virtual void set_u_balance (int u_balance)
 
virtual int v_balance ()
 
virtual void set_v_balance (int v_balance)
 
virtual unsigned int brightness ()
 
virtual void set_brightness (unsigned int brightness)
 
virtual unsigned int contrast ()
 
virtual void set_contrast (unsigned int contrast)
 
virtual unsigned int saturation ()
 
virtual void set_saturation (unsigned int saturation)
 
virtual int hue ()
 
virtual void set_hue (int hue)
 
virtual unsigned int exposure ()
 
virtual void set_exposure (unsigned int exposure)
 
virtual unsigned int gain ()
 
virtual void set_gain (unsigned int gain)
 
virtual const char * format ()
 Get the image format the camera currently uses. More...
 
virtual void set_format (const char *format)
 Set the image format the camera should use. More...
 
virtual unsigned int width ()
 
virtual unsigned int height ()
 
virtual void set_size (unsigned int width, unsigned int height)
 
virtual bool horiz_mirror ()
 Return whether the camera image is horizontally mirrored. More...
 
virtual bool vert_mirror ()
 Return whether the camera image is vertically mirrored. More...
 
virtual void set_horiz_mirror (bool enabled)
 Set whether the camera should mirror images horizontally. More...
 
virtual void set_vert_mirror (bool enabled)
 Set whether the camera should mirror images vertically. More...
 
virtual unsigned int fps ()
 Get the number of frames per second that have been requested from the camera. More...
 
virtual void set_fps (unsigned int fps)
 Set the number of frames per second the camera tries to deliver. More...
 
virtual unsigned int lens_x_corr ()
 Get current lens x correction. More...
 
virtual unsigned int lens_y_corr ()
 Get current lens y correction. More...
 
virtual void set_lens_x_corr (unsigned int x_corr)
 Set lens x correction. More...
 
virtual void set_lens_y_corr (unsigned int y_corr)
 Set lens y correction. More...
 
virtual bool exposure_auto_priority ()
 Get exposure_auto_priority V4L2 control. More...
 
virtual void set_exposure_auto_priority (bool enabled)
 Set exposure_auto_priority V4L2 control. More...
 
virtual unsigned int white_balance_temperature ()
 Get absolute white balance setting. More...
 
virtual void set_white_balance_temperature (unsigned int white_balance_temperature)
 Set white balance. More...
 
virtual unsigned int exposure_absolute ()
 Get absolute exposure time. More...
 
virtual void set_exposure_absolute (unsigned int exposure_absolute)
 set absolute exposure time (1/s) More...
 
virtual unsigned int sharpness ()
 Get sharpness value. More...
 
virtual void set_sharpness (unsigned int sharpness)
 Set sharpness. More...
 
- Public Member Functions inherited from firevision::Camera
virtual ~Camera ()
 Virtual empty destructor. More...
 
- Public Member Functions inherited from firevision::CameraControlColor
virtual ~CameraControlColor ()
 Empty virtual destructor. More...
 
virtual void set_auto_all (bool enabled)
 Enable/disable all automatic settings. More...
 
- Public Member Functions inherited from firevision::CameraControl
virtual ~CameraControl ()
 Virtual empty destructor. More...
 
- Public Member Functions inherited from firevision::CameraControlImage
virtual ~CameraControlImage ()
 Empty virtual destructor. More...
 
virtual void size (unsigned int &width, unsigned int &height)
 Get the current image size. More...
 
virtual void mirror (bool &horiz, bool &vert)
 Get information about current camera image mirroring. More...
 
virtual void set_mirror (bool horiz, bool vert)
 Set whether the camera should mirror images. More...
 
virtual void lens_corr (unsigned int &x_corr, unsigned int &y_corr)
 Get current lens correction. More...
 
virtual void set_lens_corr (unsigned int x_corr, unsigned int y_corr)
 Set lens correction. More...
 

Protected Member Functions

 V4L2Camera (const char *device_name, int dev)
 Protected Constructor. More...
 
virtual void set_one_control (const char *ctrl, unsigned int id, int value)
 Set one Camera control value. More...
 
virtual int get_one_control (const char *ctrl, unsigned int id)
 Get one Camera control value. More...
 

Protected Attributes

char * _device_name
 Device name. More...
 

Detailed Description

Video4Linux 2 camera access implementation.

Todo:

UPTR method

v4l2_pix_format.field

Author
Tobias Kellner
Tim Niemueller

Definition at line 41 of file v4l2.h.

Constructor & Destructor Documentation

◆ V4L2Camera() [1/3]

firevision::V4L2Camera::V4L2Camera ( const char *  device_name = "/dev/video0")

Constructor.

Parameters
device_namedevice file name (e.g. /dev/video0)

Definition at line 82 of file v4l2.cpp.

References _device_name.

◆ V4L2Camera() [2/3]

firevision::V4L2Camera::V4L2Camera ( const CameraArgumentParser cap)

Constructor.

Initialize camera with parameters from camera argument parser. Supported arguments: *Required:

  • device=DEV, device file, for example /dev/video0 (required) *Optional:
  • read_method=METHOD, preferred read method READ: read() MMAP: memory mapping UPTR: user pointer
  • standard=std, set video standard, e.g. PAL or NTSC
  • input=inp, set video input, e.g. S-Video
  • format=FOURCC, preferred format
  • size=WIDTHxHEIGHT, preferred image size
  • switch_u_v=true/false, switch U and V channels
  • fps=FPS, frames per second
  • aec=true/false, Auto Exposition enabled [warning: only valid on nao]
  • awb=true/false, Auto White Balance enabled
  • agc=true/false, Auto Gain enabled
  • h_flip=true/false, Horizontal mirror
  • v_flip=true/false, Vertical mirror
  • brightness=BRIGHT, Brightness 0-255
  • contrast=CONTR, Contrast 0-127
  • saturation=SAT, Saturation 0-256
  • hue=HUE, Hue -180-180
  • red_balance=RB, Red Balance 0-255
  • blue_balance=BB, Blue Balance 0-255
  • exposure=EXP, Exposure 0-65535
  • gain=GAIN, Gain 0-255
  • lens_x=CORR, Lens Correction X 0-255
  • lens_y=CORR, Lens Correction Y 0-255
    Parameters
    capcamera argument parser

Definition at line 140 of file v4l2.cpp.

References _device_name, firevision::CameraArgumentParser::get(), firevision::CameraArgumentParser::has(), and firevision::CameraControlImage::size().

◆ ~V4L2Camera()

firevision::V4L2Camera::~V4L2Camera ( )
virtual

Destructor.

Definition at line 399 of file v4l2.cpp.

References _device_name, close(), and stop().

◆ V4L2Camera() [3/3]

firevision::V4L2Camera::V4L2Camera ( const char *  device_name,
int  dev 
)
protected

Protected Constructor.

Gets called from V4LCamera, when the device has already been opened and determined to be a V4L2 device.

Parameters
device_namedevice file name (e.g. /dev/video0)
devfile descriptor of the opened device

Definition at line 363 of file v4l2.cpp.

References _device_name, and close().

Member Function Documentation

◆ auto_gain()

bool firevision::V4L2Camera::auto_gain ( )
virtual

Return whether auto gain is enabled.

Returns
true if auto gain is enabled

Implements firevision::CameraControlColor.

Definition at line 1402 of file v4l2.cpp.

References get_one_control().

◆ auto_white_balance()

bool firevision::V4L2Camera::auto_white_balance ( )
virtual

Return whether auto white balance is enabled.

Returns
true if auto white balance is enabled

Implements firevision::CameraControlColor.

Definition at line 1415 of file v4l2.cpp.

References get_one_control().

◆ blue_balance()

int firevision::V4L2Camera::blue_balance ( )
virtual

Get current blue balance.

Returns
current blue balance value

Implements firevision::CameraControlColor.

Definition at line 1454 of file v4l2.cpp.

References get_one_control().

Referenced by set_blue_balance().

◆ brightness()

unsigned int firevision::V4L2Camera::brightness ( )
virtual

Get current brightness.

Returns
current brightness value

Implements firevision::CameraControlColor.

Definition at line 1491 of file v4l2.cpp.

References get_one_control().

Referenced by set_brightness().

◆ buffer()

unsigned char * firevision::V4L2Camera::buffer ( )
virtual

Get access to current image buffer. This will return a pointer to the current buffer. The buffer contains an image of the given colorspace, width and height.

Returns
pointer to image buffer

Implements firevision::Camera.

Definition at line 1215 of file v4l2.cpp.

Referenced by capture(), close(), dispose_buffer(), and start().

◆ buffer_size()

unsigned int firevision::V4L2Camera::buffer_size ( )
virtual

Size of buffer. Gets the size in bytes of the buffer returned by buffer().

Returns
size of buffer in bytes

Implements firevision::Camera.

Definition at line 1223 of file v4l2.cpp.

References firevision::CameraControlImage::size().

◆ capture()

void firevision::V4L2Camera::capture ( )
virtual

Capture an image. Although cameras shall operate with a continuous image flow where possible sometimes capturing an image means copying a buffer or advancing a buffer list pointer. This shall be done in this method. For a camera-using application it is mandatory to call capture() just before accessing the image buffer.

Implements firevision::Camera.

Definition at line 1161 of file v4l2.cpp.

References buffer(), close(), fawkes::Time::set_time(), firevision::CameraControlImage::size(), and fawkes::Time::stamp().

◆ capture_time()

fawkes::Time * firevision::V4L2Camera::capture_time ( )
virtual

Get the Time of the last successfully captured image.

Returns a Time representing the time when the last image was captured successfully. Note that calling this function is only valid after capture() and before dispose_buffer() has been called – it is only valid when an image is currently available.

Returns
Time of the currently processed image. The pointer shall be valid at least until the next call to dispose_buffer().
Exceptions
NotImplementedExceptionthrown if Camera does not support time stamping

Reimplemented from firevision::Camera.

Definition at line 1296 of file v4l2.cpp.

◆ close()

void firevision::V4L2Camera::close ( )
virtual

Close camera. This closes the camera device. The camera must have been stopped before calling close().

Implements firevision::Camera.

Definition at line 1030 of file v4l2.cpp.

References buffer(), firevision::CameraControlImage::size(), and stop().

Referenced by capture(), dispose_buffer(), get_one_control(), open(), set_one_control(), start(), V4L2Camera(), and ~V4L2Camera().

◆ colorspace()

colorspace_t firevision::V4L2Camera::colorspace ( )
virtual

Colorspace of returned image.

Returns
colorspace of image returned by buffer()

Implements firevision::Camera.

Definition at line 1285 of file v4l2.cpp.

◆ contrast()

unsigned int firevision::V4L2Camera::contrast ( )
virtual

Get current contrast.

Returns
current contrast value

Implements firevision::CameraControlColor.

Definition at line 1504 of file v4l2.cpp.

References get_one_control().

Referenced by set_contrast().

◆ dispose_buffer()

void firevision::V4L2Camera::dispose_buffer ( )
virtual

Dispose current buffer. Some cameras need disposal of the current buffer (for example to free space in a queue to retrieve the next image). This is done with this method. It has to be called after all work has been done on the image as desired. After dispose_buffer() has been called no further access may happen to the image buffer or undesired behavior may happen.

Implements firevision::Camera.

Definition at line 1231 of file v4l2.cpp.

References buffer(), and close().

◆ exposure()

unsigned int firevision::V4L2Camera::exposure ( )
virtual

Get current exposure

Returns
current exposure value

Implements firevision::CameraControlColor.

Definition at line 1543 of file v4l2.cpp.

References get_one_control().

Referenced by set_exposure().

◆ exposure_absolute()

unsigned int firevision::V4L2Camera::exposure_absolute ( )
virtual

Get absolute exposure time.

Returns
exposure time value

Definition at line 1364 of file v4l2.cpp.

References get_one_control().

Referenced by set_exposure_absolute().

◆ exposure_auto()

unsigned int firevision::V4L2Camera::exposure_auto ( )
virtual

Return whether auto exposure is enabled.

Returns
true if auto exposure is enabled

Implements firevision::CameraControlColor.

Reimplemented in firevision::NaoCamera.

Definition at line 1428 of file v4l2.cpp.

References get_one_control().

Referenced by set_exposure_auto().

◆ exposure_auto_priority()

bool firevision::V4L2Camera::exposure_auto_priority ( )
virtual

Get exposure_auto_priority V4L2 control.

Returns
whether auto exposure gets priority

Definition at line 1316 of file v4l2.cpp.

References get_one_control().

◆ flush()

void firevision::V4L2Camera::flush ( )
virtual

Flush image queue. Some cameras may have an image buffer queue. With this it can happen that if the processing of an image took longer than desired it is needed to flush this buffer queue.

Implements firevision::Camera.

Definition at line 1154 of file v4l2.cpp.

◆ format()

const char * firevision::V4L2Camera::format ( )
virtual

Get the image format the camera currently uses.

Check implementation documentation for details on the format.

Returns
a string describing the image format
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1569 of file v4l2.cpp.

Referenced by print_info(), and set_format().

◆ fps()

unsigned int firevision::V4L2Camera::fps ( )
virtual

Get the number of frames per second that have been requested from the camera.

A return value of 0 means that fps haven't been set yet through the camera.

Returns
the currently requested fps or 0 if not set yet

Reimplemented from firevision::CameraControlImage.

Definition at line 1634 of file v4l2.cpp.

Referenced by set_fps().

◆ gain()

unsigned int firevision::V4L2Camera::gain ( )
virtual

Get current gain.

Returns
current gain value

Implements firevision::CameraControlColor.

Definition at line 1556 of file v4l2.cpp.

References get_one_control().

Referenced by set_gain().

◆ get_one_control()

int firevision::V4L2Camera::get_one_control ( const char *  ctrl,
unsigned int  id 
)
protectedvirtual

◆ height()

unsigned int firevision::V4L2Camera::height ( )
virtual

Get the current height of the image.

Returns
height in pixels

Implements firevision::CameraControlImage.

Definition at line 1589 of file v4l2.cpp.

References pixel_height().

Referenced by set_size().

◆ horiz_mirror()

bool firevision::V4L2Camera::horiz_mirror ( )
virtual

Return whether the camera image is horizontally mirrored.

Returns
true if the image is horizontally mirrored
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1603 of file v4l2.cpp.

References get_one_control().

◆ hue()

int firevision::V4L2Camera::hue ( )
virtual

Get current hue.

Returns
current hue value

Implements firevision::CameraControlColor.

Definition at line 1530 of file v4l2.cpp.

References get_one_control().

Referenced by set_hue().

◆ lens_x_corr()

unsigned int firevision::V4L2Camera::lens_x_corr ( )
virtual

Get current lens x correction.

Returns
current lens x correction
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1647 of file v4l2.cpp.

References get_one_control().

◆ lens_y_corr()

unsigned int firevision::V4L2Camera::lens_y_corr ( )
virtual

Get current lens y correction.

Returns
current lens y correction
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1653 of file v4l2.cpp.

References get_one_control().

◆ open()

void firevision::V4L2Camera::open ( )
virtual

Open the camera. The camera is opened, but image transfer not yet started. This can be used to detect general problems with the camera while delaying the real transfer startup until it is needed.

Implements firevision::Camera.

Definition at line 415 of file v4l2.cpp.

References _device_name, close(), and stop().

◆ pixel_height()

unsigned int firevision::V4L2Camera::pixel_height ( )
virtual

Height of image in pixels.

Returns
height of image in pixels

Implements firevision::Camera.

Definition at line 1277 of file v4l2.cpp.

Referenced by height().

◆ pixel_width()

unsigned int firevision::V4L2Camera::pixel_width ( )
virtual

Width of image in pixels.

Returns
width of image in pixels

Implements firevision::Camera.

Definition at line 1269 of file v4l2.cpp.

Referenced by width().

◆ print_info()

void firevision::V4L2Camera::print_info ( )
virtual

Print out camera information. Shall print out camera information and current setup information on stdout.

Implements firevision::Camera.

Definition at line 1673 of file v4l2.cpp.

References _device_name, and format().

◆ ready()

bool firevision::V4L2Camera::ready ( )
virtual

Camera is ready for taking pictures. The camera has been opened and started correctly and may now provide images.

Returns
true, if the camera is ready, false otherwise

Implements firevision::Camera.

Definition at line 1148 of file v4l2.cpp.

◆ red_balance()

int firevision::V4L2Camera::red_balance ( )
virtual

Get current red balance.

Returns
current red balance value

Implements firevision::CameraControlColor.

Definition at line 1441 of file v4l2.cpp.

References get_one_control().

Referenced by set_red_balance().

◆ saturation()

unsigned int firevision::V4L2Camera::saturation ( )
virtual

Get current saturation.

Returns
current saturation value

Implements firevision::CameraControlColor.

Definition at line 1517 of file v4l2.cpp.

References get_one_control().

Referenced by set_saturation().

◆ set_auto_gain()

void firevision::V4L2Camera::set_auto_gain ( bool  enabled)
virtual

Enable/disable auto gain.

Parameters
enabledwhether auto gain should be enabled

Implements firevision::CameraControlColor.

Definition at line 1408 of file v4l2.cpp.

References set_one_control().

◆ set_auto_white_balance()

void firevision::V4L2Camera::set_auto_white_balance ( bool  enabled)
virtual

Enable/disable auto white balance.

Parameters
enabledwhether auto white balance should be enabled

Implements firevision::CameraControlColor.

Definition at line 1421 of file v4l2.cpp.

References set_one_control().

◆ set_blue_balance()

void firevision::V4L2Camera::set_blue_balance ( int  blue_balance)
virtual

Set blue balance.

Parameters
blue_balancenew blue balance

Implements firevision::CameraControlColor.

Definition at line 1460 of file v4l2.cpp.

References blue_balance(), and set_one_control().

◆ set_brightness()

void firevision::V4L2Camera::set_brightness ( unsigned int  brightness)
virtual

Set new brightness.

Parameters
brightnessnew brightness

Implements firevision::CameraControlColor.

Definition at line 1497 of file v4l2.cpp.

References brightness(), and set_one_control().

◆ set_contrast()

void firevision::V4L2Camera::set_contrast ( unsigned int  contrast)
virtual

Set new contrast.

Parameters
contrastnew contrast

Implements firevision::CameraControlColor.

Definition at line 1510 of file v4l2.cpp.

References contrast(), and set_one_control().

◆ set_exposure()

void firevision::V4L2Camera::set_exposure ( unsigned int  exposure)
virtual

Set new exposure.

Parameters
exposurenew exposure

Implements firevision::CameraControlColor.

Definition at line 1549 of file v4l2.cpp.

References exposure(), and set_one_control().

◆ set_exposure_absolute()

void firevision::V4L2Camera::set_exposure_absolute ( unsigned int  exposure_absolute)
virtual

set absolute exposure time (1/s)

Parameters
exposure_absolute

Definition at line 1374 of file v4l2.cpp.

References exposure_absolute(), and set_one_control().

◆ set_exposure_auto()

void firevision::V4L2Camera::set_exposure_auto ( unsigned int  enabled)
virtual

Enable/disable auto exposure.

Parameters
enabledwhether auto exposure should be enabled

Implements firevision::CameraControlColor.

Definition at line 1434 of file v4l2.cpp.

References exposure_auto(), and set_one_control().

◆ set_exposure_auto_priority()

void firevision::V4L2Camera::set_exposure_auto_priority ( bool  enabled)
virtual

Set exposure_auto_priority V4L2 control.

Parameters
enabled

Definition at line 1326 of file v4l2.cpp.

References set_one_control().

◆ set_format()

void firevision::V4L2Camera::set_format ( const char *  format)
virtual

Set the image format the camera should use.

Check implementation documentation for details on the format.

Parameters
formatthe new image format
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1575 of file v4l2.cpp.

References format().

◆ set_fps()

void firevision::V4L2Camera::set_fps ( unsigned int  fps)
virtual

Set the number of frames per second the camera tries to deliver.

Parameters
fpsthe new fps
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1640 of file v4l2.cpp.

References fps(), and set_fps().

Referenced by set_fps().

◆ set_gain()

void firevision::V4L2Camera::set_gain ( unsigned int  gain)
virtual

Set new gain.

Parameters
gainnew gain

Implements firevision::CameraControlColor.

Definition at line 1562 of file v4l2.cpp.

References gain(), and set_one_control().

◆ set_horiz_mirror()

void firevision::V4L2Camera::set_horiz_mirror ( bool  enabled)
virtual

Set whether the camera should mirror images horizontally.

Parameters
enabledif true, images should be mirrored horizontally
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1615 of file v4l2.cpp.

References set_one_control().

◆ set_hue()

void firevision::V4L2Camera::set_hue ( int  hue)
virtual

Set new hue.

Parameters
huenew hue

Implements firevision::CameraControlColor.

Definition at line 1536 of file v4l2.cpp.

References hue(), and set_one_control().

◆ set_image_number()

void firevision::V4L2Camera::set_image_number ( unsigned int  n)
virtual

Set image number to retrieve. If a camera is able to retrieve several images this method can be used to select the image to be retrieved with the next call to capture().

Parameters
nimage number to set

Implements firevision::Camera.

Definition at line 1302 of file v4l2.cpp.

◆ set_lens_x_corr()

void firevision::V4L2Camera::set_lens_x_corr ( unsigned int  x_corr)
virtual

Set lens x correction.

Parameters
x_corrnew lens x correction
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1659 of file v4l2.cpp.

References set_one_control().

◆ set_lens_y_corr()

void firevision::V4L2Camera::set_lens_y_corr ( unsigned int  y_corr)
virtual

Set lens y correction.

Parameters
y_corrnew lens y correction
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1666 of file v4l2.cpp.

References set_one_control().

◆ set_one_control()

void firevision::V4L2Camera::set_one_control ( const char *  ctrl,
unsigned int  id,
int  value 
)
protectedvirtual

◆ set_red_balance()

void firevision::V4L2Camera::set_red_balance ( int  red_balance)
virtual

Set red balance.

Parameters
red_balancenew red balance

Implements firevision::CameraControlColor.

Definition at line 1447 of file v4l2.cpp.

References red_balance(), and set_one_control().

◆ set_saturation()

void firevision::V4L2Camera::set_saturation ( unsigned int  saturation)
virtual

Set new saturation.

Parameters
saturationnew saturation

Implements firevision::CameraControlColor.

Definition at line 1523 of file v4l2.cpp.

References saturation(), and set_one_control().

◆ set_sharpness()

void firevision::V4L2Camera::set_sharpness ( unsigned int  sharpness)
virtual

Set sharpness.

Lower = blurrier picture

Parameters
sharpness

Definition at line 1395 of file v4l2.cpp.

References set_one_control(), and sharpness().

◆ set_size()

void firevision::V4L2Camera::set_size ( unsigned int  width,
unsigned int  height 
)
virtual

Set the image size the camera should use.

Parameters
widthnew width of the image
heightnew height of the image
Exceptions
Exceptionthrown for instance if size setting at run-time is not supported

Implements firevision::CameraControlImage.

Definition at line 1595 of file v4l2.cpp.

References height(), and width().

◆ set_u_balance()

void firevision::V4L2Camera::set_u_balance ( int  u_balance)
virtual

Set u balance.

Parameters
u_balancenew u balance

Implements firevision::CameraControlColor.

Definition at line 1473 of file v4l2.cpp.

◆ set_v_balance()

void firevision::V4L2Camera::set_v_balance ( int  v_balance)
virtual

Set v balance.

Parameters
v_balancenew v balance

Implements firevision::CameraControlColor.

Definition at line 1485 of file v4l2.cpp.

◆ set_vert_mirror()

void firevision::V4L2Camera::set_vert_mirror ( bool  enabled)
virtual

Set whether the camera should mirror images vertically.

Parameters
enabledif true, images should be mirrored vertically
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1623 of file v4l2.cpp.

References set_one_control().

◆ set_white_balance_temperature()

void firevision::V4L2Camera::set_white_balance_temperature ( unsigned int  white_balance_temperature)
virtual

Set white balance.

Parameters
white_balance_temperature

Definition at line 1349 of file v4l2.cpp.

References set_one_control(), and white_balance_temperature().

◆ sharpness()

unsigned int firevision::V4L2Camera::sharpness ( )
virtual

Get sharpness value.

Returns
V4L2 sharpness setting

Definition at line 1385 of file v4l2.cpp.

References get_one_control().

Referenced by set_sharpness().

◆ start()

void firevision::V4L2Camera::start ( )
virtual

Start image transfer from the camera. For many cameras opening the camera and starting transmission of images are two tasks. This method will simply initiate the transfer after the camera as been opened. And exception shall be thrown if the camera has not been opened.

Implements firevision::Camera.

Definition at line 1073 of file v4l2.cpp.

References buffer(), close(), and stop().

◆ stop()

void firevision::V4L2Camera::stop ( )
virtual

Stop image transfer from the camera. This will stop the image transfer initiated with start(). This can be used to start and stop the image transfer at will without opening and closing operations inbetween.

Implements firevision::Camera.

Definition at line 1120 of file v4l2.cpp.

Referenced by close(), open(), start(), and ~V4L2Camera().

◆ u_balance()

int firevision::V4L2Camera::u_balance ( )
virtual

Get current u balance.

Returns
current u balance value

Implements firevision::CameraControlColor.

Definition at line 1467 of file v4l2.cpp.

◆ v_balance()

int firevision::V4L2Camera::v_balance ( )
virtual

Get current v balance.

Returns
current v balance value

Implements firevision::CameraControlColor.

Definition at line 1479 of file v4l2.cpp.

◆ vert_mirror()

bool firevision::V4L2Camera::vert_mirror ( )
virtual

Return whether the camera image is vertically mirrored.

Returns
true if the image is vertically mirrored
Exceptions
NotImplementedExceptionNot implemented by this control

Reimplemented from firevision::CameraControlImage.

Definition at line 1609 of file v4l2.cpp.

References get_one_control().

◆ white_balance_temperature()

unsigned int firevision::V4L2Camera::white_balance_temperature ( )
virtual

Get absolute white balance setting.

Returns
white balance temperature

Definition at line 1339 of file v4l2.cpp.

References get_one_control().

Referenced by set_white_balance_temperature().

◆ width()

unsigned int firevision::V4L2Camera::width ( )
virtual

Get the current width of the image.

Returns
width in pixels

Implements firevision::CameraControlImage.

Definition at line 1583 of file v4l2.cpp.

References pixel_width().

Referenced by set_size().

Member Data Documentation

◆ _device_name

char* firevision::V4L2Camera::_device_name
protected

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