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

#include <deinterlacebuffer.h>

Inheritance diagram for CVD::DeinterlaceBuffer< T >:
Inheritance graph
[legend]

List of all members.

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

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 75 of file deinterlacebuffer.h.


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 79 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 130 of file deinterlacebuffer.h.


Member Function Documentation

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::RawVideoBuffer.

Definition at line 100 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::RawVideoBuffer.

Definition at line 109 of file deinterlacebuffer.h.

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 148 of file deinterlacebuffer.h.

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 217 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::RawVideoBuffer.

Definition at line 103 of file deinterlacebuffer.h.

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::RawVideoBuffer.

Definition at line 207 of file deinterlacebuffer.h.


Member Data Documentation

template<typename T >
Fields CVD::DeinterlaceBuffer< T >::m_fields [private]

Definition at line 120 of file deinterlacebuffer.h.

template<typename T >
unsigned int CVD::DeinterlaceBuffer< T >::m_linebytes [private]

Definition at line 123 of file deinterlacebuffer.h.

template<typename T >
bool CVD::DeinterlaceBuffer< T >::m_loadnewframe [private]

Definition at line 121 of file deinterlacebuffer.h.

template<typename T >
ImageRef CVD::DeinterlaceBuffer< T >::m_size [private]

Definition at line 122 of file deinterlacebuffer.h.

template<typename T >
CVD::VideoBuffer<T>& CVD::DeinterlaceBuffer< T >::m_vidbuf [private]

Definition at line 119 of file deinterlacebuffer.h.

template<typename T >
CVD::VideoFrame<T>* CVD::DeinterlaceBuffer< T >::my_realframe [private]

Definition at line 118 of file deinterlacebuffer.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


libcvd
Author(s): Edward Rosten, Paul Smith, Tom Drummond, Gerhard Reitmayr, Ethan Eade, Timothy Gan, Chris Kemp, Georg Klein
autogenerated on Fri Jan 11 09:13:51 2013