CVD::DeinterlaceBuffer< T > Class Template Reference
[Video buffers]

#include <deinterlacebuffer.h>

Inheritance diagram for CVD::DeinterlaceBuffer< T >:

CVD::VideoBuffer< T >

List of all members.


Detailed Description

template<typename T>
class CVD::DeinterlaceBuffer< T >

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

Parameters:
T The pixel type of the original VideoBuffer

Definition at line 77 of file deinterlacebuffer.h.


Public Types

enum  Fields { OddOnly, EvenOnly, OddEven, EvenOdd }

Public Member Functions

 DeinterlaceBuffer (CVD::VideoBuffer< T > &buf, Fields fields=OddEven)
ImageRef size ()
CVD::VideoFrame< T > * get_frame ()
void put_frame (CVD::VideoFrame< T > *f)
virtual bool frame_pending ()
virtual void seek_to (double t)
virtual double frame_rate ()

Member Enumeration Documentation

template<typename T>
enum CVD::DeinterlaceBuffer::Fields

Used to select which fields, and in which order, to extract from the frame.

Enumerator:
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 81 of file deinterlacebuffer.h.


Constructor & Destructor Documentation

template<typename T>
CVD::DeinterlaceBuffer< T >::DeinterlaceBuffer ( CVD::VideoBuffer< T > &  buf,
Fields  fields = OddEven 
) [inline]

Construct a DeinterlaceBuffer by wrapping it around another VideoBuffer.

Parameters:
buf The buffer that will provide the raw frames
fields The fields to

Definition at line 132 of file deinterlacebuffer.h.

References CVD::ImageRef::x.


Member Function Documentation

template<typename T>
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::VideoBuffer< T >.

Definition at line 209 of file deinterlacebuffer.h.

References CVD::ImageRef::x, and CVD::ImageRef::y.

template<typename T>
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 150 of file deinterlacebuffer.h.

References CVD::SubImage< T >::data(), CVD::DeinterlaceBuffer< T >::EvenOdd, CVD::DeinterlaceBuffer< T >::frame_rate(), CVD::DeinterlaceBuffer< T >::OddEven, CVD::DeinterlaceBuffer< T >::OddOnly, CVD::DeinterlaceFrame< T >::real_frame, CVD::ImageRef::x, and CVD::ImageRef::y.

template<typename T>
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.

Parameters:
f The frame that you are finished with.

Implements CVD::VideoBuffer< T >.

Definition at line 219 of file deinterlacebuffer.h.

References CVD::SubImage< T >::data().

template<typename T>
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::VideoBuffer< T >.

Definition at line 102 of file deinterlacebuffer.h.

template<typename T>
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).

Parameters:
t The frame time in seconds

Reimplemented from CVD::VideoBuffer< T >.

Definition at line 105 of file deinterlacebuffer.h.

template<typename T>
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::VideoBuffer< T >.

Definition at line 111 of file deinterlacebuffer.h.

References CVD::DeinterlaceBuffer< T >::EvenOnly, and CVD::DeinterlaceBuffer< T >::OddOnly.

Referenced by CVD::DeinterlaceBuffer< T >::get_frame().


The documentation for this class was generated from the following file:
Generated on Wed Feb 18 10:23:06 2009 for CVD by  doxygen 1.5.3