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...
 
- Public Member Functions inherited from Filter
virtual float initialValue () const
 Initial value (zero by default, but need to be different for min/max) More...
 

Static Public Member Functions

template<typename Value_T >
static void op (Value_T &accumValue, const Value_T value)
 

Static Public Attributes

static const bool isAnalytic = false
 

Private Attributes

const float m_B
 
const float m_C
 
const float m_width
 

Detailed Description

Definition at line 340 of file Resample.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 343 of file Resample.h.

◆ CPtr

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

Definition at line 344 of file Resample.h.

Constructor & Destructor Documentation

◆ MitchellFilter()

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 349 of file Resample.h.

351  : m_B(B), m_C(C), m_width(width)
352  { /* Empty */ }

Member Function Documentation

◆ eval()

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

Evaluates the filter at coordinate 't'.

Implements Filter.

Definition at line 354 of file Resample.h.

355  {
356  const float ax = std::abs(x / m_width);
357  if (ax < 1) {
358  return ((12 - 9 * m_B - 6 * m_C) * ax * ax * ax +
359  (-18 + 12 * m_B + 6 * m_C) * ax * ax + (6 - 2 * m_B)) / 6;
360  } else if ((ax >= 1) && (ax < 2)) {
361  return ((-m_B - 6 * m_C) * ax * ax * ax +
362  (6 * m_B + 30 * m_C) * ax * ax + (-12 * m_B - 48 * m_C) *
363  ax + (8 * m_B + 24 * m_C)) / 6;
364  } else {
365  return 0;
366  }
367  }

References m_B, m_C, and m_width.

◆ support()

virtual float MitchellFilter::support ( ) const
inlinevirtual

Radial width of the filter (half of diameter)

Implements Filter.

Definition at line 368 of file Resample.h.

369  {
370  return 2.0f * m_width;
371  }

References m_width.

◆ op()

template<typename Value_T >
static void MitchellFilter::op ( Value_T &  accumValue,
const Value_T  value 
)
inlinestatic

Definition at line 373 of file Resample.h.

374  { /* No-op */ }

Member Data Documentation

◆ isAnalytic

const bool MitchellFilter::isAnalytic = false
static

Definition at line 346 of file Resample.h.

◆ m_B

const float MitchellFilter::m_B
private

Definition at line 376 of file Resample.h.

Referenced by eval().

◆ m_C

const float MitchellFilter::m_C
private

Definition at line 376 of file Resample.h.

Referenced by eval().

◆ m_width

const float MitchellFilter::m_width
private

Definition at line 377 of file Resample.h.

Referenced by eval(), and support().


The documentation for this struct was generated from the following file:
MitchellFilter::m_B
const float m_B
Definition: Resample.h:376
MitchellFilter::m_C
const float m_C
Definition: Resample.h:376
MitchellFilter::m_width
const float m_width
Definition: Resample.h:377