aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/src/offset.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 /pkg/images/tv/iis/src/offset.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/images/tv/iis/src/offset.x')
-rw-r--r--pkg/images/tv/iis/src/offset.x53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkg/images/tv/iis/src/offset.x b/pkg/images/tv/iis/src/offset.x
new file mode 100644
index 00000000..356ae55f
--- /dev/null
+++ b/pkg/images/tv/iis/src/offset.x
@@ -0,0 +1,53 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <ctotok.h>
+include <ctype.h>
+include "../lib/ids.h"
+
+# OFFSET -- Change the bias (offset) for certain colors
+
+procedure offset()
+
+int tok, i, nchar, ip
+char token[SZ_LINE]
+short color[IDS_MAXGCOLOR+1]
+short offsetdata[4] # extra space for cvmove EOD
+int count, ctoi()
+
+include "cv.com"
+
+begin
+ # In principle, we should be able to accept input for color group
+ # followed by offset value(s) or "vice versa" or for a series of
+ # color/offset pairs. We try for most of that.
+ color[1] = ERR
+ offsetdata[1] = ERR
+ count = 1
+ # anything but TOK_NEWLINE
+ tok = TOK_NUMBER
+ repeat {
+ if (tok == TOK_NEWLINE) {
+ call eprintf ("Insufficient offset specification\n")
+ return
+ }
+ call gargtok (tok, token, SZ_LINE)
+ call strlwr (token)
+ if (token[1] == 'c') {
+ call cv_color (token[2], color)
+ if (color[1] == ERR)
+ return
+ } else if (tok == TOK_NUMBER) {
+ ip = 1
+ nchar = ctoi (token, ip, i)
+ if ( count <= 3) {
+ offsetdata[count] = i
+ count = count + 1
+ }
+ }
+ } until ( (color[1] != ERR) && (offsetdata[1] != ERR) &&
+ (tok == TOK_NEWLINE) )
+
+ offsetdata[count] = IDS_EOD # mark end
+
+ call cvoffset (color, offsetdata)
+end