Filter Class Reference

Filter interface. More...

#include <filters/filter.h>

Inheritance diagram for Filter:

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 30 of file filter.h.


Constructor & Destructor Documentation

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 49 of file filter.cpp.

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

Filter::~Filter (  )  [virtual]

Destructor.

Definition at line 70 of file filter.cpp.

References _name, ori, src, and src_roi.


Member Function Documentation

const char * Filter::name (  )  [virtual]

Get filter name.

Returns:
filter name

Definition at line 156 of file filter.cpp.

References _name.

void 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 FilterClosing, and FilterOpening.

Definition at line 129 of file filter.cpp.

References dst, and dst_roi.

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

void 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 142 of file filter.cpp.

References _max_num_buffers.

void 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 FilterClosing, and FilterOpening.

Definition at line 110 of file filter.cpp.

References _max_num_buffers, ori, src, and src_roi.

void 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 FilterClosing, and FilterOpening.

Definition at line 88 of file filter.cpp.

References _max_num_buffers, src, and src_roi.

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

void 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 167 of file filter.cpp.

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

Referenced by FilterSobel::apply().


Member Data Documentation

unsigned int Filter::_max_num_buffers [protected]

Maximum number of buffers.

Definition at line 56 of file filter.h.

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

char* Filter::_name [protected]

Filter name.

Definition at line 58 of file filter.h.

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

orientation_t* Filter::ori [protected]

Orientations, one for each source image.

Definition at line 71 of file filter.h.

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


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