HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Filter2D Class Referenceabstract

#include <filter.h>

Public Member Functions

 Filter2D (float width, float height)
 
virtual ~Filter2D (void)
 
float width (void) const
 Get the width of the filter. More...
 
float height (void) const
 Get the height of the filter. More...
 
virtual bool separable () const
 
virtual float operator() (float x, float y) const =0
 
virtual float xfilt (float x) const
 
virtual float yfilt (float y) const
 
virtual string_view name (void) const =0
 Return the name of the filter, e.g., "box", "gaussian". More...
 

Static Public Member Functions

static Filter2Dcreate (string_view filtername, float width, float height)
 
static void destroy (Filter2D *filt)
 Destroy a filter that was created with create(). More...
 
static int num_filters ()
 Get the number of filters supported. More...
 
static void get_filterdesc (int filternum, FilterDesc *filterdesc)
 Get the info for a particular index (0..num_filters()-1). More...
 
static const FilterDescget_filterdesc (int filternum)
 

Protected Attributes

float m_w
 
float m_h
 

Detailed Description

Filter2D is the abstract data type for a 2D filter. The filters are NOT expected to have their results normalized.

Definition at line 73 of file filter.h.

Constructor & Destructor Documentation

Filter2D::Filter2D ( float  width,
float  height 
)
inline

Definition at line 75 of file filter.h.

virtual Filter2D::~Filter2D ( void  )
inlinevirtual

Definition at line 80 of file filter.h.

Member Function Documentation

static Filter2D* Filter2D::create ( string_view  filtername,
float  width,
float  height 
)
static

This static function allocates and returns an instance of the specific filter implementation for the name you provide. Example use: Filter2D *myfilt = Filter2::create ("box", 1, 1); The caller is responsible for deleting it when it's done. If the name is not recognized, return NULL.

static void Filter2D::destroy ( Filter2D filt)
static

Destroy a filter that was created with create().

static void Filter2D::get_filterdesc ( int  filternum,
FilterDesc filterdesc 
)
static

Get the info for a particular index (0..num_filters()-1).

static const FilterDesc& Filter2D::get_filterdesc ( int  filternum)
static
float Filter2D::height ( void  ) const
inline

Get the height of the filter.

Definition at line 85 of file filter.h.

virtual string_view Filter2D::name ( void  ) const
pure virtual

Return the name of the filter, e.g., "box", "gaussian".

static int Filter2D::num_filters ( )
static

Get the number of filters supported.

virtual float Filter2D::operator() ( float  x,
float  y 
) const
pure virtual

Evaluate the filter at an x and y position (relative to filter center).

virtual bool Filter2D::separable ( ) const
inlinevirtual

Is the filter separable?

Definition at line 89 of file filter.h.

float Filter2D::width ( void  ) const
inline

Get the width of the filter.

Definition at line 83 of file filter.h.

virtual float Filter2D::xfilt ( float  x) const
inlinevirtual

Evaluate just the horizontal filter (if separable; for non-separable it just evaluates at (x,0).

Definition at line 97 of file filter.h.

virtual float Filter2D::yfilt ( float  y) const
inlinevirtual

Evaluate just the vertical filter (if separable; for non-separable it just evaluates at (0,y).

Definition at line 101 of file filter.h.

Member Data Documentation

float Filter2D::m_h
protected

Definition at line 124 of file filter.h.

float Filter2D::m_w
protected

Definition at line 124 of file filter.h.


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