aboutsummaryrefslogtreecommitdiff
path: root/sys/plio/plempty.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/plempty.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/plio/plempty.x')
-rw-r--r--sys/plio/plempty.x25
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/plio/plempty.x b/sys/plio/plempty.x
new file mode 100644
index 00000000..2dab29ed
--- /dev/null
+++ b/sys/plio/plempty.x
@@ -0,0 +1,25 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <plio.h>
+
+# PL_EMPTY -- Test whether a mask is empty, i.e., contains no nonzero pixels.
+
+bool procedure pl_empty (pl)
+
+pointer pl #I mask descriptor
+int i
+
+begin
+ # Mask is empty if all lines are empty.
+ do i = 1, PL_NLP(pl)
+ if (PL_LP(pl,i) != PL_EMPTYLINE)
+ return (false)
+
+ return (true)
+
+ # The following also works, but the call to pl_compress is an
+ # unintended side effect which it is best to avoid.
+
+ # call pl_compress (pl)
+ # return (PL_LLOP(pl) == LP_BLEN(Ref(pl,0)))
+end