📄 telinearfilter.h
字号:
#ifndef TE_LINEAR_FILTER_H#define TE_LINEAR_FILTER_H/*****************************************************************************\ * * TeLinearFilter.h * * TeLinearFilter generator class * * Author: Martin Havl龛ek (xhavli15 AT stud.fit.vutbr.cz) * Contributors: * * ---------------------------------------------------------------------------- * * THIS SOFTWARE IS NOT COPYRIGHTED * * This source code is offered for use in the public domain. * You may use, modify or distribute it freely. * * This source code is distributed in the hope that it will be useful but * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * DISCLAIMED. This includes but is not limited to warranties of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * If you find the source code useful, authors will kindly welcome * if you give them credit and keep their names with their source code. *\*****************************************************************************//** * TeLinearFilter generator class header file. * * \file TeLinearFilter.h * \author Martin Havl龛ek (martyn AT seznam.cz) */#include "generators/TeGenerator.h"/** * Generator that performs smoothing of heightmap values. * * This generator represents simple linear filter that can be used to smooth * values stored in the TeHeightMap object. * * In one cycle, the filter goes through the data in all rows and columns * in both directions and changes the values according to the neighbours and * filtration coefficient TeLinearFilter::coef. This value should be between * (0.0f-1.0f). When large - smaller changes, when small - huge filtering will * be done. * * This cycle will be done TeLinearFilter::times -times. */class TeLinearFilter : public TeGenerator {private: /** Private attribute used by generator. \sa times */ int _times; /** Private attribute used by generator. \sa coef */ float _coef;public: /** * How many times the filtration to be performed. * * Set this one to modify its private image. * * \sa updateParams() */ int times; /** * Filtration coefficient. * * This value should be between (0.0f-1.0f). When large - smaller changes, * when small - huge filtering will be done. * * Set this one to modify its private image. * * \sa updateParams() */ float coef; TeLinearFilter(); virtual void setDefaults(); virtual void updateParams(); virtual void generate(); virtual SbBool genStep();};#endif /* TE_LINEAR_FILTER_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -