aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/imedit/bpmedit.cl
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/imedit/bpmedit.cl
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/images/tv/imedit/bpmedit.cl')
-rw-r--r--pkg/images/tv/imedit/bpmedit.cl69
1 files changed, 69 insertions, 0 deletions
diff --git a/pkg/images/tv/imedit/bpmedit.cl b/pkg/images/tv/imedit/bpmedit.cl
new file mode 100644
index 00000000..01d5f7aa
--- /dev/null
+++ b/pkg/images/tv/imedit/bpmedit.cl
@@ -0,0 +1,69 @@
+# BPMEDIT -- Edit BPM masks.
+
+procedure bpmedit (images)
+
+string images {prompt="List of images"}
+string bpmkey = "BPM" {prompt="Keyword with mask name"}
+int frame = 1 {prompt="Display frame with mask overlay"}
+int refframe = 2 {prompt="Display frame without mask overlay"}
+string command = "display $image $frame over=$mask erase=$erase ocol='1-10=red,green' fill-" {prompt="Display command"}
+bool display = yes {prompt="Interactive display?"}
+string cursor = "" {prompt="Cursor input"}
+
+struct *fd
+
+begin
+ int i1
+ file im, bpm, temp
+ struct dispcmd
+
+ set imedit_help = "tv$imedit/bpmedit.key"
+
+ temp = mktemp ("tmp$iraf")
+
+ sections (images, option="fullname", > temp)
+
+ fd = temp
+ while (fscan (fd, im) != EOF) {
+ bpm = ""; hselect (im, bpmkey, yes) | scan (bpm)
+ if (bpm == "") {
+ printf ("WARNING: No %s keyword (%s)\n", bpmkey, im)
+ next
+ }
+ if (imaccess(bpm)==NO) {
+ printf ("WARNING: Can't access mask (%s)\n", bpm)
+ next
+ }
+
+ if (display) {
+ # Override certain display parameters.
+ display.bpdisplay="none"
+ display.fill = no
+
+ # Set display command.
+ dispcmd = command
+ i1 = strstr ("$image", dispcmd)
+ if (i1 > 0)
+ dispcmd = substr (dispcmd, 1, i1-1) // im //
+ substr (dispcmd, i1+6, 1000)
+ i1 = strstr ("$frame", dispcmd)
+ if (i1 > 0)
+ dispcmd = substr (dispcmd, 1, i1-1) // frame //
+ substr (dispcmd, i1+6, 1000)
+ i1 = strstr ("$mask", dispcmd)
+ if (i1 > 0)
+ dispcmd = substr (dispcmd, 1, i1-1) // "$image" //
+ substr (dispcmd, i1+5, 1000)
+ i1 = strstr (">", dispcmd)
+ if (i1 == 0)
+ dispcmd += " >& dev$null"
+
+ display (im, refframe, over="", >& "dev$null")
+ imedit (bpm, "", command=dispcmd, display=display,
+ cursor=cursor, search=0)
+ } else
+ imedit (bpm, "", command=dispcmd, display=display,
+ cursor=cursor, search=0)
+ }
+ fd = ""; delete (temp, verify-)
+end