Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Member Functions
pcl::io::AverageBuffer< T > Class Template Reference

A buffer that computes running window average of the data inserted. More...

#include <pcl/io/buffers.h>

+ Inheritance diagram for pcl::io::AverageBuffer< T >:

Public Member Functions

 AverageBuffer (size_t size, unsigned char window_size)
 Construct a buffer of given size with given running window size. More...
 
virtual ~AverageBuffer ()
 
virtual T operator[] (size_t idx) const
 Access an element at a given index. More...
 
virtual void push (std::vector< T > &data)
 Insert a new chunk of data into the buffer. More...
 
- Public Member Functions inherited from pcl::io::Buffer< T >
virtual ~Buffer ()
 
size_t size () const
 Get the size of the buffer. More...
 

Additional Inherited Members

- Public Types inherited from pcl::io::Buffer< T >
typedef T value_type
 
- Protected Member Functions inherited from pcl::io::Buffer< T >
 Buffer (size_t size)
 
- Protected Attributes inherited from pcl::io::Buffer< T >
const size_t size_
 

Detailed Description

template<typename T>
class pcl::io::AverageBuffer< T >

A buffer that computes running window average of the data inserted.

The buffer and window sizes are specified at construction time. The buffer size defines the number of elements in each data chunk that is inserted in the buffer. The window size is the number of last data chunks that are considered for average computation. The average is computed separately for 1st, 2nd, etc. element in data chunks.

The data can contain invalid elements. For integral types zeros are assumed to be invalid elements, whereas for floating-point types it is quiet NaN. Invalid elements are ignored when computing average.

The buffer is thread-safe.

Definition at line 223 of file buffers.h.

Constructor & Destructor Documentation

template<typename T >
pcl::io::AverageBuffer< T >::AverageBuffer ( size_t  size,
unsigned char  window_size 
)

Construct a buffer of given size with given running window size.

Parameters
[in]sizebuffer size
[in]window_sizerunning window size over which the median value should be computed (0..255)

Definition at line 225 of file buffers.hpp.

References pcl::io::Buffer< T >::size_.

template<typename T >
pcl::io::AverageBuffer< T >::~AverageBuffer ( )
virtual

Definition at line 243 of file buffers.hpp.

Member Function Documentation

template<typename T >
T pcl::io::AverageBuffer< T >::operator[] ( size_t  idx) const
virtual

Access an element at a given index.

This operation is constant time.

Implements pcl::io::Buffer< T >.

Definition at line 248 of file buffers.hpp.

References pcl::io::Buffer< T >::size_.

template<typename T >
void pcl::io::AverageBuffer< T >::push ( std::vector< T > &  data)
virtual

Insert a new chunk of data into the buffer.

This operation is linear in buffer size.

Parameters
[in]datainput data chunk, the memory will be "stolen"

Implements pcl::io::Buffer< T >.

Definition at line 258 of file buffers.hpp.

References buffer_traits< T >::is_invalid(), and pcl::io::Buffer< T >::size_.


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