head	1.11;
access;
symbols
	bobbase:1.11
	bob:1.11.1
	r2_1:1.10
	r2_0:1.10
	r1_1_beta:1.10
	r1_1_alpha:1.9
	r1_0:1.9
	r0_11:1.9
	r0_10:1.5
	r0_9:1.2;
locks
	thoth:1.11.1.3; strict;
comment	@// @;


1.11
date	94.12.22.16.31.05;	author fjsoria;	state Exp;
branches
	1.11.1.1;
next	1.10;

1.10
date	94.07.25.17.26.39;	author thoth;	state Exp;
branches;
next	1.9;

1.9
date	94.03.30.14.01.44;	author thoth;	state Exp;
branches;
next	1.8;

1.8
date	94.03.14.15.53.13;	author thoth;	state Exp;
branches;
next	1.7;

1.7
date	94.02.22.18.49.39;	author thoth;	state Exp;
branches;
next	1.6;

1.6
date	94.02.12.19.45.43;	author thoth;	state Exp;
branches;
next	1.5;

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

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

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

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

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

1.11.1.1
date	94.12.28.18.08.25;	author thoth;	state Exp;
branches;
next	1.11.1.2;

1.11.1.2
date	95.01.09.18.19.53;	author thoth;	state Exp;
branches;
next	1.11.1.3;

1.11.1.3
date	95.01.13.19.37.42;	author thoth;	state Exp;
branches;
next	;


desc
@Meta code for a convolution that has a ring zero (an absorber)
@


1.11
log
@extra "," in linear product
@
text
@// Emacs: -*- C++ -*-

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


//
// $Log: img-templ-product,v $
// Revision 1.10  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.9  1994/03/30  14:01:44  thoth
// zero_extension is now a template function.
//
// Revision 1.8  1994/03/14  15:53:13  thoth
// We now use the FBI to extract the baseptr.
//
// Revision 1.7  1994/02/22  18:49:39  thoth
// We now efficiently evaluate lazy template-template convolutions
// convolved with images.
//
// Revision 1.6  1994/02/12  19:45:43  thoth
// Forward and Backward convolutions are now specified separately.
//
// Revision 1.5  1994/01/31  15:50:18  thoth
// fixed typing error in invariant convolutions.
//
// 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:29:46  thoth
// We now have support for forward convolutions.
// IPSIter is now PSIter<IntPoint>.
//
// Revision 1.1  1993/09/15  13:02:08  thoth
// Initial revision
//
// Revision 1.5  93/05/27  11:48:55  thoth
// Copyright Notices
// 
// Revision 1.4  93/04/29  11:20:56  thoth
// Faster(?) extension for VectorDIs.
// 
// Revision 1.3  93/04/17  18:56:44  jnw
// Fixed to match IA_Point<int> membername (dim)
// 
// Revision 1.2  93/04/08  13:21:59  thoth
// internal helper functions are now static.
// 
// Revision 1.1  93/03/18  11:39:42  thoth
// Initial revision
// 

//
// backward convolutions
//

static IA_Image<IA_Point<int>,RTYPE>
backw_CONV_inv_core(IA_Point<int> src_infimum,
	      IA_Point<int> src_width,
	      const IBTYPE *src_data, // length is prod(src_width)
	      const IA_Image<IA_Point<int>,TBTYPE> &templ,
	      IA_Set<IA_Point<int> > dest_ps)
{
    const int	dimen = src_width.dim();

    IA_Set<IA_Point<int> >	templ_ps = templ.domain();
    int		templ_sz = templ_ps.card();
    TBTYPE	*const templ_data = new TBTYPE[templ_sz];
    int	*const templ_offsets = new int[templ_sz];

    {
	TBTYPE	*d_scan = templ_data;
	int	*o_scan = templ_offsets;
	IA_IPIter<IA_Point<int>,TBTYPE>	iter(templ);
	IA_Point<int>	ip;
	while (iter(ip, *d_scan)) {
	    *o_scan = ip[0];
	    for (unsigned i=1; i<dimen; i++) {
		*o_scan *= src_width[i];
		*o_scan += ip[i];
	    }
	    d_scan++;
	    o_scan++;
	}
    }

    IA_PSIter<IA_Point<int> >	iter(dest_ps);
    IA_Point<int>	ip;
    RTYPE *const	dest_data = new RTYPE[dest_ps.card()];
    RTYPE *	valp = dest_data;
    while (iter(ip)) {
	int	offset= ip[0] - src_infimum[0];
	unsigned i;
	for (i=1; i<dimen; i++) {
	    offset *= src_width[i];
	    offset += ip[i] - src_infimum[i];
	}
	const IBTYPE *const base = src_data + offset;

	// _IVAL_=(base[templ_offsets[i]])
	// _TVAL_=(templ_data[i])
	// _IRESULT_=(*valp)

	INITIALIZE ;

	for (i=0; i<templ_sz; i++) {
	    ACCUMULATE ;
	}
	{
	    RESULT ;
	}
	valp++;
    }
    delete[] templ_offsets;
    delete[] templ_data;

    return IA_Image<IA_Point<int>,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
}

static IA_Image<IA_Point<int>,RTYPE>
backw_CONV_inv(const IA_Image<IA_Point<int>,IBTYPE> &img,
	 const IA_Image<IA_Point<int>,TBTYPE> &invtempl,
	 IA_Set<IA_Point<int> > dest_ps)
{
    IA_Point<int>	inf_ = dest_ps.inf()+invtempl.domain().inf();
    IA_Point<int>	sup_ = dest_ps.sup()+invtempl.domain().sup();
    IA_Set<IA_Point<int> >	src_ps = IA_Set<IA_Point<int> >(inf_,sup_);

    IBTYPE	*const src_data = new IBTYPE[src_ps.card()];

    zero_extend(img, src_ps, (IBTYPE*)src_data, IBTYPE(ZERO));
    IA_Image<IA_Point<int>,RTYPE>	rval =
	backw_CONV_inv_core(inf_, sup_-inf_ + 1, src_data, invtempl, dest_ps);

    delete[] src_data;

    return rval;
}

IA_Image<IA_Point<int>,RTYPE>
CONV(const IA_CoreImage<IA_Point<int>,IBTYPE> &img_,
     const IA_DDTemplate<TITYPE > &templ_,
     IA_Set<IA_Point<int> > dest_ps)
{
    IA_Image<IA_Point<int>,IBTYPE>	img(img_);
    /*PROMOTE*/IA_DDTemplate<TITYPE >	templ(templ_);

#ifdef KNOWN_IA_lazy_CONV_RTYPE
    if (templ.is_a(IA_lazy_inv_CONV_RTYPE::s_type())) {
	const IA_lazy_inv_CONV_RTYPE	*t =
	    (const IA_lazy_inv_CONV_RTYPE *)IA_FBI<IA_Point<int>, IA_Point<int>, IBTYPE, IBTYPE, IBTYPE>::extract_baseptr(templ);
	IA_Set<IA_Point<int> >	bigger_ps(
	    IA_Point<int>(dest_ps.inf()+
			(t->rhs(extend_to_point(0, t->rhs.domain().dim()))
			 .domain().inf())),
	    IA_Point<int>(dest_ps.sup()+
			(t->rhs(extend_to_point(0, t->rhs.domain().dim()))
			 .domain().sup()))
	    );
	return CONV(CONV(img, t->lhs, bigger_ps), t->rhs, dest_ps);
    } else
#else
#define UNKNOWN_IA_lazy_CONV_RTYPE
#endif
	if (templ.is_a(IA_InvariantDT<TITYPE >::s_type())) {
	return backw_CONV_inv
	    (img, ((IA_InvariantDT<TITYPE >*)IA_FBI<IA_Point<int>, IA_Point<int>, IBTYPE, IBTYPE, TBTYPE>::extract_baseptr(templ))->value, dest_ps);
//    } else if (templ.type() == IA_Lazy_REDUCT_DT<TITYPE >::s_type()) {
    } else {
	RTYPE *const	dest_data = new RTYPE[dest_ps.card()];
	RTYPE	*valp = dest_data;
	IA_PSIter<IA_Point<int> >	dest_iter(dest_ps);
	IA_Point<int>	base_ip;
	while (dest_iter(base_ip)) {
	    IA_CoreImage<IA_Point<int>,TBTYPE>	tv = templ(base_ip);

	    IA_IPIter<IA_Point<int>,TBTYPE>	templ_iter(tv);
	    IA_Point<int>	templ_ip;
	    TBTYPE	templ_val;

	    // _IVAL_=img(ip)
	    // _TVAL_=templ_val
	    // _IRESULT_=(*valp)

	    INITIALIZE ;

	    while ( templ_iter(templ_ip, templ_val) ) {
		const IA_Point<int>	ip = templ_ip; //+base_ip;
		if (! img.domain().contains(ip))
		    continue;
		ACCUMULATEVAR ;
	    }
	    {
		RESULT ;
	    }
	    valp++;
	}
	return IA_Image<IA_Point<int>,RTYPE>(dest_ps, dest_data,
					   dest_ps.card(), 1);
    }
}
@


1.11.1.1
log
@boxy IPSet constructor is obsolete.
detect dimension mismatch earlier.
@
text
@a10 3
// Revision 1.11  1994/12/22  16:31:05  fjsoria
// extra "," in linear product
//
a131 5
    if (img.domain().dim() != invtempl.domain().dim()) {
	ia_throw(Template_DimensionMismatch2_Exception(__FILE__, __LINE__));
	return IA_Image<IA_Point<int>,RTYPE>();
    }

d134 1
a134 1
    IA_Set<IA_Point<int> >	src_ps = IA_boxy_pset(inf_,sup_);
d159 1
a159 1
	IA_Set<IA_Point<int> >	bigger_ps = ia_boxy_pset(
@


1.11.1.2
log
@Boxy pointset constructor replaced by function.
@
text
@a10 4
// Revision 1.11.1.1  1994/12/28  18:08:25  thoth
// boxy IPSet constructor is obsolete.
// detect dimension mismatch earlier.
//
d167 1
a167 1
	IA_Set<IA_Point<int> >	bigger_ps = IA_boxy_pset(
@


1.11.1.3
log
@CoreImage has been re-merged with Image.  All special stuff should be
friends of FBI now.
@
text
@a10 3
// Revision 1.11.1.2  1995/01/09  18:19:53  thoth
// Boxy pointset constructor replaced by function.
//
d160 1
a160 1
CONV(const IA_Image<IA_Point<int>,IBTYPE> &img_,
d194 1
a194 1
	    IA_Image<IA_Point<int>,TBTYPE>	tv = templ(base_ip);
@


1.10
log
@Name sanitization
@
text
@d11 3
d165 1
a165 1
			 .domain().sup())),
@


1.9
log
@zero_extension is now a template function.
@
text
@d11 3
d48 1
a48 1
// Fixed to match IA_IntPoint membername (dim)
d61 3
a63 3
static IA_Image<IA_IntPoint,RTYPE>
backw_CONV_inv_core(IA_IntPoint src_infimum,
	      IA_IntPoint src_width,
d65 2
a66 2
	      const IA_Image<IA_IntPoint,TBTYPE> &templ,
	      IA_IntPointSet dest_ps)
d70 1
a70 1
    IA_IntPointSet	templ_ps = templ.domain();
d78 2
a79 2
	IA_IPIter<IA_IntPoint,TBTYPE>	iter(templ);
	IA_IntPoint	ip;
d91 2
a92 2
    IA_PSIter<IA_IntPoint>	iter(dest_ps);
    IA_IntPoint	ip;
d121 1
a121 1
    return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
d124 4
a127 4
static IA_Image<IA_IntPoint,RTYPE>
backw_CONV_inv(const IA_Image<IA_IntPoint,IBTYPE> &img,
	 const IA_Image<IA_IntPoint,TBTYPE> &invtempl,
	 IA_IntPointSet dest_ps)
d129 3
a131 3
    IA_IntPoint	inf_ = dest_ps.inf()+invtempl.domain().inf();
    IA_IntPoint	sup_ = dest_ps.sup()+invtempl.domain().sup();
    IA_IntPointSet	src_ps = IA_IntPointSet(inf_,sup_);
d136 1
a136 1
    IA_Image<IA_IntPoint,RTYPE>	rval =
d144 2
a145 2
IA_Image<IA_IntPoint,RTYPE>
CONV(const IA_CoreImage<IA_IntPoint,IBTYPE> &img_,
d147 1
a147 1
     IA_IntPointSet dest_ps)
d149 1
a149 1
    IA_Image<IA_IntPoint,IBTYPE>	img(img_);
d155 3
a157 3
	    (const IA_lazy_inv_CONV_RTYPE *)IA_FBI<IA_IntPoint, IA_IntPoint, IBTYPE, IBTYPE, IBTYPE>::extract_baseptr(templ);
	IA_IntPointSet	bigger_ps(
	    IA_IntPoint(dest_ps.inf()+
d160 1
a160 1
	    IA_IntPoint(dest_ps.sup()+
d171 1
a171 1
	    (img, ((IA_InvariantDT<TITYPE >*)IA_FBI<IA_IntPoint, IA_IntPoint, IBTYPE, IBTYPE, TBTYPE>::extract_baseptr(templ))->value, dest_ps);
d176 2
a177 2
	IA_PSIter<IA_IntPoint>	dest_iter(dest_ps);
	IA_IntPoint	base_ip;
d179 1
a179 1
	    IA_CoreImage<IA_IntPoint,TBTYPE>	tv = templ(base_ip);
d181 2
a182 2
	    IA_IPIter<IA_IntPoint,TBTYPE>	templ_iter(tv);
	    IA_IntPoint	templ_ip;
d192 1
a192 1
		const IA_IntPoint	ip = templ_ip; //+base_ip;
d202 1
a202 1
	return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data,
@


1.8
log
@We now use the FBI to extract the baseptr.
@
text
@d11 3
a53 71
#ifndef zero_extend_scan_IBTYPE
#define zero_extend_scan_IBTYPE

static void zero_extend_vec_scan(const IA_SetStructure &ss,
				 const IBTYPE **src,
				 IBTYPE **dest,
				 IBTYPE zero)
{
    for (unsigned i=0; i<ss.nintervals(); i++) {
	IA_ss_interval	temp(ss.retrieve_interval(i));
	if (temp.substructure == IA_SetStructure::FIRST_ONLY) {
	    (*src) += temp.count;
	} else if (temp.substructure == IA_SetStructure::BOTH) {
	    for (unsigned j=0; j<temp.count; j++) {
		*((*dest)++) = *((*src)++);
	    }
	} else if (temp.substructure == IA_SetStructure::SECOND_ONLY) {
	    for (unsigned j=0; j<temp.count; j++)
		*((*dest)++) = zero;
	} else {
	    for (unsigned j=0; j<temp.count; j++)
		zero_extend_vec_scan(temp.substructure, src, dest, zero);
	}
    }
}

static void zero_extend_iter_scan(const IA_SetStructure &ss,
				  IA_IVIter<IA_IntPoint,IBTYPE> *srciter,
				  IBTYPE **dest,
				  IBTYPE zero)
{
    for (unsigned i=0; i<ss.nintervals(); i++) {
	IA_ss_interval	temp(ss.retrieve_interval(i));
	if (temp.substructure == IA_SetStructure::FIRST_ONLY) {
	    IBTYPE	blah;
	    for (unsigned j=0; j<temp.count; j++) 
		(*srciter)(blah);
	} else if (temp.substructure == IA_SetStructure::BOTH) {
	    IBTYPE	blah;
	    for (unsigned j=0; j<temp.count; j++) {
		(*srciter)(blah);
		*((*dest)++) = blah;
	    }
	} else if (temp.substructure == IA_SetStructure::SECOND_ONLY) {
	    for (unsigned j=0; j<temp.count; j++)
		*((*dest)++) = zero;
	} else {
	    for (unsigned j=0; j<temp.count; j++)
		zero_extend_iter_scan(temp.substructure, srciter, dest, zero);
	}
    }
}

static void zero_extend(const IA_CoreImage<IA_IntPoint,IBTYPE> &srcimg,
			const IA_IntPointSet &dest_ps, IBTYPE *dest_data,
			IBTYPE zero)
{
    IA_SetStructure	ss;
    intersect_with_dualstruct(srcimg.domain(), dest_ps, &ss);

    if (srcimg.type() == IA_VectorI<IA_IntPoint,IBTYPE>::s_type()) {
	IBTYPE	*srcdata = ((IA_VectorI<IA_IntPoint,IBTYPE>*)srcimg.bip)->vec;
	zero_extend_vec_scan(ss, &srcdata, &dest_data, zero);
    } else {
	IA_IVIter<IA_IntPoint,IBTYPE>	iter(srcimg);
	zero_extend_iter_scan(ss, &iter, &dest_data, zero);
    }
}

#endif

d132 1
a132 1
    zero_extend(img, src_ps, src_data, ZERO);
d152 1
a152 1
	    (const IA_lazy_inv_CONV_RTYPE *)IA_FBI<IA_IntPoint,IBTYPE>::extract_baseptr(templ);
d168 1
a168 1
	    (img, ((IA_InvariantDT<TITYPE >*)IA_FBI<IA_IntPoint,IBTYPE>::extract_baseptr(templ))->value, dest_ps);
@


1.7
log
@We now efficiently evaluate lazy template-template convolutions
convolved with images.
@
text
@d11 4
d220 1
a220 1
	    (const IA_lazy_inv_CONV_RTYPE *)templ.bdtp;
d236 1
a236 1
	    (img, ((IA_InvariantDT<TITYPE >*)templ.bdtp)->value, dest_ps);
@


1.6
log
@Forward and Backward convolutions are now specified separately.
@
text
@d10 4
a13 1
// $Log: absorber,v $
d207 1
a207 1
     const IA_DDTemplate<TITYPE > &templ,
d211 1
d213 18
a230 1
    if (templ.type() == IA_InvariantDT<TITYPE >::s_type()) {
@


1.5
log
@fixed typing error in invariant convolutions.
@
text
@d11 3
d204 1
a204 1
     const IA_DDTemplate<TITYPE> &templ,
d209 1
a209 1
    if (templ.type() == IA_InvariantDT<TITYPE>::s_type()) {
d211 2
a212 1
	    (img, ((IA_InvariantDT<TITYPE>*)templ.bdtp)->value, dest_ps);
a243 137
    }
}

//
// foward convolutions
//

static IA_Image<IA_IntPoint,RTYPE>
forw_CONV_inv_core(IA_IntPoint src_infimum,
	      IA_IntPoint src_width,
	      const IBTYPE *src_data, // length is prod(src_width)
	      const IA_Image<IA_IntPoint,TBTYPE> &templ,
	      IA_IntPointSet dest_ps)
{
    const int	dimen = src_width.dim();

    IA_IntPointSet	templ_ps = templ.domain();
    int		templ_sz = templ_ps.card();
    TBTYPE	*const templ_data = new TBTYPE[templ_sz];
    int	*const templ_offsets = new int[templ_sz];

    {
	TBTYPE	*d_scan = templ_data;
	int	*o_scan = templ_offsets;
	IA_IPIter<IA_IntPoint,TBTYPE>	iter(templ);
	IA_IntPoint	ip;
	while (iter(ip, *d_scan)) {
	    *o_scan = -ip[0];
	    for (unsigned i=1; i<dimen; i++) {
		*o_scan *= src_width[i];
		*o_scan -= ip[i];
	    }
	    d_scan++;
	    o_scan++;
	}
    }

    IA_PSIter<IA_IntPoint>	iter(dest_ps);
    IA_IntPoint	ip;
    RTYPE *const	dest_data = new RTYPE[dest_ps.card()];
    RTYPE *	valp = dest_data;
    while (iter(ip)) {
	int	offset= ip[0] - src_infimum[0];
	unsigned i;
	for (i=1; i<dimen; i++) {
	    offset *= src_width[i];
	    offset += ip[i] - src_infimum[i];
	}
	const IBTYPE *const base = src_data + offset;

	// _IVAL_=(base[templ_offsets[i]])
	// _TVAL_=(templ_data[i])
	// _IRESULT_=(*valp)

	INITIALIZE ;

	for (i=0; i<templ_sz; i++) {
	    ACCUMULATE ;
	}
	{
	    RESULT ;
	}
	valp++;
    }
    delete[] templ_offsets;
    delete[] templ_data;

    return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
}

static
IA_Image<IA_IntPoint,RTYPE>
forw_CONV_inv(const IA_Image<IA_IntPoint,IBTYPE> &img,
	const IA_Image<IA_IntPoint,TBTYPE> &invtempl,
	IA_IntPointSet dest_ps)
{
    IA_IntPoint	inf_ = dest_ps.inf()-invtempl.domain().sup();
    IA_IntPoint	sup_ = dest_ps.sup()-invtempl.domain().inf();
    IA_IntPointSet	src_ps = IA_IntPointSet(inf_,sup_);

    IBTYPE	*const src_data = new IBTYPE[src_ps.card()];

    zero_extend(img, src_ps, src_data, ZERO);
    IA_Image<IA_IntPoint,RTYPE>	rval =
	forw_CONV_inv_core(inf_, sup_-inf_ + 1, src_data, invtempl, dest_ps);

    delete[] src_data;

    return rval;
}

IA_Image<IA_IntPoint,RTYPE>
CONV(const IA_DDTemplate<TITYPE> &templ,
     const IA_CoreImage<IA_IntPoint,IBTYPE> &img_,
     IA_IntPointSet dest_ps)
{
    IA_Image<IA_IntPoint,IBTYPE>	img(img_);

    if (templ.type() == IA_InvariantDT<TITYPE>::s_type()) {
	return forw_CONV_inv
	    (img, ((IA_InvariantDT<TITYPE>*)templ.bdtp)->value, dest_ps);
    } else {
	unsigned	size = dest_ps.card();
	RTYPE *const	dest_data = new RTYPE[size];

	for (int i=0; i<size; i++) {
	    // _IRESULT_=dest_data[i]
	    FORW_INITIALIZE ;
	}

	IA_PSIter<IA_IntPoint>	src_iter(img.domain());
	IA_IntPoint	base_ip;
	while (src_iter(base_ip)) {
	    IA_CoreImage<IA_IntPoint,TBTYPE>	tv = templ(base_ip);

	    IA_IPIter<IA_IntPoint,TBTYPE>	templ_iter(tv);
	    IA_IntPoint	templ_ip;
	    TBTYPE	templ_val;
	    IBTYPE	ival = img(base_ip);

	    // _IVAL_=ival
	    // _TVAL_=templ_val
	    // _IRESULT_=(*valp)

	    while ( templ_iter(templ_ip, templ_val) ) {
		const IA_IntPoint	ip = templ_ip; //+base_ip;
		if (! dest_ps.contains(templ_ip))
		    continue;
		unsigned	offset = dest_ps.index(templ_ip);
		RTYPE	*valp = dest_data + offset;
//		cout << "templ(" << base_ip << ") =  " << tv << " and templ()("
//		     << templ_ip <<") = " << templ_val << endl;
		FORW_ACCUMULATEVAR ;
	    }
	}
	return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data,
						      size, 1);
@


1.4
log
@Image class is now CoreImage and named image types are
Image<P,T>.
@
text
@d11 4
d157 1
a157 1
	const RTYPE *const base = src_data + offset;
d288 1
a288 1
	const RTYPE *const base = src_data + offset;
@


1.3
log
@New operator scheme that prevents the need for trivial Image conversions.
@
text
@d11 3
d90 1
a90 1
static void zero_extend(const IA_Image<IA_IntPoint,IBTYPE> &srcimg,
d112 1
a112 1
static /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>
d116 1
a116 1
	      /*PROMOTE*/const IA_Image<IA_IntPoint,TBTYPE> &templ,
d172 1
a172 1
    return /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
d175 3
a177 3
static /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>
backw_CONV_inv(const /*PROMOTE*/IA_Image<IA_IntPoint,IBTYPE> &img,
	 const /*PROMOTE*/IA_Image<IA_IntPoint,TBTYPE> &invtempl,
d187 1
a187 1
    /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>	rval =
d195 2
a196 2
/*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>
CONV(const IA_Image<IA_IntPoint,IBTYPE> &img_,
d200 1
a200 1
    /*PROMOTE*/IA_Image<IA_IntPoint,IBTYPE>	img(img_);
d211 1
a211 1
	    IA_Image<IA_IntPoint,TBTYPE>	tv = templ(base_ip);
d234 1
a234 1
	return /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data,
d243 1
a243 1
static /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>
d247 1
a247 1
	      const /*PROMOTE*/IA_Image<IA_IntPoint,TBTYPE> &templ,
d303 1
a303 1
    return /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
d307 3
a309 3
/*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>
forw_CONV_inv(const /*PROMOTE*/IA_Image<IA_IntPoint,IBTYPE> &img,
	const /*PROMOTE*/IA_Image<IA_IntPoint,TBTYPE> &invtempl,
d319 1
a319 1
    /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>	rval =
d327 1
a327 1
/*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>
d329 1
a329 1
     const IA_Image<IA_IntPoint,IBTYPE> &img_,
d332 1
a332 1
    /*PROMOTE*/IA_Image<IA_IntPoint,IBTYPE>	img(img_);
d349 1
a349 1
	    IA_Image<IA_IntPoint,TBTYPE>	tv = templ(base_ip);
d371 1
a371 1
	return /*PROMOTE*/IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data,
@


1.2
log
@We now have support for forward convolutions.
IPSIter is now PSIter<IntPoint>.
@
text
@d11 4
d109 1
a109 1
static IA_Image<IA_IntPoint,RTYPE>
d113 1
a113 1
	      const IA_Image<IA_IntPoint,TBTYPE> &templ,
d169 1
a169 1
    return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
d172 3
a174 3
static IA_Image<IA_IntPoint,RTYPE>
backw_CONV_inv(const IA_Image<IA_IntPoint,IBTYPE> &img,
	 const IA_Image<IA_IntPoint,TBTYPE> &invtempl,
d184 1
a184 1
    IA_Image<IA_IntPoint,RTYPE>	rval =
d192 4
a195 3
IA_Image<IA_IntPoint,RTYPE> CONV(const IA_Image<IA_IntPoint,IBTYPE> &img,
			     const IA_DDTemplate<TITYPE> &templ,
			     IA_IntPointSet dest_ps)
d197 2
d231 1
a231 1
	return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data,
d240 1
a240 1
static IA_Image<IA_IntPoint,RTYPE>
d244 1
a244 1
	      const IA_Image<IA_IntPoint,TBTYPE> &templ,
d300 1
a300 1
    return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
d303 4
a306 3
static IA_Image<IA_IntPoint,RTYPE>
forw_CONV_inv(const IA_Image<IA_IntPoint,IBTYPE> &img,
	const IA_Image<IA_IntPoint,TBTYPE> &invtempl,
d316 1
a316 1
    IA_Image<IA_IntPoint,RTYPE>	rval =
d324 4
a327 3
IA_Image<IA_IntPoint,RTYPE> CONV(const IA_DDTemplate<TITYPE> &templ,
			     const IA_Image<IA_IntPoint,IBTYPE> &img,
			     IA_IntPointSet dest_ps)
d329 2
d368 2
a369 2
	return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data,
					   size, 1);
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log:	absorber,v $
d101 4
d106 1
a106 1
CONV_inv_core(IA_IntPoint src_infimum,
d135 1
a135 1
    IA_IPSIter	iter(dest_ps);
d169 1
a169 1
CONV_inv(const IA_Image<IA_IntPoint,IBTYPE> &img,
d181 1
a181 1
	CONV_inv_core(inf_, sup_-inf_ + 1, src_data, invtempl, dest_ps);
d193 2
a194 1
	return CONV_inv(img, ((IA_InvariantDT<TITYPE>*)templ.bdtp)->value, dest_ps);
d198 1
a198 1
	IA_IPSIter	dest_iter(dest_ps);
d224 135
a358 1
	return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
@
