aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/ids/testcode/zm.x
blob: dff01cbe223360f976c23352e8901f159ce665a1 (plain) (blame)
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
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include "imd.h"
include <gki.h>
include <gset.h>

define	DIM	512
define	MCXSCALE	64
define	MCYSCALE	64

# zoom

procedure t_im()

pointer	gp
char	output[SZ_FNAME], output_file[SZ_FNAME], device[SZ_FNAME]
int	fd

pointer	gopen()
bool	streq()
int	open()

short	i,data[DIM+1]
short	set_image[6]
int	key
real	x[30],y[30]
int	xjunk, yjunk

begin
	call clgstr("output", output, SZ_FNAME)
	if (!streq (output, "") ) {
	    call strcpy (output, output_file, SZ_FNAME)
	    fd = open (output_file, NEW_FILE, BINARY_FILE)
	} else
	    fd = open ("dev$stdimage", NEW_FILE, BINARY_FILE)

	call clgstr("device", device, SZ_FNAME)
	gp = gopen ( device, NEW_FILE, fd)

	# now zoom after reading button presses
	# read first to clear box
	call gseti(gp, G_CURSOR, IMD_BUT_RD)
	call ggcur(gp, xjunk, yjunk, key)

	for ( i = 1 ; i < 5 ; i = i + 1) {
	    call gseti(gp, G_CURSOR, IMD_BUT_WT)
	    call ggcur(gp, xjunk, yjunk, key)

	    data[11] = IMD_ZOOM
	    data[12] = IMD_WRITE
	    data[13] = 3
	    data[14] = IMD_EOD
	    data[15] = IMD_EOD
	    data[16] = 0
	    data[17] = 4
	    data[18] = (((i-1)* 128)-1) * MCXSCALE
	    data[19] = (((i-1)* 128)-1) * MCYSCALE
	    call gescape ( gp, IMD_CONTROL, data[11], 9)
	}

	# all done
	call gclose ( gp )
	call close ( fd )
end