aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/src/snap.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 /pkg/images/tv/iis/src/snap.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/images/tv/iis/src/snap.x')
-rw-r--r--pkg/images/tv/iis/src/snap.x64
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