KernelFilter Class Reference

2D discrete, symmetric filter which can be compactly / efficiently stored / applied using a 2D kernel (array) More...

#include <KernelFilter.h>

Inheritance diagram for KernelFilter:

Filter< N, T > PropertyMap BoxFilter GaussianFilter LanczosSincFilter MitchellFilter TriangleFilter

List of all members.

Public Member Functions

Constructors
 KernelFilter (real_t support=2)
virtual ~KernelFilter ()
Initialization
virtual void init ()
 Performs any initialization which may be necessary before filter evaluation.
Main usage interface
virtual real_t evaluate (const Vector2 &pt)=0
void apply (Image *image)
 Applies this filter to the given image, (performs discrete convolution with the given image and this 2D filter).
RgbaHDR apply (Image *image, real_t x, real_t y)
 Convolves this filter with the image at the given location and returns the result.
Accessors / Mutators
const real_tgetKernel () const
unsigned getWidth () const
unsigned getSize () const

Static Public Member Functions

Static factory
static KernelFiltercreate (const std::string &type, PropertyMap &p)

Protected Member Functions

virtual void _computeKernel ()
 Allocates and initializes m_kernel.

Protected Attributes

unsigned m_width
real_tm_kernel
bool m_isNormalized
 whether or not 'apply' should assume the kernel is normalized


Detailed Description

2D discrete, symmetric filter which can be compactly / efficiently stored / applied using a 2D kernel (array)

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008

Definition at line 20 of file KernelFilter.h.


Constructor & Destructor Documentation

KernelFilter::KernelFilter ( real_t  support = 2  )  [inline]

Definition at line 25 of file KernelFilter.h.

KernelFilter::~KernelFilter (  )  [virtual]

Definition at line 46 of file KernelFilter.cpp.


Member Function Documentation

KernelFilter * KernelFilter::create ( const std::string &  type,
PropertyMap p 
) [static]

Definition at line 17 of file KernelFilter.cpp.

void KernelFilter::init (  )  [virtual]

Performs any initialization which may be necessary before filter evaluation.

Note:
Default implementation initializes the filter support based on its PropertyMap

Reimplemented from Filter< N, T >.

Reimplemented in GaussianFilter, LanczosSincFilter, and MitchellFilter.

Definition at line 50 of file KernelFilter.cpp.

virtual real_t KernelFilter::evaluate ( const Vector2 pt  )  [pure virtual]

Returns:
the value of this filter function evaluated at the given point

Implements Filter< N, T >.

Implemented in BoxFilter, GaussianFilter, LanczosSincFilter, MitchellFilter, and TriangleFilter.

void KernelFilter::apply ( Image image  ) 

Applies this filter to the given image, (performs discrete convolution with the given image and this 2D filter).

Note:
this involves allocating a temporary intermediate image

Definition at line 77 of file KernelFilter.cpp.

RgbaHDR KernelFilter::apply ( Image image,
real_t  x,
real_t  y 
)

Convolves this filter with the image at the given location and returns the result.

Definition at line 131 of file KernelFilter.cpp.

const real_t* KernelFilter::getKernel (  )  const [inline]

Returns:
the underlying 2D kernel

Definition at line 85 of file KernelFilter.h.

unsigned KernelFilter::getWidth (  )  const [inline]

Returns:
the width of the kernel (same as height since its symmetric)

Definition at line 90 of file KernelFilter.h.

unsigned KernelFilter::getSize (  )  const [inline]

Returns:
the number of real_ts contained in the kernel

Definition at line 95 of file KernelFilter.h.

void KernelFilter::_computeKernel (  )  [protected, virtual]

Allocates and initializes m_kernel.

Definition at line 177 of file KernelFilter.cpp.


Member Data Documentation

unsigned KernelFilter::m_width [protected]

Definition at line 106 of file KernelFilter.h.

Definition at line 107 of file KernelFilter.h.

bool KernelFilter::m_isNormalized [protected]

whether or not 'apply' should assume the kernel is normalized

Definition at line 110 of file KernelFilter.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6