#include <colourspacebuffer.h>
In general, the kernel video buffers such as dvbuffer and v4l1buffer give access to what the device can provide natively. However, the native formats may not be what is required. This buffer transparently converts incoming frames to the required type.
Not every possible conversion is available natively through the library, some conversions have to be performed in several steps. For instance, to convert yuv411 to Rgb<float>
, the conversion must go via Rgb<byte>
since the conversions from yuv411 are limited.
Provides frames of type CVD::ColourspaceFrame.
This class throws only generic VideoBuffer exceptions, but the underlying videobuffer may throw.
From | The pixel type of the original VideoBuffer | |
T | The pixel type to convert in to. |
Definition at line 52 of file colourspacebuffer.h.
Public Member Functions | |
ColourspaceBuffer (CVD::VideoBuffer< From > &buf) | |
ImageRef | size () |
virtual bool | frame_pending () |
virtual void | seek_to (double t) |
virtual double | frame_rate () |
virtual CVD::ColourspaceFrame < T > * | get_frame () |
virtual void | put_frame (CVD::VideoFrame< T > *f) |
CVD::ColourspaceBuffer< T, From >::ColourspaceBuffer | ( | CVD::VideoBuffer< From > & | buf | ) | [inline] |
Construct a ColourspaceBuffer by wrapping it around another VideoBuffer.
buf | The buffer that will provide the raw frames |
Definition at line 57 of file colourspacebuffer.h.
ImageRef CVD::ColourspaceBuffer< T, From >::size | ( | ) | [inline, virtual] |
The size of the VideoFrames returns by this buffer.
Implements CVD::LocalVideoBuffer< T >.
Definition at line 63 of file colourspacebuffer.h.
virtual bool CVD::ColourspaceBuffer< T, From >::frame_pending | ( | ) | [inline, virtual] |
Is there a frame waiting in the buffer? This function does not block.
See is_live and is_flushable.
Implements CVD::LocalVideoBuffer< T >.
Definition at line 68 of file colourspacebuffer.h.
References CVD::VideoBuffer< T >::frame_pending().
virtual void CVD::ColourspaceBuffer< T, From >::seek_to | ( | double | ) | [inline, virtual] |
Go to a particular point in the video buffer (only implemented in buffers of recorded video).
t | The frame time in seconds |
Reimplemented from CVD::LocalVideoBuffer< T >.
Definition at line 73 of file colourspacebuffer.h.
References CVD::VideoBuffer< T >::seek_to().
virtual double CVD::ColourspaceBuffer< T, From >::frame_rate | ( | ) | [inline, virtual] |
What is the (expected) frame rate of this video buffer, in frames per second?
Implements CVD::VideoBuffer< T >.
Definition at line 78 of file colourspacebuffer.h.
References CVD::VideoBuffer< T >::frame_rate().
virtual CVD::ColourspaceFrame<T>* CVD::ColourspaceBuffer< T, From >::get_frame | ( | ) | [inline, virtual] |
Returns the next frame from the buffer. This function blocks until a frame is ready.
Implements CVD::LocalVideoBuffer< T >.
Definition at line 83 of file colourspacebuffer.h.
References CVD::VideoBuffer< T >::get_frame(), and CVD::VideoBuffer< T >::put_frame().
virtual void CVD::ColourspaceBuffer< T, From >::put_frame | ( | CVD::VideoFrame< T > * | f | ) | [inline, virtual] |
Tell the buffer that you are finished with this frame.
Typically the VideoBuffer then destroys the frame.
f | The frame that you are finished with. |
Implements CVD::LocalVideoBuffer< T >.
Definition at line 95 of file colourspacebuffer.h.