1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
include "../lib/ids.h"
include "iis.h"
# ZCONTROL -- call the device dependent control routines
procedure zcontrol(device, rw, frame, color, offset, n, data)
short device # which device/register to control
short rw # write/read/wait,read
short frame[ARB] # array of image frames
short color[ARB] # array of color
short offset # generalized offset or datum
short n # count of items in data array
short data[ARB] # data array
begin
switch(device) {
case IDS_FRAME_LUT:
call iislut(rw, frame, color, offset, n, data)
case IDS_GR_MAP:
# for now, nothing
case IDS_INPUT_LUT:
call iisifm(rw, offset, n, data)
case IDS_OUTPUT_LUT:
call iisofm(rw, color, offset, n, data)
case IDS_SPLIT:
call iissplit(rw, n, data)
case IDS_SCROLL:
call iisscroll(rw, frame, n, data)
case IDS_ZOOM:
call iiszoom(rw, frame, n, data)
case IDS_OUT_OFFSET:
call iisoffset(rw, color, n, data)
case IDS_MIN:
call iismin(rw, color, n, data)
case IDS_MAX:
call iismax(rw, color, n, data)
case IDS_RANGE:
call iisrange(rw, color, n, data)
case IDS_HISTOGRAM:
call iishisto(rw, color, offset, n, data)
case IDS_ALU_FCN:
# for now, nothing
case IDS_FEEDBACK:
# for now, nothing
case IDS_SLAVE:
# for now, nothing
case IDS_CURSOR:
call iiscursor(rw, offset, n, data)
case IDS_TBALL:
call iistball(rw, data)
case IDS_DIGITIZER:
# for now, nothing
case IDS_BLINK:
# for now, nothing
case IDS_SNAP:
call zsnap_init(data[1])
case IDS_MATCH:
call iismatch (rw, frame, color, n, data)
}
end
# MAPCOLOR - modify the color array to map rgb for iis
int procedure mapcolor(color)
short color[ARB] # input data
int i
int val, result
int or()
begin
result = 0
for ( i = 1; color[i] != IDS_EOD ; i = i + 1 ) {
val = color[i]
switch (val) {
case IDS_RED:
val = RED
case IDS_GREEN:
val = GREEN
case IDS_BLUE:
val = BLUE
default:
val = 2**(val-1)
}
result = or (result, val)
}
return (result)
end
|