head	1.3;
access
	monica
	thoth;
symbols;
locks
	thoth:1.3; strict;
comment	@// @;


1.3
date	94.10.24.20.29.59;	author monica;	state Exp;
branches;
next	1.2;

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

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


desc
@Test of assorted image-image operations.
@


1.3
log
@updated type names
@
text
@// Emacs: -*- C++ -*-

//
// $Log: test-ops.h,v $
// Revision 1.2  1994/08/18  22:17:06  thoth
// incomplete updating.
//
// Revision 1.1  93/03/10  13:55:31  thoth
// Initial revision
// 

#ifndef test_ops_h_
#define test_ops_h_

#include "Image.h"
#include "ClosureI.h"

template <class T>
class RandomDI: public IA_ClosureI<IA_Point<int>, T> {
    T	max,min;
  public:
    RandomDI(IA_Set<IA_Point<int> > ps, T b1, T b2=0);
    T operator()(const IA_Point<int>&) const;
    IA_ClosureI<IA_Point<int>,T> *clone_self() const { return new RandomDI<T>(*this); }
};

template <class T>
class CopyDI: public IA_ClosureI<IA_Point<int>,T> {
    IA_Image<IA_Point<int>,T>	copy;
  public:
    CopyDI(const IA_Image<IA_Point<int>,T> &copy_)
    :IA_ClosureI<IA_Point<int> ,T>(copy_.domain()), copy(copy_) {}
    T operator()(const IA_Point<int>  &p) const { return copy(p); }
    IA_ClosureI<IA_Point<int> ,T> *clone_self() const { return new CopyDI<T>(*this); }
};

template <class T>
void test_plus(const IA_Image<IA_Point<int> ,T> &a,
	       const IA_Image<IA_Point<int> ,T> &b,
	       const IA_Image<IA_Point<int> ,T> &ab);

template <class T>
void test_minus(const IA_Image<IA_Point<int> ,T> &a,
		const IA_Image<IA_Point<int> ,T> &b,
		const IA_Image<IA_Point<int> ,T> &ab);

template <class T>
void test_mult(const IA_Image<IA_Point<int> ,T> &a,
	       const IA_Image<IA_Point<int> ,T> &b,
	       const IA_Image<IA_Point<int> ,T> &ab);

template <class T>
void test_divide(const IA_Image<IA_Point<int> ,T> &a,
		 const IA_Image<IA_Point<int> ,T> &b,
		 const IA_Image<IA_Point<int> ,T> &ab);

template <class T>
void test_equal(const IA_Image<IA_Point<int> ,T> &a,
		const IA_Image<IA_Point<int> ,T> &b,
		int ab);

template <class T>
void test_pweq(const IA_Image<IA_Point<int> ,T> &a,
	       const IA_Image<IA_Point<int> ,T> &b,
	       const IA_Image<IA_Point<int> ,T> &ab);

template <class T>
void test_strictne(const IA_Image<IA_Point<int> ,T> &a,
		   const IA_Image<IA_Point<int> ,T> &b,
		   int ab);

template <class P, class T>
void test_restrict(const IA_Image<P,T> &a,
		   const IA_Set<IA_Point<int> > &ps,
		   const IA_Image<IA_Point<int> ,T> &arps);

template <class P, class T>
void test_restrict(const IA_Image<P,T> &a,
		   const IA_Set<IA_Point<double> > &ps,
		   const IA_Image<P,T> &arps);

#ifdef NEED_CLUE
// If these clues are provided to the template instantiator, the template
// versions will not be compiled.

// Compiler clues for int images
void test_plus(const IA_Image<IA_Point<int> ,int> &a,
	       const IA_Image<IA_Point<int> ,int> &b,
	       const IA_Image<IA_Point<int> ,int> &ab);

void test_minus(const IA_Image<IA_Point<int> ,int> &a,
		const IA_Image<IA_Point<int> ,int> &b,
		const IA_Image<IA_Point<int> ,int> &ab);

void test_mult(const IA_Image<IA_Point<int> ,int> &a,
	       const IA_Image<IA_Point<int> ,int> &b,
	       const IA_Image<IA_Point<int> ,int> &ab);

void test_divide(const IA_Image<IA_Point<int> ,int> &a,
		 const IA_Image<IA_Point<int> ,int> &b,
		 const IA_Image<IA_Point<int> ,int> &ab);

void test_equal(const IA_Image<IA_Point<int> ,int> &a,
		const IA_Image<IA_Point<int> ,int> &b,
		int ab);

void test_equal(const IA_Image<IA_Point<int> ,int> &a,
		const IA_Image<IA_Point<int> ,int> &b,
		int ab);

void test_pweq(const IA_Image<IA_Point<int> ,int> &a,
	       const IA_Image<IA_Point<int> ,int> &b,
	       const IA_Image<IA_Point<int> ,int> &ab);

void test_strictne(const IA_Image<IA_Point<int> ,int> &a,
		   const IA_Image<IA_Point<int> ,int> &b,
		   int ab);
#endif

#endif
@


1.2
log
@incomplete updating.
@
text
@d4 4
a7 1
// $Log:	test-ops.h,v $
d19 1
a19 1
class RandomDI: public IA_ClosureI<IA_IntPoint,T> {
d22 3
a24 3
    RandomDI(IA_IntPointSet ps, T b1, T b2=0);
    T operator()(const IA_IntPoint&) const;
    IA_ClosureI<IA_IntPoint,T> *clone_self() const { return new RandomDI<T>(*this); }
d28 2
a29 2
class CopyDI: public IA_ClosureI<IA_IntPoint,T> {
    IA_Image<IA_IntPoint,T>	copy;
d31 4
a34 4
    CopyDI(const IA_Image<IA_IntPoint,T> &copy_)
    :IA_ClosureI<IA_IntPoint,T>(copy_.domain()), copy(copy_) {}
    T operator()(const IA_IntPoint&p) const { return copy(p); }
    IA_ClosureI<IA_IntPoint,T> *clone_self() const { return new CopyDI<T>(*this); }
d38 3
a40 3
void test_plus(const IA_Image<IA_IntPoint,T> &a,
	       const IA_Image<IA_IntPoint,T> &b,
	       const IA_Image<IA_IntPoint,T> &ab);
d43 3
a45 3
void test_minus(const IA_Image<IA_IntPoint,T> &a,
		const IA_Image<IA_IntPoint,T> &b,
		const IA_Image<IA_IntPoint,T> &ab);
d48 3
a50 3
void test_mult(const IA_Image<IA_IntPoint,T> &a,
	       const IA_Image<IA_IntPoint,T> &b,
	       const IA_Image<IA_IntPoint,T> &ab);
d53 3
a55 3
void test_divide(const IA_Image<IA_IntPoint,T> &a,
		 const IA_Image<IA_IntPoint,T> &b,
		 const IA_Image<IA_IntPoint,T> &ab);
d58 2
a59 2
void test_equal(const IA_Image<IA_IntPoint,T> &a,
		const IA_Image<IA_IntPoint,T> &b,
d63 3
a65 3
void test_pweq(const IA_Image<IA_IntPoint,T> &a,
	       const IA_Image<IA_IntPoint,T> &b,
	       const IA_Image<IA_IntPoint,T> &ab);
d68 2
a69 2
void test_strictne(const IA_Image<IA_IntPoint,T> &a,
		   const IA_Image<IA_IntPoint,T> &b,
d74 2
a75 2
		   const IA_Set<IA_IntPoint> &ps,
		   const IA_Image<IA_IntPoint,T> &arps);
d79 1
a79 1
		   const IA_Set<IA_FloatPoint> &ps,
d87 15
a101 15
void test_plus(const IA_Image<IA_IntPoint,int> &a,
	       const IA_Image<IA_IntPoint,int> &b,
	       const IA_Image<IA_IntPoint,int> &ab);

void test_minus(const IA_Image<IA_IntPoint,int> &a,
		const IA_Image<IA_IntPoint,int> &b,
		const IA_Image<IA_IntPoint,int> &ab);

void test_mult(const IA_Image<IA_IntPoint,int> &a,
	       const IA_Image<IA_IntPoint,int> &b,
	       const IA_Image<IA_IntPoint,int> &ab);

void test_divide(const IA_Image<IA_IntPoint,int> &a,
		 const IA_Image<IA_IntPoint,int> &b,
		 const IA_Image<IA_IntPoint,int> &ab);
d103 2
a104 2
void test_equal(const IA_Image<IA_IntPoint,int> &a,
		const IA_Image<IA_IntPoint,int> &b,
d107 2
a108 2
void test_equal(const IA_Image<IA_IntPoint,int> &a,
		const IA_Image<IA_IntPoint,int> &b,
d111 3
a113 3
void test_pweq(const IA_Image<IA_IntPoint,int> &a,
	       const IA_Image<IA_IntPoint,int> &b,
	       const IA_Image<IA_IntPoint,int> &ab);
d115 2
a116 2
void test_strictne(const IA_Image<IA_IntPoint,int> &a,
		   const IA_Image<IA_IntPoint,int> &b,
@


1.1
log
@Initial revision
@
text
@d4 4
a7 1
// $Log:	test002.c,v $
d12 2
a13 2
#include "DiscreteImage.h"
#include "OtherDI.h"
d16 1
a16 1
class RandomDI: public IA_OtherDI<T> {
d21 1
a21 1
    IA_BaseDI<T> *clone_self() const { return new RandomDI<T>(*this); }
d25 2
a26 2
class CopyDI: public IA_OtherDI<T> {
    IA_DiscreteImage<T>	copy;
d28 2
a29 2
    CopyDI(const IA_DiscreteImage<T> &copy_)
    :IA_OtherDI<T>(copy_.domain()), copy(copy_) {}
d31 1
a31 1
    IA_BaseDI<T> *clone_self() const { return new CopyDI<T>(*this); }
d35 3
a37 2
void test_plus(const IA_DiscreteImage<T> &a, const IA_DiscreteImage<T> &b,
	       const IA_DiscreteImage<T> &ab);
d40 3
a42 2
void test_minus(const IA_DiscreteImage<T> &a, const IA_DiscreteImage<T> &b,
		const IA_DiscreteImage<T> &ab);
d45 3
a47 2
void test_mult(const IA_DiscreteImage<T> &a, const IA_DiscreteImage<T> &b,
	       const IA_DiscreteImage<T> &ab);
d50 3
a52 2
void test_divide(const IA_DiscreteImage<T> &a, const IA_DiscreteImage<T> &b,
		 const IA_DiscreteImage<T> &ab);
d55 2
a56 1
void test_equal(const IA_DiscreteImage<T> &a, const IA_DiscreteImage<T> &b,
d60 3
a62 2
void test_pweq(const IA_DiscreteImage<T> &a, const IA_DiscreteImage<T> &b,
	       const IA_DiscreteImage<T> &ab);
d65 2
a66 1
void test_strictne(const IA_DiscreteImage<T> &a, const IA_DiscreteImage<T> &b,
d69 10
d84 15
a98 12
void test_plus(const IA_DiscreteImage<int> &a, const IA_DiscreteImage<int> &b,
	       const IA_DiscreteImage<int> &ab);

void test_minus(const IA_DiscreteImage<int> &a, const IA_DiscreteImage<int> &b,
		const IA_DiscreteImage<int> &ab);

void test_mult(const IA_DiscreteImage<int> &a, const IA_DiscreteImage<int> &b,
	       const IA_DiscreteImage<int> &ab);

void test_divide(const IA_DiscreteImage<int> &a,
		 const IA_DiscreteImage<int> &b,
		 const IA_DiscreteImage<int> &ab);
d100 2
a101 1
void test_equal(const IA_DiscreteImage<int> &a, const IA_DiscreteImage<int> &b,
d104 2
a105 1
void test_equal(const IA_DiscreteImage<int> &a, const IA_DiscreteImage<int> &b,
d108 3
a110 2
void test_pweq(const IA_DiscreteImage<int> &a, const IA_DiscreteImage<int> &b,
	       const IA_DiscreteImage<int> &ab);
d112 2
a113 2
void test_strictne(const IA_DiscreteImage<int> &a,
		   const IA_DiscreteImage<int> &b,
@
