diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/images/imutil/src/imamin.gx | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/images/imutil/src/imamin.gx')
-rw-r--r-- | pkg/images/imutil/src/imamin.gx | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/pkg/images/imutil/src/imamin.gx b/pkg/images/imutil/src/imamin.gx new file mode 100644 index 00000000..b0360510 --- /dev/null +++ b/pkg/images/imutil/src/imamin.gx @@ -0,0 +1,48 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <imhdr.h> + +# IMA_MIN -- Image arithmetic minimum value. + +$for (silrd) +procedure ima_min$t (im_a, im_b, im_c, a, b) + +pointer im_a, im_b, im_c +PIXEL a, b + +int len +pointer im[3], buf[3] +long v[IM_MAXDIM, 3] + +int ima_nl$t() + +begin + # Loop through all of the image lines. + im[1] = im_c + len = IM_LEN (im[1], 1) + call amovkl (long(1), v, 3 * IM_MAXDIM) + + # If imagea is constant then read imageb and do the vector/scalar + # minimum to imagec. + if (im_a == NULL) { + im[2] = im_b + while (ima_nl$t (im, buf, v, 2) != EOF) + call amink$t (Mem$t[buf[2]], a, Mem$t[buf[1]], len) + + # If imageb is constant then read imagea and do the vector/scalar + # minimum to imagec. + } else if (im_b == NULL) { + im[2] = im_a + while (ima_nl$t (im, buf, v, 2) != EOF) + call amink$t (Mem$t[buf[2]], b, Mem$t[buf[1]], len) + + # Read imagea and imageb and do a vector-vector minimum operation + # to imagec. + } else { + im[2] = im_a + im[3] = im_b + while (ima_nl$t (im, buf, v, 3) != EOF) + call amin$t (Mem$t[buf[2]], Mem$t[buf[3]], Mem$t[buf[1]], len) + } +end +$endfor |