Fawkes API  Fawkes Development Version
firevision::Filter Class Reference

Filter interface. More...

#include <>>

Inheritance diagram for firevision::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

Constructor & Destructor Documentation

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

Constructor.

Parameters:
namename of the filter
max_num_buffersThe maximum number of source buffers that can be set.

Definition at line 54 of file filter.cpp.

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

Destructor.

Definition at line 75 of file filter.cpp.


Member Function Documentation

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

Get filter name.

Returns:
filter name

Definition at line 161 of file filter.cpp.

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

Set the destination buffer.

Parameters:
bufBuffer to use as destination image
roiRegion 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.

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

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:
oriOrientation
buffer_numbuffer this orientation applies to

Definition at line 147 of file filter.cpp.

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:
bufBuffer to use as source image
roiRegion Of Interest to work on
oriOrientation to apply the filter in, maybe ignored in some filters
buffer_numsource buffer to set for filter that need multiple src buffers
Exceptions:
OutOfBoundsExceptionThrown if buffer_num is illegal

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

Definition at line 93 of file filter.cpp.

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

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

Set source buffer.

Parameters:
bufBuffer to use as source image
roiRegion Of Interest to work on
buffer_numsource buffer to set for filter that need multiple src buffers
Exceptions:
OutOfBoundsExceptionThrown if buffer_num is illegal

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

Definition at line 115 of file filter.cpp.

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

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

Parameters:
rROI to shrink
nsize of the matrix

Definition at line 172 of file filter.cpp.

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

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.

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

Filter name.

Definition at line 62 of file filter.h.

orientation_t* firevision::Filter::ori [protected]

Orientations, one for each source image.

Definition at line 75 of file filter.h.


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