Fawkes API  Fawkes Development Version
morphologicalfilter.cpp
1 
2 /***************************************************************************
3  * morphologicalfilter.cpp - interface for a morphological filter
4  *
5  * Created: Tue Mar 27 23:27:46 2007
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version. A runtime exception applies to
13  * this software (see LICENSE.GPL_WRE file mentioned below for details).
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21  */
22 
23 #include <fvfilters/morphology/morphologicalfilter.h>
24 
25 #include <cstddef>
26 
27 namespace firevision {
28 #if 0 /* just to make Emacs auto-indent happy */
29 }
30 #endif
31 
32 /** @class MorphologicalFilter <fvfilters/morphology/morphologicalfilter.h>
33  * Morphological filter interface.
34  * This interface defines specific API details for morphological filters.
35  *
36  * @author Tim Niemueller
37  *
38  */
39 
40 /** Constructor.
41  * @param name filter name
42  * @param max_num_buffers maximum number of source buffers. */
43 MorphologicalFilter::MorphologicalFilter(const char *name, unsigned int max_num_buffers)
44  : Filter(name, max_num_buffers)
45 {
46  se = NULL;
48 }
49 
50 
51 /** Destructor. */
53 {
54 }
55 
56 
57 /** Set the structuring element for successive filter runs.
58  * @param se structuring element buffer. This is just a line-wise concatenated array
59  * of values. A value of zero means ignore, any other value means to consider this
60  * value.
61  * @param se_width width of structuring element
62  * @param se_height height of structuring element
63  * @param se_anchor_x x coordinate of anchor in structuring element
64  * @param se_anchor_y y coordinate of anchor in structuring element
65  */
66 void
68  unsigned int se_width, unsigned int se_height,
69  unsigned int se_anchor_x, unsigned int se_anchor_y)
70 {
71  this->se = se;
72  this->se_width = se_width;
73  this->se_height = se_height;
74  this->se_anchor_x = se_anchor_x;
75  this->se_anchor_y = se_anchor_y;
76 }
77 
78 } // end namespace firevision
virtual void set_structuring_element(unsigned char *se, unsigned int se_width, unsigned int se_height, unsigned int se_anchor_x, unsigned int se_anchor_y)
Set the structuring element for successive filter runs.
unsigned int se_anchor_y
Anchor point y offset of structuring element.
unsigned int se_anchor_x
Anchor point x offset of structuring element.
unsigned char * se
Structuring element.
unsigned int se_height
Height of structuring element.
MorphologicalFilter(const char *name, unsigned int max_num_buffers=1)
Constructor.
Filter interface.
Definition: filter.h:35
virtual ~MorphologicalFilter()
Destructor.
unsigned int se_width
Width of structuring element.