The camera and video file source base class. More...
#include <source.h>
Public Member Functions | |
DISALLOW_COPY_AND_ASSIGN (Source) | |
Copy and assign of the class is not allowed. | |
virtual bool | canRecord () const =0 |
Returns information on the source recording abilities. More... | |
virtual FrameCapture | get (FrameTime passed_time)=0 |
Retrieves the next frame from the camera. More... | |
virtual double | getBarrelCorrection ()=0 |
Returns the barrel correction applied to the source frames. More... | |
virtual std::string | getDescription () const =0 |
Retrieves the description of the source. More... | |
virtual double | getFramerate () const =0 |
Retrieves the framerate. More... | |
virtual SourceID | getID () const final |
Gets the unique source ID number. More... | |
virtual cv::Size | getResolution () const =0 |
Retrieves the resolution of the source. More... | |
virtual FrameTime | getPosition () const =0 |
Retrieves the current time position of the source. More... | |
virtual SourceType | getSourceType () const |
Returns the type of the source. More... | |
virtual SourceStats | getStats ()=0 |
Retrieves the source statistical information. More... | |
virtual bool | hasNew ()=0 |
Checks whether the device has a new image to be retrieved or not. More... | |
virtual bool | isOpen () const =0 |
Checks whether the source has been initialized or not. More... | |
virtual bool | isPlaying () const =0 |
Checks whether the source is playing or not. More... | |
virtual void | play () |
Starts to play the source. More... | |
virtual bool | record (const std::string &filename, const std::string &codec="")=0 |
Starts the recording of the source to the file. More... | |
virtual void | resetStats () final |
Resets the source statistics. | |
virtual void | setBarrelCorrection (double amount)=0 |
Sets the new barrel correction value. More... | |
virtual bool | setResolution (const cv::Size &new_size)=0 |
Sets the source resolution. More... | |
virtual void | stop ()=0 |
Stops the source. More... | |
Protected Member Functions | |
Source (SourceID desired_id=UNDEFINED_SOURCE) | |
General Source creator. More... | |
Protected Attributes | |
SourceStats | statistics = EMPTY_SOURCE_STATS |
The statistics of the source. | |
The camera and video file source base class.
The base class for any kind of frame source that provides the frame updates with buffering. The inherits from the class can provide their own functionality such as recording, resolution changes and/or framerate alterations.
|
inlineprotected |
General Source creator.
desired_id | The desired ID number for the source. |
|
pure virtual |
Returns information on the source recording abilities.
Implemented in cavapa_gui::Camera, and cavapa_gui::VideoFile.
|
pure virtual |
Retrieves the next frame from the camera.
The time supplied to the function informs the source about how much time has passed since the last image retrieval. The source will depend on its internal clock, either retrieving a new image or returning the buffered image that it retrieved previously.
passed_time | The time passed since the last call (in milliseconds). |
Implemented in cavapa_gui::Camera, cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
pure virtual |
Returns the barrel correction applied to the source frames.
Implemented in cavapa_gui::Camera, cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
pure virtual |
Retrieves the description of the source.
Implemented in cavapa_gui::Camera, cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
pure virtual |
Retrieves the framerate.
Implemented in cavapa_gui::Camera, cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
inlinefinalvirtual |
Gets the unique source ID number.
|
pure virtual |
Retrieves the current time position of the source.
Implemented in cavapa_gui::Camera, and cavapa_gui::VideoFile.
|
pure virtual |
Retrieves the resolution of the source.
Implemented in cavapa_gui::Camera, cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
inlinevirtual |
Returns the type of the source.
Reimplemented in cavapa_gui::Camera, cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
pure virtual |
Retrieves the source statistical information.
Implemented in cavapa_gui::Camera, cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
pure virtual |
Checks whether the device has a new image to be retrieved or not.
This checks if the FrameTime on the buffered image differs from what was retrieved on the last get().
Implemented in cavapa_gui::Camera, cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
pure virtual |
Checks whether the source has been initialized or not.
Implemented in cavapa_gui::Camera, and cavapa_gui::VideoFile.
|
pure virtual |
Checks whether the source is playing or not.
Implemented in cavapa_gui::Camera, and cavapa_gui::VideoFile.
|
inlinevirtual |
Starts to play the source.
Depending on the source type, this might have no effect.
Reimplemented in cavapa_gui::VideoFile, and cavapa_gui::VideoFileSet.
|
pure virtual |
Starts the recording of the source to the file.
This can also be used to start an entirely new video file during the recording. The recording file will change immediately.
filename | The path of the recording file. |
codec | The codec to be used for recording. |
Implemented in cavapa_gui::Camera, and cavapa_gui::VideoFile.
|
pure virtual |
Sets the new barrel correction value.
The value is used to correct barrel effect (lens correction) on each image that the source will return.
amount | The barrel value. |
Implemented in cavapa_gui::VideoFile, cavapa_gui::Camera, and cavapa_gui::VideoFileSet.
|
pure virtual |
Sets the source resolution.
new_size | The new resolution for the source. |
Implemented in cavapa_gui::VideoFile, and cavapa_gui::Camera.
|
pure virtual |
Stops the source.
Depending on the source type this will have a different effect.
Implemented in cavapa_gui::VideoFile, cavapa_gui::Camera, and cavapa_gui::VideoFileSet.