aboutsummaryrefslogtreecommitdiff
path: root/sys/pmio/miosrange.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/pmio/miosrange.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/pmio/miosrange.x')
-rw-r--r--sys/pmio/miosrange.x33
1 files changed, 33 insertions, 0 deletions
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 <imhdr.h>
+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