00001 00002 /*************************************************************************** 00003 * gauss.cpp - Implementation of a Gauss filter 00004 * 00005 * Created: Thu May 12 09:33:55 2005 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/gauss.h" 00025 00026 #include <cstddef> 00027 #include <ippi.h> 00028 00029 namespace firevision { 00030 #if 0 /* just to make Emacs auto-indent happy */ 00031 } 00032 #endif 00033 00034 /** @class FilterGauss <filters/gauss.h> 00035 * Gaussian filter. 00036 * Applies Gaussian linear filter to image (blur effect). 00037 */ 00038 00039 /** Constructor. */ 00040 FilterGauss::FilterGauss() 00041 : Filter("FilterGauss") 00042 { 00043 } 00044 00045 00046 void 00047 FilterGauss::apply() 00048 { 00049 IppiSize size; 00050 size.width = src_roi[0]->width; 00051 size.height = src_roi[0]->height; 00052 00053 /* IppStatus status = */ ippiFilterGauss_8u_C1R( src[0] + (src_roi[0]->start.y * src_roi[0]->line_step) + (src_roi[0]->start.x * src_roi[0]->pixel_step), src_roi[0]->line_step, 00054 dst + (dst_roi->start.y * dst_roi->line_step) + (dst_roi->start.x * dst_roi->pixel_step), dst_roi->line_step, 00055 size, 00056 ippMskSize5x5 ); 00057 00058 /* 00059 cout << "FilterGauss: ippiFilterGauss exit code: " << flush; 00060 switch (status) { 00061 case ippStsNoErr: 00062 cout << "ippStsNoErr"; 00063 break; 00064 case ippStsNullPtrErr: 00065 cout << "ippStsNullPtrErr"; 00066 break; 00067 case ippStsSizeErr: 00068 cout << "ippStsSizeErr"; 00069 break; 00070 case ippStsStepErr: 00071 cout << "ippStsStepErr"; 00072 break; 00073 case ippStsMaskSizeErr: 00074 cout << "ippStsMaskSizeErr"; 00075 break; 00076 default: 00077 cout << "Unknown status"; 00078 } 00079 cout << endl; 00080 */ 00081 } 00082 00083 } // end namespace firevision