From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/plio/plempty.x | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sys/plio/plempty.x (limited to 'sys/plio/plempty.x') 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 + +# 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 -- cgit