NeighbourhoodOp(Dst, Src, Ker, Ngb) { foreach d, s in Dst, Src { Ngb.init(s.x, s.y, Src(s)); foreach k in Ker Ngb.next(k.x, k.y, Src(s - (Ngb.size()/2) + k), Ker(k)); Dst(d) = ngb.result(); } }
The requirements on the NgbT template parameter expressed as class definition are:
template<class DstValT, class SrcValT, class KerValT> class NgbT { public: typedef HxTagLoop IteratorCategory; typedef HxTag1Phase PhaseCategory; NgbT(HxTagList& tags); ~NgbT(); HxSizes size(); void init(int ix, int iy, SrcValT imVal); void next(int nx, int ny, SrcValT imVal, KerValT kerVal); DstValT result() const; static HxString className(); };
Example(s):