firevision::Filter Class Reference

Filter interface. More...

#include <filters/filter.h>

Inheritance diagram for firevision::Filter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Filter (const char *name, unsigned int max_num_buffers=1)
 Constructor.
virtual ~Filter ()
 Destructor.
virtual void set_src_buffer (unsigned char *buf, ROI *roi, orientation_t ori=ORI_HORIZONTAL, unsigned int buffer_num=0)
 Set source buffer with orientation.
virtual void set_src_buffer (unsigned char *buf, ROI *roi, unsigned int buffer_num)
 Set source buffer.
virtual void set_dst_buffer (unsigned char *buf, ROI *roi)
 Set the destination buffer.
virtual void set_orientation (orientation_t ori, unsigned int buffer_num)
 Set the orientation to apply the filter in.
virtual const char * name ()
 Get filter name.
virtual void apply ()=0
 Apply the filter.
void shrink_region (ROI *r, unsigned int n)
 This shrinks the regions as needed for a N x N matrix.

Protected Attributes

unsigned int _max_num_buffers
 Maximum number of buffers.
char * _name
 Filter name.
unsigned char ** src
 Source buffers, dynamically allocated by Filter ctor.
unsigned char * dst
 Destination buffer.
ROI ** src_roi
 Source ROIs, dynamically allocated by Filter ctor.
ROIdst_roi
 Destination ROI.
orientation_t * ori
 Orientations, one for each source image.

Detailed Description

Filter interface.

This class defines the general interface that filters are used with.

Author:
Tim Niemueller

Definition at line 35 of file filter.h.


Constructor & Destructor Documentation

firevision::Filter::Filter ( const char *  name,
unsigned int  max_num_buffers = 1 
)

Constructor.

Parameters:
name name of the filter
max_num_buffers The maximum number of source buffers that can be set.

Definition at line 54 of file filter.cpp.

References _max_num_buffers, _name, ori, src, and src_roi.

firevision::Filter::~Filter (  )  [virtual]

Destructor.

Definition at line 75 of file filter.cpp.

References _name, ori, src, and src_roi.


Member Function Documentation

void firevision::Filter::apply (  )  [pure virtual]
const char * firevision::Filter::name (  )  [virtual]

Get filter name.

Returns:
filter name

Definition at line 161 of file filter.cpp.

References _name.

void firevision::Filter::set_dst_buffer ( unsigned char *  buf,
ROI roi 
) [virtual]

Set the destination buffer.

Parameters:
buf Buffer to use as destination image
roi Region Of Interest where the result is put in the dst image

Reimplemented in firevision::FilterClosing, and firevision::FilterOpening.

Definition at line 134 of file filter.cpp.

References dst, and dst_roi.

Referenced by firevision::FilterTophatClosing::apply(), firevision::FilterGeodesicErosion::apply(), firevision::FilterGeodesicDilation::apply(), firevision::FilterOpening::set_dst_buffer(), and firevision::FilterClosing::set_dst_buffer().

void firevision::Filter::set_orientation ( orientation_t  ori,
unsigned int  buffer_num 
) [virtual]

Set the orientation to apply the filter in.

Maybe ignored by some filters.

Parameters:
ori Orientation
buffer_num buffer this orientation applies to

Definition at line 147 of file filter.cpp.

References _max_num_buffers.

void firevision::Filter::set_src_buffer ( unsigned char *  buf,
ROI roi,
unsigned int  buffer_num 
) [virtual]

Set source buffer.

Parameters:
buf Buffer to use as source image
roi Region Of Interest to work on
buffer_num source buffer to set for filter that need multiple src buffers
Exceptions:
OutOfBoundsException Thrown if buffer_num is illegal

Reimplemented in firevision::FilterClosing, and firevision::FilterOpening.

Definition at line 115 of file filter.cpp.

References _max_num_buffers, ori, src, and src_roi.

void firevision::Filter::set_src_buffer ( unsigned char *  buf,
ROI roi,
orientation_t  ori = ORI_HORIZONTAL,
unsigned int  buffer_num = 0 
) [virtual]

Set source buffer with orientation.

Parameters:
buf Buffer to use as source image
roi Region Of Interest to work on
ori Orientation to apply the filter in, maybe ignored in some filters
buffer_num source buffer to set for filter that need multiple src buffers
Exceptions:
OutOfBoundsException Thrown if buffer_num is illegal

Reimplemented in firevision::FilterClosing, and firevision::FilterOpening.

Definition at line 93 of file filter.cpp.

References _max_num_buffers, src, and src_roi.

Referenced by firevision::FilterTophatClosing::apply(), firevision::FilterGeodesicErosion::apply(), firevision::FilterGeodesicDilation::apply(), firevision::FilterOpening::set_dst_buffer(), firevision::FilterClosing::set_dst_buffer(), firevision::FilterOpening::set_src_buffer(), and firevision::FilterClosing::set_src_buffer().

void firevision::Filter::shrink_region ( ROI r,
unsigned int  n 
)

This shrinks the regions as needed for a N x N matrix.

Parameters:
r ROI to shrink
n size of the matrix

Definition at line 172 of file filter.cpp.

References firevision::ROI::height, firevision::ROI::image_height, firevision::ROI::image_width, firevision::ROI::start, firevision::ROI::width, fawkes::point_t::x, and fawkes::point_t::y.

Referenced by firevision::FilterSobel::apply().


Member Data Documentation

unsigned int firevision::Filter::_max_num_buffers [protected]

Maximum number of buffers.

Definition at line 60 of file filter.h.

Referenced by Filter(), set_orientation(), and set_src_buffer().

char* firevision::Filter::_name [protected]

Filter name.

Definition at line 62 of file filter.h.

Referenced by Filter(), name(), and ~Filter().

unsigned char* firevision::Filter::dst [protected]
orientation_t* firevision::Filter::ori [protected]

Orientations, one for each source image.

Definition at line 75 of file filter.h.

Referenced by firevision::FilterSobel::apply(), Filter(), set_src_buffer(), and ~Filter().

unsigned char** firevision::Filter::src [protected]

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

Generated on 1 Mar 2011 for Fawkes API by  doxygen 1.6.1