head	1.10;
access;
symbols
	bobbase:1.10
	bob:1.10.1
	r2_1:1.9
	r2_0:1.9
	r1_1_beta:1.8
	r1_1_alpha:1.7
	r1_0:1.7
	r0_11:1.7
	r0_10:1.6
	r0_9:1.3;
locks
	thoth:1.10.1.3; strict;
comment	@// @;


1.10
date	94.12.23.01.05.10;	author ljr;	state Exp;
branches
	1.10.1.1;
next	1.9;

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

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

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

1.6
date	94.01.31.15.48.12;	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.12.29.17.04.57;	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.50;	author thoth;	state Exp;
branches;
next	1.1;

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

1.10.1.1
date	94.12.28.17.42.53;	author thoth;	state Exp;
branches;
next	1.10.1.2;

1.10.1.2
date	95.01.09.17.52.46;	author thoth;	state Exp;
branches;
next	1.10.1.3;

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


desc
@Integer discrete image declaration.
@


1.10
log
@changed #include <sys/types.h> to #include "compat.h"
@
text
@// Emacs: -*- C++ -*-

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


//
// $Log: IntDI.h,v $
// Revision 1.9  1994/08/22  15:20:29  thoth
// DOS-inspired name rework.
//
// Revision 1.8  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.7  1994/03/30  13:51:17  thoth
// inline non-member functions to do image input.
//
// Revision 1.6  1994/01/31  15:48:12  thoth
// read_PGM now can return the maxval.
//
// 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/12/29  17:04:57  thoth
// pointarray valuearray constructor.
//
// Revision 1.3  1993/10/05  19:33:08  thoth
// Move to new Closure naming convention.
//
// Revision 1.2  1993/09/27  15:51:50  thoth
// op= with a constant now works.
//
// Revision 1.1  93/09/15  12:55:01  thoth
// Initial revision
// 
// Revision 1.7  93/06/10  17:24:22  thoth
// 
// 
// Revision 1.6  93/05/27  11:22:24  thoth
// Copyright Notices
// 
// Revision 1.5  93/05/26  17:02:27  thoth
// write_PGM convenience friends.
// 
// Revision 1.4  93/04/08  13:17:02  thoth
// write_PGM will now compute maxval if not supplied.
// read/write_PGM now accept character strings as well
// as ostream&s and treat them as filenames.
// 
// Revision 1.3  93/03/10  13:36:18  thoth
// Provide some simple inline definitions that we don't use perl for.
// 
// Revision 1.2  93/02/23  14:31:04  thoth
// FunctionRefDIs are supported again.
// OtherDIs are supported.
// We have a clue for operator<<.
// operations +-*/ are supported for image-image.
// 
// Revision 1.1  93/02/20  12:18:44  thoth
// Initial revision
// 
// 

#ifndef IntDI_h_
#define IntDI_h_

#include "compat.h"
#include "IntPoint.h"
#include "CoreImage.h"

#define SUPPRESS_INCLUDE
#include "Image.h"
#undef SUPPRESS_INCLUDE

#include	<complex.h>	// for the complex conversion
#include "Bit.h"		// for the to_bit converter function

class IA_Image<IA_Point<int>,int>: public IA_CoreImage<IA_Point<int>,int>
{
  public:
    IA_Image():IA_CoreImage<IA_Point<int>,int>() {}

    IA_Image(const IA_Image<IA_Point<int>,int>& im)
    :IA_CoreImage<IA_Point<int>,int>(im) {}

    IA_Image(IA_Set<IA_Point<int> > ps, int value)
    :IA_CoreImage<IA_Point<int>,int>(ps,value) {}

    IA_Image(IA_Set<IA_Point<int> > ps, int *vp, unsigned sz,
			int giveaway=0)
    :IA_CoreImage<IA_Point<int>,int>(ps, vp, sz, giveaway) {}

    IA_Image(IA_Set<IA_Point<int> > ps, const int *vp, unsigned sz)
    :IA_CoreImage<IA_Point<int>,int>(ps, vp, sz) {}

    IA_Image(const IA_Point<int> *pp, unsigned plen, int *vp, unsigned vlen, int giveaway=0)
    :IA_CoreImage<IA_Point<int>,int>(pp, plen, vp, vlen, giveaway) {}
    IA_Image(const IA_Point<int> *pp, unsigned plen, const int *vp, unsigned vlen)
    :IA_CoreImage<IA_Point<int>,int>(pp, plen, vp, vlen) {}

    IA_Image(const IA_ClosureI<IA_Point<int>,int> &img)
    :IA_CoreImage<IA_Point<int>,int>(img) {}

    IA_Image(IA_Set<IA_Point<int> > ps, int (*f)(const IA_Point<int>&))
    :IA_CoreImage<IA_Point<int>,int>(ps,f) {}

    IA_Image( const IA_CoreImage<IA_Point<int>,int> &d)
    :IA_CoreImage<IA_Point<int>,int>(d) {}

    virtual ~IA_Image(){ }

    IA_Image& operator=(int v) {
	(IA_CoreImage<IA_Point<int>,int>&)*this = v;
	return *this;
    }
#include	"IntIOps.h"

    static IA_Image read_PGM(istream &, int *maxval=0);
    static IA_Image read_PGM(const char *fname, int *maxval=0);

    ostream& write_PGM(ostream &, unsigned) const;
    ostream& write_PGM(ostream &) const;
    void write_PGM(const char *fname, unsigned) const;
    void write_PGM(const char *fname) const;
};

inline int operator!=(const IA_CoreImage<IA_Point<int>,int> &lhs,
	       const IA_CoreImage<IA_Point<int>,int> &rhs) {
    return ! (lhs == rhs);
}
inline int operator!=(const IA_CoreImage<IA_Point<int>,int> &lhs, int rhs) {
    return ! (lhs == rhs);
}
inline int operator!=(int lhs, const IA_CoreImage<IA_Point<int>,int> &rhs) {
    return ! (rhs == lhs);
}

//
//

inline IA_Image<IA_Point<int>,int> read_int_PGM(istream &i, int *maxval=0) {
    return IA_Image<IA_Point<int>,int>::read_PGM(i, maxval);
}
inline IA_Image<IA_Point<int>,int> read_int_PGM(const char *fname,
					      int *maxval=0) {
    return IA_Image<IA_Point<int>,int>::read_PGM(fname, maxval);
}

//
//

inline ostream& write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, ostream &o, unsigned max) {
    return IA_Image<IA_Point<int>,int>(im).write_PGM(o, max);
}

inline ostream& write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, ostream &o) {
    return IA_Image<IA_Point<int>,int>(im).write_PGM(o);
}

inline void write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, const char *fname) {
    IA_Image<IA_Point<int>,int>(im).write_PGM(fname);
}

inline void write_PGM(const IA_CoreImage<IA_Point<int>,int> &im,
		      const char *fname, unsigned max) {
    IA_Image<IA_Point<int>,int>(im).write_PGM(fname, max);
}

//
//

// compiler clue to allow inexact matches on a function template
ostream& operator <<(ostream&, const IA_CoreImage<IA_Point<int>,int>&);


#endif
@


1.10.1.1
log
@Image operations are now friendly with FBI.
Image I/O is now ROF
@
text
@a10 3
// Revision 1.10  1994/12/23  01:05:10  ljr
// changed #include <sys/types.h> to #include "compat.h"
//
d83 1
a83 1
public:
a112 1
public:
d119 2
a120 1
#if 0
a127 1
#endif
a129 2
#include	"IntIOps.h"

d144 3
a146 1
inline IA_Image<IA_Point<int>,int> read_int_PGM(istream &i, int *maxval=0);
d148 3
a150 1
					      int *maxval=0);
d155 3
a157 1
inline ostream& write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, ostream &o, unsigned max);
d159 3
a161 1
inline ostream& write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, ostream &o);
d163 3
a165 1
inline void write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, const char *fname);
d168 3
a170 1
		      const char *fname, unsigned max);
@


1.10.1.2
log
@Outline functions shouldn't have inline qualifier.
@
text
@a10 4
// Revision 1.10.1.1  1994/12/28  17:42:53  thoth
// Image operations are now friendly with FBI.
// Image I/O is now ROF
//
d150 2
a151 2
IA_Image<IA_Point<int>,int> read_int_PGM(istream &i, int *maxval=0);
IA_Image<IA_Point<int>,int> read_int_PGM(const char *fname,
d157 1
a157 1
ostream& write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, ostream &o, unsigned max);
d159 1
a159 1
ostream& write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, ostream &o);
d161 1
a161 1
void write_PGM(const IA_CoreImage<IA_Point<int>,int> &im, const char *fname);
d163 1
a163 1
void write_PGM(const IA_CoreImage<IA_Point<int>,int> &im,
@


1.10.1.3
log
@CoreImage has been re-merged with Image.  All special stuff should be
friends of FBI now.
@
text
@a10 3
// Revision 1.10.1.2  1995/01/09  17:52:46  thoth
// Outline functions shouldn't have inline qualifier.
//
d79 1
a79 1
//#include "Image.h"
d88 1
a88 2
#if 0
class IA_Image<IA_Point<int>,int>: public IA_Image<IA_Point<int>,int>
d91 1
a91 1
    IA_Image():IA_Image<IA_Point<int>,int>() {}
d94 1
a94 1
    :IA_Image<IA_Point<int>,int>(im) {}
d97 1
a97 1
    :IA_Image<IA_Point<int>,int>(ps,value) {}
d101 1
a101 1
    :IA_Image<IA_Point<int>,int>(ps, vp, sz, giveaway) {}
d104 1
a104 1
    :IA_Image<IA_Point<int>,int>(ps, vp, sz) {}
d107 1
a107 1
    :IA_Image<IA_Point<int>,int>(pp, plen, vp, vlen, giveaway) {}
d109 1
a109 1
    :IA_Image<IA_Point<int>,int>(pp, plen, vp, vlen) {}
d112 1
a112 1
    :IA_Image<IA_Point<int>,int>(img) {}
d115 1
a115 1
    :IA_Image<IA_Point<int>,int>(ps,f) {}
d117 2
a118 2
    IA_Image( const IA_Image<IA_Point<int>,int> &d)
    :IA_Image<IA_Point<int>,int>(d) {}
d124 1
a124 1
	(IA_Image<IA_Point<int>,int>&)*this = v;
a136 1
#endif
d140 2
a141 2
inline int operator!=(const IA_Image<IA_Point<int>,int> &lhs,
	       const IA_Image<IA_Point<int>,int> &rhs) {
d144 1
a144 1
inline int operator!=(const IA_Image<IA_Point<int>,int> &lhs, int rhs) {
d147 1
a147 1
inline int operator!=(int lhs, const IA_Image<IA_Point<int>,int> &rhs) {
d161 1
a161 1
ostream& write_PGM(const IA_Image<IA_Point<int>,int> &im, ostream &o, unsigned max);
d163 1
a163 1
ostream& write_PGM(const IA_Image<IA_Point<int>,int> &im, ostream &o);
d165 1
a165 1
void write_PGM(const IA_Image<IA_Point<int>,int> &im, const char *fname);
d167 1
a167 1
void write_PGM(const IA_Image<IA_Point<int>,int> &im,
d174 1
a174 1
ostream& operator <<(ostream&, const IA_Image<IA_Point<int>,int>&);
@


1.9
log
@DOS-inspired name rework.
@
text
@d11 3
d70 1
a70 1
#include <sys/types.h>
@


1.8
log
@Name sanitization
@
text
@d11 3
d116 1
a116 1
#include	"IntImageOps.h"
@


1.7
log
@inline non-member functions to do image input.
@
text
@d11 3
d75 1
a75 1
class IA_Image<IA_IntPoint,int>: public IA_CoreImage<IA_IntPoint,int>
d78 1
a78 1
    IA_Image():IA_CoreImage<IA_IntPoint,int>() {}
d80 2
a81 2
    IA_Image(const IA_Image<IA_IntPoint,int>& im)
    :IA_CoreImage<IA_IntPoint,int>(im) {}
d83 2
a84 2
    IA_Image(IA_IntPointSet ps, int value)
    :IA_CoreImage<IA_IntPoint,int>(ps,value) {}
d86 1
a86 1
    IA_Image(IA_IntPointSet ps, int *vp, unsigned sz,
d88 1
a88 1
    :IA_CoreImage<IA_IntPoint,int>(ps, vp, sz, giveaway) {}
d90 2
a91 2
    IA_Image(IA_IntPointSet ps, const int *vp, unsigned sz)
    :IA_CoreImage<IA_IntPoint,int>(ps, vp, sz) {}
d93 4
a96 4
    IA_Image(const IA_IntPoint *pp, unsigned plen, int *vp, unsigned vlen, int giveaway=0)
    :IA_CoreImage<IA_IntPoint,int>(pp, plen, vp, vlen, giveaway) {}
    IA_Image(const IA_IntPoint *pp, unsigned plen, const int *vp, unsigned vlen)
    :IA_CoreImage<IA_IntPoint,int>(pp, plen, vp, vlen) {}
d98 2
a99 2
    IA_Image(const IA_ClosureI<IA_IntPoint,int> &img)
    :IA_CoreImage<IA_IntPoint,int>(img) {}
d101 2
a102 2
    IA_Image(IA_IntPointSet ps, int (*f)(const IA_IntPoint&))
    :IA_CoreImage<IA_IntPoint,int>(ps,f) {}
d104 2
a105 2
    IA_Image( const IA_CoreImage<IA_IntPoint,int> &d)
    :IA_CoreImage<IA_IntPoint,int>(d) {}
d110 1
a110 1
	(IA_CoreImage<IA_IntPoint,int>&)*this = v;
d124 2
a125 2
inline int operator!=(const IA_CoreImage<IA_IntPoint,int> &lhs,
	       const IA_CoreImage<IA_IntPoint,int> &rhs) {
d128 1
a128 1
inline int operator!=(const IA_CoreImage<IA_IntPoint,int> &lhs, int rhs) {
d131 1
a131 1
inline int operator!=(int lhs, const IA_CoreImage<IA_IntPoint,int> &rhs) {
d138 2
a139 2
inline IA_Image<IA_IntPoint,int> read_int_PGM(istream &i, int *maxval=0) {
    return IA_Image<IA_IntPoint,int>::read_PGM(i, maxval);
d141 1
a141 1
inline IA_Image<IA_IntPoint,int> read_int_PGM(const char *fname,
d143 1
a143 1
    return IA_Image<IA_IntPoint,int>::read_PGM(fname, maxval);
d149 2
a150 2
inline ostream& write_PGM(const IA_CoreImage<IA_IntPoint,int> &im, ostream &o, unsigned max) {
    return IA_Image<IA_IntPoint,int>(im).write_PGM(o, max);
d153 2
a154 2
inline ostream& write_PGM(const IA_CoreImage<IA_IntPoint,int> &im, ostream &o) {
    return IA_Image<IA_IntPoint,int>(im).write_PGM(o);
d157 2
a158 2
inline void write_PGM(const IA_CoreImage<IA_IntPoint,int> &im, const char *fname) {
    IA_Image<IA_IntPoint,int>(im).write_PGM(fname);
d161 1
a161 1
inline void write_PGM(const IA_CoreImage<IA_IntPoint,int> &im,
d163 1
a163 1
    IA_Image<IA_IntPoint,int>(im).write_PGM(fname, max);
d170 1
a170 1
ostream& operator <<(ostream&, const IA_CoreImage<IA_IntPoint,int>&);
@


1.6
log
@read_PGM now can return the maxval.
@
text
@d11 3
d130 11
@


1.5
log
@Image class is now CoreImage and named image types are
Image<P,T>.
@
text
@d11 4
d66 3
d109 2
a110 2
    static IA_Image read_PGM(istream &);
    static IA_Image read_PGM(const char *fname);
@


1.4
log
@pointarray valuearray constructor.
@
text
@d11 3
d56 3
d60 1
d62 1
a62 1
class IA_IntDiscreteImage: public IA_Image<IA_IntPoint,int>
d65 1
a65 1
    IA_IntDiscreteImage():IA_Image<IA_IntPoint,int>() {}
d67 2
a68 2
    IA_IntDiscreteImage(const IA_IntDiscreteImage& im)
    :IA_Image<IA_IntPoint,int>(im) {}
d70 2
a71 2
    IA_IntDiscreteImage(IA_IntPointSet ps, int value)
    :IA_Image<IA_IntPoint,int>(ps,value) {}
d73 1
a73 1
    IA_IntDiscreteImage(IA_IntPointSet ps, int *vp, unsigned sz,
d75 1
a75 1
    :IA_Image<IA_IntPoint,int>(ps, vp, sz, giveaway) {}
d77 2
a78 2
    IA_IntDiscreteImage(IA_IntPointSet ps, const int *vp, unsigned sz)
    :IA_Image<IA_IntPoint,int>(ps, vp, sz) {}
d80 4
a83 4
    IA_IntDiscreteImage(const IA_IntPoint *pp, unsigned plen, int *vp, unsigned vlen, int giveaway=0)
    :IA_Image<IA_IntPoint,int>(pp, plen, vp, vlen, giveaway) {}
    IA_IntDiscreteImage(const IA_IntPoint *pp, unsigned plen, const int *vp, unsigned vlen)
    :IA_Image<IA_IntPoint,int>(pp, plen, vp, vlen) {}
d85 2
a86 2
    IA_IntDiscreteImage(const IA_ClosureI<IA_IntPoint,int> &img)
    :IA_Image<IA_IntPoint,int>(img) {}
d88 2
a89 2
    IA_IntDiscreteImage(IA_IntPointSet ps, int (*f)(const IA_IntPoint&))
    :IA_Image<IA_IntPoint,int>(ps,f) {}
d91 2
a92 2
    IA_IntDiscreteImage( const IA_Image<IA_IntPoint,int> &d)
    :IA_Image<IA_IntPoint,int>(d) {}
d94 1
a94 1
    virtual ~IA_IntDiscreteImage(){ }
d96 2
a97 2
    IA_IntDiscreteImage& operator=(int v) {
	(IA_Image<IA_IntPoint,int>&)*this = v;
d102 2
a103 2
    static IA_IntDiscreteImage read_PGM(istream &);
    static IA_IntDiscreteImage read_PGM(const char *fname);
d111 2
a112 2
inline int operator!=(const IA_IntDiscreteImage &lhs,
	       const IA_IntDiscreteImage &rhs) {
d115 1
a115 1
inline int operator!=(const IA_IntDiscreteImage &lhs, int rhs) {
d118 1
a118 1
inline int operator!=(int lhs, const IA_IntDiscreteImage &rhs) {
d125 2
a126 2
inline ostream& write_PGM(const IA_IntDiscreteImage &im, ostream &o, unsigned max) {
    return im.write_PGM(o, max);
d129 2
a130 2
inline ostream& write_PGM(const IA_IntDiscreteImage &im, ostream &o) {
    return im.write_PGM(o);
d133 2
a134 2
inline void write_PGM(const IA_IntDiscreteImage &im, const char *fname) {
    im.write_PGM(fname);
d137 1
a137 1
inline void write_PGM(const IA_IntDiscreteImage &im,
d139 1
a139 1
    im.write_PGM(fname, max);
d146 1
a146 1
ostream& operator <<(ostream&, const IA_Image<IA_IntPoint,int>&);
@


1.3
log
@Move to new Closure naming convention.
@
text
@d11 3
d69 8
@


1.2
log
@op= with a constant now works.
@
text
@d10 4
a13 1
// $Log:	IntDI.h,v $
d67 1
a67 1
    IA_IntDiscreteImage(const IA_OtherI<IA_IntPoint,int> &img)
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log:	IntDiscreteImage.h,v $
d75 4
@
