Field3D
MaxFilter Struct Reference

#include <Resample.h>

Inheritance diagram for MaxFilter:
Filter

Public Types

typedef boost::shared_ptr< const MaxFilterCPtr
 
typedef boost::shared_ptr< MaxFilterPtr
 
- 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...
 
virtual float initialValue () const
 Initial value (zero by default, but need to be different for min/max) More...
 
 MaxFilter ()
 
 MaxFilter (const float width)
 
virtual float support () const
 Radial width of the filter (half of diameter) More...
 

Static Public Member Functions

template<typename T >
static void op (Imath::Vec3< T > &accumValue, const Imath::Vec3< T > value)
 
template<typename Value_T >
static void op (Value_T &accumValue, const Value_T value)
 

Static Public Attributes

static const bool isAnalytic = true
 

Private Attributes

const float m_width
 

Detailed Description

Definition at line 209 of file Resample.h.

Member Typedef Documentation

◆ Ptr

typedef boost::shared_ptr<MaxFilter> MaxFilter::Ptr

Definition at line 212 of file Resample.h.

◆ CPtr

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

Definition at line 213 of file Resample.h.

Constructor & Destructor Documentation

◆ MaxFilter() [1/2]

MaxFilter::MaxFilter ( )
inline

Definition at line 218 of file Resample.h.

219  : m_width(1.0)
220  { }
const float m_width
Definition: Resample.h:259

◆ MaxFilter() [2/2]

MaxFilter::MaxFilter ( const float  width)
inline

Definition at line 221 of file Resample.h.

222  : m_width(width)
223  { }
const float m_width
Definition: Resample.h:259

Member Function Documentation

◆ eval()

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

Evaluates the filter at coordinate 't'.

Implements Filter.

Definition at line 225 of file Resample.h.

References m_width.

226  {
227  const float t = x / m_width;
228  if (t <= 0.5f) {
229  return 1.0f;
230  } else {
231  return 0.0f;
232  }
233  }
const float m_width
Definition: Resample.h:259

◆ support()

virtual float MaxFilter::support ( ) const
inlinevirtual

Radial width of the filter (half of diameter)

Implements Filter.

Definition at line 234 of file Resample.h.

References m_width.

235  {
236  return 0.5f * m_width;
237  }
const float m_width
Definition: Resample.h:259

◆ initialValue()

virtual float MaxFilter::initialValue ( ) const
inlinevirtual

Initial value (zero by default, but need to be different for min/max)

Reimplemented from Filter.

Definition at line 238 of file Resample.h.

References detail::max().

239  {
241  }
T max(const T a, const T2 b)
Max operation on mixed types.
Definition: FieldSampler.h:32

◆ op() [1/2]

template<typename T >
static void MaxFilter::op ( Imath::Vec3< T > &  accumValue,
const Imath::Vec3< T >  value 
)
inlinestatic

Definition at line 245 of file Resample.h.

References detail::max().

246  {
247  accumValue.x = std::max(accumValue.x, value.x);
248  accumValue.y = std::max(accumValue.y, value.y);
249  accumValue.z = std::max(accumValue.z, value.z);
250  }
T max(const T a, const T2 b)
Max operation on mixed types.
Definition: FieldSampler.h:32

◆ op() [2/2]

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

Definition at line 253 of file Resample.h.

References detail::max().

254  {
255  accumValue = std::max(accumValue, value);
256  }
T max(const T a, const T2 b)
Max operation on mixed types.
Definition: FieldSampler.h:32

Member Data Documentation

◆ isAnalytic

const bool MaxFilter::isAnalytic = true
static

Definition at line 215 of file Resample.h.

◆ m_width

const float MaxFilter::m_width
private

Definition at line 259 of file Resample.h.

Referenced by eval(), and support().


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