head	1.5;
access;
symbols
	bobbase:1.5
	bob:1.5
	r2_1:1.5
	r2_0:1.5
	r1_1_beta:1.5
	r1_1_alpha:1.5
	r1_0:1.5
	r0_11:1.5
	r0_10:1.4
	r0_9:1.4;
locks; strict;
comment	@# @;


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

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

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

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

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


desc
@description of unsigned char DT convolutions.
@


1.5
log
@Rehack of template operation specifications.
@
text
@#
#	Copyright 1993, Center for Computer Vision and Visualization,
#	University of Florida.  All rights reserved.
#

#
# $Log: uchar-convolutions.desc,v $
# Revision 1.4  1993/11/17  18:45:15  thoth
# forward convolutions are now supported.
# template reductions are now supported.
#
# Revision 1.3  1993/09/27  15:55:30  thoth
# Make the xxxmax_product and xxxmin_product functions a little more robust.
#
# Revision 1.2  1993/09/21  11:45:04  thoth
# Give uchar convolutions the proper names.
#
# Revision 1.1  93/09/15  13:05:15  thoth
# Initial revision
# 
# Revision 1.2  93/05/27  11:41:16  thoth
# Copyright Notices
# 
# Revision 1.1  93/03/18  11:26:37  thoth
# Initial revision
# 

convolution linear_product zero=0 I(u_char) I(u_char) T(u_char)
init:	RTYPE	a = ZERO;
accum:	a += IVAL * TVAL;
final:	IRESULT = a;
end

convolution linear_product zero=0 I(u_char) T(u_char) I(u_char)
init:	RTYPE	a = ZERO;
accum:	a += IVAL * TVAL;
final:	IRESULT = a;
accvar:	IRESULT += IVAL * TVAL;
end

# we have to be careful doing the following transforms
# machine integers are NOT mathematical integers...

#the following is especially suspect.  What if there was NO
#intersection between the original image and the template.  We get the
#max value of the template, not the minimum value of the uchar ( 0 ).
#  *sigh*

convolution addmax_product zero=0 I(u_char) I(u_char) T(u_char)
init:	RTYPE	a=ZERO;
accum:	int temp = IVAL+TVAL; if (temp>255) temp = 255; if (temp > a) a = temp;
accvar:	int temp = IVAL+TVAL; if (temp > a) a = temp;
final:	IRESULT = a;
end

convolution addmax_product zero=0 I(u_char) T(u_char) I(u_char)
init:	RTYPE	a=ZERO;
accum:	int temp = IVAL+TVAL; if (temp>255) temp = 255; if (temp > a) a = temp;
final:	IRESULT = a;
accvar:	int temp = IVAL + TVAL; if (temp>255) temp = 255; if (temp > IRESULT) IRESULT = temp;
end

#

convolution addmin_product zero=255 I(u_char) I(u_char) T(u_char)
init:	RTYPE	a=ZERO;
accum:	register IBTYPE ival = IVAL; if (ival == ZERO) continue; int temp = ival+TVAL; if (temp < a) a = temp;
accvar:	int temp = IVAL+TVAL; if (temp < a) a = temp;
final:	IRESULT = a;
end

convolution addmin_product zero=255 I(u_char) T(u_char) I(u_char)
accum:	register IBTYPE ival = IVAL; if (ival == ZERO) continue; int temp = ival+TVAL; if (temp < a) a = temp;
final:	IRESULT = a;
init:	RTYPE	a=ZERO;
accvar:	int temp = IVAL + TVAL; if (temp < IRESULT) IRESULT = temp;
end

# take advantage of the fact that we are doing integer arithmetic and
# probably have extra precision lying around.  If the ints on your
# machine are not twice the size of chars (almost impossible) then use
# a long for the temp variable

convolution multmax_product zero=0 I(u_char) I(u_char) T(u_char)
init:	RTYPE	a=ZERO;
accum:	register IBTYPE	ival = IVAL; int temp = ival*TVAL; if (temp>255) temp = 255; if (temp>a) a = temp;
accvar:	RTYPE temp = IVAL*TVAL; if (temp>255) temp = 255; if (temp>a) a = temp;
final:	IRESULT = a;
end

convolution multmax_product zero=0 I(u_char) T(u_char) I(u_char)
init:	RTYPE	a=ZERO;
accum:	register IBTYPE	ival = IVAL; int temp = ival*TVAL; if (temp>255) temp = 255; if (temp>a) a = temp;
final:	IRESULT = a;
accvar:	int temp = IVAL+TVAL; if (temp>255) temp = 255; if (temp>IRESULT) IRESULT=temp;
end

# what do we do when the template has a zero and the image is
# undefined?  Currently we multiply +infty (255) by zero and get 0, a
# minimum value.  crap.

convolution multmin_product zero=255 I(u_char) I(u_char) T(u_char)
init:	RTYPE	a=ZERO;
accum:	register IBTYPE	ival = IVAL; int temp = ival*TVAL; if (temp>255) temp = 255; if (temp<a) a = temp;
accvar:	RTYPE temp = IVAL*TVAL; if (temp<a) a = temp;
final:	IRESULT = a;
end

convolution multmin_product zero=255 I(u_char) T(u_char) I(u_char)
init:	RTYPE	a=ZERO;
accum:	register IBTYPE	ival = IVAL; int temp = ival*TVAL; if (temp>255) temp = 255; if (temp<a) a = temp;
final:	IRESULT = a;
accvar:	int temp = IVAL+TVAL; if (temp<IRESULT) IRESULT=temp;
end

#
#

reduction sum zero=0 I(int) T(u_char)
accum:	IRESULT += TVAL;
end

reduction max zero=0 I(u_char) T(u_char)
accum:	if (TVAL>IRESULT) IRESULT = TVAL;
end

reduction min zero=255 I(u_char) T(u_char)
accum:	if (TVAL<IRESULT) IRESULT = TVAL;
end
@


1.4
log
@forward convolutions are now supported.
template reductions are now supported.
@
text
@d8 4
d28 1
a28 1
convolution u_char linear_product u_char u_char zero=0
a31 2
forw_init:	IRESULT = ZERO;
forw_accumvar:	IRESULT += IVAL * TVAL;
d34 7
d49 1
a49 1
convolution u_char addmax_product u_char u_char zero=0
a53 2
forw_init:	IRESULT = ZERO;
forw_accumvar:	int temp = IVAL + TVAL; if (temp>255) temp = 255; if (temp > IRESULT) IRESULT = temp;
d56 1
a56 1
convolution u_char addmin_product u_char u_char  zero=255
d58 9
a69 2
forw_init:	IRESULT = ZERO;
forw_accumvar:	int temp = IVAL + TVAL; if (temp < IRESULT) IRESULT = temp;
d72 7
d84 1
a84 1
convolution u_char multmax_product u_char u_char zero=0
a88 2
forw_init:	IRESULT = ZERO;
forw_accumvar:	int temp = IVAL+TVAL; if (temp>255) temp = 255; if (temp>IRESULT) IRESULT=temp;
d91 7
d102 1
a102 1
convolution u_char multmin_product u_char u_char zero=255
a106 2
forw_init:	IRESULT = ZERO;
forw_accumvar:	int temp = IVAL+TVAL; if (temp<IRESULT) IRESULT=temp;
d109 11
a119 1
reduction int sum u_char zero=0
d123 1
a123 1
reduction u_char max u_char zero=0
d127 1
a127 1
reduction u_char min u_char zero=255
@


1.3
log
@Make the xxxmax_product and xxxmin_product functions a little more robust.
@
text
@d8 3
d24 1
a24 1
u_char linear_product u_char u_char zero=0
d28 3
d40 1
a40 1
u_char addmax_product u_char u_char zero=0
d42 2
a43 1
accum:	RTYPE temp = IVAL+TVAL; if (temp>255) temp = 255; if (temp > a) a = temp;
d45 3
d49 1
a49 1
u_char addmin_product u_char u_char  zero=255
d51 2
a52 2
accum:	register IBTYPE ival = IVAL; if (ival == ZERO) continue; RTYPE temp = ival+TVAL; if (temp < a) a = temp;
accvar:	RTYPE temp = IVAL+TVAL; if (temp < a) a = temp;
d54 3
d63 1
a63 1
u_char multmax_product u_char u_char zero=0
d68 3
d76 1
a76 1
u_char multmin_product u_char u_char zero=255
d79 1
a79 1
accvar:	RTYPE temp = IVAL*TVAL; if (temp>255) temp = 255; if (temp<a) a = temp;
d81 15
@


1.2
log
@Give uchar convolutions the proper names.
@
text
@d7 4
a10 1
# $Log:	uchar-convolutions.desc,v $
d26 8
d36 1
a36 1
accum:	RTYPE temp = IVAL+TVAL; if (temp > a) a = temp;
d43 21
@


1.1
log
@Initial revision
@
text
@d8 3
d18 1
a18 1
u_char gcon u_char u_char zero=0
d23 1
a23 1
u_char addmax u_char u_char zero=0
d28 1
a28 1
u_char addmin u_char u_char  zero=255
@
