GIFT-Grab  1708
Copyright (c) 2015-7, University College London (UCL)
IVideoSource Class Referenceabstract

This abstract class defines the interface that every video source must implement. More...

#include <ivideosource.h>

Inheritance diagram for IVideoSource:
gg::IObservable

Public Member Functions

virtual ~IVideoSource ()
 Destructor, doing nothing. More...
 
virtual gg::ColourSpace get_colour ()
 Get colour space in which this source is operating. More...
 
virtual bool get_frame_dimensions (int &width, int &height)=0
 Get frame dimensions. More...
 
virtual bool get_frame (gg::VideoFrame &frame)=0
 Grab next available frame. More...
 
virtual double get_frame_rate ()=0
 Get frame rate of used source. More...
 
virtual void set_sub_frame (int x, int y, int width, int height)=0
 Set a ROI within each grabbed frame. More...
 
virtual void get_full_frame ()
 Reset sub-framing, i.e. return full frames instead of only ROI. More...
 
void set_number_of_frames_to_burn (unsigned int burn_num)
 Set number of frames to discard after starting streaming (i.e. one-off, until streaming becomes stable). This is a device-specific setting. More...
 
unsigned int get_number_of_frames_to_burn ()
 
- Public Member Functions inherited from gg::IObservable
virtual ~IObservable ()
 
virtual void attach (IObserver &observer)
 Attach given observer to this observable. If observer already attached, no action is taken, no action is taken. More...
 
virtual void detach (IObserver &observer)
 Detach given observer from this observable. More...
 
virtual void notify (VideoFrame &frame) noexcept
 Notify all attached observers of new data. More...
 

Protected Member Functions

 IVideoSource ()
 Default constructor that resets sub-framing and also _num_burn_frames. More...
 
 IVideoSource (gg::ColourSpace colour)
 Constructor setting colour space. More...
 
 DISALLOW_COPY_AND_ASSIGNMENT (IVideoSource)
 
- Protected Member Functions inherited from gg::IObservable
bool attached (const IObserver &observer) const noexcept
 Check whether passed observer is already attached. Because this function is protected, no thread-safety operation is performed inside it. More...
 

Protected Attributes

gg::ColourSpace _colour
 Indicates the colour space in which this source is operating. More...
 
bool _get_sub_frame
 If false, then grab full frames, otherwise a specific ROI within grabbed frames. More...
 
unsigned int _num_burn_frames
 Number of frames to discard after starting streaming. More...
 
- Protected Attributes inherited from gg::IObservable
std::vector< IObserver *> _observers
 
std::mutex _observers_lock
 

Detailed Description

This abstract class defines the interface that every video source must implement.

This enables the underlying algorithms to be agnostic of the data sources.

Constructor & Destructor Documentation

§ ~IVideoSource()

virtual IVideoSource::~IVideoSource ( )
inlinevirtual

Destructor, doing nothing.

§ IVideoSource() [1/2]

IVideoSource::IVideoSource ( )
inlineprotected

Default constructor that resets sub-framing and also _num_burn_frames.

§ IVideoSource() [2/2]

IVideoSource::IVideoSource ( gg::ColourSpace  colour)
inlineprotected

Constructor setting colour space.

Parameters
colour
See also
default constructor

Member Function Documentation

§ DISALLOW_COPY_AND_ASSIGNMENT()

IVideoSource::DISALLOW_COPY_AND_ASSIGNMENT ( IVideoSource  )
protected

§ get_colour()

virtual gg::ColourSpace IVideoSource::get_colour ( )
inlinevirtual

Get colour space in which this source is operating.

Returns

§ get_frame()

virtual bool IVideoSource::get_frame ( gg::VideoFrame frame)
pure virtual

Grab next available frame.

Parameters
framethe caller is responsible for making sure the colour space of frame matches that of this object
Returns
false if the colour space of frame mismatches that of this object OR if there is a problem with the acquisition, true otherwise

§ get_frame_dimensions()

virtual bool IVideoSource::get_frame_dimensions ( int &  width,
int &  height 
)
pure virtual

Get frame dimensions.

Attention
In Python: This function is not available yet.
Parameters
width
height
Returns
whether querying frame dimensions has succeeded

§ get_frame_rate()

virtual double IVideoSource::get_frame_rate ( )
pure virtual

Get frame rate of used source.

Returns

§ get_full_frame()

virtual void IVideoSource::get_full_frame ( )
inlinevirtual

Reset sub-framing, i.e. return full frames instead of only ROI.

See also
set_sub_frame

§ get_number_of_frames_to_burn()

unsigned int IVideoSource::get_number_of_frames_to_burn ( )
inline

§ set_number_of_frames_to_burn()

void IVideoSource::set_number_of_frames_to_burn ( unsigned int  burn_num)
inline

Set number of frames to discard after starting streaming (i.e. one-off, until streaming becomes stable). This is a device-specific setting.

Parameters
burn_num

§ set_sub_frame()

virtual void IVideoSource::set_sub_frame ( int  x,
int  y,
int  width,
int  height 
)
pure virtual

Set a ROI within each grabbed frame.

Parameters
xupper left corner
yupper left corner
widthfrom x onwards
heightfrom y onwards
See also
get_full_frame

Member Data Documentation

§ _colour

gg::ColourSpace IVideoSource::_colour
protected

Indicates the colour space in which this source is operating.

§ _get_sub_frame

bool IVideoSource::_get_sub_frame
protected

If false, then grab full frames, otherwise a specific ROI within grabbed frames.

See also
get_full_frame
set_sub_frame

§ _num_burn_frames

unsigned int IVideoSource::_num_burn_frames
protected

Number of frames to discard after starting streaming.


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