head	1.4;
access;
symbols
	bobbase:1.4
	bob:1.4.1
	r2_1:1.3
	r2_0:1.3
	r1_1_beta:1.3
	r1_1_alpha:1.2
	r1_0:1.2
	r0_11:1.1
	r0_10:1.1;
locks
	thoth:1.4.1.3; strict;
comment	@// @;


1.4
date	94.11.14.15.53.48;	author thoth;	state Exp;
branches
	1.4.1.1;
next	1.3;

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

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

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

1.4.1.1
date	94.12.28.17.57.21;	author thoth;	state Exp;
branches;
next	1.4.1.2;

1.4.1.2
date	95.01.09.18.20.14;	author thoth;	state Exp;
branches;
next	1.4.1.3;

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


desc
@Meta-code for a neighborhood reduction.
@


1.4
log
@Fixed severe uninitialized data error introduced to variant reductions
during the autodecomposition experiments.
@
text
@// Emacs: -*- C++ -*-

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


//
// $Log: nbh-reduction,v $
// Revision 1.3  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.2  1994/05/08  19:43:05  thoth
// New automatic neighborhood decomposition capability.
//
// Revision 1.1  1994/01/31  16:50:30  thoth
// Initial revision
//

#if 0
#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_Point<int>,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_Point<int>,IBTYPE> &srcimg,
			const IA_Set<IA_Point<int> > &dest_ps, IBTYPE *dest_data,
			IBTYPE zero)
{
    IA_SetStructure	ss;
    intersect_with_dualstruct(srcimg.domain(), dest_ps, &ss);

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

#endif
#endif

//
// backward neighborhood reductions
//

#ifdef NEED_SPARE
static void
backw_CONV_inv_core(IA_Point<int> src_infimum,
		    IA_Point<int> src_width,
		    const RTYPE *src_data, // length is prod(src_width)
		    const IA_Set<IA_Point<int> > &nbh,
		    IA_Set<IA_Point<int> > dest_ps,
		    RTYPE *const dest_data)
{
    const int	dimen = src_width.dim();

    int		nbh_sz = nbh.card();
    int	*const nbh_offsets = new int[nbh_sz];

    {
	int	*o_scan = nbh_offsets;
	IA_PSIter<IA_Point<int> >	iter(nbh);
	IA_Point<int>	ip;
	while (iter(ip)) {
	    *o_scan = ip[0];
	    for (unsigned i=1; i<dimen; i++) {
		*o_scan *= src_width[i];
		*o_scan += ip[i];
	    }
	    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 RTYPE *const base = src_data + offset;

	// _IVAL_=(base[nbh_offsets[i]])
	// _IRESULT_=(*valp)

	*valp = ZERO
	// INITIALIZE ;

	for (i=0; i<nbh_sz; i++) {
	    ACCUMULATE ;
	}
	//{
	//    RESULT ;
	//}
	valp++;
    }
    delete[] nbh_offsets;

    //return dest_data;
}
#else
static void
backw_CONV_inv_core(IA_Point<int> src_infimum,
		    IA_Point<int> src_width,
		    const RTYPE *src_data, // length is prod(src_width)
		    const IA_Set<IA_Point<int> > &nbh,
		    IA_Set<IA_Point<int> > dest_ps,
		    RTYPE *const dest_data);
#endif

static void
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_Set<IA_Point<int> > &nbh,
		    IA_Set<IA_Point<int> > dest_ps,
		    RTYPE *const dest_data)
{
    const int	dimen = src_width.dim();

    int		nbh_sz = nbh.card();
    int	*const nbh_offsets = new int[nbh_sz];

    {
	int	*o_scan = nbh_offsets;
	IA_PSIter<IA_Point<int> >	iter(nbh);
	IA_Point<int>	ip;
	while (iter(ip)) {
	    *o_scan = ip[0];
	    for (unsigned i=1; i<dimen; i++) {
		*o_scan *= src_width[i];
		*o_scan += ip[i];
	    }
	    o_scan++;
	}
    }

    if (dest_ps.boxy()) {

	IA_Point<int>	inf_ = dest_ps.inf();
	IA_Point<int>	sup_ = dest_ps.sup();
	IA_Point<int>	dest_width = sup_-inf_+1;

	int	offset = inf_ [0] - src_infimum[0];
	int	i;
	for (i=1; i<dimen; i++) {
	    offset *= src_width[i];
	    offset += inf_[i] - src_infimum[i];
	}

	IA_Point<int>	bases = extend_to_point(0, inf_.dim());
	i = dimen;
	bases[i-1] = 1;
	for (i--; i>0; i--) {
	    bases[i-1] = bases[i]*src_width[i];
	}

	IA_Point<int>	ip = extend_to_point(0, inf_.dim());

	RTYPE *	valp = dest_data;

	do {
	    const IBTYPE *const base = src_data + offset;

	    // _IVAL_=(base[nbh_offsets[i]])
	    // _IRESULT_=(*valp)

	    for (i=0; i<nbh_sz; i++) {
		ACCUMULATE ;
	    }
	    valp++;

	    // now we go to next point
	    for (i=dimen-1; i>=0; i--) {
		ip[i]++;
		offset+=bases[i];
		if (ip[i]<dest_width[i])
		    break;
		ip[i] = 0;
		offset -= dest_width[i]*bases[i];
	    }
	    // no more code here, might corrupt i
	} while (i>=0);

    } else {

	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[nbh_offsets[i]])
	    // _IRESULT_=(*valp)

	    *valp = ZERO;
	    // INITIALIZE ;

	    for (i=0; i<nbh_sz; i++) {
		ACCUMULATE ;
	    }
	    //{
	    //    RESULT ;
	    //}
	    valp++;
	}

    }				// end if boxy()

    delete[] nbh_offsets;

    //return dest_data;
}

static void
backw_decomp_CONV_inv(IA_Point<int> src_infimum,
		      IA_Point<int> src_width,
		      const IBTYPE	*src_data,
		      IA_Set<IA_Point<int> >	invnbh,
		      IA_Set<IA_Point<int> >	dest_ps,
		      RTYPE *dest_data)
{
    const int	sz = dest_ps.card();

    int	i;

    IA_PointSetDecomposition	decomp(invnbh);
    for (i=0; i<decomp.nfragments(); i++) {
	const IA_decomp_frag	&frag = decomp.get_frag(i);
	if (frag.plate.card()==1) {
	    backw_CONV_inv_core(src_infimum, src_width, src_data,
				       frag.bar, dest_ps, dest_data);
	} else {
	    IA_Point<int>	inf_ = dest_ps.inf() + frag.bar.inf();
	    IA_Point<int>	sup_ = dest_ps.sup() + frag.bar.sup();
	    IA_Set<IA_Point<int> >	intermed_ps(inf_, sup_);
	    const int sz = intermed_ps.card();
	    RTYPE	*intermed = new RTYPE[sz];
	    for (int j=0; j<sz; j++)
		intermed[j] = ZERO;
	    backw_decomp_CONV_inv
		(src_infimum, src_width, src_data,
		 frag.plate, intermed_ps, intermed);
	    backw_CONV_inv_core(inf_, sup_ - inf_ + 1, intermed,
				frag.bar, dest_ps, dest_data);
	    delete[] intermed;
	}
    }

}

static IA_Image<IA_Point<int>,RTYPE>
backw_CONV_inv(const IA_Image<IA_Point<int>,IBTYPE> &img,
	 const IA_Set<IA_Point<int> > &invnbh,
	 IA_Set<IA_Point<int> > dest_ps)
{
    IA_Point<int>	inf_ = dest_ps.inf()+invnbh.inf();
    IA_Point<int>	sup_ = dest_ps.sup()+invnbh.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));

#if 1
    const int sz = dest_ps.card();
    RTYPE	*const dest_data = new RTYPE[sz];
    for (int i=0; i<sz; i++)
	dest_data[i] = ZERO;
    if (IA_Neighborhood<IA_Point<int>, IA_Point<int> >::auto_decomposition)
	backw_decomp_CONV_inv (inf_, sup_-inf_ + 1, src_data,
			       invnbh, dest_ps, dest_data);
    else
	backw_CONV_inv_core(inf_, sup_-inf_ + 1, src_data,
			       invnbh, dest_ps, dest_data);
    IA_Image<IA_Point<int>,RTYPE> rval (dest_ps, dest_data, dest_ps.card(), 1);
#else
    IA_Image<IA_Point<int>,RTYPE>	rval =
	backw_CONV_inv_core(inf_, sup_-inf_ + 1, src_data, invnbh, dest_ps);
#endif

    delete[] src_data;

    return rval;
}

IA_Image<IA_Point<int>,RTYPE>
CONV(const IA_CoreImage<IA_Point<int>,IBTYPE> &img_,
     const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
     IA_Set<IA_Point<int> > dest_ps)
{
    IA_Image<IA_Point<int>,IBTYPE>	img(img_);

    if (nbh.type() == IA_InvariantNbh<IA_Point<int>,IA_Point<int> >::s_type()) {
	return backw_CONV_inv
	    (img,
	     ((IA_InvariantNbh<IA_Point<int>,IA_Point<int> >*) nbh.bnbh)->value,
	     dest_ps);
    } 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_Set<IA_Point<int> >	ps = nbh(base_ip);

	    IA_PSIter<IA_Point<int> >	nbh_iter(ps);
	    IA_Point<int>	nbh_ip;

	    // _IVAL_=img(nbh_ip)
	    // _IRESULT_=(*valp)

#if 1
	    *valp = ZERO;
#else			// obsoleted by neighborhood reduction decomposition
	    INITIALIZE ;
#endif

	    while ( nbh_iter(nbh_ip) ) {
		if (! img.domain().contains(nbh_ip))
		    continue;
		ACCUMULATEVAR ;
	    }
	    {
		RESULT ;
	    }
	    valp++;
	}
	return IA_Image<IA_Point<int>,RTYPE>(dest_ps, dest_data,
					   dest_ps.card(), 1);
    }
}

//
// foward neighborhood reductions
//

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

    int		nbh_sz = nbh.card();
    int	*const nbh_offsets = new int[nbh_sz];

    {
	int	*o_scan = nbh_offsets;
	IA_PSIter<IA_Point<int> >	iter(nbh);
	IA_Point<int>	ip;
	while (iter(ip)) {
	    *o_scan = -ip[0];
	    for (unsigned i=1; i<dimen; i++) {
		*o_scan *= src_width[i];
		*o_scan -= ip[i];
	    }
	    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[nbh_offsets[i]])
	// _IRESULT_=(*valp)

	*valp = ZERO;
	//INITIALIZE ;

	for (i=0; i<nbh_sz; i++) {
	    ACCUMULATE ;
	}
	//{
	//    RESULT ;
	//}
	valp++;
    }
    delete[] nbh_offsets;

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

static
IA_Image<IA_Point<int>,RTYPE>
forw_CONV_inv(const IA_Image<IA_Point<int>,IBTYPE> &img,
	const IA_Set<IA_Point<int> > &invnbh,
	IA_Set<IA_Point<int> > dest_ps)
{
    IA_Point<int>	inf_ = dest_ps.inf()-invnbh.sup();
    IA_Point<int>	sup_ = dest_ps.sup()-invnbh.inf();
    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 =
	forw_CONV_inv_core(inf_, sup_-inf_ + 1, src_data, invnbh, dest_ps);

    delete[] src_data;

    return rval;
}

IA_Image<IA_Point<int>,RTYPE>
CONV(const IA_Neighborhood<IA_Point<int>,IA_Point<int> > &nbh,
     const IA_CoreImage<IA_Point<int>,IBTYPE> &img_,
     IA_Set<IA_Point<int> > dest_ps)
{
    IA_Image<IA_Point<int>,IBTYPE>	img(img_);

    if (nbh.type() == IA_InvariantNbh<IA_Point<int>,IA_Point<int> >::s_type()) {
	return forw_CONV_inv
	    (img,
	     ((IA_InvariantNbh<IA_Point<int>,IA_Point<int> >*)nbh.bnbh)->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_Point<int> >	src_iter(img.domain());
	IA_Point<int>	base_ip;
	while (src_iter(base_ip)) {
	    IA_Set<IA_Point<int> >	ps = nbh(base_ip);

	    IA_PSIter<IA_Point<int> >	nbh_iter(ps);
	    IA_Point<int>	nbh_ip;
	    IBTYPE	ival = img(base_ip);

	    // _IVAL_=ival
	    // _IRESULT_=dest_data[offset]

	    while ( nbh_iter(nbh_ip) ) {
		if (! dest_ps.contains(nbh_ip))
		    continue;
		unsigned	offset = dest_ps.index(nbh_ip);
//		cout << "nbh(" << base_ip << ") =  " << tv << " and nbh()("
//		     << nbh_ip <<") = " << nbh_val << endl;
		FORW_ACCUMULATEVAR ;
	    }
	}
	return IA_Image<IA_Point<int>,RTYPE>(dest_ps, dest_data, size, 1);
    }
}
@


1.4.1.1
log
@Detect dimension mismatch a little earlier.
@
text
@a10 4
// Revision 1.4  1994/11/14  15:53:48  thoth
// Fixed severe uninitialized data error introduced to variant reductions
// during the autodecomposition experiments.
//
a319 5
    if (img.domain().dim() != invnbh.dim()) {
	ia_throw(Neighborhood_DimensionMismatch2_Exception(__FILE__,__LINE__));
	return IA_Image<IA_Point<int>,RTYPE>();
    }

a464 5
    if (img.domain().dim() != invnbh.dim()) {
	ia_throw(Neighborhood_DimensionMismatch2_Exception(__FILE__,__LINE__));
	return IA_Image<IA_Point<int>,RTYPE>();
    }

@


1.4.1.2
log
@Boxy pointset constructor replaced by function.
@
text
@a10 3
// Revision 1.4.1.1  1994/12/28  17:57:21  thoth
// Detect dimension mismatch a little earlier.
//
d303 1
a303 1
	    IA_Set<IA_Point<int> >	intermed_ps = IA_boxy_pset(inf_, sup_);
d331 1
a331 1
    IA_Set<IA_Point<int> >	src_ps = IA_boxy_pset(inf_,sup_);
d481 1
a481 1
    IA_Set<IA_Point<int> >	src_ps = IA_boxy_pset(inf_,sup_);
@


1.4.1.3
log
@CoreImage has been re-merged with Image.  All special stuff should be
friends of FBI now.
@
text
@a10 3
// Revision 1.4.1.2  1995/01/09  18:20:14  thoth
// Boxy pointset constructor replaced by function.
//
d82 1
a82 1
static void zero_extend(const IA_Image<IA_Point<int>,IBTYPE> &srcimg,
d363 1
a363 1
CONV(const IA_Image<IA_Point<int>,IBTYPE> &img_,
d499 1
a499 1
     const IA_Image<IA_Point<int>,IBTYPE> &img_,
@


1.3
log
@Name sanitization
@
text
@d10 4
a13 1
// $Log: neighborhood-reduction,v $
d142 1
d259 1
d376 3
d380 1
@


1.2
log
@New automatic neighborhood decomposition capability.
@
text
@d11 3
d46 1
a46 1
				  IA_IVIter<IA_IntPoint,IBTYPE> *srciter,
d72 2
a73 2
static void zero_extend(const IA_CoreImage<IA_IntPoint,IBTYPE> &srcimg,
			const IA_IntPointSet &dest_ps, IBTYPE *dest_data,
d79 2
a80 2
    if (srcimg.type() == IA_VectorI<IA_IntPoint,IBTYPE>::s_type()) {
	IBTYPE	*srcdata = ((IA_VectorI<IA_IntPoint,IBTYPE>*)srcimg.bip)->vec;
d83 1
a83 1
	IA_IVIter<IA_IntPoint,IBTYPE>	iter(srcimg);
d97 2
a98 2
backw_CONV_inv_core(IA_IntPoint src_infimum,
		    IA_IntPoint src_width,
d100 2
a101 2
		    const IA_IntPointSet &nbh,
		    IA_IntPointSet dest_ps,
d111 2
a112 2
	IA_PSIter<IA_IntPoint>	iter(nbh);
	IA_IntPoint	ip;
d123 2
a124 2
    IA_PSIter<IA_IntPoint>	iter(dest_ps);
    IA_IntPoint	ip;
d155 2
a156 2
backw_CONV_inv_core(IA_IntPoint src_infimum,
		    IA_IntPoint src_width,
d158 2
a159 2
		    const IA_IntPointSet &nbh,
		    IA_IntPointSet dest_ps,
d164 2
a165 2
backw_CONV_inv_core(IA_IntPoint src_infimum,
		    IA_IntPoint src_width,
d167 2
a168 2
		    const IA_IntPointSet &nbh,
		    IA_IntPointSet dest_ps,
d178 2
a179 2
	IA_PSIter<IA_IntPoint>	iter(nbh);
	IA_IntPoint	ip;
d192 3
a194 3
	IA_IntPoint	inf_ = dest_ps.inf();
	IA_IntPoint	sup_ = dest_ps.sup();
	IA_IntPoint	dest_width = sup_-inf_+1;
d203 1
a203 1
	IA_IntPoint	bases = extend_to_point(0, inf_.dim());
d210 1
a210 1
	IA_IntPoint	ip = extend_to_point(0, inf_.dim());
d239 2
a240 2
	IA_PSIter<IA_IntPoint>	iter(dest_ps);
	IA_IntPoint	ip;
d274 2
a275 2
backw_decomp_CONV_inv(IA_IntPoint src_infimum,
		      IA_IntPoint src_width,
d277 2
a278 2
		      IA_IntPointSet	invnbh,
		      IA_IntPointSet	dest_ps,
d292 3
a294 3
	    IA_IntPoint	inf_ = dest_ps.inf() + frag.bar.inf();
	    IA_IntPoint	sup_ = dest_ps.sup() + frag.bar.sup();
	    IA_IntPointSet	intermed_ps(inf_, sup_);
d310 8
a317 8
static IA_Image<IA_IntPoint,RTYPE>
backw_CONV_inv(const IA_Image<IA_IntPoint,IBTYPE> &img,
	 const IA_IntPointSet &invnbh,
	 IA_IntPointSet dest_ps)
{
    IA_IntPoint	inf_ = dest_ps.inf()+invnbh.inf();
    IA_IntPoint	sup_ = dest_ps.sup()+invnbh.sup();
    IA_IntPointSet	src_ps = IA_IntPointSet(inf_,sup_);
d328 1
a328 1
    if (IA_Neighborhood<IA_IntPoint, IA_IntPoint>::auto_decomposition)
d334 1
a334 1
    IA_Image<IA_IntPoint,RTYPE> rval (dest_ps, dest_data, dest_ps.card(), 1);
d336 1
a336 1
    IA_Image<IA_IntPoint,RTYPE>	rval =
d345 4
a348 4
IA_Image<IA_IntPoint,RTYPE>
CONV(const IA_CoreImage<IA_IntPoint,IBTYPE> &img_,
     const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
     IA_IntPointSet dest_ps)
d350 1
a350 1
    IA_Image<IA_IntPoint,IBTYPE>	img(img_);
d352 1
a352 1
    if (nbh.type() == IA_InvariantNbh<IA_IntPoint,IA_IntPoint>::s_type()) {
d355 1
a355 1
	     ((IA_InvariantNbh<IA_IntPoint,IA_IntPoint>*) nbh.bnbh)->value,
d360 2
a361 2
	IA_PSIter<IA_IntPoint>	dest_iter(dest_ps);
	IA_IntPoint	base_ip;
d363 1
a363 1
	    IA_IntPointSet	ps = nbh(base_ip);
d365 2
a366 2
	    IA_PSIter<IA_IntPoint>	nbh_iter(ps);
	    IA_IntPoint	nbh_ip;
d383 1
a383 1
	return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data,
d392 3
a394 3
static IA_Image<IA_IntPoint,RTYPE>
forw_CONV_inv_core(IA_IntPoint src_infimum,
	      IA_IntPoint src_width,
d396 2
a397 2
	      const IA_IntPointSet &nbh,
	      IA_IntPointSet dest_ps)
d406 2
a407 2
	IA_PSIter<IA_IntPoint>	iter(nbh);
	IA_IntPoint	ip;
d418 2
a419 2
    IA_PSIter<IA_IntPoint>	iter(dest_ps);
    IA_IntPoint	ip;
d447 1
a447 1
    return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
d451 8
a458 8
IA_Image<IA_IntPoint,RTYPE>
forw_CONV_inv(const IA_Image<IA_IntPoint,IBTYPE> &img,
	const IA_IntPointSet &invnbh,
	IA_IntPointSet dest_ps)
{
    IA_IntPoint	inf_ = dest_ps.inf()-invnbh.sup();
    IA_IntPoint	sup_ = dest_ps.sup()-invnbh.inf();
    IA_IntPointSet	src_ps = IA_IntPointSet(inf_,sup_);
d463 1
a463 1
    IA_Image<IA_IntPoint,RTYPE>	rval =
d471 4
a474 4
IA_Image<IA_IntPoint,RTYPE>
CONV(const IA_Neighborhood<IA_IntPoint,IA_IntPoint> &nbh,
     const IA_CoreImage<IA_IntPoint,IBTYPE> &img_,
     IA_IntPointSet dest_ps)
d476 1
a476 1
    IA_Image<IA_IntPoint,IBTYPE>	img(img_);
d478 1
a478 1
    if (nbh.type() == IA_InvariantNbh<IA_IntPoint,IA_IntPoint>::s_type()) {
d481 1
a481 1
	     ((IA_InvariantNbh<IA_IntPoint,IA_IntPoint>*)nbh.bnbh)->value,
d492 2
a493 2
	IA_PSIter<IA_IntPoint>	src_iter(img.domain());
	IA_IntPoint	base_ip;
d495 1
a495 1
	    IA_IntPointSet	ps = nbh(base_ip);
d497 2
a498 2
	    IA_PSIter<IA_IntPoint>	nbh_iter(ps);
	    IA_IntPoint	nbh_ip;
d513 1
a513 1
	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 $
d15 1
d86 1
d92 2
a93 1
static IA_Image<IA_IntPoint,RTYPE>
d95 5
a99 4
	      IA_IntPoint src_width,
	      const IBTYPE *src_data, // length is prod(src_width)
	      const IA_IntPointSet &nbh,
	      IA_IntPointSet dest_ps)
d122 1
a122 1
    RTYPE *const	dest_data = new RTYPE[dest_ps.card()];
d131 1
a131 1
	const IBTYPE *const base = src_data + offset;
d136 1
a136 1
	INITIALIZE ;
d141 43
a183 2
	{
	    RESULT ;
a184 1
	valp++;
d186 79
d267 38
a304 1
    return IA_Image<IA_IntPoint,RTYPE>(dest_ps, dest_data, dest_ps.card(), 1);
d318 15
a332 1
    zero_extend(img, src_ps, src_data, ZERO);
d335 1
d431 2
a432 1
	INITIALIZE ;
d437 3
a439 3
	{
	    RESULT ;
	}
d459 1
a459 1
    zero_extend(img, src_ps, src_data, ZERO);
@
