VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Gv::ImageInputSource Class Referenceabstract

A base class for distributing incoming images to multiple client objects, supporting some simple image type conversions. More...

#include <gvimageinput.h>

+ Inheritance diagram for Gv::ImageInputSource:

Public Member Functions

 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.
 
virtual void resend (ImageInputHandler &)=0
 Asks the source to resend asynchronously the lastest available image, if any, to the specified handler, even if it is old or seen before. More...
 

Protected Member Functions

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 base class for distributing incoming images to multiple client objects, supporting some simple image type conversions.

Derived classes emit images by calling sendImageInput(). Client objects register an interest by calling addImageInputHandler(), and they implement imageInputConversion() to indicate the image format they require.

Definition at line 116 of file gvimageinput.h.

Member Function Documentation

virtual void Gv::ImageInputSource::resend ( ImageInputHandler )
pure virtual

Asks the source to resend asynchronously the lastest available image, if any, to the specified handler, even if it is old or seen before.

Some overrides may always do nothing, and others may do nothing only if no data is available.

bool Gv::ImageInputSource::sendImageInput ( Gr::Image  image_in,
ImageInputHandler one_handler_p = nullptr 
)
protected

Sends a new image to all registered handlers, or optionally to just one of them.

Returns false if there were any image conversion errors.

Definition at line 100 of file gvimageinput.cpp.


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