aboutsummaryrefslogtreecommitdiff
path: root/sys/pmio/tf
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pmio/tf')
-rw-r--r--sys/pmio/tf/miogld.x103
-rw-r--r--sys/pmio/tf/miogli.x103
-rw-r--r--sys/pmio/tf/miogll.x103
-rw-r--r--sys/pmio/tf/mioglr.x103
-rw-r--r--sys/pmio/tf/miogls.x103
-rw-r--r--sys/pmio/tf/mioglx.x103
-rw-r--r--sys/pmio/tf/miopld.x102
-rw-r--r--sys/pmio/tf/miopli.x102
-rw-r--r--sys/pmio/tf/miopll.x102
-rw-r--r--sys/pmio/tf/mioplr.x102
-rw-r--r--sys/pmio/tf/miopls.x102
-rw-r--r--sys/pmio/tf/mioplx.x102
-rw-r--r--sys/pmio/tf/mkpkg33
-rw-r--r--sys/pmio/tf/pmglpi.x69
-rw-r--r--sys/pmio/tf/pmglpl.x69
-rw-r--r--sys/pmio/tf/pmglps.x69
-rw-r--r--sys/pmio/tf/pmglri.x81
-rw-r--r--sys/pmio/tf/pmglrl.x81
-rw-r--r--sys/pmio/tf/pmglrs.x81
-rw-r--r--sys/pmio/tf/pmplpi.x34
-rw-r--r--sys/pmio/tf/pmplpl.x34
-rw-r--r--sys/pmio/tf/pmplps.x34
-rw-r--r--sys/pmio/tf/pmplri.x34
-rw-r--r--sys/pmio/tf/pmplrl.x34
-rw-r--r--sys/pmio/tf/pmplrs.x34
25 files changed, 1917 insertions, 0 deletions
diff --git a/sys/pmio/tf/miogld.x b/sys/pmio/tf/miogld.x
new file mode 100644
index 00000000..7c3dc743
--- /dev/null
+++ b/sys/pmio/tf/miogld.x
@@ -0,0 +1,103 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_GLSEG -- Get a line segment from a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_glsegd (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U coords of first pixel in output ine segment
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer imgl2d(), imgl3d(), imggsd()
+errchk imgl2d, imgl3d, imggsd, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, M_NDIM(mp))
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = imgl2d (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = imgl3d (im, v[2], v[3])
+ else {
+ call amovl (v, ve, M_NDIM(mp)); ve[1] = M_VE(mp,1)
+ bp = imggsd (im, v, ve, M_NDIM(mp))
+ }
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/miogli.x b/sys/pmio/tf/miogli.x
new file mode 100644
index 00000000..726f46f1
--- /dev/null
+++ b/sys/pmio/tf/miogli.x
@@ -0,0 +1,103 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_GLSEG -- Get a line segment from a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_glsegi (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U coords of first pixel in output ine segment
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer imgl2i(), imgl3i(), imggsi()
+errchk imgl2i, imgl3i, imggsi, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, M_NDIM(mp))
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = imgl2i (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = imgl3i (im, v[2], v[3])
+ else {
+ call amovl (v, ve, M_NDIM(mp)); ve[1] = M_VE(mp,1)
+ bp = imggsi (im, v, ve, M_NDIM(mp))
+ }
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/miogll.x b/sys/pmio/tf/miogll.x
new file mode 100644
index 00000000..6566ae01
--- /dev/null
+++ b/sys/pmio/tf/miogll.x
@@ -0,0 +1,103 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_GLSEG -- Get a line segment from a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_glsegl (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U coords of first pixel in output ine segment
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer imgl2l(), imgl3l(), imggsl()
+errchk imgl2l, imgl3l, imggsl, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, M_NDIM(mp))
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = imgl2l (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = imgl3l (im, v[2], v[3])
+ else {
+ call amovl (v, ve, M_NDIM(mp)); ve[1] = M_VE(mp,1)
+ bp = imggsl (im, v, ve, M_NDIM(mp))
+ }
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/mioglr.x b/sys/pmio/tf/mioglr.x
new file mode 100644
index 00000000..d0fa8de0
--- /dev/null
+++ b/sys/pmio/tf/mioglr.x
@@ -0,0 +1,103 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_GLSEG -- Get a line segment from a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_glsegr (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U coords of first pixel in output ine segment
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer imgl2r(), imgl3r(), imggsr()
+errchk imgl2r, imgl3r, imggsr, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, M_NDIM(mp))
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = imgl2r (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = imgl3r (im, v[2], v[3])
+ else {
+ call amovl (v, ve, M_NDIM(mp)); ve[1] = M_VE(mp,1)
+ bp = imggsr (im, v, ve, M_NDIM(mp))
+ }
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/miogls.x b/sys/pmio/tf/miogls.x
new file mode 100644
index 00000000..4973da4f
--- /dev/null
+++ b/sys/pmio/tf/miogls.x
@@ -0,0 +1,103 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_GLSEG -- Get a line segment from a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_glsegs (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U coords of first pixel in output ine segment
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer imgl2s(), imgl3s(), imggss()
+errchk imgl2s, imgl3s, imggss, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, M_NDIM(mp))
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = imgl2s (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = imgl3s (im, v[2], v[3])
+ else {
+ call amovl (v, ve, M_NDIM(mp)); ve[1] = M_VE(mp,1)
+ bp = imggss (im, v, ve, M_NDIM(mp))
+ }
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/mioglx.x b/sys/pmio/tf/mioglx.x
new file mode 100644
index 00000000..44f866a2
--- /dev/null
+++ b/sys/pmio/tf/mioglx.x
@@ -0,0 +1,103 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_GLSEG -- Get a line segment from a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_glsegx (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U coords of first pixel in output ine segment
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer imgl2x(), imgl3x(), imggsx()
+errchk imgl2x, imgl3x, imggsx, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, M_NDIM(mp))
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = imgl2x (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = imgl3x (im, v[2], v[3])
+ else {
+ call amovl (v, ve, M_NDIM(mp)); ve[1] = M_VE(mp,1)
+ bp = imggsx (im, v, ve, M_NDIM(mp))
+ }
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/miopld.x b/sys/pmio/tf/miopld.x
new file mode 100644
index 00000000..33515220
--- /dev/null
+++ b/sys/pmio/tf/miopld.x
@@ -0,0 +1,102 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_PLSEG -- Put a line segment to a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_plsegd (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U vector coordinates of first pixel
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer impl2d(), impl3d(), impgsd()
+errchk impl2d, impl3d, impgsd, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, IM_MAXDIM)
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = impl2d (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = impl3d (im, v[2], v[3])
+ else
+ bp = impgsd (im, v, ve, M_NDIM(mp))
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/miopli.x b/sys/pmio/tf/miopli.x
new file mode 100644
index 00000000..80ab9ab2
--- /dev/null
+++ b/sys/pmio/tf/miopli.x
@@ -0,0 +1,102 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_PLSEG -- Put a line segment to a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_plsegi (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U vector coordinates of first pixel
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer impl2i(), impl3i(), impgsi()
+errchk impl2i, impl3i, impgsi, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, IM_MAXDIM)
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = impl2i (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = impl3i (im, v[2], v[3])
+ else
+ bp = impgsi (im, v, ve, M_NDIM(mp))
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/miopll.x b/sys/pmio/tf/miopll.x
new file mode 100644
index 00000000..c59564b4
--- /dev/null
+++ b/sys/pmio/tf/miopll.x
@@ -0,0 +1,102 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_PLSEG -- Put a line segment to a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_plsegl (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U vector coordinates of first pixel
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer impl2l(), impl3l(), impgsl()
+errchk impl2l, impl3l, impgsl, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, IM_MAXDIM)
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = impl2l (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = impl3l (im, v[2], v[3])
+ else
+ bp = impgsl (im, v, ve, M_NDIM(mp))
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/mioplr.x b/sys/pmio/tf/mioplr.x
new file mode 100644
index 00000000..05471efd
--- /dev/null
+++ b/sys/pmio/tf/mioplr.x
@@ -0,0 +1,102 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_PLSEG -- Put a line segment to a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_plsegr (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U vector coordinates of first pixel
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer impl2r(), impl3r(), impgsr()
+errchk impl2r, impl3r, impgsr, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, IM_MAXDIM)
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = impl2r (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = impl3r (im, v[2], v[3])
+ else
+ bp = impgsr (im, v, ve, M_NDIM(mp))
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/miopls.x b/sys/pmio/tf/miopls.x
new file mode 100644
index 00000000..85288e28
--- /dev/null
+++ b/sys/pmio/tf/miopls.x
@@ -0,0 +1,102 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_PLSEG -- Put a line segment to a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_plsegs (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U vector coordinates of first pixel
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer impl2s(), impl3s(), impgss()
+errchk impl2s, impl3s, impgss, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, IM_MAXDIM)
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = impl2s (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = impl3s (im, v[2], v[3])
+ else
+ bp = impgss (im, v, ve, M_NDIM(mp))
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/mioplx.x b/sys/pmio/tf/mioplx.x
new file mode 100644
index 00000000..238cb7eb
--- /dev/null
+++ b/sys/pmio/tf/mioplx.x
@@ -0,0 +1,102 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+include "../mio.h"
+
+# MIO_PLSEG -- Put a line segment to a masked image. A line segment is a
+# region of the data image for which the corresponding region of the mask has
+# the constant nonzero value MVAL. Line segments are returned for each line in
+# the region VS to VE, returning the number of pixels in each line segment as
+# the function value, or EOF when the region is exhausted. Once EOF is
+# reached, repeated calls will continue to return EOF until the next call to
+# MIO_SETRANGE. Repeated calls to MIO_SETRANGE may be used to access a series
+# of distinct regions in the image. If a subregion of the image is being
+# accessed with MIO_SETRANGE, the vector coordinates V returned below will
+# be relative to the defined subregion (if this is not what is desired,
+# the range should be set to the full image and a region mask used to mask
+# off the subregion to be accessed).
+
+int procedure mio_plsegx (mp, ptr, mval, v, npix)
+
+pointer mp #I MIO descriptor
+pointer ptr #O pointer to a buffer containing the data
+int mval #O mask value for the output line segment
+long v[IM_MAXDIM] #U vector coordinates of first pixel
+int npix #O number of pixels in output line segment
+
+int x1, i
+long ve[IM_MAXDIM]
+pointer pm, im, rl, rp, bp
+pointer impl2x(), impl3x(), impgsx()
+errchk impl2x, impl3x, impgsx, pm_glri
+bool pm_sectnotempty()
+int plloop()
+
+begin
+ pm = M_PM(mp)
+ rl = M_RLP(mp)
+
+ # Initialization performed for the first i/o on a new region.
+ if (M_ACTIVE(mp) == NO) {
+ call plsslv (pm, M_VS(mp,1), M_VN(mp,1), M_V(mp,1), M_VE(mp,1))
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ M_ACTIVE(mp) = YES
+ }
+
+ # Get a new mask line?
+ while (M_RLI(mp) > RLI_LEN(rl))
+ if (plloop (M_V(mp,1), M_VS(mp,1), M_VE(mp,1),
+ M_NDIM(mp)) == LOOP_DONE) {
+ return (EOF)
+ } else {
+ call amovl (M_V(mp,1), ve, M_NDIM(mp))
+ ve[1] = M_VE(mp,1)
+ if (pm_sectnotempty (pm, M_V(mp,1), ve, M_NDIM(mp))) {
+ call pm_glri (pm,
+ M_V(mp,1), Memi[rl], M_DEPTH(mp), M_VN(mp,1), PIX_SRC)
+ M_RLI(mp) = RL_FIRST
+ }
+ }
+
+
+ # Get a new image line?
+ if (M_RLI(mp) == RL_FIRST) {
+ call amovl (M_V(mp,1), v, IM_MAXDIM)
+ im = M_IM(mp)
+
+ if (M_LINEIO(mp) == YES && M_NDIM(mp) == 2)
+ bp = impl2x (im, v[2])
+ else if (M_LINEIO(mp) == YES && M_NDIM(mp) == 3)
+ bp = impl3x (im, v[2], v[3])
+ else
+ bp = impgsx (im, v, ve, M_NDIM(mp))
+
+ M_LBP(mp) = bp
+ } else
+ bp = M_LBP(mp)
+
+ # Return the next line segment.
+ rp = rl + (M_RLI(mp) - 1) * RL_LENELEM
+ M_RLI(mp) = M_RLI(mp) + 1
+
+ x1 = Memi[rp+RL_XOFF]
+ npix = Memi[rp+RL_NOFF]
+ mval = Memi[rp+RL_VOFF]
+ ptr = bp + x1 - M_VS(mp,1)
+
+ if (M_REGCOORDS(mp) == NO) {
+ v[1] = x1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i)
+ } else {
+ v[1] = x1 - M_VS(mp,1) + 1
+ do i = 2, M_NDIM(mp)
+ v[i] = M_V(mp,i) - M_VS(mp,i) + 1
+ }
+
+ return (npix)
+end
diff --git a/sys/pmio/tf/mkpkg b/sys/pmio/tf/mkpkg
new file mode 100644
index 00000000..2d51c91e
--- /dev/null
+++ b/sys/pmio/tf/mkpkg
@@ -0,0 +1,33 @@
+# Update the type expanded generic files in the PMIO package library.
+
+$checkout libex.a lib$
+$update libex.a
+$checkin libex.a lib$
+$exit
+
+libex.a:
+ miogld.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ miogli.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ miogll.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ mioglr.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ miogls.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ mioglx.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ miopld.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ miopli.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ miopll.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ mioplr.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ miopls.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ mioplx.x ../mio.h <imhdr.h> <plio.h> <pmset.h>
+ pmglpi.x ../pmio.com <plio.h> <pmset.h>
+ pmglpl.x ../pmio.com <plio.h> <pmset.h>
+ pmglps.x ../pmio.com <plio.h> <pmset.h>
+ pmglri.x ../pmio.com <imhdr.h> <plio.h> <pmset.h>
+ pmglrl.x ../pmio.com <imhdr.h> <plio.h> <pmset.h>
+ pmglrs.x ../pmio.com <imhdr.h> <plio.h> <pmset.h>
+ pmplpi.x ../pmio.com <plio.h> <pmset.h>
+ pmplpl.x ../pmio.com <plio.h> <pmset.h>
+ pmplps.x ../pmio.com <plio.h> <pmset.h>
+ pmplri.x ../pmio.com <plio.h> <pmset.h>
+ pmplrl.x ../pmio.com <plio.h> <pmset.h>
+ pmplrs.x ../pmio.com <plio.h> <pmset.h>
+ ;
diff --git a/sys/pmio/tf/pmglpi.x b/sys/pmio/tf/pmglpi.x
new file mode 100644
index 00000000..2de53760
--- /dev/null
+++ b/sys/pmio/tf/pmglpi.x
@@ -0,0 +1,69 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_GLP -- Get a line segment as a pixel array, applying the given ROP to
+# combine the pixels with those of the output array.
+
+procedure pm_glpi (pl, v, px_dst, px_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+int px_dst[ARB] #O output pixel array
+int px_depth #I pixel depth, bits
+int npix #I number of pixels desired
+int rop #I rasterop
+
+int temp, np, step, xstep
+pointer sp, px_src, px_out, im
+include "../pmio.com"
+
+begin
+ im = PM_REFIM(pl)
+ if (PM_MAPXY(pl) == NO) {
+ call pl_glpi (pl, v, px_dst, px_depth, npix, rop)
+ return
+ }
+
+ call smark (sp)
+
+ # Determine physical coords of line segment.
+ call amovl (v, v3, PM_MAXDIM)
+ call imaplv (im, v3, v1, PM_MAXDIM)
+ v3[1] = v3[1] + npix - 1
+ call imaplv (im, v3, v2, PM_MAXDIM)
+
+ # Get line scaling parameters.
+ if (npix <= 1)
+ xstep = 1
+ else
+ xstep = (v2[1] - v1[1]) / (npix - 1)
+ step = xstep
+ if (xstep < 0) {
+ temp = v1[1]; v1[1] = v2[1]; v2[1] = temp
+ step = -step
+ }
+
+ # Extract the pixels.
+ np = (npix - 1) * step + 1
+ call salloc (px_src, np, TY_INT)
+ call pl_glpi (pl, v1, Memi[px_src], 0, np, PIX_SRC)
+
+ # Subsample and flip if necessary.
+ if (step > 1)
+ call imsamp (Memi[px_src], Memi[px_src], npix, SZ_INT, step)
+ if (xstep < 0)
+ call imaflp (Memi[px_src], npix, SZ_INT)
+
+ if (!R_NEED_DST(rop))
+ call amovi (Memi[px_src], px_dst, npix)
+ else {
+ call salloc (px_out, npix, TY_INT)
+ call pl_pixropi (Memi[px_src], 1, PL_MAXVAL(pl), px_dst, 1,
+ MV(px_depth), npix, rop)
+ call amovi (Memi[px_out], px_dst, npix)
+ }
+
+ call sfree (sp)
+end
diff --git a/sys/pmio/tf/pmglpl.x b/sys/pmio/tf/pmglpl.x
new file mode 100644
index 00000000..24e4b6ff
--- /dev/null
+++ b/sys/pmio/tf/pmglpl.x
@@ -0,0 +1,69 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_GLP -- Get a line segment as a pixel array, applying the given ROP to
+# combine the pixels with those of the output array.
+
+procedure pm_glpl (pl, v, px_dst, px_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+long px_dst[ARB] #O output pixel array
+int px_depth #I pixel depth, bits
+int npix #I number of pixels desired
+int rop #I rasterop
+
+int temp, np, step, xstep
+pointer sp, px_src, px_out, im
+include "../pmio.com"
+
+begin
+ im = PM_REFIM(pl)
+ if (PM_MAPXY(pl) == NO) {
+ call pl_glpl (pl, v, px_dst, px_depth, npix, rop)
+ return
+ }
+
+ call smark (sp)
+
+ # Determine physical coords of line segment.
+ call amovl (v, v3, PM_MAXDIM)
+ call imaplv (im, v3, v1, PM_MAXDIM)
+ v3[1] = v3[1] + npix - 1
+ call imaplv (im, v3, v2, PM_MAXDIM)
+
+ # Get line scaling parameters.
+ if (npix <= 1)
+ xstep = 1
+ else
+ xstep = (v2[1] - v1[1]) / (npix - 1)
+ step = xstep
+ if (xstep < 0) {
+ temp = v1[1]; v1[1] = v2[1]; v2[1] = temp
+ step = -step
+ }
+
+ # Extract the pixels.
+ np = (npix - 1) * step + 1
+ call salloc (px_src, np, TY_LONG)
+ call pl_glpl (pl, v1, Meml[px_src], 0, np, PIX_SRC)
+
+ # Subsample and flip if necessary.
+ if (step > 1)
+ call imsamp (Meml[px_src], Meml[px_src], npix, SZ_LONG, step)
+ if (xstep < 0)
+ call imaflp (Meml[px_src], npix, SZ_LONG)
+
+ if (!R_NEED_DST(rop))
+ call amovl (Meml[px_src], px_dst, npix)
+ else {
+ call salloc (px_out, npix, TY_LONG)
+ call pl_pixropl (Meml[px_src], 1, PL_MAXVAL(pl), px_dst, 1,
+ MV(px_depth), npix, rop)
+ call amovl (Meml[px_out], px_dst, npix)
+ }
+
+ call sfree (sp)
+end
diff --git a/sys/pmio/tf/pmglps.x b/sys/pmio/tf/pmglps.x
new file mode 100644
index 00000000..bcc50de4
--- /dev/null
+++ b/sys/pmio/tf/pmglps.x
@@ -0,0 +1,69 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_GLP -- Get a line segment as a pixel array, applying the given ROP to
+# combine the pixels with those of the output array.
+
+procedure pm_glps (pl, v, px_dst, px_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+short px_dst[ARB] #O output pixel array
+int px_depth #I pixel depth, bits
+int npix #I number of pixels desired
+int rop #I rasterop
+
+int temp, np, step, xstep
+pointer sp, px_src, px_out, im
+include "../pmio.com"
+
+begin
+ im = PM_REFIM(pl)
+ if (PM_MAPXY(pl) == NO) {
+ call pl_glps (pl, v, px_dst, px_depth, npix, rop)
+ return
+ }
+
+ call smark (sp)
+
+ # Determine physical coords of line segment.
+ call amovl (v, v3, PM_MAXDIM)
+ call imaplv (im, v3, v1, PM_MAXDIM)
+ v3[1] = v3[1] + npix - 1
+ call imaplv (im, v3, v2, PM_MAXDIM)
+
+ # Get line scaling parameters.
+ if (npix <= 1)
+ xstep = 1
+ else
+ xstep = (v2[1] - v1[1]) / (npix - 1)
+ step = xstep
+ if (xstep < 0) {
+ temp = v1[1]; v1[1] = v2[1]; v2[1] = temp
+ step = -step
+ }
+
+ # Extract the pixels.
+ np = (npix - 1) * step + 1
+ call salloc (px_src, np, TY_SHORT)
+ call pl_glps (pl, v1, Mems[px_src], 0, np, PIX_SRC)
+
+ # Subsample and flip if necessary.
+ if (step > 1)
+ call imsamp (Mems[px_src], Mems[px_src], npix, SZ_SHORT, step)
+ if (xstep < 0)
+ call imaflp (Mems[px_src], npix, SZ_SHORT)
+
+ if (!R_NEED_DST(rop))
+ call amovs (Mems[px_src], px_dst, npix)
+ else {
+ call salloc (px_out, npix, TY_SHORT)
+ call pl_pixrops (Mems[px_src], 1, PL_MAXVAL(pl), px_dst, 1,
+ MV(px_depth), npix, rop)
+ call amovs (Mems[px_out], px_dst, npix)
+ }
+
+ call sfree (sp)
+end
diff --git a/sys/pmio/tf/pmglri.x b/sys/pmio/tf/pmglri.x
new file mode 100644
index 00000000..3b3881f8
--- /dev/null
+++ b/sys/pmio/tf/pmglri.x
@@ -0,0 +1,81 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+
+# PM_GLR -- Get a line segment as a range list, applying the given ROP to
+# combine the pixels with those of the output line list. Note that this
+# operator uses IMIO if a section transformation is needed, hence if the
+# application also uses IMIO to directly access the mask image, care must
+# be taken to avoid confusion over the use of IMIO allocated pixel buffers.
+
+procedure pm_glri (pl, v, rl_dst, rl_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+int rl_dst[3,ARB] #O output line list
+int rl_depth #I line list depth, bits
+int npix #I number of pixels desired
+int rop #I rasterop
+
+int rl_len, temp, step, xstep, np
+pointer sp, px_src, rl_src, rl_out, im
+include "../pmio.com"
+int pl_p2ri()
+
+begin
+ im = PM_REFIM(pl)
+ if (PM_MAPXY(pl) == NO) {
+ call pl_glri (pl, v, rl_dst, rl_depth, npix, rop)
+ return
+ }
+
+ call smark (sp)
+ call salloc (rl_src, RL_MAXLEN(pl), TY_INT)
+
+ # Determine physical coords of line segment.
+ call amovl (v, v3, PM_MAXDIM)
+ call imaplv (im, v3, v1, PM_MAXDIM)
+ v3[1] = v3[1] + npix - 1
+ call imaplv (im, v3, v2, PM_MAXDIM)
+
+ # Get line scaling parameters.
+ if (npix <= 1)
+ xstep = 1
+ else
+ xstep = (v2[1] - v1[1]) / (npix - 1)
+ step = xstep
+ if (xstep < 0) {
+ temp = v1[1]; v1[1] = v2[1]; v2[1] = temp
+ step = -step
+ }
+
+ # Extract the pixels.
+ np = (npix - 1) * step + 1
+ call salloc (px_src, np, TY_INT)
+ call pl_glpi (pl, v1, Memi[px_src], 0, np, PIX_SRC)
+
+ # Subsample and flip if necessary.
+ if (step > 1)
+ call imsamp (Memi[px_src], Memi[px_src], npix, SZ_INT, step)
+ if (xstep < 0)
+ call imaflp (Memi[px_src], npix, SZ_INT)
+
+ # Convert to a range list.
+ rl_len = pl_p2ri (Memi[px_src], 1, Memi[rl_src], npix)
+
+ # Copy to or combine with destination.
+ if (!R_NEED_DST(rop)) {
+ rl_len = RLI_LEN(rl_src) * RL_LENELEM
+ call amovi (Memi[rl_src], rl_dst, rl_len)
+ } else {
+ call salloc (rl_out, RL_MAXLEN(pl), TY_INT)
+ call pl_rangeropi (Memi[rl_src], 1, PL_MAXVAL(pl), rl_dst, 1,
+ MV(rl_depth), Memi[rl_out], npix, rop)
+ rl_len = RLI_LEN(rl_out) * RL_LENELEM
+ call amovi (Memi[rl_out], rl_dst, rl_len)
+ }
+
+ call sfree (sp)
+end
diff --git a/sys/pmio/tf/pmglrl.x b/sys/pmio/tf/pmglrl.x
new file mode 100644
index 00000000..d78b891e
--- /dev/null
+++ b/sys/pmio/tf/pmglrl.x
@@ -0,0 +1,81 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+
+# PM_GLR -- Get a line segment as a range list, applying the given ROP to
+# combine the pixels with those of the output line list. Note that this
+# operator uses IMIO if a section transformation is needed, hence if the
+# application also uses IMIO to directly access the mask image, care must
+# be taken to avoid confusion over the use of IMIO allocated pixel buffers.
+
+procedure pm_glrl (pl, v, rl_dst, rl_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+long rl_dst[3,ARB] #O output line list
+int rl_depth #I line list depth, bits
+int npix #I number of pixels desired
+int rop #I rasterop
+
+int rl_len, temp, step, xstep, np
+pointer sp, px_src, rl_src, rl_out, im
+include "../pmio.com"
+int pl_p2rl()
+
+begin
+ im = PM_REFIM(pl)
+ if (PM_MAPXY(pl) == NO) {
+ call pl_glrl (pl, v, rl_dst, rl_depth, npix, rop)
+ return
+ }
+
+ call smark (sp)
+ call salloc (rl_src, RL_MAXLEN(pl), TY_LONG)
+
+ # Determine physical coords of line segment.
+ call amovl (v, v3, PM_MAXDIM)
+ call imaplv (im, v3, v1, PM_MAXDIM)
+ v3[1] = v3[1] + npix - 1
+ call imaplv (im, v3, v2, PM_MAXDIM)
+
+ # Get line scaling parameters.
+ if (npix <= 1)
+ xstep = 1
+ else
+ xstep = (v2[1] - v1[1]) / (npix - 1)
+ step = xstep
+ if (xstep < 0) {
+ temp = v1[1]; v1[1] = v2[1]; v2[1] = temp
+ step = -step
+ }
+
+ # Extract the pixels.
+ np = (npix - 1) * step + 1
+ call salloc (px_src, np, TY_LONG)
+ call pl_glpl (pl, v1, Meml[px_src], 0, np, PIX_SRC)
+
+ # Subsample and flip if necessary.
+ if (step > 1)
+ call imsamp (Meml[px_src], Meml[px_src], npix, SZ_LONG, step)
+ if (xstep < 0)
+ call imaflp (Meml[px_src], npix, SZ_LONG)
+
+ # Convert to a range list.
+ rl_len = pl_p2rl (Meml[px_src], 1, Meml[rl_src], npix)
+
+ # Copy to or combine with destination.
+ if (!R_NEED_DST(rop)) {
+ rl_len = RLI_LEN(rl_src) * RL_LENELEM
+ call amovl (Meml[rl_src], rl_dst, rl_len)
+ } else {
+ call salloc (rl_out, RL_MAXLEN(pl), TY_LONG)
+ call pl_rangeropl (Meml[rl_src], 1, PL_MAXVAL(pl), rl_dst, 1,
+ MV(rl_depth), Meml[rl_out], npix, rop)
+ rl_len = RLI_LEN(rl_out) * RL_LENELEM
+ call amovl (Meml[rl_out], rl_dst, rl_len)
+ }
+
+ call sfree (sp)
+end
diff --git a/sys/pmio/tf/pmglrs.x b/sys/pmio/tf/pmglrs.x
new file mode 100644
index 00000000..79fea4f6
--- /dev/null
+++ b/sys/pmio/tf/pmglrs.x
@@ -0,0 +1,81 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <pmset.h>
+include <plio.h>
+
+# PM_GLR -- Get a line segment as a range list, applying the given ROP to
+# combine the pixels with those of the output line list. Note that this
+# operator uses IMIO if a section transformation is needed, hence if the
+# application also uses IMIO to directly access the mask image, care must
+# be taken to avoid confusion over the use of IMIO allocated pixel buffers.
+
+procedure pm_glrs (pl, v, rl_dst, rl_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+short rl_dst[3,ARB] #O output line list
+int rl_depth #I line list depth, bits
+int npix #I number of pixels desired
+int rop #I rasterop
+
+int rl_len, temp, step, xstep, np
+pointer sp, px_src, rl_src, rl_out, im
+include "../pmio.com"
+int pl_p2rs()
+
+begin
+ im = PM_REFIM(pl)
+ if (PM_MAPXY(pl) == NO) {
+ call pl_glrs (pl, v, rl_dst, rl_depth, npix, rop)
+ return
+ }
+
+ call smark (sp)
+ call salloc (rl_src, RL_MAXLEN(pl), TY_SHORT)
+
+ # Determine physical coords of line segment.
+ call amovl (v, v3, PM_MAXDIM)
+ call imaplv (im, v3, v1, PM_MAXDIM)
+ v3[1] = v3[1] + npix - 1
+ call imaplv (im, v3, v2, PM_MAXDIM)
+
+ # Get line scaling parameters.
+ if (npix <= 1)
+ xstep = 1
+ else
+ xstep = (v2[1] - v1[1]) / (npix - 1)
+ step = xstep
+ if (xstep < 0) {
+ temp = v1[1]; v1[1] = v2[1]; v2[1] = temp
+ step = -step
+ }
+
+ # Extract the pixels.
+ np = (npix - 1) * step + 1
+ call salloc (px_src, np, TY_SHORT)
+ call pl_glps (pl, v1, Mems[px_src], 0, np, PIX_SRC)
+
+ # Subsample and flip if necessary.
+ if (step > 1)
+ call imsamp (Mems[px_src], Mems[px_src], npix, SZ_SHORT, step)
+ if (xstep < 0)
+ call imaflp (Mems[px_src], npix, SZ_SHORT)
+
+ # Convert to a range list.
+ rl_len = pl_p2rs (Mems[px_src], 1, Mems[rl_src], npix)
+
+ # Copy to or combine with destination.
+ if (!R_NEED_DST(rop)) {
+ rl_len = RLI_LEN(rl_src) * RL_LENELEM
+ call amovs (Mems[rl_src], rl_dst, rl_len)
+ } else {
+ call salloc (rl_out, RL_MAXLEN(pl), TY_SHORT)
+ call pl_rangerops (Mems[rl_src], 1, PL_MAXVAL(pl), rl_dst, 1,
+ MV(rl_depth), Mems[rl_out], npix, rop)
+ rl_len = RLS_LEN(rl_out) * RL_LENELEM
+ call amovs (Mems[rl_out], rl_dst, rl_len)
+ }
+
+ call sfree (sp)
+end
diff --git a/sys/pmio/tf/pmplpi.x b/sys/pmio/tf/pmplpi.x
new file mode 100644
index 00000000..b62b333a
--- /dev/null
+++ b/sys/pmio/tf/pmplpi.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_PLP -- Put a line segment input as a pixel array a mask, applying the
+# given ROP to combine the pixels with those of the mask.
+
+procedure pm_plpi (pl, v, px_src, px_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+int px_src[ARB] #I input pixel array
+int px_depth #I pixel depth, bits
+int npix #I number of pixels affected
+int rop #I rasterop
+
+pointer sp, ll_src
+int ll_len, pl_p2li()
+include "../pmio.com"
+
+begin
+ if (PM_MAPXY(pl) == NO)
+ call pl_plpi (pl, v, px_src, px_depth, npix, rop)
+ else {
+ call smark (sp)
+ call salloc (ll_src, LL_MAXLEN(pl), TY_SHORT)
+
+ ll_len = pl_p2li (px_src, 1, Mems[ll_src], npix)
+ call pm_plls (pl, v, Mems[ll_src], px_depth, npix, rop)
+
+ call sfree (sp)
+ }
+end
diff --git a/sys/pmio/tf/pmplpl.x b/sys/pmio/tf/pmplpl.x
new file mode 100644
index 00000000..2194d9f9
--- /dev/null
+++ b/sys/pmio/tf/pmplpl.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_PLP -- Put a line segment input as a pixel array a mask, applying the
+# given ROP to combine the pixels with those of the mask.
+
+procedure pm_plpl (pl, v, px_src, px_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+long px_src[ARB] #I input pixel array
+int px_depth #I pixel depth, bits
+int npix #I number of pixels affected
+int rop #I rasterop
+
+pointer sp, ll_src
+int ll_len, pl_p2ll()
+include "../pmio.com"
+
+begin
+ if (PM_MAPXY(pl) == NO)
+ call pl_plpl (pl, v, px_src, px_depth, npix, rop)
+ else {
+ call smark (sp)
+ call salloc (ll_src, LL_MAXLEN(pl), TY_SHORT)
+
+ ll_len = pl_p2ll (px_src, 1, Mems[ll_src], npix)
+ call pm_plls (pl, v, Mems[ll_src], px_depth, npix, rop)
+
+ call sfree (sp)
+ }
+end
diff --git a/sys/pmio/tf/pmplps.x b/sys/pmio/tf/pmplps.x
new file mode 100644
index 00000000..68e26f7d
--- /dev/null
+++ b/sys/pmio/tf/pmplps.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_PLP -- Put a line segment input as a pixel array a mask, applying the
+# given ROP to combine the pixels with those of the mask.
+
+procedure pm_plps (pl, v, px_src, px_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+short px_src[ARB] #I input pixel array
+int px_depth #I pixel depth, bits
+int npix #I number of pixels affected
+int rop #I rasterop
+
+pointer sp, ll_src
+int ll_len, pl_p2ls()
+include "../pmio.com"
+
+begin
+ if (PM_MAPXY(pl) == NO)
+ call pl_plps (pl, v, px_src, px_depth, npix, rop)
+ else {
+ call smark (sp)
+ call salloc (ll_src, LL_MAXLEN(pl), TY_SHORT)
+
+ ll_len = pl_p2ls (px_src, 1, Mems[ll_src], npix)
+ call pm_plls (pl, v, Mems[ll_src], px_depth, npix, rop)
+
+ call sfree (sp)
+ }
+end
diff --git a/sys/pmio/tf/pmplri.x b/sys/pmio/tf/pmplri.x
new file mode 100644
index 00000000..4a2f1435
--- /dev/null
+++ b/sys/pmio/tf/pmplri.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_PLR -- Put a line segment input as a range list to a mask, applying the
+# given ROP to combine the pixels with those of the output mask.
+
+procedure pm_plri (pl, v, rl_src, rl_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+int rl_src[3,ARB] #I input range list
+int rl_depth #I range list pixel depth, bits
+int npix #I number of pixels affected
+int rop #I rasterop
+
+pointer sp, ll_src
+int ll_len, pl_r2li()
+include "../pmio.com"
+
+begin
+ if (PM_MAPXY(pl) == NO)
+ call pl_plri (pl, v, rl_src, rl_depth, npix, rop)
+ else {
+ call smark (sp)
+ call salloc (ll_src, LL_MAXLEN(pl), TY_SHORT)
+
+ ll_len = pl_r2li (rl_src, 1, Mems[ll_src], npix)
+ call pm_plls (pl, v, Mems[ll_src], rl_depth, npix, rop)
+
+ call sfree (sp)
+ }
+end
diff --git a/sys/pmio/tf/pmplrl.x b/sys/pmio/tf/pmplrl.x
new file mode 100644
index 00000000..260daa21
--- /dev/null
+++ b/sys/pmio/tf/pmplrl.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_PLR -- Put a line segment input as a range list to a mask, applying the
+# given ROP to combine the pixels with those of the output mask.
+
+procedure pm_plrl (pl, v, rl_src, rl_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+long rl_src[3,ARB] #I input range list
+int rl_depth #I range list pixel depth, bits
+int npix #I number of pixels affected
+int rop #I rasterop
+
+pointer sp, ll_src
+int ll_len, pl_r2ll()
+include "../pmio.com"
+
+begin
+ if (PM_MAPXY(pl) == NO)
+ call pl_plrl (pl, v, rl_src, rl_depth, npix, rop)
+ else {
+ call smark (sp)
+ call salloc (ll_src, LL_MAXLEN(pl), TY_SHORT)
+
+ ll_len = pl_r2ll (rl_src, 1, Mems[ll_src], npix)
+ call pm_plls (pl, v, Mems[ll_src], rl_depth, npix, rop)
+
+ call sfree (sp)
+ }
+end
diff --git a/sys/pmio/tf/pmplrs.x b/sys/pmio/tf/pmplrs.x
new file mode 100644
index 00000000..43b99b98
--- /dev/null
+++ b/sys/pmio/tf/pmplrs.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_PLR -- Put a line segment input as a range list to a mask, applying the
+# given ROP to combine the pixels with those of the output mask.
+
+procedure pm_plrs (pl, v, rl_src, rl_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+short rl_src[3,ARB] #I input range list
+int rl_depth #I range list pixel depth, bits
+int npix #I number of pixels affected
+int rop #I rasterop
+
+pointer sp, ll_src
+int ll_len, pl_r2ls()
+include "../pmio.com"
+
+begin
+ if (PM_MAPXY(pl) == NO)
+ call pl_plrs (pl, v, rl_src, rl_depth, npix, rop)
+ else {
+ call smark (sp)
+ call salloc (ll_src, LL_MAXLEN(pl), TY_SHORT)
+
+ ll_len = pl_r2ls (rl_src, 1, Mems[ll_src], npix)
+ call pm_plls (pl, v, Mems[ll_src], rl_depth, npix, rop)
+
+ call sfree (sp)
+ }
+end