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

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


//
// $Log: constructor.templ,v $
// Revision 1.4  1994/01/07  15:10:00  thoth
// Image class is now CoreImage and named image types are
// Image<P,T>.
//
// Revision 1.3  1993/12/29  17:33:18  thoth
// New operator scheme that prevents the need for trivial Image conversions.
//
// Revision 1.2  1993/11/17  18:31:30  thoth
// Conversion members now properly delete the ErrorDIs that their
// base member was initialized with.
//
// Revision 1.1  1993/09/15  13:02:30  thoth
// Initial revision
//
// 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_Image<IA_IntPoint, ATYPE>::
	IA_Image/*<IA_IntPoint, ATYPE>*/(const IA_CoreImage<IA_IntPoint, 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_IVIter<IA_IntPoint,LTYPE>	iter(arg);
	LTYPE	temp;
	while (iter(temp)) {
	    *(scan++) = temp;
	}
    }

    disassociate_image();
    set_and_reference_image(new IA_VectorI<IA_IntPoint,ATYPE>(domain, vec, sz, 1));
}
