aboutsummaryrefslogtreecommitdiff
path: root/sys/plio/plcircle.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/plio/plcircle.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/plio/plcircle.x')
-rw-r--r--sys/plio/plcircle.x43
1 files changed, 43 insertions, 0 deletions
diff --git a/sys/plio/plcircle.x b/sys/plio/plcircle.x
new file mode 100644
index 00000000..504c1ce5
--- /dev/null
+++ b/sys/plio/plcircle.x
@@ -0,0 +1,43 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <plset.h>
+include <plio.h>
+include "plcircle.h"
+
+
+# PL_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 pl_setplane procedure should
+# be called first to specify the plane to be modified.
+
+procedure pl_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
+
+int y1, y2
+pointer sp, ufd
+extern pl_ucircle()
+
+begin
+ call plvalid (pl)
+ call smark (sp)
+ call salloc (ufd, LEN_CIRCLEDES, TY_STRUCT)
+
+ y1 = max ( 1, min (PL_AXLEN(pl,2), y - radius))
+ y2 = max (y1, min (PL_AXLEN(pl,2), y + radius))
+
+ C_PL(ufd) = pl
+ C_XCEN(ufd) = x
+ C_YCEN(ufd) = y
+ C_RADIUS(ufd) = radius
+ C_PV(ufd) = 1
+
+ call pl_regionrop (pl, pl_ucircle, ufd, y1, y2, rop)
+
+ call sfree (sp)
+end