head	1.11;
access;
symbols
	r0_10:1.11
	Eglin_alpha_1:1.11;
locks; strict;
comment	@// @;


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

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

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

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

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

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

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

1.4
date	93.01.19.14.55.46;	author jnw;	state Exp;
branches;
next	1.3;

1.3
date	92.11.14.09.35.29;	author jnw;	state Exp;
branches;
next	1.2;

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

1.1
date	92.10.05.11.43.34;	author jnw;	state Exp;
branches;
next	;


desc
@Initial revision
@


1.11
log
@Copyright Notices
@
text
@// Emacs: -*- C++ -*-

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


// $Log:	ConstDI.h,v $
// Revision 1.10  93/05/18  21:38:49  thoth
// range method returns ValueSet again.
// new value_array method gives an Array of image values.
// 
// 
// Revision 1.9  93/04/17  18:45:03  thoth
// Iterator support is no longer based on a switch statement.  We now
// use a virtual method.  The user can now provide faster iterators.
// 
// Revision 1.8  93/04/08  13:09:43  thoth
// new restriction and translation methods.
// 
// Revision 1.7  93/03/10  13:32:08  thoth
// range method no longer returns valueset due to
// difficulties with template implementation.
// 
// Revision 1.6  93/02/20  12:39:13  thoth
// operator() is too simple to be outline.
// The pointset should go first in an image constructor.
// 
// Revision 1.5  93/02/08  12:53:59  thoth
// refcounts are now handled by BaseDI.
// unused value is now unnamed.
// static dummy member belongs somewhere else.
// 
// Revision 1.4  93/01/19  14:55:46  jnw
// Modified to support IA_ naming convention
// 
// Revision 1.3  92/11/14  09:35:29  jnw
// Substituted () and [] for val and ref
// 
// Revision 1.2  92/11/13  13:51:03  jnw
//  Updated to include all sorts of new goodies
// 
// Revision 1.1  92/10/05  11:43:34  jnw
// Initial revision
// 

#ifndef ConstDI_h_
#define ConstDI_h_

#include "BaseDI.h"

template <class T> class IA_ConstDIVIter;
template <class T> class IA_ConstDIPIter;

template <class T>
class IA_ConstDI: public IA_BaseDI<T> {
public:
    static char dummy;

    T value;
public:
    IA_ConstDI(const IA_IntPointSet& p, const T& val)
    : IA_BaseDI<T>(p), value(val) { }

    int extensivep() const { return 0; }

    T operator ()(const IA_IntPoint &) const { return value; }

    // ~IA_ConstDI() {}

    static IA_DiscreteImageType s_type() { return &dummy; }

    IA_DiscreteImageType type() const { return &dummy; }

    IA_BaseDI<T>* clone_self_extensively() const;

    IA_ValueSet<T> range() const;

    IA_Array<T> value_array() const;

    IA_BaseDI<T> * restricted_to(const IA_IntPointSet &ps) const {
	return new IA_ConstDI<T>(this->domain() & ps, this->value);
    }

    IA_BaseDI<T> * xlated_by(const IA_IntPoint &p) const {
	return new IA_ConstDI<T>(this->domain()+p, this->value);
    }

    IA_BaseDIVIter<T> *value_iterator() const;
    IA_BaseDIPIter<T> *pixel_iterator() const;

    ostream& print_this(ostream&) const;

    friend class IA_ConstDIVIter<T>;
    friend class IA_ConstDIPIter<T>;
};

#endif
@


1.10
log
@range method returns ValueSet again.
new value_array method gives an Array of image values.

@
text
@d3 6
d10 5
@


1.9
log
@Iterator support is no longer based on a switch statement.  We now
use a virtual method.  The user can now provide faster iterators.
@
text
@d4 4
d67 3
a69 1
    T* range(unsigned *sz) const;
@


1.8
log
@new restriction and translation methods.
@
text
@d4 3
a38 1

d53 1
a53 1
    T operator ()(const IntPoint &) const { return value; }
d72 3
@


1.7
log
@range method no longer returns valueset due to
difficulties with template implementation.
@
text
@d4 4
d62 8
@


1.6
log
@operator() is too simple to be outline.
The pointset should go first in an image constructor.
@
text
@d4 4
d57 1
a57 1
    IA_ValueSet<T> range() const;
@


1.5
log
@refcounts are now handled by BaseDI.
unused value is now unnamed.
static dummy member belongs somewhere else.
@
text
@d4 5
d33 1
a33 1
private:
d38 2
a39 2
    IA_ConstDI(const T& j, const IA_IntPointSet& p)
    : IA_BaseDI<T>(p), value(j) { }
d43 1
a43 1
    T operator ()(const IntPoint &) const;
d45 1
a45 1
    ~IA_ConstDI() {}
a46 2
    T operator ()(int) const { return value; }

a49 2

    int equal(const IA_BaseDI<T>* other) const;
@


1.4
log
@Modified to support IA_ naming convention
@
text
@d4 3
d22 1
a22 2
template <class T>
class IA_ConstDIVIter;
d24 1
a24 2
template <class T>
class IA_ConstDIPIter;
d34 1
a34 3
    : IA_BaseDI<T>(p) {
	this->value = j;
    }
d42 1
a42 1
    T operator ()(int i) const { return value; }
a58 3

template <class T>
char IA_ConstDI<T>::dummy = 0;
@


1.3
log
@Substituted () and [] for val and ref
@
text
@d4 3
d20 1
a20 1
class ConstDIVIter;
d23 1
a23 1
class ConstDIPIter;
d26 1
a26 1
class ConstDI: public BaseDI<T> {
d32 2
a33 2
    ConstDI(const T& j, const IntPointSet& p)
    : BaseDI<T>(p) {
d41 1
a41 1
    ~ConstDI() {}
d45 1
a45 1
    static DiscreteImageType s_type() { return &dummy; }
d47 1
a47 1
    DiscreteImageType type() const { return &dummy; }
d49 1
a49 1
    int equal(const BaseDI<T>* other) const;
d51 1
a51 1
    BaseDI<T>* clone_self_extensively() const;
d53 1
a53 1
    ValueSet<T> range() const;
d57 2
a58 2
    friend class ConstDIVIter<T>;
    friend class ConstDIPIter<T>;
d62 1
a62 1
char ConstDI<T>::dummy = 0;
@


1.2
log
@ Updated to include all sorts of new goodies
@
text
@d4 3
d40 1
a40 1
    T val(int i) const { return value; }
d43 1
d46 1
a46 5
    int equal(const BaseDI<T>* other) const {
	return (((BaseDI<T> *)this)->equal(other)
		&& this->type()==other->type()
		&& this->value == ((ConstDI *)other)->value);
    }
d50 1
a50 4
    ValueSet<T> range() const {
	ValueSet<T> result = this->value;
	return result;
    }
@


1.1
log
@Initial revision
@
text
@d3 4
a6 1
// $Log$
d14 1
a14 1
class ConstDIIter;
d37 2
d50 5
d57 1
a57 1
    friend class ConstDIIter<T>;
@
