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

« back to all changes in this revision

Viewing changes to prim/proc/lutcrea.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
! @(#)lutcrea.prg       19.1 (ES0-DMD) 02/25/03 14:08:54
 
2
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!
 
4
! MIDAS procedure lutcrea.prg to implement CREATE/LUT
 
5
! K. Banse      901108
 
6
!
 
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
 
14
! or
 
15
! as CREATE/LUT LUT_name CURSOR [start_LUT] [new_LUT]
 
16
!
 
17
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
18
!
 
19
define/param p1 + C "Enter name of new LUT:"
 
20
!
 
21
if p2(1:4) .eq. "CURS" goto cursor_lut
 
22
!
 
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: "
 
27
define/maxpar 5
 
28
!
 
29
write/keyw history "CREATE/LUT "
 
30
!
 
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
 
35
   inputr(10) = 1.0
 
36
else
 
37
   inputr(10) = -1.0
 
38
endif
 
39
!
 
40
action = "HU"
 
41
run MID_EXE:IDFUNC
 
42
return
 
43
!
 
44
CURSOR_LUT:
 
45
if ididev(18) .eq. 11 then
 
46
   write/out CURSOR option not supported for X11 displays...
 
47
   return/exit
 
48
endif
 
49
 
50
define/param p3 + C "Enter LUT used as starting LUT:"
 
51
define/param p4 ? C "Enter LUT used via cursor input:"
 
52
define/maxpar 4
 
53
!
 
54
if m$exist("lutdisp.bdf") .le. 0 -
 
55
   create/image lutdisp 2,512,20 ? POLY 0.,1.
 
56
!
 
57
set/split 1,2
 
58
display/chan 1 1                                !channel 1 with LUTsection 1
 
59
load/image lutdisp 1
 
60
!
 
61
if p3(1:1) .ne. "+" load/lut {p3} 0,256
 
62
display/chan 2 0                                !channel 2 with LUTsection 0
 
63
display/lut
 
64
!
 
65
write/keyw in_a {p1}                            !save new LUT name
 
66
set/cursor 0 PROG
 
67
!
 
68
LOOP:
 
69
load/lut {p4} 1,256
 
70
p1(1:1) = "C"
 
71
default(16:16) = "C"
 
72
run MID_EXE:LUTMOD
 
73
!
 
74
inquire/keyw p4 "Enter new LUT for input or hit RETURN to exit:"
 
75
if aux_mode(7) .ne. 0 goto loop
 
76
!
 
77
!  now we pull out the new LUT
 
78
display/chan 2 0
 
79
get/lut {in_a}