Field3D
MitchellFilter Struct Reference

#include <Resample.h>

Inheritance diagram for MitchellFilter:
Filter

Public Types

typedef boost::shared_ptr< const MitchellFilterCPtr
 
typedef boost::shared_ptr< MitchellFilterPtr
 
- Public Types inherited from Filter
typedef boost::shared_ptr< const FilterCPtr
 
typedef boost::shared_ptr< FilterPtr
 

Public Member Functions

virtual float eval (const float x) const
 Evaluates the filter at coordinate 't'. More...
 
 MitchellFilter (const float width=1.0, const float B=1.0/3.0, const float C=1.0/3.0)
 
virtual float support () const
 Radial width of the filter (half of diameter) More...
 

Private Attributes

const float m_B
 
const float m_C
 
const float m_width
 

Detailed Description

Definition at line 203 of file Resample.h.

Member Typedef Documentation

typedef boost::shared_ptr<MitchellFilter> MitchellFilter::Ptr

Definition at line 206 of file Resample.h.

typedef boost::shared_ptr<const MitchellFilter> MitchellFilter::CPtr

Definition at line 207 of file Resample.h.

Constructor & Destructor Documentation

MitchellFilter::MitchellFilter ( const float  width = 1.0,
const float  B = 1.0 / 3.0,
const float  C = 1.0 / 3.0 
)
inline

Definition at line 209 of file Resample.h.

211  : m_B(B), m_C(C), m_width(width)
212  { /* Empty */ }
const float m_B
Definition: Resample.h:233
const float m_C
Definition: Resample.h:233
const float m_width
Definition: Resample.h:234

Member Function Documentation

virtual float MitchellFilter::eval ( const float  t) const
inlinevirtual

Evaluates the filter at coordinate 't'.

Implements Filter.

Definition at line 214 of file Resample.h.

215  {
216  const float ax = std::abs(x / m_width);
217  if (ax < 1) {
218  return ((12 - 9 * m_B - 6 * m_C) * ax * ax * ax +
219  (-18 + 12 * m_B + 6 * m_C) * ax * ax + (6 - 2 * m_B)) / 6;
220  } else if ((ax >= 1) && (ax < 2)) {
221  return ((-m_B - 6 * m_C) * ax * ax * ax +
222  (6 * m_B + 30 * m_C) * ax * ax + (-12 * m_B - 48 * m_C) *
223  ax + (8 * m_B + 24 * m_C)) / 6;
224  } else {
225  return 0;
226  }
227  }
const float m_B
Definition: Resample.h:233
const float m_C
Definition: Resample.h:233
const float m_width
Definition: Resample.h:234
virtual float MitchellFilter::support ( ) const
inlinevirtual

Radial width of the filter (half of diameter)

Implements Filter.

Definition at line 228 of file Resample.h.

229  {
230  return 2.0f * m_width;
231  }
const float m_width
Definition: Resample.h:234

Member Data Documentation

const float MitchellFilter::m_B
private

Definition at line 233 of file Resample.h.

const float MitchellFilter::m_C
private

Definition at line 233 of file Resample.h.

const float MitchellFilter::m_width
private

Definition at line 234 of file Resample.h.


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