head	1.5;
access;
symbols
	bobbase:1.5
	bob:1.5.1
	r2_1:1.5
	r2_0:1.5
	r1_1_beta:1.5
	r1_1_alpha:1.4
	r1_0:1.4
	r0_11:1.4
	r0_10:1.2
	r0_9:1.2;
locks
	thoth:1.5.1.1; strict;
comment	@// @;


1.5
date	94.07.25.17.24.13;	author thoth;	state Exp;
branches
	1.5.1.1;
next	1.4;

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

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

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

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

1.5.1.1
date	94.12.28.16.41.19;	author thoth;	state Exp;
branches;
next	;


desc
@Constant image declaration.
@


1.5
log
@Name sanitization
@
text
@// Emacs: -*- C++ -*-

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


//
// $Log: ConstI.h,v $
// Revision 1.4  1994/03/14  15:48:33  thoth
// ValueSet has been replaced by container class Set.
//
// Revision 1.3  1994/02/26  16:02:08  thoth
// operator() of the container now relies upon the contained classes
// to check if p is contained in the domain.  This means that users
// could possibly write an erroneous operator().
//
// Revision 1.2  1993/11/17  18:12:47  thoth
// extensivep is now extensive
//
// Revision 1.1  1993/09/15  12:51:13  thoth
// Initial revision
//

#ifndef ConstI_h_
#define ConstI_h_

#include "BaseI.h"

template < class P,class T> class IA_ConstIVIter;
template < class P,class T> class IA_ConstIPIter;

template < class P,class T>
class IA_ConstI: public IA_BaseImage<P,T> {
public:
    static char dummy;

    T value;
public:
    IA_ConstI(const IA_Set<P>& p, const T& val)
    : IA_BaseImage<P,T>(p), value(val) { }

    int extensive() const { return 0; }

    T operator ()(const P &p) const {
	if (!domain().contains(p)) {
	    ia_throw(IA::IMAGE_POINT_OUTSIDE_DOMAIN, __FILE__,__LINE__);
	}
	return value;
    }

    // ~IA_ConstI() {}

    static IA::Type s_type() { return &dummy; }

    IA::Type type() const { return &dummy; }

    IA_BaseImage<P,T>* clone_self_extensively() const;

    IA_Set<T> range() const;

    IA_Array<T> value_array() const;

#if 0
    IA_BaseImage<IA_Point<int>,T> * restricted_to(const IA_Point<int>Set &ps) const
#if 1
	;
#else
    {
	return new IA_ConstI<IA_Point<int>,T>(this->domain() & ps, this->value);
    }
#endif

    IA_BaseImage<P,T> * restricted_to(const IA_Point<double>Set &ps) const
#if 1
    ;
#else
    {
	return new IA_ConstI<P,T>(this->domain() & ps, this->value);
    }
#endif
#endif
    
    IA_BaseImage<P,T> * xlated_by(const P &p) const {
	return new IA_ConstI<P,T>(this->domain()+p, this->value);
    }

    IA_BaseIVIter<P,T> *value_iterator() const;
    IA_BaseIPIter<P,T> *pixel_iterator() const;

    ostream& print_this(ostream&) const;

    friend class IA_ConstIVIter<P,T>;
    friend class IA_ConstIPIter<P,T>;
};

#endif
@


1.5.1.1
log
@Pass T by value (avoids problem with const float&).
conversion to classes for throw.
@
text
@a10 3
// Revision 1.5  1994/07/25  17:24:13  thoth
// Name sanitization
//
a29 1
#include "image_errors.h"
d41 1
a41 1
    IA_ConstI(const IA_Set<P>& p,  T val)
d48 1
a48 1
	    ia_throw(Image_PointOutsideDomain_Exception(__FILE__,__LINE__));
@


1.4
log
@ValueSet has been replaced by container class Set.
@
text
@d11 3
d55 1
a55 1
    static IA_ImageType s_type() { return &dummy; }
d57 1
a57 1
    IA_ImageType type() const { return &dummy; }
d66 1
a66 1
    IA_BaseImage<IA_IntPoint,T> * restricted_to(const IA_IntPointSet &ps) const
d71 1
a71 1
	return new IA_ConstI<IA_IntPoint,T>(this->domain() & ps, this->value);
d75 1
a75 1
    IA_BaseImage<P,T> * restricted_to(const IA_FloatPointSet &ps) const
@


1.3
log
@operator() of the container now relies upon the contained classes
to check if p is contained in the domain.  This means that users
could possibly write an erroneous operator().
@
text
@d11 5
d58 1
a58 1
    IA_ValueSet<T> range() const;
@


1.2
log
@extensivep is now extensive
@
text
@d11 3
d38 6
a43 1
    T operator ()(const P &) const { return value; }
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log:	ConstDI.h,v $
d33 1
a33 1
    int extensivep() const { return 0; }
@
