head	1.6;
access;
symbols
	bobbase:1.4
	bob:1.4
	r2_1:1.4
	r2_0:1.4
	r1_1_beta:1.4
	r1_1_alpha:1.3
	r1_0:1.3
	r0_11:1.3
	r0_10:1.2
	r0_9:1.2;
locks
	fjsoria:1.6; strict;
comment	@// @;


1.6
date	95.01.11.15.42.13;	author fjsoria;	state Exp;
branches;
next	1.5;

1.5
date	94.12.22.21.37.58;	author fjsoria;	state Exp;
branches;
next	1.4;

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

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

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

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


desc
@Constant Image implementation.
@


1.6
log
@patched problem with operator<< with dummy_op()
@
text
@// Emacs: -*- C++ -*-

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


//
// $Log: ConstI.c,v $
// Revision 1.5  1994/12/22  21:37:58  fjsoria
// statci member template fix
//
// Revision 1.4  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.3  1994/03/14  15:48:33  thoth
// ValueSet has been replaced by container class Set.
//
// Revision 1.2  1993/11/17  18:13:40  thoth
// IPSIter is now PSIter<IntPoint>.
// extensivep is now extensive.
//
// Revision 1.1  1993/09/15  12:50:48  thoth
// Initial revision
//

#include "VectorI.h"
#include "ConstI.h"
#include "ConstImageIter.h"
#include "PSIter.h"



#ifndef IA_NO_AUTOINST_OF_STATIC_DATA
template < class P,class T>
char IA_ConstI<P,T>::dummy;
#endif

template < class P,class T>
IA_BaseImage<P,T>* IA_ConstI<P,T>::clone_self_extensively() const
{
    // VectorDI will throw if the pointset is nonextensive
    return (IA_BaseImage<P,T> *) new IA_VectorI<P,T>(this->ps, this->value);
}

#if 1
template < class P,class T>
IA_Set<T> IA_ConstI<P,T>::range() const
{
    return value;
}
#else
template < class P,class T>
T* IA_ConstI<P,T>::range(unsigned *sz) const
{
    T	*vec = new T[*sz=1];
    vec[0] = value;
    return vec;
}
#endif
template < class P,class T>
IA_Array<T> IA_ConstI<P,T>::value_array() const
{
    const int	sz=domain().card();
    T	*vec = new T[sz];
    for (int i=0; i<sz; i++)
	vec[i] = value;
    return IA_Array<T>(vec,sz,1);
}



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

//
// iterator support below
//

template < class P,class T>
IA_BaseIVIter<P,T> *IA_ConstI<P,T>::value_iterator() const
{
    return new IA_ConstIVIter<P,T>(this);
}

template < class P,class T>
IA_BaseIPIter<P,T> *IA_ConstI<P,T>::pixel_iterator() const
{
    return new IA_ConstIPIter<P,T>(this);
}

//
//
//

template < class P,class T>
ostream& IA_ConstI<P,T>::print_this(ostream &o) const
{
   dummy_op( o << "Constant Image - Value : ",this->value) ;
    if (this->ps.extensive()){
	IA_PSIter<P> iter(this->ps);
	P p;
	o << ", Points follow\n";
	while(iter(p)) {
#ifdef IA_UNRESOLVED_OPERATOR
	  dummy_op( o,p) << ", ";
#else
	  o << p << ", ";
#endif
	}
    } else {
	o << ", Comprehensive PointSet";
    }
    return o << "\n";
}
@


1.5
log
@statci member template fix
@
text
@d11 3
d33 2
d105 1
a105 1
    o << "Constant Image - Value : " << this->value ;
d111 5
a115 1
	    o << p << ", ";
@


1.4
log
@Name sanitization
@
text
@d11 3
d30 1
d33 1
@


1.3
log
@ValueSet has been replaced by container class Set.
@
text
@d11 3
d66 1
a66 1
IA_BaseImage<IA_IntPoint,T> * IA_ConstI<IA_IntPoint,T>::restricted_to(const IA_IntPointSet &ps) const
d68 1
a68 1
    return new IA_ConstI<IA_IntPoint,T>(this->domain() & ps, this->value);
@


1.2
log
@IPSIter is now PSIter<IntPoint>.
extensivep is now extensive.
@
text
@d11 4
d36 1
a36 1
IA_ValueSet<T> IA_ConstI<P,T>::range() const
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log:	ConstI.c,v $
d18 1
a18 1
#include "IPSIter.h"
d89 1
a89 1
    if (this->ps.extensivep()){
@
