gauss.cpp
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 /** @class FilterGauss <filters/gauss.h> 00030 * Gaussian filter. 00031 * Applies Gaussian linear filter to image (blur effect). 00032 */ 00033 00034 /** Constructor. */ 00035 FilterGauss::FilterGauss() 00036 : Filter("FilterGauss") 00037 { 00038 } 00039 00040 00041 void 00042 FilterGauss::apply() 00043 { 00044 IppiSize size; 00045 size.width = src_roi[0]->width; 00046 size.height = src_roi[0]->height; 00047 00048 /* 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, 00049 dst + (dst_roi->start.y * dst_roi->line_step) + (dst_roi->start.x * dst_roi->pixel_step), dst_roi->line_step, 00050 size, 00051 ippMskSize5x5 ); 00052 00053 /* 00054 cout << "FilterGauss: ippiFilterGauss exit code: " << flush; 00055 switch (status) { 00056 case ippStsNoErr: 00057 cout << "ippStsNoErr"; 00058 break; 00059 case ippStsNullPtrErr: 00060 cout << "ippStsNullPtrErr"; 00061 break; 00062 case ippStsSizeErr: 00063 cout << "ippStsSizeErr"; 00064 break; 00065 case ippStsStepErr: 00066 cout << "ippStsStepErr"; 00067 break; 00068 case ippStsMaskSizeErr: 00069 cout << "ippStsMaskSizeErr"; 00070 break; 00071 default: 00072 cout << "Unknown status"; 00073 } 00074 cout << endl; 00075 */ 00076 }

