VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Gv::Camera Class Reference

A high-level webcam interface that hooks into the GNet event loop and acts as an Gv::ImageInputSource. More...

#include <gvcamera.h>

+ Inheritance diagram for Gv::Camera:

Public Member Functions

 Camera (Gr::ImageConverter &, const std::string &dev_name, const std::string &dev_config, bool one_shot, bool lazy_open, unsigned int lazy_open_timeout, const std::string &caption, const Gv::Timezone &caption_tz=Gv::Timezone(), const std::string &image_input_source_name=std::string())
 Constructor. More...
 
virtual ~Camera ()
 Destructor.
 
bool isOpen () const
 Returns true if the webcam device is open.
 
- Public Member Functions inherited from Gv::ImageInputSource
 ImageInputSource (Gr::ImageConverter &, const std::string &source_name=std::string())
 Constructor.
 
virtual ~ImageInputSource ()
 Destructor.
 
size_t handlers () const
 Returns the number of registered handlers.
 
void addImageInputHandler (ImageInputHandler &)
 Adds a handler for image callbacks.
 
void removeImageInputHandler (ImageInputHandler &)
 Removes a handler for image callbacks.
 
std::string name () const
 Returns the source name, as passed to the constructor.
 

Additional Inherited Members

- Protected Member Functions inherited from Gv::ImageInputSource
bool sendImageInput (Gr::Image, ImageInputHandler *one_handler_p=nullptr)
 Sends a new image to all registered handlers, or optionally to just one of them. More...
 
void sendNonImageInput (Gr::Image non_image, const std::string &type_str, ImageInputHandler *one_handler_p=nullptr)
 Sends non-image data to registered handlers (or one).
 

Detailed Description

A high-level webcam interface that hooks into the GNet event loop and acts as an Gv::ImageInputSource.

Supports lazy device opening, transparent re-opening, and slow reads.

Definition at line 50 of file gvcamera.h.

Constructor & Destructor Documentation

Gv::Camera::Camera ( Gr::ImageConverter converter,
const std::string &  dev_name,
const std::string &  dev_config,
bool  one_shot,
bool  lazy_open,
unsigned int  lazy_open_timeout,
const std::string &  caption,
const Gv::Timezone caption_tz = Gv::Timezone(),
const std::string &  image_input_source_name = std::string() 
)

Constructor.

Adds itself to the GNet event loop.

The device configuration string supports a "sleep" parameter for slow reads; while sleeping any read events are ignored. The device configuration is also passed to the Gv::Capture sub-object.

Images are received by objects implementing Gv::ImageInputHandler, and they need to register themselves by calling the base class Gv::ImageInputSource::addImageInputHandler() method.

Definition at line 28 of file gvcamera.cpp.


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