ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/do_results.tcl
(Generate patch)

Comparing ray/src/util/do_results.tcl (file contents):
Revision 2.1 by greg, Wed Sep 13 14:52:19 1995 UTC vs.
Revision 2.9 by greg, Wed Oct 26 20:06:17 2011 UTC

# Line 1 | Line 1
1 < # SCCSid "$SunId$ LBL"
1 > # RCSid: $Id$
2   #
3   # Results screen for trad
4   #
# Line 9 | Line 9 | set conv(TIFF-bw,suf)  .tif
9   set conv(TIFF-24,nam)   "TIFF 24-bit"
10   set conv(TIFF-24,com)   "ra_tiff %s %s"
11   set conv(TIFF-24,suf)   .tif
12 + set conv(TIFF-Luv,nam)  "TIFF LogLuv"
13 + set conv(TIFF-Luv,com)  "ra_tiff -L %s %s"
14 + set conv(TIFF-Luv,suf)  .tif
15   set conv(GIF-bw,nam)    "GIF B&W"
16   set conv(GIF-bw,com)    "ra_gif -b %s %s"
17   set conv(GIF-bw,suf)    .gif
# Line 21 | Line 24 | set conv(PPM-bin,suf)  .ppm
24   set conv(PPM-asc,nam)   "PPM (ASCII)"
25   set conv(PPM-asc,com)   "ra_ppm -a %s %s"
26   set conv(PPM-asc,suf)   .ppm
27 + set conv(BMP-bw,nam)    "BMP B&W"
28 + set conv(BMP-bw,com)    "ra_bmp -b %s %s"
29 + set conv(BMP-bw,suf)    .bmp
30 + set conv(BMP-clr,nam)   "BMP Color"
31 + set conv(BMP-clr,com)   "ra_bmp %s %s"
32 + set conv(BMP-clr,suf)   .bmp
33   set conv(PICT,nam)      "PICT 32-bit"
34   set conv(PICT,com)      "ra_pict -g 1.8 %s %s"
35   set conv(PICT,suf)      .pict
36 < set conv(ras-bw,nam)    "Sun B&W"
37 < set conv(ras-bw,com)    "ra_pr -b %s %s"
38 < set conv(ras-bw,suf)    .ras
39 < set conv(ras-8,nam)     "Sun 8-bit"
40 < set conv(ras-8,com)     "ra_pr %s %s"
41 < set conv(ras-8,suf)     .ras
33 < set conv(ras-24,nam)    "Sun 24-bit"
34 < set conv(ras-24,com)    "ra_pr24 %s %s"
35 < set conv(ras-24,suf)    .ras
36 < set conv(PS,nam)        "PostScript B&W"
37 < set conv(PS,com)        "ra_ps %s %s"
38 < set conv(PS,suf)        .ps
36 > set conv(PS-bw,nam)     "PostScript B&W"
37 > set conv(PS-bw,com)     "ra_ps -b -C %s %s"
38 > set conv(PS-bw,suf)     .ps
39 > set conv(PS-clr,nam)    "PostScript Color"
40 > set conv(PS-clr,com)    "ra_ps -c -C %s %s"
41 > set conv(PS-clr,suf)    .ps
42   set conv(tga-bw,nam)    "Targa B&W"
43   set conv(tga-bw,com)    "ra_t8 -b %s %s"
44   set conv(tga-bw,suf)    .tga
# Line 48 | Line 51 | set conv(tga-16,suf)   .tga
51   set conv(tga-24,nam)    "Targa 24-bit"
52   set conv(tga-24,com)    "ra_t16 -3 %s %s"
53   set conv(tga-24,suf)    .tga
54 < set conv(types) {GIF-bw GIF-8 PICT PS PPM-asc PPM-bin ras-bw ras-8 ras-24\
55 <                tga-bw tga-8 tga-16 tga-24 TIFF-bw TIFF-24}
54 > set conv(types) {GIF-bw GIF-8 PICT PS-bw PS-clr BMP-bw BMP-clr PPM-asc\
55 >                PPM-bin tga-bw tga-8 tga-16 tga-24 TIFF-bw TIFF-24}
56   set conv(typ) tga-24
57  
58   proc testappend {flst tf} {     # test if tf exists and append to flst if so
59          upvar $flst mylist
60 <        if [file exists $tf] {
60 >        if [file isfile $tf] {
61                  lappend mylist $tf
62          }
63   }
# Line 64 | Line 67 | proc list_views {} {           # List finished and unfinished p
67          set fpics {}
68          set ufpics {}
69          foreach vw $radvar(view) {
70 <                if [file exists ${rawfroot}_[lindex $vw 0].unf] {
70 >                if [file isfile ${rawfroot}_[lindex $vw 0].unf] {
71                          lappend ufpics [lindex $vw 0]
72 <                } elseif {[file exists $radvar(PICTURE)_[lindex $vw 0].pic]} {
72 >                } elseif {[file isfile $radvar(PICTURE)_[lindex $vw 0].hdr]} {
73                          lappend fpics [lindex $vw 0]
74                  }
75          }
# Line 80 | Line 83 | proc list_views {} {           # List finished and unfinished p
83   proc delpic {} {                # Delete selected pictures
84          global curmess
85          set selected_pics [get_selpics 1]
86 <        if {"$selected_pics" == {}} {
86 >        if {$selected_pics == {}} {
87                  set curmess "No pictures selected."
88                  return
89          }
# Line 99 | Line 102 | proc get_selpics {{getall 0}} {                # return selected pic
102          global fvwbox ufvwbox radvar rawfroot
103          set sl {}
104          foreach i [$fvwbox curselection] {
105 <                testappend sl $radvar(PICTURE)_[$fvwbox get $i].pic
105 >                testappend sl $radvar(PICTURE)_[$fvwbox get $i].hdr
106                  if {$getall && $rawfroot != $radvar(PICTURE)} {
107 <                        testappend sl ${rawfroot}_[$fvwbox get $i].pic
107 >                        testappend sl ${rawfroot}_[$fvwbox get $i].hdr
108                  }
109                  if {$getall && $radvar(ZFILE) != {}} {
110                          testappend sl $radvar(ZFILE)_[$fvwbox get $i].zbf
# Line 119 | Line 122 | proc get_selpics {{getall 0}} {                # return selected pic
122   proc dsppic {} {                # Display selected pictures
123          global curmess dispcom radvar
124          set selected_pics [get_selpics]
125 <        if {"$selected_pics" == {}} {
125 >        if {$selected_pics == {}} {
126                  set curmess "No pictures selected."
127                  return
128          }
129 <        if {"$radvar(EXPOSURE)" == {}} {
129 >        if {$radvar(EXPOSURE) == {}} {
130                  set ev 0
131          } else {
132                  if [regexp {^[+-]} $radvar(EXPOSURE)] {
133 <                        set ev $radvar(EXPOSURE)
133 >                        set ev [expr {round($radvar(EXPOSURE))}]
134                  } else {
135 <                        set ev [expr {log($radvar(EXPOSURE))/log(2)}]
135 >                        set ev [expr {round(log($radvar(EXPOSURE))/log(2))}]
136                  }
134                if {$ev < 0} {
135                        set ev [expr {int($ev - .5)}]
136                } else {
137                        set ev [expr {int($ev + .5)}]
138                }
137          }
138          foreach p $selected_pics {
139 <                if [string match *.unf $p] {
139 >                if {[string match *.unf $p] ||
140 >                                $radvar(PICTURE) == $radvar(RAWFILE)} {
141                          set dc [format $dispcom $ev $p]
142                  } else {
143                          set dc [format $dispcom 0 $p]
# Line 152 | Line 151 | proc cnvpic {} {               # Convert selected pictures
151          set curmess "No finished pictures selected."
152          foreach i [$fvwbox curselection] {
153                  set vw [$fvwbox get $i]
154 <                set p $radvar(PICTURE)_$vw.pic
154 >                set p $radvar(PICTURE)_$vw.hdr
155                  set df [format $convdest $vw]
156                  set curmess "Converting $p to $df..."
157                  update
# Line 167 | Line 166 | proc prtpic {} {               # Print selected pictures
166          global curmess prntcom radvar fvwbox
167          set curmess "No finished pictures selected."
168          foreach i [$fvwbox curselection] {
169 <                set p $radvar(PICTURE)_[$fvwbox get $i].pic
169 >                set p $radvar(PICTURE)_[$fvwbox get $i].hdr
170                  set curmess "Printing $p..."
171                  update
172                  set pc [format $prntcom $p]
# Line 235 | Line 234 | proc do_results w {            # Results screen
234          helplink $w.cnvb trad results convert
235          menubutton $w.typb -text $conv($conv(typ),nam) -relief raised \
236                          -menu $w.typb.m
237 <        place $w.typb -relwidth .1786 -relheight .0610 -relx .2143 -rely .7317
237 >        place $w.typb -relwidth .1986 -relheight .0610 -relx .2143 -rely .7317
238          helplink $w.typb trad results convtype
239          menu $w.typb.m
240          foreach t $conv(types) {
# Line 245 | Line 244 | proc do_results w {            # Results screen
244                                  set convdest $radvar(PICTURE)_%s$conv($t,suf)"
245          }
246          label $w.fil -text File:
247 <        place $w.fil -relx .4286 -rely .7317
247 >        place $w.fil -relx .4486 -rely .7317
248          set convdest $radvar(PICTURE)_%s$conv($conv(typ),suf)
249          entry $w.file -textvariable convdest -relief sunken
250 <        place $w.file -relwidth .4286 -relheight .0610 -relx .5000 -rely .7317
250 >        place $w.file -relwidth .4086 -relheight .0610 -relx .5200 -rely .7317
251          helplink $w.file trad results convfile
252          # Print picture(s)
253          button $w.prtb -text Print -relief raised -command prtpic
# Line 263 | Line 262 | proc do_results w {            # Results screen
262          place $w.prte -relwidth .5714 -relheight .0610 -relx .3571 -rely .8537
263          helplink $w.prte trad results printcommand
264          # Fill in views
265 <        if {[info exists radvar(RAWFILE)] && $radvar(RAWFILE) != {}} {
265 >        if {$radvar(RAWFILE) != {}} {
266                  set rawfroot $radvar(RAWFILE)
267 +                if {$radvar(RAWFILE) == $radvar(PICTURE)} {
268 +                        set curmess "Warning: finished views are unfiltered"
269 +                }
270          } else {
271                  set rawfroot $radvar(PICTURE)
270        }
271        if {! [info exists radvar(ZFILE)]} {
272                set radvar(ZFILE) {}
272          }
273          list_views
274   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines