aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/gki/gkipca.x
blob: b2cf30abe28a22c8e34a0cd34ea45a88b1d1cb58 (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
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<config.h>
include	<gki.h>

# GKI_PUTCELLARRAY -- Output a cell array (pixel array).
#
# BOI GKI_PUTCELLARRAY L LL UR NC NL P
#    
#        L(i)            9 + (NC * NL)
#        LL(p)           coordinates of lower left corner of output area
#        UR(p)           coordinates of upper right corner of output area
#        NC(i)           number of columns in array
#        NL(i)           number of lines in array
#        P(NCNLi)        array of color indices (pixels) stored by row

procedure gki_putcellarray (fd, m, nx, ny, x1,y1, x2,y2)

int	fd			# output file
int	nx, ny			# number of columns and lines in M
short	m[nx,ny]		# pixel array
int	x1, y1			# lower left corner of window to be written
int	x2, y2			# upper right corner of window to be written

int	epa
short	gki[GKI_PUTCELLARRAY_LEN]
data	gki[1] /BOI/, gki[2] /GKI_PUTCELLARRAY/
include	"gki.com"

begin
	if (IS_INLINE(fd)) {
	    epa = gk_dd[GKI_PUTCELLARRAY]
	    if (epa != 0)
		call zcall7 (epa, m, nx,ny, x1,y1, x2,y2)
	} else {
	    gki[GKI_PUTCELLARRAY_L]    = GKI_PUTCELLARRAY_LEN + (nx * ny)
	    gki[GKI_PUTCELLARRAY_LL]   = x1
	    gki[GKI_PUTCELLARRAY_LL+1] = y1
	    gki[GKI_PUTCELLARRAY_UR]   = x2
	    gki[GKI_PUTCELLARRAY_UR+1] = y2
	    gki[GKI_PUTCELLARRAY_NC]   = nx
	    gki[GKI_PUTCELLARRAY_NL]   = ny

	    call write (gk_fd[fd], gki, GKI_PUTCELLARRAY_LEN)
	    call write (gk_fd[fd], m, (nx * ny) * SZ_SHORT)
	}
end