Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

N phase, loop neighbourhood operation using a kernel

Pseudo code of the operation:

NeighbourhoodOp(Dst, Src, Ker, Ngb)
{
    foreach d, s in Dst, Src {
        phase = 1;
        do {
            Ngb.init(phase, s.x, s.y, Src(s));
            foreach k in Ker
                Ngb.next(k.x, k.y, Src(s - (Ngb.size()/2) + k), Ker(k));
            Ngb.done(phase);
        } while (Ngb.hasNextPhase(phase++));
        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 HxTagNPhase     PhaseCategory;

                                NgbT(HxTagList& tags);
                                ~NgbT();

    HxSizes                     size();

    void                        init(int phase, int ix, int iy, SrcValT imVal);
    void                        next(int nx, int ny, SrcValT imVal, KerValT kerVal);
    void                        done(int phase);
    bool                        hasNextPhase(int thisPhase);
    DstValT                     result() const;

    static HxString             className();
};

Example(s):


Return to patterns.


Generated on Tue Feb 3 14:19:12 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001