1 #ifndef array2dfilter_h 2 #define array2dfilter_h 44 {
return "Array 2D Filter Pars"; }
64 if ( !iop )
return false;
110 inline int nextStep();
134 inline void filterRow(
int);
135 inline void doPoint(
int,
int);
140 template <
class T>
inline 147 , inputrowsize_(a.info().getSize(0))
148 , inputcolsize_(a.info().getSize(1))
162 template <
class T>
inline 173 ,
nrcols_(2 * p.stepout_.col() + 1)
189 template <
class T>
inline 215 ErrMsg(
"Invalid parameters");
263 int firstrow = startrow;
264 if ( firstrow < 0 ) firstrow = 0;
266 int lastrow = endrow;
270 int firstcol = startcol;
271 if ( firstcol < 0 ) firstcol = 0;
273 int lastcol = endcol;
276 for (
int irow=firstrow; irow<=lastrow; irow++ )
278 const bool issiderow = irow == startrow || irow == endrow;
279 const int rowdist = row-irow;
280 const int rowdist2 = rowdist*rowdist;
281 const bool iscenterrow = irow == row;
283 const T* buf =
input_.getData()+
input_.info().getOffset(irow,firstcol);
285 for (
int icol=firstcol; icol<=lastcol; icol++, buf++ )
287 const bool issidecol = icol == startcol || icol == endcol;
288 const bool iscentercol = icol == col;
290 if ( !
linefilt_ && ( (issidecol && !iscenterrow )
291 || (issiderow && !iscentercol) ) )
296 const int coldist = icol - col;
297 const int coldist2 = coldist*coldist;
IdxType & row()
Definition: posidxpair.h:45
static const char * sKeyDistanceFactor()
Definition: array2dfilter.h:47
int nextStep()
Definition: array2dfilter.h:203
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:287
FixedString Type()
Definition: keystrs.h:138
int nrrowsdone_
Definition: array2dfilter.h:132
static const char * sKeyRowDistance()
Definition: array2dfilter.h:46
Setup for the Stats::RunCalc and Stats::ParallelCalc objects.
Definition: statruncalc.h:38
IOPar * subselect(const char *) const
returns iopar with key that start with <str>.
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
static int ErrorOccurred()
Definition: task.h:141
od_int64 totalNr() const
Definition: array2dfilter.h:114
bool usePar(const IOPar &par)
Definition: array2dfilter.h:61
void clear()
Definition: statruncalc.h:292
FixedString StepOut()
Definition: keystrs.h:178
#define od_int64
Definition: plftypes.h:36
od_int64 nrDone() const
Definition: array2dfilter.h:112
const Array2D< T > & output() const
Definition: array2dfilter.h:105
Implementation of Array2D.
Definition: arrayndimpl.h:102
Stats::RunCalc< float > * calc_
Definition: array2dfilter.h:120
void filterRow(int)
Definition: array2dfilter.h:233
Definition: uistring.h:89
static int MoreToDo()
Definition: task.h:143
double getValue(Type) const
Definition: statruncalc.h:302
RunCalc< T > & addValue(T data, T weight=1)
Definition: statruncalc.h:595
bool get(const char *, int &) const
bool linefilt_
Definition: array2dfilter.h:131
Array2DFilterPars(Stats::Type t=Stats::Average, RowCol rc=RowCol(1, 1), bool filludf=false)
Definition: array2dfilter.h:34
const int inputrowsize_
Definition: array2dfilter.h:128
const Array2DFilterPars & pars() const
Definition: array2dfilter.h:107
Type
Definition: stattype.h:21
void setScope(const Interval< int > &rowrg, const Interval< int > &colrg)
Definition: array2dfilter.h:195
virtual int getSize(int dim) const =0
static int Finished()
Definition: task.h:142
void ErrMsg(const char *, bool progr=false)
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
void mergeComp(const IOPar &, const char *)
merge entries, where IOPar's entries get a prefix
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Stats::Type type_
Definition: array2dfilter.h:74
~Array2DFilterer()
Definition: array2dfilter.h:190
RowCol origin_
Definition: array2dfilter.h:123
bool fillPar(IOPar &par) const
Definition: array2dfilter.h:49
Definition: stattype.h:24
void setYN(const char *, bool)
Array2D< T > & output_
Definition: array2dfilter.h:118
Array2D< T > & output()
Definition: array2dfilter.h:104
Array2DFilterPars pars_
Definition: array2dfilter.h:119
Interval< int > outputcolrg_
Definition: array2dfilter.h:126
Interval< int > outputrowrg_
Definition: array2dfilter.h:125
Array2DFilterer(Array2D< T > &, const Array2DFilterPars &)
Definition: array2dfilter.h:141
const Stats::RunCalc< float > & calc() const
Definition: array2dfilter.h:108
IdxPair used for its row() and col().
Definition: rowcol.h:25
const int inputcolsize_
Definition: array2dfilter.h:129
T stop
Definition: ranges.h:93
IdxType & col()
Definition: posidxpair.h:50
void doPoint(int, int)
Definition: array2dfilter.h:257
CalcSetup & require(Type)
RowCol stepout_
In nodes. Center point not counted.
Definition: array2dfilter.h:75
Parameters for Array2DFilterer.
Definition: array2dfilter.h:31
T start
Definition: ranges.h:92
static const char * sKeyFillUndefined()
Definition: array2dfilter.h:45
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: array2dfilter.h:113
float distfac_
if weigthed, distance factor
Definition: array2dfilter.h:78
uiString uiMessage() const
will be message() again in 7.x
Definition: array2dfilter.h:111
#define mClass(module)
Definition: commondefs.h:164
static const char * sKeyArray2DFilterPars()
Definition: array2dfilter.h:43
virtual const Array2DInfo & info() const =0
void set(const char *ky, const char *val)
float rowdist_
non-undef = weighted filter
Definition: array2dfilter.h:77
bool isWeighted() const
Definition: statruncalc.h:108
const int nrcols_
Definition: array2dfilter.h:130
Export_Basic const char * toString(ViewStyle)
bool getYN(const char *, bool &) const
bool filludf_
Output when center point is undef?
Definition: array2dfilter.h:76
Filters an Array2D.
Definition: array2dfilter.h:91
Specification to enable chunkwise execution of a process.
Definition: executor.h:39
Array2DImpl< T > input_
Definition: array2dfilter.h:122