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.36;	author thoth;	state Exp;
branches;
next	1.4;

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

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

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

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


desc
@Pixel 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:	DIPIter.h,v $
// Revision 1.4  93/04/17  18:45:05  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:43:45  thoth
// There are now two sorts of BaseDIIters.
// ourDI data member seems useless.
// 
// Revision 1.2  93/01/19  14:55:56  jnw
// Modified to support IA_ naming convention
// 
// Revision 1.1  92/11/13  13:46:20  jnw
// Initial revision
// 

#ifndef DIPIter_h_
#define DIPIter_h_

#ifdef IA_PRII
#pragma interface
#endif

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

template <class T>
class IA_DIPIter {
protected:
    IA_BaseDIPIter<T> *iter;
    
public:
    IA_DIPIter();
    IA_DIPIter(const IA_DiscreteImage<T> &image)
    { iter = image.bdip->pixel_iterator(); }

    IA_DIPIter(const IA_DIPIter &x) { this->iter = x.iter->clone_self(); }
    ~IA_DIPIter() { if (iter) delete iter; }
    
    IA_DIPIter& operator=(const IA_DiscreteImage<T> &);
    IA_DIPIter& operator=(const IA_DIPIter &);
    
    IA_DiscreteImage<T> domain() { return iter->domain_(); }
    
    int operator() (IA_IntPoint& pixel_location, T& pixel_value) {
	return this->iter->next(pixel_location, 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
a29 5
    static IA_BaseDIPIter<T> * make_pixel_iter(const IA_DiscreteImage<T>&);


    // Need an uninitialized image for an uninitialized iterator!
    //IA_DiscreteImage<T> errorDI, ourDI;
d31 1
a31 1
    IA_DIPIter() { iter = 0; }
d33 1
a33 1
    /*:ourDI(image)*/ { iter = make_pixel_iter(image); }
@


1.2
log
@Modified to support IA_ naming convention
@
text
@d4 3
d24 1
a24 1
    IA_BaseDIIter<T> *iter;
d26 1
a26 1
    static IA_BaseDIIter<T> * make_pixel_iter(const IA_DiscreteImage<T>&);
d30 1
a30 1
    IA_DiscreteImage<T> errorDI, ourDI;
d34 1
a34 1
    :ourDI(image) { iter = make_pixel_iter(image); }
@


1.1
log
@Initial revision
@
text
@d3 4
a6 1
// $Log$
d19 1
a19 1
class DIPIter {
d21 1
a21 1
    BaseDIIter<T> *iter;
d23 1
a23 1
    static BaseDIIter<T> * make_pixel_iter(const DiscreteImage<T>&);
d27 1
a27 1
    DiscreteImage<T> errorDI, ourDI;
d29 2
a30 2
    DIPIter() { iter = 0; }
    DIPIter(const DiscreteImage<T> &image)
d33 2
a34 2
    DIPIter(const DIPIter &x) { this->iter = x.iter->clone_self(); }
    ~DIPIter() { if (iter) delete iter; }
d36 2
a37 2
    DIPIter& operator=(const DiscreteImage<T> &);
    DIPIter& operator=(const DIPIter &);
d39 1
a39 1
    DiscreteImage<T> domain() { return iter->domain_(); }
d41 1
a41 1
    int operator() (IntPoint& pixel_location, T& pixel_value) {
@
