00001 /***************************************************************************\ 00002 * Copyright (C) by University Paris-Est - MISS team 00003 * ConvolutionKernel.hpp created in 10 2008. 00004 * Mail : biri@univ-mlv.fr 00005 * 00006 * This file is part of the OpenKraken-image. 00007 * 00008 * The OpenKraken-image is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation; either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * The OpenKraken-image is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 * 00021 \***************************************************************************/ 00022 00023 /* 00024 * Anti-doublon 00025 */ 00026 #ifndef __OPENKN_IMAGE__CONVOLUTIONKERNEL_HPP__ 00027 #define __OPENKN_IMAGE__CONVOLUTIONKERNEL_HPP__ 00028 00029 00030 /* 00031 * External Includes 00032 */ 00033 00034 #include <iostream> 00035 #include <string> 00036 #include <cstring> 00037 00038 00039 /* 00040 * Internal Includes 00041 */ 00042 #include "ImageException.hpp" 00043 00044 /* 00045 * Namespace 00046 */ 00047 namespace kn{ 00048 /* 00049 * Class definition 00050 */ 00051 00055 class ConvolutionKernel{ 00056 /* 00057 * Constructor & destructors 00058 */ 00059 public: 00064 ConvolutionKernel(); 00072 ConvolutionKernel(unsigned int width, unsigned int height, 00073 unsigned int xOrigin, unsigned int yOrigin, double* values=NULL); 00077 ConvolutionKernel(const ConvolutionKernel & e); 00081 ~ConvolutionKernel(); 00082 00083 00084 protected : 00085 unsigned int _width; 00086 unsigned int _height; 00087 int _xOrigin; 00088 int _yOrigin; 00089 double* _values; 00090 00091 public : 00095 inline unsigned int width()const {return _width;} 00096 00100 inline unsigned int height() const{return _height;} 00101 00105 inline unsigned int xOrigin()const {return _xOrigin;} 00106 00110 inline unsigned int yOrigin()const{return _yOrigin;} 00111 00115 inline const double* values()const{return _values;} 00116 00121 inline int xLowerBound()const{return -_xOrigin;} 00122 00127 inline int yLowerBound()const{return -_yOrigin;} 00128 00133 inline int xUpperBound()const{return _width-_xOrigin;} 00134 00139 inline int yUpperBound()const{return _height-_yOrigin;} 00140 00141 00149 double operator()(int x, int y)const; 00150 00151 00157 ConvolutionKernel& operator=(const ConvolutionKernel& k); 00158 00159 }; 00160 00161 /* 00162 * End of Namespace 00163 */ 00164 } 00165 00166 /* 00167 * End of Anti-doublon 00168 */ 00169 #endif 00170
1.5.8