1
! @(#)lutcrea.prg 19.1 (ES0-DMD) 02/25/03 14:08:54
2
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4
! MIDAS procedure lutcrea.prg to implement CREATE/LUT
7
! execute as CREATE/LUT LUT_name H_specs S_specs I_specs cyclic_flag
8
! LUT_name - name of optional LUT table, defaulted to ? which means no table
9
! H_specs - start,end,increments for hue, defaulted to 0.0,360.,-1.
10
! S_specs - start,end,increments for saturation, defaulted to 0.0,1.-1.
11
! I_specs - start,end,increments for intensity, defaulted to 0.0,1.-1.
12
! if increments < 0. increment is set to (end-start)/255.
13
! cyclic_flag = C or N
15
! as CREATE/LUT LUT_name CURSOR [start_LUT] [new_LUT]
17
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19
define/param p1 + C "Enter name of new LUT:"
21
if p2(1:4) .eq. "CURS" goto cursor_lut
23
define/param p2 0.0,360.,-1. N "Enter start,end,increment for hue:"
24
define/param p3 0.0,1.0,-1. N "Enter start,end,increment for saturation:"
25
define/param p4 0.0,1.0,-1. N "Enter start,end,increment for intensity:"
26
define/param p5 C ? "Enter Cyclic or No: "
29
write/keyw history "CREATE/LUT "
31
write/keyw inputr/r/1/3 {p4}
32
write/keyw inputr/r/4/3 {p3}
33
write/keyw inputr/r/7/3 {p2}
34
if p5(1:1) .eq. "C" then
45
if ididev(18) .eq. 11 then
46
write/out CURSOR option not supported for X11 displays...
50
define/param p3 + C "Enter LUT used as starting LUT:"
51
define/param p4 ? C "Enter LUT used via cursor input:"
54
if m$exist("lutdisp.bdf") .le. 0 -
55
create/image lutdisp 2,512,20 ? POLY 0.,1.
58
display/chan 1 1 !channel 1 with LUTsection 1
61
if p3(1:1) .ne. "+" load/lut {p3} 0,256
62
display/chan 2 0 !channel 2 with LUTsection 0
65
write/keyw in_a {p1} !save new LUT name
74
inquire/keyw p4 "Enter new LUT for input or hit RETURN to exit:"
75
if aux_mode(7) .ne. 0 goto loop
77
! now we pull out the new LUT