Interface for the capture devices. More...
#include <captureinterface.h>
Public Types | |
enum | INTERFACE_TYPE { HTTP, OPENCV } |
Used to define the type of source interface. | |
Public Member Functions | |
DISALLOW_COPY_AND_ASSIGN (CaptureInterface) | |
Copy and assign of the class is not allowed. | |
virtual double | getBarrelCorrection ()=0 |
Retrieves the barrel correction applied to the source. More... | |
virtual FrameCapture | getBuffered ()=0 |
Retrieves the currently buffered frame. More... | |
virtual std::string | getDescription () const =0 |
Retrieves the description of the device. More... | |
virtual int | getDeviceID () const =0 |
Returns the ID number the device was initialized with. More... | |
virtual double | getFramerate () const =0 |
Retrieves the capture device framerate. More... | |
virtual int | getMissedFrames () const =0 |
Retrieves the logged frame misses. More... | |
virtual FrameCapture | getNext (bool skip, bool *error)=0 |
Retrieves the next frame. More... | |
virtual std::string | getPath () const =0 |
Retrieves the path given during the initialization. More... | |
virtual cv::Size | getResolution () const =0 |
Retrieves the capture device resolution. More... | |
virtual int | getRetrievedFrames () const =0 |
Retrieves the total logged frames. More... | |
virtual INTERFACE_TYPE | getType () const =0 |
Retrieves the type of the device. More... | |
virtual bool | hasNew ()=0 |
Checks whether the device has a new image to retrieve or not. More... | |
virtual bool | isOpen () const =0 |
Checks whether the capturing device is open or not. More... | |
virtual bool | open (const std::string &path)=0 |
Opens the video file or the stream. More... | |
virtual void | resetStats ()=0 |
Resets the statistical counters. More... | |
virtual void | setBarrelCorrection (double amount)=0 |
Sets the amount of the barrel correction to be applied. More... | |
virtual bool | setResolution (const cv::Size &new_size)=0 |
Sets the capturing device resolution. More... | |
Interface for the capture devices.
The inherits from this class are used by the actual video frame sources. The class represents the core functionality of device image retrieval.
The key functions of this abstract class are getNext() and open().
|
pure virtual |
Retrieves the barrel correction applied to the source.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Retrieves the currently buffered frame.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Retrieves the description of the device.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Returns the ID number the device was initialized with.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Retrieves the capture device framerate.
Implemented in cavapa_gui::HTTPCapture, and cavapa_gui::OpenCVCapture.
|
pure virtual |
Retrieves the logged frame misses.
A frame miss occurs everytime when getNext() is called and the previous retrieval was still ongoing.
Implemented in cavapa_gui::HTTPCapture, and cavapa_gui::OpenCVCapture.
|
pure virtual |
Retrieves the next frame.
Basically it returns the currently buffered frame and signals the device to grab a new image for next call to the function. If the device has not returned from previous image grab the call is recorded as a missed frame.
skip | Specifies if the frame can be skipped. When set to true, this will force the main thread to wait for a new image from the device. This can result in a huge lag if the device is not capable of retrieving images fast enough. |
error | Will receive an error message if something went wrong. |
Implemented in cavapa_gui::HTTPCapture, and cavapa_gui::OpenCVCapture.
|
pure virtual |
Retrieves the path given during the initialization.
Implemented in cavapa_gui::HTTPCapture, and cavapa_gui::OpenCVCapture.
|
pure virtual |
Retrieves the capture device resolution.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Retrieves the total logged frames.
Basically, this is a counter on how many times getNext() has been called.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Retrieves the type of the device.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Checks whether the device has a new image to retrieve or not.
This checks if the FrameTime on the buffered image differs from what was retrieved on the last getNext().
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Checks whether the capturing device is open or not.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Opens the video file or the stream.
path | The path of the video file or the network stream. |
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Resets the statistical counters.
This affects the missed and total frame counters.
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Sets the amount of the barrel correction to be applied.
amount | The barrel effect. 0.0 means none. |
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.
|
pure virtual |
Sets the capturing device resolution.
new_size | The size to be set. |
Implemented in cavapa_gui::OpenCVCapture, and cavapa_gui::HTTPCapture.