head	1.16;
access;
symbols
	bobbase:1.16
	bob:1.16.1
	r2_1:1.12
	r2_0:1.12
	r1_1_beta:1.11
	r1_1_alpha:1.10
	r1_0:1.10
	r0_11:1.10
	r0_10:1.8
	r0_9:1.5;
locks
	thoth:1.16.1.3; strict;
comment	@// @;


1.16
date	94.12.23.01.02.25;	author ljr;	state Exp;
branches
	1.16.1.1;
next	1.15;

1.15
date	94.12.22.16.25.33;	author fjsoria;	state Exp;
branches;
next	1.14;

1.14
date	94.12.12.21.33.37;	author fjsoria;	state Exp;
branches;
next	1.13;

1.13
date	94.12.12.21.01.01;	author fjsoria;	state Exp;
branches;
next	1.12;

1.12
date	94.08.22.15.20.29;	author thoth;	state Exp;
branches;
next	1.11;

1.11
date	94.07.25.17.26.39;	author thoth;	state Exp;
branches;
next	1.10;

1.10
date	94.03.30.13.58.31;	author thoth;	state Exp;
branches;
next	1.9;

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

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

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

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

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

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

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

1.2
date	93.09.24.11.37.21;	author jnw;	state Exp;
branches;
next	1.1;

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

1.16.1.1
date	94.12.28.18.23.57;	author thoth;	state Exp;
branches;
next	1.16.1.2;

1.16.1.2
date	95.01.09.17.52.46;	author thoth;	state Exp;
branches;
next	1.16.1.3;

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


desc
@Unsigned character discrete image declaration.
@


1.16
log
@Changed #include <sys/stdtypes.h> to #include "compat.h"
@
text
@// Emacs: -*- C++ -*-

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


//
// $Log: UcharDI.h,v $
// Revision 1.15  1994/12/22  16:25:33  fjsoria
// broken type conversion
//
// Revision 1.14  1994/12/12  21:33:37  fjsoria
// IDP doesn't exsist so removed fuctions that depend
// on it.
//
// Revision 1.13  1994/12/12  21:01:01  fjsoria
// commented out ImageDisplayProtocol.h (not used)
//
// Revision 1.12  1994/08/22  15:20:29  thoth
// DOS-inspired name rework.
//
// Revision 1.11  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.10  1994/03/30  13:58:31  thoth
// inline non-member functions to do image input.
//
// Revision 1.9  1994/03/14  15:51:55  thoth
// display was accepting pointer to wrong type.
//
// Revision 1.8  1994/01/31  15:50:03  thoth
// read_PGM now can return the maxval.
//
// Revision 1.7  1994/01/07  15:10:00  thoth
// Image class is now CoreImage and named image types are
// Image<P,T>.
//
// Revision 1.6  1993/12/29  17:05:11  thoth
// Workaround for woejus CFront bug.
// write_PGM functions will no longer calculate a maxval of 0.
//
// Revision 1.5  1993/11/17  18:28:34  thoth
// write_PGM friend functions now accept Image<IntPoint, u_char> & arguments.
//
// Revision 1.4  1993/10/05  19:33:08  thoth
// Move to new Closure naming convention.
//
// Revision 1.3  1993/09/27  15:56:11  thoth
// op= with a constant now works.
//
// Revision 1.2  1993/09/24  11:37:21  jnw
// Added display function.
//
// Revision 1.1  93/09/15  12:57:32  thoth
// Initial revision
// 
// Revision 1.4  93/05/31  15:56:45  thoth
// write_PGM now supports maxval.
// 
// Revision 1.3  93/05/27  11:22:43  thoth
// Copyright Notices
// 
// Revision 1.2  93/05/18  21:41:34  thoth
// IDM interface for Uchar DIs.
// 
// Revision 1.1  93/03/18  11:17:14  thoth
// Initial revision
// 

#ifndef UcharDI_h_
#define UcharDI_h_

#include "compat.h"
#include "CoreImage.h"
// not used #include "ImageDisplayProtocol.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>,u_char>: public IA_CoreImage<IA_Point<int>,u_char>
{
  public:
    IA_Image():IA_CoreImage<IA_Point<int>,u_char>() {}

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

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

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

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

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

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

    virtual ~IA_Image(){ }

#ifdef __BROKEN_TYPE_CONVERSION
    IA_Image& operator=(u_char v) {
#else
      IA_Image& operator=(int v) {
#endif
	(IA_CoreImage<IA_Point<int>,u_char>&)*this =  v;
	return *this;
    }
  
#include	"UcharIOps.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;


//    void IDM_display(IDP::LinkID, const char *label=0);
};

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

//
//

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

//
//

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

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

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

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

//
//

pid_t display(IA_Image<IA_Point<int>,u_char> img);

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


#endif
@


1.16.1.1
log
@Image I/O is now ROF.
Image operations are now friendly with FBI.
@
text
@a10 3
// Revision 1.16  1994/12/23  01:02:25  ljr
// Changed #include <sys/stdtypes.h> to #include "compat.h"
//
d120 10
d131 1
a134 2
#include	"UcharIOps.h"

d150 3
a152 1
						   int *maxval=0);
d154 3
a156 1
						   int *maxval=0);
d161 3
a163 2
inline ostream& write_PGM(const IA_CoreImage<IA_Point<int>,u_char> &im,
			  ostream &o, unsigned max);
d165 3
a167 2
inline ostream& write_PGM(const IA_CoreImage<IA_Point<int>,u_char> &im,
			  ostream &o);
d169 3
a171 2
inline void write_PGM(const IA_CoreImage<IA_Point<int>,u_char> &im,
		      const char *fname);
d174 3
a176 1
		      const char *fname, unsigned max);
@


1.16.1.2
log
@Outline functions shouldn't have inline qualifier.
@
text
@a10 4
// Revision 1.16.1.1  1994/12/28  18:23:57  thoth
// Image I/O is now ROF.
// Image operations are now friendly with FBI.
//
d143 1
a143 1
IA_Image<IA_Point<int>,u_char> read_uchar_PGM(istream &i,
d145 1
a145 1
IA_Image<IA_Point<int>,u_char> read_uchar_PGM(const char *fname,
d151 1
a151 1
ostream& write_PGM(const IA_CoreImage<IA_Point<int>,u_char> &im,
d154 1
a154 1
ostream& write_PGM(const IA_CoreImage<IA_Point<int>,u_char> &im,
d157 1
a157 1
void write_PGM(const IA_CoreImage<IA_Point<int>,u_char> &im,
d160 1
a160 1
void write_PGM(const IA_CoreImage<IA_Point<int>,u_char> &im,
@


1.16.1.3
log
@CoreImage has been re-merged with Image.  All special stuff should be
friends of FBI now.
@
text
@a10 3
// Revision 1.16.1.2  1995/01/09  17:52:46  thoth
// Outline functions shouldn't have inline qualifier.
//
d83 1
a83 1
//#include "Image.h"
d93 1
a93 2
#if 0
class IA_Image<IA_Point<int>,u_char>: public IA_Image<IA_Point<int>,u_char>
d96 1
a96 1
    IA_Image():IA_Image<IA_Point<int>,u_char>() {}
d99 1
a99 1
    :IA_Image<IA_Point<int>,u_char>(im) {}
d102 1
a102 1
    :IA_Image<IA_Point<int>,u_char>(ps,value) {}
d106 1
a106 1
    :IA_Image<IA_Point<int>,u_char>(ps, vp, sz, giveaway) {}
d109 1
a109 1
    :IA_Image<IA_Point<int>,u_char>(img) {}
d112 1
a112 1
    :IA_Image<IA_Point<int>,u_char>(ps,f) {}
d114 2
a115 2
    IA_Image( const IA_Image<IA_Point<int>,u_char> &d)
    :IA_Image<IA_Point<int>,u_char>(d) {}
d124 1
a124 1
	(IA_Image<IA_Point<int>,u_char>&)*this =  v;
a129 1
#endif
d133 2
a134 2
inline int operator!=(const IA_Image<IA_Point<int>,u_char> &lhs,
	       const IA_Image<IA_Point<int>,u_char> &rhs) {
d137 1
a137 1
inline int operator!=(const IA_Image<IA_Point<int>,u_char> &lhs, int rhs) {
d140 1
a140 1
inline int operator!=(int lhs, const IA_Image<IA_Point<int>,u_char> &rhs) {
d155 1
a155 1
ostream& write_PGM(const IA_Image<IA_Point<int>,u_char> &im,
d158 1
a158 1
ostream& write_PGM(const IA_Image<IA_Point<int>,u_char> &im,
d161 1
a161 1
void write_PGM(const IA_Image<IA_Point<int>,u_char> &im,
d164 1
a164 1
void write_PGM(const IA_Image<IA_Point<int>,u_char> &im,
d173 1
a173 1
//ostream& operator <<(ostream&, const IA_Image<IA_Point<int>,u_char>&);
@


1.15
log
@broken type conversion
@
text
@d11 3
d75 1
a75 1
#include <sys/stdtypes.h>
@


1.14
log
@IDP doesn't exsist so removed fuctions that depend
on it.
@
text
@d11 4
d109 6
a114 2
    IA_Image& operator=(int v) {
	(IA_CoreImage<IA_Point<int>,u_char>&)*this = v;
d117 1
@


1.13
log
@commented out ImageDisplayProtocol.h (not used)
@
text
@d11 3
d120 1
a120 1
    void IDM_display(IDP::LinkID, const char *label=0);
@


1.12
log
@DOS-inspired name rework.
@
text
@d11 3
d67 1
a67 1
#include "ImageDisplayProtocol.h"
@


1.11
log
@Name sanitization
@
text
@d11 3
d103 1
a103 1
#include	"UcharImageOps.h"
@


1.10
log
@inline non-member functions to do image input.
@
text
@d11 3
d70 1
a70 1
class IA_Image<IA_IntPoint,u_char>: public IA_CoreImage<IA_IntPoint,u_char>
d73 1
a73 1
    IA_Image():IA_CoreImage<IA_IntPoint,u_char>() {}
d76 1
a76 1
    :IA_CoreImage<IA_IntPoint,u_char>(im) {}
d78 2
a79 2
    IA_Image(IA_IntPointSet ps, u_char value)
    :IA_CoreImage<IA_IntPoint,u_char>(ps,value) {}
d81 1
a81 1
    IA_Image(IA_IntPointSet ps, u_char *vp, unsigned sz,
d83 1
a83 1
    :IA_CoreImage<IA_IntPoint,u_char>(ps, vp, sz, giveaway) {}
d85 2
a86 2
    IA_Image(const IA_ClosureI<IA_IntPoint,u_char> &img)
    :IA_CoreImage<IA_IntPoint,u_char>(img) {}
d88 2
a89 2
    IA_Image(IA_IntPointSet ps, u_char (*f)(const IA_IntPoint&))
    :IA_CoreImage<IA_IntPoint,u_char>(ps,f) {}
d91 2
a92 2
    IA_Image( const IA_CoreImage<IA_IntPoint,u_char> &d)
    :IA_CoreImage<IA_IntPoint,u_char>(d) {}
d97 1
a97 1
	(IA_CoreImage<IA_IntPoint,u_char>&)*this = v;
d114 2
a115 2
inline int operator!=(const IA_CoreImage<IA_IntPoint,u_char> &lhs,
	       const IA_CoreImage<IA_IntPoint,u_char> &rhs) {
d118 1
a118 1
inline int operator!=(const IA_CoreImage<IA_IntPoint,u_char> &lhs, int rhs) {
d121 1
a121 1
inline int operator!=(int lhs, const IA_CoreImage<IA_IntPoint,u_char> &rhs) {
d128 1
a128 1
inline IA_Image<IA_IntPoint,u_char> read_uchar_PGM(istream &i,
d130 1
a130 1
    return IA_Image<IA_IntPoint,u_char>::read_PGM(i, maxval);
d132 1
a132 1
inline IA_Image<IA_IntPoint,u_char> read_uchar_PGM(const char *fname,
d134 1
a134 1
    return IA_Image<IA_IntPoint,u_char>::read_PGM(fname, maxval);
d140 2
a141 2
inline ostream& write_PGM(const IA_CoreImage<IA_IntPoint,u_char> &im, ostream &o, unsigned max) {
    return IA_Image<IA_IntPoint,u_char>(im).write_PGM(o, max);
d144 2
a145 2
inline ostream& write_PGM(const IA_CoreImage<IA_IntPoint,u_char> &im, ostream &o) {
    return IA_Image<IA_IntPoint,u_char>(im).write_PGM(o);
d148 2
a149 2
inline void write_PGM(const IA_CoreImage<IA_IntPoint,u_char> &im, const char *fname) {
    IA_Image<IA_IntPoint,u_char>(im).write_PGM(fname);
d152 1
a152 1
inline void write_PGM(const IA_CoreImage<IA_IntPoint,u_char> &im,
d154 1
a154 1
    IA_Image<IA_IntPoint,u_char>(im).write_PGM(fname, max);
d160 1
a160 1
pid_t display(IA_Image<IA_IntPoint,u_char> img);
d163 1
a163 1
//ostream& operator <<(ostream&, const IA_CoreImage<IA_IntPoint,u_char>&);
@


1.9
log
@display was accepting pointer to wrong type.
@
text
@d11 3
d120 12
@


1.8
log
@read_PGM now can return the maxval.
@
text
@d11 3
d142 1
a142 1
pid_t display(IA_CoreImage<IA_IntPoint,u_char> img);
@


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

@


1.6
log
@Workaround for woejus CFront bug.
write_PGM functions will no longer calculate a maxval of 0.
@
text
@d11 4
d47 4
d52 1
a52 1
#include "ImageDisplayProtocol.h"
d54 1
a54 1
class IA_UcharDiscreteImage: public IA_Image<IA_IntPoint,u_char>
d57 1
a57 1
    IA_UcharDiscreteImage():IA_Image<IA_IntPoint,u_char>() {}
d59 2
a60 2
    IA_UcharDiscreteImage(const IA_UcharDiscreteImage& im)
    :IA_Image<IA_IntPoint,u_char>(im) {}
d62 2
a63 2
    IA_UcharDiscreteImage(IA_IntPointSet ps, u_char value)
    :IA_Image<IA_IntPoint,u_char>(ps,value) {}
d65 1
a65 1
    IA_UcharDiscreteImage(IA_IntPointSet ps, u_char *vp, unsigned sz,
d67 1
a67 1
    :IA_Image<IA_IntPoint,u_char>(ps, vp, sz, giveaway) {}
d69 2
a70 2
    IA_UcharDiscreteImage(const IA_ClosureI<IA_IntPoint,u_char> &img)
    :IA_Image<IA_IntPoint,u_char>(img) {}
d72 2
a73 2
    IA_UcharDiscreteImage(IA_IntPointSet ps, u_char (*f)(const IA_IntPoint&))
    :IA_Image<IA_IntPoint,u_char>(ps,f) {}
d75 2
a76 2
    IA_UcharDiscreteImage( const IA_Image<IA_IntPoint,u_char> &d)
    :IA_Image<IA_IntPoint,u_char>(d) {}
d78 1
a78 1
    virtual ~IA_UcharDiscreteImage(){ }
d80 2
a81 2
    IA_UcharDiscreteImage& operator=(int v) {
	(IA_Image<IA_IntPoint,u_char>&)*this = v;
d86 2
a87 2
    static IA_UcharDiscreteImage read_PGM(istream &);
    static IA_UcharDiscreteImage read_PGM(const char *fname);
d99 2
a100 2
inline int operator!=(const IA_UcharDiscreteImage &lhs,
	       const IA_UcharDiscreteImage &rhs) {
d103 1
a103 1
inline int operator!=(const IA_UcharDiscreteImage &lhs, int rhs) {
d106 1
a106 1
inline int operator!=(int lhs, const IA_UcharDiscreteImage &rhs) {
d113 2
a114 2
inline ostream& write_PGM(const IA_Image<IA_IntPoint,u_char> &im, ostream &o, unsigned max) {
    return IA_UcharDiscreteImage(im).write_PGM(o, max);
d117 2
a118 2
inline ostream& write_PGM(const IA_Image<IA_IntPoint,u_char> &im, ostream &o) {
    return IA_UcharDiscreteImage(im).write_PGM(o);
d121 2
a122 2
inline void write_PGM(const IA_Image<IA_IntPoint,u_char> &im, const char *fname) {
    IA_UcharDiscreteImage(im).write_PGM(fname);
d125 1
a125 1
inline void write_PGM(const IA_Image<IA_IntPoint,u_char> &im,
d127 1
a127 1
    IA_UcharDiscreteImage(im).write_PGM(fname, max);
d133 1
a133 1
pid_t display(IA_UcharDiscreteImage img);
d136 1
a136 1
//ostream& operator <<(ostream&, const IA_Image<IA_IntPoint,u_char>&);
@


1.5
log
@write_PGM friend functions now accept Image<IntPoint, u_char> & arguments.
@
text
@d11 3
d44 1
a44 1
//#include "ImageDisplayProtocol.h"
d88 1
a88 1
//    void IDM_display(IDP::LinkID, const char *label=0);
@


1.4
log
@Move to new Closure naming convention.
@
text
@d11 3
d102 2
a103 2
inline ostream& write_PGM(const IA_UcharDiscreteImage &im, ostream &o, unsigned max) {
    return im.write_PGM(o, max);
d106 2
a107 2
inline ostream& write_PGM(const IA_UcharDiscreteImage &im, ostream &o) {
    return im.write_PGM(o);
d110 2
a111 2
inline void write_PGM(const IA_UcharDiscreteImage &im, const char *fname) {
    im.write_PGM(fname);
d114 1
a114 1
inline void write_PGM(const IA_UcharDiscreteImage &im,
d116 1
a116 1
    im.write_PGM(fname, max);
@


1.3
log
@op= with a constant now works.
@
text
@d11 3
d55 1
a55 1
    IA_UcharDiscreteImage(const IA_OtherI<IA_IntPoint,u_char> &img)
@


1.2
log
@Added display function.
@
text
@d10 4
a13 1
// $Log:	UcharDI.h,v $
d63 4
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log:	UcharDiscreteImage.h,v $
d30 1
d108 2
@
