libcvd
Public Member Functions | List of all members
CVD::ColourspaceBuffer< T, From > Class Template Reference

A decorator class which wraps a VideoBuffer to perfrom colourspace conversion on the incoming data. More...

#include <colourspacebuffer.h>

Inheritance diagram for CVD::ColourspaceBuffer< T, From >:
Inheritance graph
[legend]
Collaboration diagram for CVD::ColourspaceBuffer< T, From >:
Collaboration graph
[legend]

Public Member Functions

 ColourspaceBuffer (CVD::VideoBuffer< From > &buf)
 Construct a ColourspaceBuffer by wrapping it around another VideoBuffer. More...
 
virtual RawVideoBuffersource_buffer ()
 Which video grabber provides the source images for this video grabber. More...
 
ImageRef size ()
 The size of the VideoFrames returns by this buffer.
 
virtual bool frame_pending ()
 Is there a frame waiting in the buffer? This function does not block. More...
 
virtual void seek_to (double t)
 Go to a particular point in the video buffer (only implemented in buffers of recorded video) More...
 
virtual double frame_rate ()
 What is the (expected) frame rate of this video buffer, in frames per second?
 
virtual CVD::ColourspaceFrame< T > * get_frame ()
 Returns the next frame from the buffer. This function blocks until a frame is ready.
 
virtual void put_frame (CVD::VideoFrame< T > *f)
 Tell the buffer that you are finished with this frame. More...
 
- Public Member Functions inherited from CVD::LocalVideoBuffer< T >
 LocalVideoBuffer (typename VideoBufferType::Type t)
 
- Public Member Functions inherited from CVD::VideoBuffer< T >
 VideoBuffer (VideoBufferType::Type _type)
 Construct the buffer with the known semantics.
 
virtual void flush ()
 Flush all old frames out of the video buffer, on a flushable buffer, causing the next get_frame() to sleep until a frame arrives. More...
 
VideoBufferType::Type type ()
 Returns the type of the video stream. More...
 
- Public Member Functions inherited from CVD::RawVideoBuffer
RawVideoBufferroot_buffer ()
 Follow the chain of video grabbers back as far as at will go. More...
 

Detailed Description

template<class T, class From>
class CVD::ColourspaceBuffer< T, From >

A decorator class which wraps a VideoBuffer to perfrom colourspace conversion on the incoming data.

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.

Parameters
FromThe pixel type of the original VideoBuffer
TThe pixel type to convert in to.

Constructor & Destructor Documentation

◆ ColourspaceBuffer()

template<class T , class From >
CVD::ColourspaceBuffer< T, From >::ColourspaceBuffer ( CVD::VideoBuffer< From > &  buf)
inline

Construct a ColourspaceBuffer by wrapping it around another VideoBuffer.

Parameters
bufThe buffer that will provide the raw frames

Member Function Documentation

◆ frame_pending()

template<class T , class From >
virtual bool CVD::ColourspaceBuffer< T, From >::frame_pending ( )
inlinevirtual

Is there a frame waiting in the buffer? This function does not block.

See is_live and is_flushable.

Implements CVD::LocalVideoBuffer< T >.

◆ put_frame()

template<class T , class From >
virtual void CVD::ColourspaceBuffer< T, From >::put_frame ( CVD::VideoFrame< T > *  f)
inlinevirtual

Tell the buffer that you are finished with this frame.

Typically the VideoBuffer then destroys the frame.

Parameters
fThe frame that you are finished with.

Implements CVD::LocalVideoBuffer< T >.

◆ seek_to()

template<class T , class From >
virtual void CVD::ColourspaceBuffer< T, From >::seek_to ( double  )
inlinevirtual

Go to a particular point in the video buffer (only implemented in buffers of recorded video)

Parameters
tThe frame time in seconds

Reimplemented from CVD::LocalVideoBuffer< T >.

◆ source_buffer()

template<class T , class From >
virtual RawVideoBuffer* CVD::ColourspaceBuffer< T, From >::source_buffer ( )
inlinevirtual

Which video grabber provides the source images for this video grabber.

Reimplemented from CVD::RawVideoBuffer.


The documentation for this class was generated from the following file: