1
! @(#)modlut.prg 19.1 (ESO-DMD) 02/25/03 14:08:55
2
! +++++++++++++++++++++++++++++++++++++
4
! command procedure modlut.prg to implement MODIFY/LUT, /ITT
5
! K. Banse 910227, 910611, 920523, 940216, 980907
7
! execute via MODIFY/LUT method colour print_flag
8
! method = Band, Rotate, Graphics, Squeeze, HSI
9
! colour = Red (def), Green, Blue, White + Dark or
10
! individual RGB colour values as integer (Ir,Ig,Ib) or
11
! as hex. values (0xrrggbb) for for method B
12
! Red, Green, Blue + All (def) for method R
13
! Red, Green, Blue + All (def) for method G
14
! Hue, Saturation, Intensity for method HSI
16
! print_flag = Y(es) for showing the corresponding intensity interval
17
! N(o) if not, only used for method = Band
19
! or MODIFY/ITT method value print_flag
20
! method = Band, Rotate, Squeeze, Convolve, Contrast
22
! print_flag = Y(es) for showing the corresponding intensity interval
25
! or EQUALIZE/HISTOGRAM frame [descr] [itt_name]
27
! +++++++++++++++++++++++++++++++++++++
29
if ididev(18) .eq. 11 then
30
if dazdevr(4) .ne. 1 then !only possible with own LUT
31
write/out this command only possible with own LUT ...
34
define/local modscale/i/1/2 8,3 !scaling of joystick delta
36
define/local modscale/i/1/2 8,12
39
if mid$cmnd(1:1) .eq. "E" then !EQUALIZE/HISTOGRAM
40
define/param p1 * IMA "Enter image name: "
41
define/param p2 + C "Enter optional descr name: "
42
define/param p3 + C "Enter name for resulting ITT: "
50
! here the MODIFY/... commands
51
! -----------------------------
53
define/param p1 B ? "Enter method:"
58
if mid$cmnd(11:11) .eq. "I" then !MODIFY/ITT
59
define/param p2 255 N "Enter value in [0,255]: "
60
define/param p3 N C "Enter print_flag: "
61
default(16:16) = p1(1:1)
63
if p1(1:1) .eq. "C" then
64
if p1(2:4) .eq. "ONT" then !option CONTRAST => K
67
if p2(1:1) .eq. "C" then !for option CONVOLVE
68
inputr(1) = 1 !use INPUTR(1) for passing the
69
else !CONTINUE option...
77
define/local izz/i/1/2 1,20
83
branch p1(1:1) R,G,S,H ROTA,GRAPH,SQU,HSI !branch according to method...
85
! default is overlay a colour band...
86
define/param p2 R ? "Enter colour value - R/G/B/W/D or Ir,Ig,Ib or 0xrrggbb:"
87
define/param p3 N C "Enter print_flag: "
89
if p2(1:2) .eq. "0x" then !input in hex. as in X11 notation
90
define/local hex/c/1/14 "0x ,0x ,0x "
94
write/keyw inputi {hex}
95
write/keyw inputr {inputi(1)},{inputi(2)},{inputi(3)}
96
else if m$tstno(p2) .eq. 1 then
97
write/keyw inputr {p2}
101
goto runluta !continue as for rotation
104
define/param p2 A ? "Enter colour value - R,G,B or for all colours:"
111
define/param p2 A ? "Enter colour value - R,G,B or for all colours:"
119
HSI: !HSI modification
120
define/param p2 H ? "Enter colour value - H, S or I:"
124
define/local izz/i/1/2 21,40
130
write/keyw inputc/c/1/20 {hcittlut({izz(1)}:{izz(2)})}
131
inputi = m$len(inputc)+2
132
write/keyw inputc/c/{inputi}/8 modified
133
write/keyw hcittlut/c/{izz(1)}/20 "{inputc(1:20)}"