head	1.8;
access;
symbols
	bobbase:1.8
	bob:1.8.1
	r2_1:1.6
	r2_0:1.6
	r1_1_beta:1.5
	r1_1_alpha:1.4
	r1_0:1.4
	r0_11:1.3
	r0_10:1.1;
locks
	thoth:1.8.1.2; strict;
comment	@// @;


1.8
date	94.12.22.18.10.15;	author fjsoria;	state Exp;
branches
	1.8.1.1;
next	1.7;

1.7
date	94.12.22.16.24.07;	author fjsoria;	state Exp;
branches;
next	1.6;

1.6
date	94.08.22.15.20.29;	author thoth;	state Exp;
branches;
next	1.5;

1.5
date	94.07.25.17.26.39;	author thoth;	state Exp;
branches;
next	1.4;

1.4
date	94.05.08.19.40.25;	author thoth;	state Exp;
branches;
next	1.3;

1.3
date	94.04.15.13.17.48;	author thoth;	state Exp;
branches;
next	1.2;

1.2
date	94.03.30.13.57.51;	author thoth;	state Exp;
branches;
next	1.1;

1.1
date	94.01.31.16.50.30;	author thoth;	state Exp;
branches;
next	;

1.8.1.1
date	94.12.28.18.22.11;	author thoth;	state Exp;
branches;
next	1.8.1.2;

1.8.1.2
date	95.01.13.19.37.42;	author thoth;	state Exp;
branches;
next	;


desc
@Declaration of the point->pointset mapping container class.
@


1.8
log
@none
@
text
@// Emacs: -*- C++ -*-

//
//	Copyright 1993, Center for Computer Vision and Visualization,
//	University of Florida.  All rights reserved.
//


//
// $Log: Nbh.h,v $
// Revision 1.7  1994/12/22  16:24:07  fjsoria
// fixed friend template fucntion for g++
//
// Revision 1.6  1994/08/22  15:20:29  thoth
// DOS-inspired name rework.
//
// Revision 1.5  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.4  1994/05/08  19:40:25  thoth
// New automatic neighborhood decomposition capability.
//
// Revision 1.3  1994/04/15  13:17:48  thoth
// Finish u the list of generic reductions.
//
// Revision 1.2  1994/03/30  13:57:51  thoth
// generic neighborhood reductions are now available.
//
// Revision 1.1  1994/01/31  16:50:30  thoth
// Initial revision
//

#ifndef Neighborhood_h_
#define Neighborhood_h_

#include "BaseNbh.h"
#include "Image.h"

template <class P, class Q, class R, class S, class T> class IA_FBI;

template <class P, class Q>
class IA_Neighborhood {
#ifndef __NO_FRIEND_TEMPLATE_SUPPORT 
  template <class R, class S, class T> friend class IA_FBI<P,Q,R,S,T>;
#else
    friend class IA_FBI<IA_Point<int>, IA_Point<int>, int, int, int>;
    friend class IA_FBI<IA_Point<int>, IA_Point<int>, float, float, float>;
    friend class IA_FBI<IA_Point<int>, IA_Point<int>, IA_Bit, IA_Bit, IA_Bit>;
    friend class IA_FBI<IA_Point<int>, IA_Point<int>, u_char, u_char, u_char>;
    friend class IA_FBI<IA_Point<int>, IA_Point<int>, IA_RGB, IA_RGB, IA_RGB>;
    friend class IA_FBI<IA_Point<int>, IA_Point<int>, complex, complex, complex>;
    friend class IA_FBI<IA_Point<double>, IA_Point<double>, float, float, float>;
#endif
protected:
    IA_BaseNbh<P,Q>	*bnbh;

    void set_and_reference(IA_BaseNbh<P,Q> *);
    void disassociate();

  
public:
    IA_Neighborhood(unsigned dim, const IA_Set<P> & ps);
    IA_Neighborhood(const IA_Neighborhood &);

    ~IA_Neighborhood();

    IA_Neighborhood& operator=(const IA_Neighborhood &);

    static int	auto_decomposition;

    IA_Set<P> operator()(const Q &p) const { return (*bnbh)(p); }

    IA_Set<Q> domain() const { return bnbh->domain(); }
    IA::Type type() const { return bnbh->type(); }

#include "NbhOps.h"

};

//
//
//

template <class T>
IA_Image<IA_Point<int>, T> neighborhood_reduction
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &tmpl,
 const IA_Set<IA_Point<int> > &dst,
 T (*gamma)(T,T),
 T gamma_zero);

//

template <class S, class T>
IA_Image<IA_Point<int>, S> neighborhood_reduction
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 T gamma_zero,
 S (*Gamma)(T*, unsigned count),
 const S*);

template <class T> inline 
IA_Image<IA_Point<int>, T> neighborhood_reduction
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 T gamma_zero,
 T (*Gamma)(T*, unsigned count)) {
    return neighborhood_reduction(img, nbh, dst, gamma_zero, Gamma, (T*)0);
}

//

template <class S, class T>
IA_Image<IA_Point<int>, S> neighborhood_reduction
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 const S*);

template <class T> inline 
IA_Image<IA_Point<int>, T> neighborhood_reduction
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 T (*Gamma)(T*, unsigned count)) {
    return neighborhood_reduction(img, nbh, dst, Gamma, (T*)0);
}

//

template <class T>
IA_Image<IA_Point<int>, T> neighborhood_reduction
(const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &tmpl,
 const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &dst,
 T (*gamma)(T,T),
 T gamma_zero);

//

template <class S, class T>
IA_Image<IA_Point<int>, S> neighborhood_reduction
(const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
 const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &dst,
 T gamma_zero,
 S (*Gamma)(T*, unsigned count),
 const S*);

template <class T> inline 
IA_Image<IA_Point<int>, T> neighborhood_reduction
(const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
 const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &dst,
 T gamma_zero,
 T (*Gamma)(T*, unsigned count)) {
    return neighborhood_reduction(nbh, img, dst, gamma_zero, Gamma, (T*)0);
}

//

template <class S, class T>
IA_Image<IA_Point<int>, S> neighborhood_reduction
(const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
 const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 const S*);

template <class T> inline 
IA_Image<IA_Point<int>, T> neighborhood_reduction
(const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
 const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &dst,
 T (*Gamma)(T*, unsigned count)) {
    return neighborhood_reduction(nbh, img, dst, Gamma, (T*)0);
}

//
// support procedures.
//

template <class T>
IA_Image<IA_Point<int>, T> backw_nbh_inv_core1
(IA_Point<int> src_infimum,
 IA_Point<int> src_width,
 const T* src_data,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dest_ps,
 T (*gamma)(T, T),
 T gamma_zero);

template <class T>
IA_Image<IA_Point<int>, T> backw_nbh_inv1
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &invnbh,
 const IA_Set<IA_Point<int> > &dest_ps,
 T (*gamma)(T, T),
 T gamma_zero);

//

template <class S, class T>
IA_Image<IA_Point<int>, S> backw_nbh_inv_core
(IA_Point<int> src_infimum,
 IA_Point<int> src_width,
 const T* src_data,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 const S*);

template <class S, class T>
IA_Image<IA_Point<int>, S> backw_nbh_inv
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 T gamma_zero,
 const S*);

//

template <class S, class T>
IA_Image<IA_Point<int>, S> backw_nbh_inv_core3
(IA_Point<int> src_infimum,
 IA_Point<int> src_width,
 const T* src_data,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 const S*);

template <class S, class T>
IA_Image<IA_Point<int>, S> backw_nbh_inv3
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 const S*);

//

template <class T>
IA_Image<IA_Point<int>, T> forw_nbh_inv_core1
(IA_Point<int> src_infimum,
 IA_Point<int> src_width,
 const T* src_data,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dest_ps,
 T (*gamma)(T, T),
 T gamma_zero);

template <class T>
IA_Image<IA_Point<int>, T> forw_nbh_inv1
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &invnbh,
 const IA_Set<IA_Point<int> > &dest_ps,
 T (*gamma)(T, T),
 T gamma_zero);

//

template <class S, class T>
IA_Image<IA_Point<int>, S> forw_nbh_inv_core
(IA_Point<int> src_infimum,
 IA_Point<int> src_width,
 const T* src_data,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 const S*);

template <class S, class T>
IA_Image<IA_Point<int>, S> forw_nbh_inv
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 T gamma_zero,
 const S*);

//

template <class S, class T>
IA_Image<IA_Point<int>, S> forw_nbh_inv_core3
(IA_Point<int> src_infimum,
 IA_Point<int> src_width,
 const T* src_data,
 const IA_Set<IA_Point<int> > &src_ps,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 const S*);

template <class S, class T>
IA_Image<IA_Point<int>, S> forw_nbh_inv3
(const IA_CoreImage<IA_Point<int>, T> &img,
 const IA_Set<IA_Point<int> > &nbh,
 const IA_Set<IA_Point<int> > &dst,
 S (*Gamma)(T*, unsigned count),
 const S*);

#endif // Neighborhood_h_
@


1.8.1.1
log
@New Closure and Function Nbh constructors.
@
text
@a10 3
// Revision 1.8  1994/12/22  18:10:15  fjsoria
// none
//
d24 1
a24 1
// Finish up the list of generic reductions.
a39 1
template <class P, class Q> class IA_ClosureNbh;
a63 4

    IA_Neighborhood(const IA_ClosureNbh<P,Q> &);
    IA_Neighborhood(const IA_Set<Q> &s, IA_Set<P>(*f)(Q));
    IA_Neighborhood(const IA_Set<Q> &s, IA_Set<P>(*f)(const Q&));
@


1.8.1.2
log
@CoreImage has been re-merged with Image.  All special stuff should be
friends of FBI now.
@
text
@a10 3
// Revision 1.8.1.1  1994/12/28  18:22:11  thoth
// New Closure and Function Nbh constructors.
//
d94 1
a94 1
(const IA_Image<IA_Point<int>, T> &img,
d104 1
a104 1
(const IA_Image<IA_Point<int>, T> &img,
d113 1
a113 1
(const IA_Image<IA_Point<int>, T> &img,
d125 1
a125 1
(const IA_Image<IA_Point<int>, T> &img,
d133 1
a133 1
(const IA_Image<IA_Point<int>, T> &img,
d145 1
a145 1
 const IA_Image<IA_Point<int>, T> &img,
d155 1
a155 1
 const IA_Image<IA_Point<int>, T> &img,
d164 1
a164 1
 const IA_Image<IA_Point<int>, T> &img,
d176 1
a176 1
 const IA_Image<IA_Point<int>, T> &img,
d184 1
a184 1
 const IA_Image<IA_Point<int>, T> &img,
d206 1
a206 1
(const IA_Image<IA_Point<int>, T> &img,
d226 1
a226 1
(const IA_Image<IA_Point<int>, T> &img,
d247 1
a247 1
(const IA_Image<IA_Point<int>, T> &img,
d267 1
a267 1
(const IA_Image<IA_Point<int>, T> &img,
d287 1
a287 1
(const IA_Image<IA_Point<int>, T> &img,
d309 1
a309 1
(const IA_Image<IA_Point<int>, T> &img,
@


1.7
log
@fixed friend template fucntion for g++
@
text
@d11 3
d60 1
@


1.6
log
@DOS-inspired name rework.
@
text
@d11 3
d21 1
a21 1
// Finish up the list of generic reductions.
d40 11
a50 1
    template <class R, class S, class T> friend class IA_FBI<P,Q,R,S,T>;
@


1.5
log
@Name sanitization
@
text
@d10 4
a13 1
// $Log: Neighborhood.h,v $
d59 1
a59 1
#include "NeighborhoodOps.h"
@


1.4
log
@New automatic neighborhood decomposition capability.
@
text
@d11 3
d65 4
a68 4
IA_Image<IA_IntPoint, T> neighborhood_reduction
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &tmpl,
 const IA_Set<IA_IntPoint> &dst,
d75 4
a78 4
IA_Image<IA_IntPoint, S> neighborhood_reduction
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
 const IA_Set<IA_IntPoint> &dst,
d84 4
a87 4
IA_Image<IA_IntPoint, T> neighborhood_reduction
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
 const IA_Set<IA_IntPoint> &dst,
d96 4
a99 4
IA_Image<IA_IntPoint, S> neighborhood_reduction
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
 const IA_Set<IA_IntPoint> &dst,
d104 4
a107 4
IA_Image<IA_IntPoint, T> neighborhood_reduction
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
 const IA_Set<IA_IntPoint> &dst,
d115 4
a118 4
IA_Image<IA_IntPoint, T> neighborhood_reduction
(const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &tmpl,
 const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &dst,
d125 4
a128 4
IA_Image<IA_IntPoint, S> neighborhood_reduction
(const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
 const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &dst,
d134 4
a137 4
IA_Image<IA_IntPoint, T> neighborhood_reduction
(const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
 const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &dst,
d146 4
a149 4
IA_Image<IA_IntPoint, S> neighborhood_reduction
(const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
 const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &dst,
d154 4
a157 4
IA_Image<IA_IntPoint, T> neighborhood_reduction
(const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
 const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &dst,
d167 3
a169 3
IA_Image<IA_IntPoint, T> backw_nbh_inv_core1
(IA_IntPoint src_infimum,
 IA_IntPoint src_width,
d171 2
a172 2
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dest_ps,
d177 4
a180 4
IA_Image<IA_IntPoint, T> backw_nbh_inv1
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &invnbh,
 const IA_IntPointSet &dest_ps,
d187 3
a189 3
IA_Image<IA_IntPoint, S> backw_nbh_inv_core
(IA_IntPoint src_infimum,
 IA_IntPoint src_width,
d191 2
a192 2
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dst,
d197 4
a200 4
IA_Image<IA_IntPoint, S> backw_nbh_inv
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dst,
d208 3
a210 3
IA_Image<IA_IntPoint, S> backw_nbh_inv_core3
(IA_IntPoint src_infimum,
 IA_IntPoint src_width,
d212 2
a213 2
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dst,
d218 4
a221 4
IA_Image<IA_IntPoint, S> backw_nbh_inv3
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dst,
d228 3
a230 3
IA_Image<IA_IntPoint, T> forw_nbh_inv_core1
(IA_IntPoint src_infimum,
 IA_IntPoint src_width,
d232 2
a233 2
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dest_ps,
d238 4
a241 4
IA_Image<IA_IntPoint, T> forw_nbh_inv1
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &invnbh,
 const IA_IntPointSet &dest_ps,
d248 3
a250 3
IA_Image<IA_IntPoint, S> forw_nbh_inv_core
(IA_IntPoint src_infimum,
 IA_IntPoint src_width,
d252 2
a253 2
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dst,
d258 4
a261 4
IA_Image<IA_IntPoint, S> forw_nbh_inv
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dst,
d269 3
a271 3
IA_Image<IA_IntPoint, S> forw_nbh_inv_core3
(IA_IntPoint src_infimum,
 IA_IntPoint src_width,
d273 3
a275 3
 const IA_Set<IA_IntPoint> &src_ps,
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dst,
d280 4
a283 4
IA_Image<IA_IntPoint, S> forw_nbh_inv3
(const IA_CoreImage<IA_IntPoint, T> &img,
 const IA_Set<IA_IntPoint> &nbh,
 const IA_IntPointSet &dst,
@


1.3
log
@Finish up the list of generic reductions.
@
text
@d11 3
d45 2
@


1.2
log
@generic neighborhood reductions are now available.
@
text
@d11 3
d52 4
d64 2
d67 1
a67 1
IA_Image<IA_IntPoint, S> neighborhood_Reduction
d71 1
d73 7
d81 12
d96 1
a96 1
IA_Image<IA_IntPoint, T> neighborhood_Reduction
d100 2
a101 3
 T (*Gamma)(T*, unsigned count),
 T gamma_zero) {
    return neighborhood_Reduction(img, nbh, dst, Gamma, gamma_zero, (T*)0);
d104 2
d107 1
a107 1
IA_Image<IA_IntPoint, T> neighborhood_reductioN
d114 2
d117 1
a117 1
IA_Image<IA_IntPoint, S> neighborhood_ReductioN
d121 1
d123 7
d131 12
d146 1
a146 1
IA_Image<IA_IntPoint, T> neighborhood_ReductioN
d150 2
a151 3
 T (*Gamma)(T*, unsigned count),
 T gamma_zero) {
    return neighborhood_ReductioN(nbh, img, dst, Gamma, gamma_zero, (T*)0);
d199 20
d256 21
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log: DDTempl.h,v $
d21 2
d25 1
d46 1
d48 138
@
