// Emacs: -*- C++ -*-

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


//
// $Log:	conversion.templ,v $
// Revision 1.2  93/05/27  11:49:02  thoth
// Copyright Notices
// 
// Revision 1.1  93/03/18  11:18:33  thoth
// Initial revision
// 

IA_DiscreteImage<ATYPE>::
	IA_DiscreteImage<ATYPE>(const IA_DiscreteImage<LTYPE> &arg)
{
    IA_IntPointSet	domain = arg.domain();
    // if the domain isn\'t extensive, we need a lazy conversion image...
    const unsigned	sz = domain.card();
    ATYPE * const	vec = new ATYPE[sz];
    {
	ATYPE	*scan = vec;
	IA_DIVIter<LTYPE>	iter(arg);
	LTYPE	temp;
	while (iter(temp)) {
	    *(scan++) = temp;
	}
    }
    set_and_reference_image(new IA_VectorDI<ATYPE>(domain, vec, sz, 1));
}
