aboutsummaryrefslogtreecommitdiff
path: root/sys/plio/plglr.gx
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/plio/plglr.gx
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/plio/plglr.gx')
-rw-r--r--sys/plio/plglr.gx44
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/plio/plglr.gx b/sys/plio/plglr.gx
new file mode 100644
index 00000000..3a63346d
--- /dev/null
+++ b/sys/plio/plglr.gx
@@ -0,0 +1,44 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <plio.h>
+include <plset.h>
+
+# PL_GLR -- Get a line segment as a range list, applying the given ROP to
+# combine the pixels with those of the output list.
+
+procedure pl_glr$t (pl, v, rl_dst, rl_depth, npix, rop)
+
+pointer pl #I mask descriptor
+long v[PL_MAXDIM] #I vector coords of line segment
+PIXEL rl_dst[ARB] #O output range list
+int rl_depth #I range list depth, bits
+int npix #I number of pixels desired
+int rop #I rasterop
+
+int mr, nr
+pointer sp, rl_out, rl_src, ll_src
+pointer pl_access()
+int pl_l2r$t()
+errchk pl_access
+
+begin
+ ll_src = pl_access (pl,v)
+ if (!R_NEED_DST(rop))
+ nr = pl_l2r$t (Mems[ll_src], v[1], rl_dst, npix)
+ else {
+ call smark (sp)
+ mr = min (RL_MAXLEN(pl), npix * 3)
+ call salloc (rl_src, mr, TY_PIXEL)
+ call salloc (rl_out, mr, TY_PIXEL)
+
+ nr = pl_l2r$t (Mems[ll_src], v[1], Mem$t[rl_src], npix)
+ call pl_rangerop$t (Mem$t[rl_src], 1, PL_MAXVAL(pl),
+ rl_dst, 1, MV(rl_depth),
+ Mem$t[rl_out], npix, rop)
+
+ # Copy out the edited range list.
+ call amov$t (Mem$t[rl_out], rl_dst, RL$T_LEN(rl_out))
+
+ call sfree (sp)
+ }
+end