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