#include <HxNgbLWshed2d.h>
Public Types | |
| typedef HxTagLoop | IteratorCategory |
| Loop version. More... | |
| typedef HxTag1Phase | PhaseCategory |
| 1 phase. More... | |
Public Methods | |
| HxNgbLWshed2d (HxTagList &tags) | |
| Constructor. More... | |
| ~HxNgbLWshed2d () | |
| Destructor. More... | |
| HxSizes | size () |
| Size of the neighbourhood. More... | |
| void | init (int, int, ArgType) |
| Initialization. More... | |
| void | next (int x, int y, ArgType value) |
| Processing one pixel. More... | |
| ResType | result () const |
| Produce the result value. More... | |
Static Public Methods | |
| HxString | className () |
| The name : "lwshed". More... | |
|
|||||
|
Loop version.
|
|
|||||
|
1 phase.
|
|
||||||||||
|
Constructor. Taglist should contain: int "conn", int "wshedval"
|
|
|||||||||
|
Destructor.
00038 {
00039 if (_values)
00040 delete [] _values;
00041 }
|
|
|||||||||
|
Size of the neighbourhood.
00105 {
00106 // return HxSizes(_size, _size, 1);
00107 return HxSizes(3, 3, 1);
00108 }
|
|
||||||||||||||||||||
|
Initialization.
00091 {
00092 _i = 0;
00093 }
|
|
||||||||||||||||||||
|
Processing one pixel.
00098 {
00099 _values[_i++] = value;
00100 }
|
|
|||||||||
|
Produce the result value.
00113 {
00114 ArgType minval=_values[_pctIdx];
00115 if(_conn==4)
00116 {
00117 if( _values[1] < minval && _values[1]>_wshedval)
00118 minval = _values[1];
00119 if( _values[3] < minval && _values[3]>_wshedval)
00120 minval = _values[3];
00121 if( _values[5] < minval && _values[5]>_wshedval)
00122 minval = _values[5];
00123 if( _values[7] < minval && _values[7]>_wshedval)
00124 minval = _values[7];
00125
00126 if(minval<_values[_pctIdx])
00127 return _wshedval;
00128 else
00129 return _values[_pctIdx];
00130 }
00131 if(_conn==8)
00132 {
00133 if( _values[0] < minval && _values[0]>_wshedval)
00134 minval = _values[0];
00135 if( _values[1] < minval && _values[1]>_wshedval)
00136 minval = _values[1];
00137 if( _values[2] < minval && _values[2]>_wshedval)
00138 minval = _values[2];
00139 if( _values[3] < minval && _values[3]>_wshedval)
00140 minval = _values[3];
00141 if( _values[5] < minval && _values[5]>_wshedval)
00142 minval = _values[5];
00143 if( _values[6] < minval && _values[6]>_wshedval)
00144 minval = _values[6];
00145 if( _values[7] < minval && _values[7]>_wshedval)
00146 minval = _values[7];
00147 if( _values[8] < minval && _values[8]>_wshedval)
00148 minval = _values[8];
00149
00150 if(minval>_wshedval && minval<_values[_pctIdx])
00151 return _wshedval;
00152 else
00153 return _values[_pctIdx];
00154 }
00155
00156 return _values[_pctIdx];
00157 }
|
|
|||||||||
|
The name : "lwshed".
00083 {
00084 static HxString s("lwshed");
00085 return s;
00086 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001