NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeRe::Filter Class Referenceabstract

This is an abstract base class for any type of a data filter. Requires some methods to be implemented by its child classes. More...

#include <filtering.hpp>

Inheritance diagram for NumeRe::Filter:
Collaboration diagram for NumeRe::Filter:

Public Member Functions

 Filter (size_t row, size_t col)
 Filter base constructor. Will set the used window sizes. More...
 
virtual ~Filter ()
 Empty virtual abstract destructor. More...
 
virtual double operator() (size_t i, size_t j) const =0
 Virtual operator() override. Has to be implemented in the child classes and shall return the kernel value at position (i,j). More...
 
virtual mu::value_type apply (size_t i, size_t j, const mu::value_type &val) const =0
 Virtual method for applying the filter to a distinct value. Has to be implemented in all child classes. More...
 
bool isConvolution () const
 This method returns, whether the current filter is a convolution, ie. whether the returned value may be used directly or if all values of a window have to be accumulated first. More...
 
FilterSettings::FilterType getType () const
 This method returns the type of the current filter as a value of the FilterType enumeration. More...
 
std::pair< size_t, size_t > getWindowSize () const
 This method returns the window size of the current filter as a std::pair in the order (row,col). More...
 
FilterBuffer & getBuffer ()
 This method returns the internal filtering buffer queue to store already smoothed points avoiding leakage effects. More...
 
FilterBuffer2D & get2DBuffer ()
 This method returns the internal filtering buffer queue for 2D data to store already smoothed points avoiding leakage effects. More...
 

Protected Attributes

FilterSettings::FilterType m_type
 
std::pair< size_t, size_t > m_windowSize
 
bool m_isConvolution
 
FilterBuffer m_buffer
 
FilterBuffer2D m_buffer2D
 

Detailed Description

This is an abstract base class for any type of a data filter. Requires some methods to be implemented by its child classes.

Definition at line 116 of file filtering.hpp.

Constructor & Destructor Documentation

◆ Filter()

NumeRe::Filter::Filter ( size_t  row,
size_t  col 
)
inline

Filter base constructor. Will set the used window sizes.

Parameters
rowsize_t
colsize_t

Definition at line 134 of file filtering.hpp.

References m_windowSize, and max.

◆ ~Filter()

virtual NumeRe::Filter::~Filter ( )
inlinevirtual

Empty virtual abstract destructor.

Definition at line 144 of file filtering.hpp.

Member Function Documentation

◆ apply()

virtual mu::value_type NumeRe::Filter::apply ( size_t  i,
size_t  j,
const mu::value_type &  val 
) const
pure virtual

Virtual method for applying the filter to a distinct value. Has to be implemented in all child classes.

Parameters
isize_t
jsize_t
valconst mu::value_type&
Returns
mu::value_type

Implemented in NumeRe::WeightedLinearFilter, NumeRe::GaussianFilter, NumeRe::SavitzkyGolayFilter, NumeRe::SavitzkyGolayDiffFilter, and NumeRe::RetouchRegion.

Referenced by Memory::smoothingWindow1D(), and Memory::smoothingWindow2D().

◆ get2DBuffer()

FilterBuffer2D & NumeRe::Filter::get2DBuffer ( )
inline

This method returns the internal filtering buffer queue for 2D data to store already smoothed points avoiding leakage effects.

Returns
FilterBuffer2D&

Definition at line 234 of file filtering.hpp.

References m_buffer2D.

Referenced by Memory::smoothingWindow2D().

◆ getBuffer()

FilterBuffer & NumeRe::Filter::getBuffer ( )
inline

This method returns the internal filtering buffer queue to store already smoothed points avoiding leakage effects.

Returns
FilterBuffer&

Definition at line 220 of file filtering.hpp.

References m_buffer.

Referenced by Memory::smoothingWindow1D().

◆ getType()

FilterSettings::FilterType NumeRe::Filter::getType ( ) const
inline

This method returns the type of the current filter as a value of the FilterType enumeration.

Returns
FilterType

Definition at line 194 of file filtering.hpp.

References m_type.

◆ getWindowSize()

std::pair< size_t, size_t > NumeRe::Filter::getWindowSize ( ) const
inline

This method returns the window size of the current filter as a std::pair in the order (row,col).

Returns
std::pair<size_t,size_t>

Definition at line 207 of file filtering.hpp.

References m_windowSize.

Referenced by Memory::smoothingWindow1D(), and Memory::smoothingWindow2D().

◆ isConvolution()

bool NumeRe::Filter::isConvolution ( ) const
inline

This method returns, whether the current filter is a convolution, ie. whether the returned value may be used directly or if all values of a window have to be accumulated first.

Returns
bool

Definition at line 181 of file filtering.hpp.

References m_isConvolution.

Referenced by Memory::smoothingWindow1D(), and Memory::smoothingWindow2D().

◆ operator()()

virtual double NumeRe::Filter::operator() ( size_t  i,
size_t  j 
) const
pure virtual

Virtual operator() override. Has to be implemented in the child classes and shall return the kernel value at position (i,j).

Parameters
isize_t
jsize_t
Returns
double

Implemented in NumeRe::WeightedLinearFilter, NumeRe::GaussianFilter, NumeRe::SavitzkyGolayFilter, NumeRe::SavitzkyGolayDiffFilter, and NumeRe::RetouchRegion.

Member Data Documentation

◆ m_buffer

FilterBuffer NumeRe::Filter::m_buffer
protected

Definition at line 122 of file filtering.hpp.

Referenced by getBuffer().

◆ m_buffer2D

FilterBuffer2D NumeRe::Filter::m_buffer2D
protected

Definition at line 123 of file filtering.hpp.

Referenced by get2DBuffer().

◆ m_isConvolution

◆ m_type

◆ m_windowSize


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