Fawkes API  Fawkes Development Version
morphologicalfilter.cpp
00001 
00002 /***************************************************************************
00003  *  morphologicalfilter.cpp - interface for a morphological filter
00004  *
00005  *  Created: Tue Mar 27 23:27:46 2007
00006  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00007  ****************************************************************************/
00008 
00009 /*  This program is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version. A runtime exception applies to
00013  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00021  */
00022 
00023 #include <fvfilters/morphology/morphologicalfilter.h>
00024 
00025 #include <cstddef>
00026 
00027 namespace firevision {
00028 #if 0 /* just to make Emacs auto-indent happy */
00029 }
00030 #endif
00031 
00032 /** @class MorphologicalFilter <fvfilters/morphology/morphologicalfilter.h>
00033  * Morphological filter interface.
00034  * This interface defines specific API details for morphological filters.
00035  *
00036  * @author Tim Niemueller
00037  *
00038  */
00039 
00040 /** Constructor.
00041  * @param name filter name
00042  * @param max_num_buffers maximum number of source buffers. */
00043 MorphologicalFilter::MorphologicalFilter(const char *name, unsigned int max_num_buffers)
00044   : Filter(name, max_num_buffers)
00045 {
00046   se = NULL;
00047   se_width = se_height = se_anchor_x = se_anchor_y = 0;
00048 }
00049 
00050 
00051 /** Destructor. */
00052 MorphologicalFilter::~MorphologicalFilter()
00053 {
00054 }
00055 
00056 
00057 /** Set the structuring element for successive filter runs.
00058  * @param se structuring element buffer. This is just a line-wise concatenated array
00059  * of values. A value of zero means ignore, any other value means to consider this
00060  * value.
00061  * @param se_width width of structuring element
00062  * @param se_height height of structuring element
00063  * @param se_anchor_x x coordinate of anchor in structuring element
00064  * @param se_anchor_y y coordinate of anchor in structuring element
00065  */
00066 void
00067 MorphologicalFilter::set_structuring_element(unsigned char *se,
00068                                              unsigned int se_width, unsigned int se_height,
00069                                              unsigned int se_anchor_x, unsigned int se_anchor_y)
00070 {
00071   this->se          = se;
00072   this->se_width    = se_width;
00073   this->se_height   = se_height;
00074   this->se_anchor_x = se_anchor_x;
00075   this->se_anchor_y = se_anchor_y;
00076 }
00077 
00078 } // end namespace firevision