~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to prim/proc/modlut.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! @(#)modlut.prg        19.1 (ESO-DMD) 02/25/03 14:08:55
 
2
! +++++++++++++++++++++++++++++++++++++
 
3
!
 
4
! command procedure  modlut.prg  to implement MODIFY/LUT, /ITT
 
5
! K. Banse      910227, 910611, 920523, 940216, 980907
 
6
!       
 
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
 
15
!                n.a. for method S
 
16
!   print_flag = Y(es) for showing the corresponding intensity interval
 
17
!                N(o) if not, only used for method = Band
 
18
 
19
! or          MODIFY/ITT method value print_flag
 
20
!       method = Band, Rotate, Squeeze, Convolve, Contrast
 
21
!       value  = in [0,255]
 
22
!   print_flag = Y(es) for showing the corresponding intensity interval
 
23
!                N(o) if not
 
24
 
25
! or          EQUALIZE/HISTOGRAM frame [descr] [itt_name]
 
26
!
 
27
! +++++++++++++++++++++++++++++++++++++
 
28
!
 
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 ...
 
32
      return
 
33
   endif
 
34
   define/local modscale/i/1/2 8,3              !scaling of joystick delta
 
35
else
 
36
   define/local modscale/i/1/2 8,12
 
37
endif
 
38
 
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: "
 
43
!
 
44
   write/keyw in_a {p1}
 
45
   default(15:16) = "IH"
 
46
   run MID_EXE:LUTMOD
 
47
   return
 
48
endif
 
49
 
50
!  here the MODIFY/...  commands
 
51
!  -----------------------------
 
52
 
53
define/param p1 B ? "Enter method:"
 
54
default(15:15) = "I"
 
55
!
 
56
!  MODIFY/ITT
 
57
!
 
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)
 
62
 
63
   if p1(1:1) .eq. "C" then
 
64
      if p1(2:4) .eq. "ONT" then        !option CONTRAST => K
 
65
         default(16:16) = "K"
 
66
      else         
 
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...
 
70
            inputr(1) = 0
 
71
         endif
 
72
      endif
 
73
   else
 
74
      inputr(1) = {p2}
 
75
   endif
 
76
 
77
   define/local izz/i/1/2 1,20
 
78
else
 
79
!       
 
80
!  MODIFY/LUT
 
81
!
 
82
   default(15:15) = "L"
 
83
   branch p1(1:1) R,G,S,H ROTA,GRAPH,SQU,HSI   !branch according to method...
 
84
!
 
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: "
 
88
!
 
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  "
 
91
      hex(3:4) = p2(3:4)
 
92
      hex(8:9) = p2(5:6)
 
93
      hex(13:14) = p2(7:8)
 
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}
 
98
   else
 
99
      @ colourdef {p2}
 
100
   endif
 
101
   goto runluta                         !continue as for rotation
 
102
!
 
103
ROTA:
 
104
   define/param p2 A ? "Enter colour value - R,G,B or  for all colours:"
 
105
!
 
106
RUNLUTA:
 
107
   default(16:16) = "A"
 
108
   goto modi_lut
 
109
!
 
110
GRAPH:
 
111
   define/param p2 A ? "Enter colour value - R,G,B or  for all colours:"
 
112
   default(16:16) = "B"
 
113
   goto modi_lut
 
114
!
 
115
SQU:                                    !squeeze...
 
116
   default(16:16) = "C"
 
117
   goto modi_lut
 
118
!
 
119
HSI:                                    !HSI modification
 
120
   define/param p2 H ? "Enter colour value - H, S or I:"
 
121
   default(16:16) = "D"
 
122
 
123
MODI_LUT:
 
124
   define/local izz/i/1/2 21,40
 
125
endif
 
126
 
127
define/maxpar 3
 
128
run MID_EXE:LUTMOD
 
129
 
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)}"