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


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

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

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

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

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


desc
@Value Iterator header
@


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

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


// $Log:	DIVIter.h,v $
// Revision 1.4  93/04/17  18:45:08  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.3  93/02/20  12:44:23  thoth
// There are now two sorts of BaseDIIters.
// ourDI data member seems useless.
// 
// Revision 1.2  93/01/19  14:56:00  jnw
// Modified to support IA_ naming convention
// 
// Revision 1.1  92/11/13  13:46:31  jnw
// Initial revision
// 
// Revision 1.1  92/10/05  11:46:34  jnw
// Initial revision
// 

#ifndef DIVIter_h_
#define DIVIter_h_

#ifdef IA_PRII
#pragma interface
#endif

#include "BaseDIIter.h"
#include "DiscreteImage.h"

template <class T>
class IA_DIVIter {
protected:
    IA_BaseDIVIter<T> *iter;
public:
    IA_DIVIter();
    IA_DIVIter(const IA_DiscreteImage<T> &image)
     { iter = image.bdip->value_iterator(); }

    IA_DIVIter(const IA_DIVIter &x) { this->iter = x.iter->clone_self(); }
    ~IA_DIVIter() { delete iter; }
    
    IA_DIVIter& operator=(const IA_DiscreteImage<T> &);
    IA_DIVIter& operator=(const IA_DIVIter &);
    
    IA_DiscreteImage<T> domain() { return iter->domain_(); }
    
    int operator() (T& pixel_value) {
	return this->iter->next(pixel_value);
    }

    void reset() { iter->reset(); }
};

#endif
@


1.4
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
@d3 6
d10 4
@


1.3
log
@There are now two sorts of BaseDIIters.
ourDI data member seems useless.
@
text
@d4 4
a31 5
    
    static IA_BaseDIVIter<T> * make_value_iter(const IA_DiscreteImage<T>&);

    // Need an uninitialized image for an uninitialized iterator!
    // IA_DiscreteImage<T> errorDI, ourDI;
d33 1
a33 1
    IA_DIVIter() { iter = 0; }
d35 1
a35 1
    /*:ourDI(image)*/ { iter = make_value_iter(image); }
d38 1
a38 1
    ~IA_DIVIter() { if (iter) delete iter; }
@


1.2
log
@Modified to support IA_ naming convention
@
text
@d4 3
d27 1
a27 1
    IA_BaseDIIter<T> *iter;
d29 1
a29 1
    static IA_BaseDIIter<T> * make_value_iter(const IA_DiscreteImage<T>&);
d32 1
a32 1
    IA_DiscreteImage<T> errorDI, ourDI;
d36 1
a36 1
    :ourDI(image) { iter = make_value_iter(image); }
@


1.1
log
@Initial revision
@
text
@d4 3
d22 1
a22 1
class DIVIter {
d24 1
a24 1
    BaseDIIter<T> *iter;
d26 1
a26 1
    static BaseDIIter<T> * make_value_iter(const DiscreteImage<T>&);
d29 1
a29 1
    DiscreteImage<T> errorDI, ourDI;
d31 2
a32 2
    DIVIter() { iter = 0; }
    DIVIter(const DiscreteImage<T> &image)
d35 2
a36 2
    DIVIter(const DIVIter &x) { this->iter = x.iter->clone_self(); }
    ~DIVIter() { if (iter) delete iter; }
d38 2
a39 2
    DIVIter& operator=(const DiscreteImage<T> &);
    DIVIter& operator=(const DIVIter &);
d41 1
a41 1
    DiscreteImage<T> domain() { return iter->domain_(); }
@
