Fawkes API  Fawkes Development Version
firevision::Filter Class Referenceabstract

Filter interface. More...

#include <>>

Inheritance diagram for firevision::Filter:

Public Member Functions

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

Protected Attributes

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

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

◆ Filter()

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.

◆ ~Filter()

firevision::Filter::~Filter ( )
virtual

Destructor.

Definition at line 75 of file filter.cpp.

Member Function Documentation

◆ apply()

◆ name()

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

Get filter name.

Returns
filter name

Definition at line 161 of file filter.cpp.

◆ set_dst_buffer()

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::MirrorCalibTool::abort(), firevision::FilterTophatClosing::apply(), firevision::FilterGeodesicDilation::apply(), firevision::FilterGeodesicErosion::apply(), firevision::FilterOpening::set_dst_buffer(), and firevision::FilterClosing::set_dst_buffer().

◆ set_orientation()

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.

◆ set_src_buffer() [1/2]

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::MirrorCalibTool::abort(), firevision::FilterTophatClosing::apply(), firevision::FilterGeodesicErosion::apply(), firevision::FilterGeodesicDilation::apply(), firevision::FilterClosing::set_dst_buffer(), firevision::FilterOpening::set_dst_buffer(), firevision::FilterClosing::set_src_buffer(), and firevision::FilterOpening::set_src_buffer().

◆ set_src_buffer() [2/2]

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.

◆ shrink_region()

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::height, firevision::ROI::image_height, firevision::ROI::image_width, firevision::ROI::start, firevision::ROI::width, fawkes::upoint_t::x, and fawkes::upoint_t::y.

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

Member Data Documentation

◆ _max_num_buffers

unsigned int firevision::Filter::_max_num_buffers
protected

Maximum number of buffers.

Definition at line 60 of file filter.h.

◆ _name

char* firevision::Filter::_name
protected

Filter name.

Definition at line 62 of file filter.h.

◆ dst

◆ dst_roi

◆ ori

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(), and firevision::FilterSobel::FilterSobel().

◆ src

◆ src_roi


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