diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/images/tv/iis/src/snap.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/images/tv/iis/src/snap.x')
-rw-r--r-- | pkg/images/tv/iis/src/snap.x | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pkg/images/tv/iis/src/snap.x b/pkg/images/tv/iis/src/snap.x new file mode 100644 index 00000000..12694568 --- /dev/null +++ b/pkg/images/tv/iis/src/snap.x @@ -0,0 +1,64 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <ctotok.h> +include <ctype.h> +include <imhdr.h> +include <gki.h> +include "../lib/ids.h" + +# SNAP -- Take a picture!! + +procedure snap() + +char token[SZ_LINE] +int tok +char fname[SZ_FNAME] +int snap_color + +include "cv.com" + +begin + snap_color = IDS_SNAP_MONO # default color for snap + call gargtok (tok, token, SZ_LINE) + call strlwr (token) + if (tok == TOK_IDENTIFIER) { + if (token[1] != 'c') { + call eprintf ("unknown snap argument: %s\n") + call pargstr (token) + return + } else { + # snap colors: r, g, b, rgb, m (monochrome) == bw (black/white) + switch (token[2]) { + case 'm': + snap_color = IDS_SNAP_MONO + + case 'r': + if ((token[3] == 'g') && (token[4] == 'b') ) + snap_color = IDS_SNAP_RGB + else + snap_color = IDS_SNAP_RED + + case 'g': + snap_color = IDS_SNAP_GREEN + + case 'b': + if (token[3] == 'w') + snap_color = IDS_SNAP_MONO + else + snap_color = IDS_SNAP_BLUE + + default: + call eprintf ("Unknown snap color: %c\n") + call pargc (token[2]) + return + } + } + } else if (tok != TOK_NEWLINE) { + call eprintf ("unexpected argument to snap: %s\n") + call pargstr (token) + return + } + + call clgstr("snap_file", fname, SZ_FNAME) + call cvsnap (fname, snap_color) +end |