#include <deinterlacebuffer.h>
Public Types | |
enum | Fields { OddOnly, EvenOnly, OddEven, EvenOdd } |
Used to select which fields, and in which order, to extract from the frame. More... | |
Public Member Functions | |
DeinterlaceBuffer (CVD::VideoBuffer< T > &buf, Fields fields=OddEven) | |
virtual bool | frame_pending () |
virtual double | frame_rate () |
CVD::VideoFrame< T > * | get_frame () |
Returns the next frame from the buffer. This function blocks until a frame is ready. | |
void | put_frame (CVD::VideoFrame< T > *f) |
virtual void | seek_to (double t) |
ImageRef | size () |
Private Attributes | |
Fields | m_fields |
unsigned int | m_linebytes |
bool | m_loadnewframe |
ImageRef | m_size |
CVD::VideoBuffer< T > & | m_vidbuf |
CVD::VideoFrame< T > * | my_realframe |
A decorator class which wraps a VideoBuffer to return fields instead of the original frames (see also DeinterlaceFrame). The majority of commands are passed straight through to the buffer that this class wraps, but get_frame() is overloaded to extract fields from the video frames.
Video intended for television use (i.e. from non-progressive scan cameras) tends to be interlaced. Instead of grabbing the entire frame at one time instant, the image is grabbed in two parts (fields), made up of the odd-numbered lines and the even-numbered lines respectively (thus giving an effective field-rate of twice the video frame-rate. Any fast motion in frame will therefore exhibit serrated distortion, with alternate lines out of step.
This class returns individual fields from the video, which are guaranteed to represent a single time instant. The VideoFrames returned from this buffer are therefore half the height of the original image, and so you might want to double the y-scale before displaying.
Provides frames of type CVD::DeinterlaceFrame and throws exceptions of type CVD::Exceptions::DeinterlaceBuffer
T | The pixel type of the original VideoBuffer |
Definition at line 75 of file deinterlacebuffer.h.
enum CVD::DeinterlaceBuffer::Fields |
Used to select which fields, and in which order, to extract from the frame.
OddOnly |
Odd fields only. |
EvenOnly |
Even fields only. |
OddEven |
Both fields, presenting the odd lines from each frame first. |
EvenOdd |
Both fields, presenting the even lines from each frame first. |
Definition at line 79 of file deinterlacebuffer.h.
CVD::DeinterlaceBuffer< T >::DeinterlaceBuffer | ( | CVD::VideoBuffer< T > & | buf, | |
Fields | fields = OddEven | |||
) | [inline] |
Construct a DeinterlaceBuffer by wrapping it around another VideoBuffer
buf | The buffer that will provide the raw frames | |
fields | The fields to |
Definition at line 130 of file deinterlacebuffer.h.
virtual bool CVD::DeinterlaceBuffer< T >::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::RawVideoBuffer.
Definition at line 100 of file deinterlacebuffer.h.
virtual double CVD::DeinterlaceBuffer< T >::frame_rate | ( | ) | [inline, virtual] |
What is the (expected) frame rate of this video buffer, in frames per second? If OddEven or EvenOdd are selected, this will be reported as twice the original buffer's rate.
Implements CVD::RawVideoBuffer.
Definition at line 109 of file deinterlacebuffer.h.
VideoFrame< T > * CVD::DeinterlaceBuffer< T >::get_frame | ( | ) | [inline, virtual] |
Returns the next frame from the buffer. This function blocks until a frame is ready.
Implements CVD::VideoBuffer< T >.
Definition at line 148 of file deinterlacebuffer.h.
void CVD::DeinterlaceBuffer< T >::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::VideoBuffer< T >.
Definition at line 217 of file deinterlacebuffer.h.
virtual void CVD::DeinterlaceBuffer< T >::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::RawVideoBuffer.
Definition at line 103 of file deinterlacebuffer.h.
ImageRef CVD::DeinterlaceBuffer< T >::size | ( | ) | [inline, virtual] |
The size of the VideoFrames returns by this buffer. This will be half the height of the original frames.
Implements CVD::RawVideoBuffer.
Definition at line 207 of file deinterlacebuffer.h.
Fields CVD::DeinterlaceBuffer< T >::m_fields [private] |
Definition at line 120 of file deinterlacebuffer.h.
unsigned int CVD::DeinterlaceBuffer< T >::m_linebytes [private] |
Definition at line 123 of file deinterlacebuffer.h.
bool CVD::DeinterlaceBuffer< T >::m_loadnewframe [private] |
Definition at line 121 of file deinterlacebuffer.h.
ImageRef CVD::DeinterlaceBuffer< T >::m_size [private] |
Definition at line 122 of file deinterlacebuffer.h.
CVD::VideoBuffer<T>& CVD::DeinterlaceBuffer< T >::m_vidbuf [private] |
Definition at line 119 of file deinterlacebuffer.h.
CVD::VideoFrame<T>* CVD::DeinterlaceBuffer< T >::my_realframe [private] |
Definition at line 118 of file deinterlacebuffer.h.