aboutsummaryrefslogtreecommitdiff
path: root/sys/pmio/pmcircle.x
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/pmio/pmcircle.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/pmio/pmcircle.x')
-rw-r--r--sys/pmio/pmcircle.x37
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/pmio/pmcircle.x b/sys/pmio/pmcircle.x
new file mode 100644
index 00000000..086da99a
--- /dev/null
+++ b/sys/pmio/pmcircle.x
@@ -0,0 +1,37 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <pmset.h>
+include <plio.h>
+
+# PM_CIRCLE -- Rasterop between a circular region as source, and an existing
+# mask as destination. It is not necessary for the center of the circle to
+# be inside the mask; if it is outside, the boundary of the circle will be
+# clipped to the boundary of the mask. This is a 2-dim operator. If the
+# image dimensionality is greater than two the pm_setplane procedure should
+# be called first to specify the plane to be modified.
+
+procedure pm_circle (pl, x, y, radius, rop)
+
+pointer pl #I mask descriptor
+int x,y #I center coords of circle
+int radius #I radius of circle
+int rop #I rasterop
+
+errchk pl_getplane
+include "pmio.com"
+
+begin
+ if (PM_MAPXY(pl) == YES) {
+ call pl_getplane (pl, v1)
+ v1[1] = x; v1[2] = y
+ call imaplv (PM_REFIM(pl), v1, v2, PM_MAXDIM)
+
+ call pl_getplane (pl, v3)
+ v3[1] = x + radius; v3[2] = y
+ call imaplv (PM_REFIM(pl), v3, v4, PM_MAXDIM)
+
+ call pl_circle (pl, v2[1], v2[2], abs(v4[1]-v2[1]), rop)
+
+ } else
+ call pl_circle (pl, x, y, radius, rop)
+end