head	1.9;
access;
symbols
	bobbase:1.9
	bob:1.9
	r2_1:1.9
	r2_0:1.8
	r1_1_beta:1.7
	r1_1_alpha:1.6
	r1_0:1.6
	r0_11:1.6
	r0_10:1.5
	r0_9:1.4;
locks; strict;
comment	@// @;


1.9
date	94.09.16.14.57.11;	author thoth;	state Exp;
branches;
next	1.8;

1.8
date	94.08.22.15.20.29;	author thoth;	state Exp;
branches;
next	1.7;

1.7
date	94.07.25.17.26.39;	author thoth;	state Exp;
branches;
next	1.6;

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

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

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

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

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

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


desc
@Integer discrete template implementation.
@


1.9
log
@more DOS-inspired renaming.
@
text
@// Emacs: -*- C++ -*-

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

static char copyright[] = "Copyright 1993, Center for Computer Vision and Visualization,\nUniversity of Florida.  All rights reserved.\n";

// Emacs -*- C++ -*-

static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.8 1994/08/22 15:20:29 thoth Exp thoth $";

//
// $Log: IntDDTempl.c,v $
// Revision 1.8  1994/08/22  15:20:29  thoth
// DOS-inspired name rework.
//
// Revision 1.7  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.6  1994/02/12  19:37:41  thoth
// Need min and max for pointwise operations.
//
// Revision 1.5  1994/01/07  15:10:00  thoth
// Image class is now CoreImage and named image types are
// Image<P,T>.
//
// Revision 1.4  1993/11/17  18:22:03  thoth
// IPSIter is now PSIter<IntPoint>.
// sample template reduction operation is no longer needed.
// urk was causing problems through name conflicts.
//
// Revision 1.3  1993/10/05  19:33:08  thoth
// Move to new Closure naming convention.
//
// Revision 1.2  1993/09/27  15:51:21  thoth
// Prototype template reduction operation.
//
// Revision 1.1  93/09/15  12:54:32  thoth
// Initial revision
// 
// Revision 1.5  93/05/27  11:36:26  thoth
// Copyright Notices
// 
// Revision 1.4  93/05/26  17:01:14  thoth
// constructors that specify pointsets aren't supported right now.
// 
// Revision 1.3  93/04/29  11:20:11  thoth
// Convolutions now know about VectorDIs.
// 
// Revision 1.2  93/04/08  13:13:18  thoth
// *** empty log message ***
// 
// Revision 1.1  93/03/18  11:03:44  thoth
// Initial revision
// 

#include <limits.h>
#include <values.h>

#include "PSIter.h"

#include "InvDT.h"
#include "ClosureDT.h"
#include "IntDDTempl.h"

#include "VectorI.h"
#include "ImageIter.h"


template <class T>
inline T max(T a, T b)
{
    return (a<b)?b:a;
}

template <class T>
inline T min(T a, T b)
{
    return (a<b)?a:b;
}
#include "IntConv.c"


class urk: public IA_ClosureDT<IA_Image<IA_Point<int>,int> > {
  public:
    urk()
    :IA_ClosureDT<IA_Image<IA_Point<int>,int> >(IA_Set<IA_Point<int> >()) {}
    IA_Image<IA_Point<int>,int> operator()(const IA_Point<int>&) const { return IA_Image<IA_Point<int>,int>(); }
    IA_ClosureDT<IA_Image<IA_Point<int>,int> > *clone_self() const { return 0; }
    IA_BaseDT<IA_Image<IA_Point<int>,int> > *restricted_to(const IA_Set<IA_Point<int> > &) const { return new urk(); }
};

typedef IA_Image<IA_Point<int>,int> (*IDIfunc)(const IA_Point<int>&);

static void dummy1()
{
    IA_Set<IA_Point<int> >	ps;
    IA_Image<IA_Point<int>,int>	im;
    IA_IntDDTemplate	//t1(ps, im),
	t2(0,im),
//	t3(ps,(IA_Image<IA_Point<int>,int>(*)(const IA_Point<int>&))0),
#if 0
	t4(0,(IA_Image<IA_Point<int>,int>
	      (*)
	      (const IA_Point<int>&)
	      )0),
#else
	t4(0,(IDIfunc)0),
#endif
	t5(*(IA_ClosureDT<IA_Image<IA_Point<int>,int> >*)0);
}
@


1.8
log
@DOS-inspired name rework.
@
text
@d12 1
a12 1
static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.7 1994/07/25 17:26:39 thoth Exp thoth $";
d16 3
d64 1
a64 1
#include "InvariantDT.h"
@


1.7
log
@Name sanitization
@
text
@d12 1
a12 1
static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.6 1994/02/12 19:37:41 thoth Exp $";
d16 3
d80 1
a80 1
#include "IntConvolutions.c"
@


1.6
log
@Need min and max for pointwise operations.
@
text
@d12 1
a12 1
static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.5 1994/01/07 15:10:00 thoth Exp thoth $";
d16 3
d80 1
a80 1
class urk: public IA_ClosureDT<IA_Image<IA_IntPoint,int> > {
d83 4
a86 4
    :IA_ClosureDT<IA_Image<IA_IntPoint,int> >(IA_IntPointSet()) {}
    IA_Image<IA_IntPoint,int> operator()(const IA_IntPoint&) const { return IA_Image<IA_IntPoint,int>(); }
    IA_ClosureDT<IA_Image<IA_IntPoint,int> > *clone_self() const { return 0; }
    IA_BaseDT<IA_Image<IA_IntPoint,int> > *restricted_to(const IA_IntPointSet &) const { return new urk(); }
d89 1
a89 1
typedef IA_Image<IA_IntPoint,int> (*IDIfunc)(const IA_IntPoint&);
d93 2
a94 2
    IA_IntPointSet	ps;
    IA_Image<IA_IntPoint,int>	im;
d97 1
a97 1
//	t3(ps,(IA_Image<IA_IntPoint,int>(*)(const IA_IntPoint&))0),
d99 1
a99 1
	t4(0,(IA_Image<IA_IntPoint,int>
d101 1
a101 1
	      (const IA_IntPoint&)
d106 1
a106 1
	t5(*(IA_ClosureDT<IA_Image<IA_IntPoint,int> >*)0);
@


1.5
log
@Image class is now CoreImage and named image types are
Image<P,T>.
@
text
@d12 1
a12 1
static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.4 1993/11/17 18:22:03 thoth Exp $";
d16 4
d62 12
@


1.4
log
@IPSIter is now PSIter<IntPoint>.
sample template reduction operation is no longer needed.
urk was causing problems through name conflicts.
@
text
@d12 1
a12 1
static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.3 1993/10/05 19:33:08 thoth Exp thoth $";
d16 5
d61 1
a61 1
class urk: public IA_ClosureDT<IA_IntDiscreteImage> {
d64 4
a67 4
    :IA_ClosureDT<IA_IntDiscreteImage>(IA_IntPointSet()) {}
    IA_IntDiscreteImage operator()(const IA_IntPoint&) const { return IA_IntDiscreteImage(); }
    IA_ClosureDT<IA_IntDiscreteImage> *clone_self() const { return 0; }
    IA_BaseDT<IA_IntDiscreteImage> *restricted_to(const IA_IntPointSet &) const { return new urk(); }
d70 2
d75 1
a75 1
    IA_IntDiscreteImage	im;
d78 10
a87 3
//	t3(ps,(IA_IntDiscreteImage(*)(const IA_IntPoint&))0),
	t4(0,(IA_IntDiscreteImage(*)(const IA_IntPoint&))0),
	t5(*(IA_ClosureDT<IA_IntDiscreteImage>*)0);
@


1.3
log
@Move to new Closure naming convention.
@
text
@d12 1
a12 1
static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.2 1993/09/27 15:51:21 thoth Exp thoth $";
d16 3
d44 1
a44 1
#include "IPSIter.h"
a54 23
IA_IntDiscreteImage template_sum(IA_IntPointSet domain,
				 IA_IntDDTemplate templ,
				 IA_IntPointSet dest_domain)
{
    IA_IntDiscreteImage	rval(dest_domain, 0);

    IA_IPSIter	psiter(domain);
    IA_IntPoint	scan;

    while (psiter(scan)) {
	IA_IntDiscreteImage	curr = templ(scan);
	IA_IPIter<IA_IntPoint, int>	iiter(curr);
	IA_IntPoint	p;
	int	val;

	while (iiter(p,val)) {
	    if (rval.domain().contains(p))
		rval[p] += val;
	}
    }
    return rval;
}

d73 1
a73 1
	t5(urk);
@


1.2
log
@Prototype template reduction operation.
@
text
@d12 1
a12 1
static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.1 93/09/15 12:54:32 thoth Exp Locker: thoth $";
d15 4
a18 1
// $Log:	IntDDTempl.c,v $
d44 1
a44 1
#include "OtherDT.h"
d76 1
a76 1
class urk: public IA_OtherDT<IA_IntDiscreteImage> {
d79 1
a79 1
    :IA_OtherDT<IA_IntDiscreteImage>(IA_IntPointSet()) {}
d81 1
a81 1
    IA_OtherDT<IA_IntDiscreteImage> *clone_self() const { return 0; }
@


1.1
log
@Initial revision
@
text
@d12 1
a12 1
static char IntDDTempl_rcsid[] = "$Id: IntDDTempl.c,v 1.5 93/05/27 11:36:26 thoth Exp $";
d16 3
d46 1
d48 24
@
