From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/pmio/miosrange.x | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sys/pmio/miosrange.x (limited to 'sys/pmio/miosrange.x') diff --git a/sys/pmio/miosrange.x b/sys/pmio/miosrange.x new file mode 100644 index 00000000..26b42727 --- /dev/null +++ b/sys/pmio/miosrange.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include "mio.h" + +# MIO_SETRANGE -- Set the region of the image to be accessed, and rewind the +# i/o pointer to the beginning of the specified region. + +procedure mio_setrange (mp, vs, ve, ndim) + +pointer mp #I MIO descriptor +long vs[IM_MAXDIM] #I vector coords of start of region +long ve[IM_MAXDIM] #I vector coords of end of region +int ndim #I dimensionality of region + +int i +int btoi() + +begin + do i = 1, IM_MAXDIM + if (i <= ndim) { + M_VS(mp,i) = min (vs[i], ve[i]) + M_VN(mp,i) = abs (ve[i] - vs[i]) + 1 + } else { + M_VS(mp,i) = 1 + M_VN(mp,i) = 1 + } + + M_LINEIO(mp) = btoi (vs[1] == 1 && ve[1] == IM_LEN(M_IM(mp),1)) + M_REGCOORDS(mp) = YES + M_ACTIVE(mp) = NO + M_NDIM(mp) = ndim +end -- cgit