From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- vo/votools/gasplib/rdxy.x | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 vo/votools/gasplib/rdxy.x (limited to 'vo/votools/gasplib/rdxy.x') diff --git a/vo/votools/gasplib/rdxy.x b/vo/votools/gasplib/rdxy.x new file mode 100644 index 00000000..360f9cd0 --- /dev/null +++ b/vo/votools/gasplib/rdxy.x @@ -0,0 +1,43 @@ +include + +# RDXY -- procedure to get (x,y) pixel values from a line. +# The line can have any number of columns but only up to 162 +# characters per line. +# +procedure rdxy (line, icol, x, y) + +char line[SZ_LINE] # input line with (x,y) in it +int icol[2] # X, Y column numbers within the line +double x # X pixel value +double y # Y pixel value + +pointer sp, pp +int i, ip, ic, ctowrd(), ctod() +int maxcol, nchar + +begin + + # find the right most column to read from buffer + maxcol = max (icol[1], icol[2]) + + call smark (sp) + call salloc (pp, maxcol*MAX_DIGITS, TY_CHAR) + + ip = 1 + ic = pp + do i = 1, maxcol { + nchar = ctowrd (line, ip, Memc[ic], MAX_DIGITS) + # store word in equal length array + call amovkc (" ", Memc[ic+nchar], MAX_DIGITS-nchar) + Memc[ic+MAX_DIGITS] = EOS + ic = ic + MAX_DIGITS+1 + } + + # get the output parameters + + nchar = ctod (Memc[pp], (icol(1)-1)*(MAX_DIGITS+1)+1, x) + nchar = ctod (Memc[pp], (icol(2)-1)*(MAX_DIGITS+1)+1, y) + + call sfree (sp) + +end -- cgit