Filter Class Reference
Filter interface. More...
#include <filters/filter.h>

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. | |
| ROI * | dst_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.
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] |
Member Function Documentation
| void Filter::apply | ( | ) | [pure virtual] |
Apply the filter.
Apply the filter to the given source and destination buffers with given width and height and orientation (ori may be ignored for some filters).
Implemented in FilterCompare, FilterDifference, FilterGauss, FilterHipass, FilterHSearch, FilterHVSearch, FilterInvert, FilterLaplace, FilterMax, FilterMedian, FilterMin, FilterClosing, FilterDilation, FilterErosion, FilterGeodesicDilation, FilterGeodesicErosion, FilterOpening, FilterTophatClosing, FilterNothing, FilterOr, FilterRectify, FilterROIDraw, FilterSegment, FilterColorSegmentation, FilterScanlineSegmentation, FilterShapeRemover, FilterSharpen, FilterSobel, FilterSum, FilterThreshold, and FilterUnwarp.
| const char * Filter::name | ( | ) | [virtual] |
| 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.
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] |
unsigned char* Filter::dst [protected] |
Destination buffer.
Definition at line 63 of file filter.h.
Referenced by FilterUnwarp::apply(), FilterThreshold::apply(), FilterSum::apply(), FilterSobel::apply(), FilterSharpen::apply(), FilterShapeRemover::apply(), FilterScanlineSegmentation::apply(), FilterColorSegmentation::apply(), FilterSegment::apply(), FilterRectify::apply(), FilterOr::apply(), FilterTophatClosing::apply(), FilterGeodesicErosion::apply(), FilterGeodesicDilation::apply(), FilterErosion::apply(), FilterDilation::apply(), FilterMin::apply(), FilterMedian::apply(), FilterMax::apply(), FilterLaplace::apply(), FilterInvert::apply(), FilterHVSearch::apply(), FilterHSearch::apply(), FilterHipass::apply(), FilterGauss::apply(), FilterDifference::apply(), FilterCompare::apply(), FilterGeodesicDilation::FilterGeodesicDilation(), FilterTophatClosing::FilterTophatClosing(), and set_dst_buffer().
ROI* Filter::dst_roi [protected] |
Destination ROI.
Definition at line 68 of file filter.h.
Referenced by FilterUnwarp::apply(), FilterThreshold::apply(), FilterSum::apply(), FilterSobel::apply(), FilterSharpen::apply(), FilterShapeRemover::apply(), FilterScanlineSegmentation::apply(), FilterColorSegmentation::apply(), FilterSegment::apply(), FilterROIDraw::apply(), FilterRectify::apply(), FilterOr::apply(), FilterTophatClosing::apply(), FilterGeodesicErosion::apply(), FilterGeodesicDilation::apply(), FilterErosion::apply(), FilterDilation::apply(), FilterMin::apply(), FilterMedian::apply(), FilterMax::apply(), FilterLaplace::apply(), FilterInvert::apply(), FilterHVSearch::apply(), FilterHSearch::apply(), FilterHipass::apply(), FilterGauss::apply(), FilterDifference::apply(), FilterCompare::apply(), FilterGeodesicDilation::FilterGeodesicDilation(), FilterTophatClosing::FilterTophatClosing(), and set_dst_buffer().
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().
unsigned char** Filter::src [protected] |
Source buffers, dynamically allocated by Filter ctor.
Definition at line 61 of file filter.h.
Referenced by FilterUnwarp::apply(), FilterThreshold::apply(), FilterSum::apply(), FilterSobel::apply(), FilterSharpen::apply(), FilterShapeRemover::apply(), FilterScanlineSegmentation::apply(), FilterColorSegmentation::apply(), FilterSegment::apply(), FilterRectify::apply(), FilterOr::apply(), FilterTophatClosing::apply(), FilterGeodesicErosion::apply(), FilterGeodesicDilation::apply(), FilterErosion::apply(), FilterDilation::apply(), FilterMin::apply(), FilterMedian::apply(), FilterMax::apply(), FilterLaplace::apply(), FilterInvert::apply(), FilterHVSearch::apply(), FilterHSearch::apply(), FilterHipass::apply(), FilterGauss::apply(), FilterDifference::apply(), FilterCompare::apply(), Filter(), FilterGeodesicDilation::FilterGeodesicDilation(), FilterTophatClosing::FilterTophatClosing(), set_src_buffer(), and ~Filter().
ROI** Filter::src_roi [protected] |
Source ROIs, dynamically allocated by Filter ctor.
Definition at line 66 of file filter.h.
Referenced by FilterUnwarp::apply(), FilterThreshold::apply(), FilterSum::apply(), FilterSobel::apply(), FilterSharpen::apply(), FilterShapeRemover::apply(), FilterScanlineSegmentation::apply(), FilterColorSegmentation::apply(), FilterSegment::apply(), FilterRectify::apply(), FilterOr::apply(), FilterTophatClosing::apply(), FilterGeodesicErosion::apply(), FilterGeodesicDilation::apply(), FilterErosion::apply(), FilterDilation::apply(), FilterMin::apply(), FilterMedian::apply(), FilterMax::apply(), FilterLaplace::apply(), FilterInvert::apply(), FilterHVSearch::apply(), FilterHSearch::apply(), FilterHipass::apply(), FilterGauss::apply(), FilterDifference::apply(), FilterCompare::apply(), Filter(), FilterGeodesicDilation::FilterGeodesicDilation(), FilterTophatClosing::FilterTophatClosing(), set_src_buffer(), and ~Filter().
The documentation for this class was generated from the following files:
- src/firevision/filters/filter.h
- src/firevision/filters/filter.cpp

