c************
c  Description:	Include for xraster.for
c
c  Author:	
c
c  $Revision: 1.1 $
c  $Modtime:   01 May 1996 16:04:28  $
c  
c************
c
	implicit none
	include 'primitive.inc'
	include 'xprimitive.inc'
	include 'xfacilities.inc'
	include 'msgmask.inc'
c
	STRUCTURE /XRASTERLEVEL/
	  integer*4	cmode 	! complex mode of level
	  integer*4	size	! number of elements in data buffer
	  integer*4	ioff	! offset into frame of first element in buffer
	  integer*4	xpts	! number of data elements in X dimension
	  integer*4	ypts	! number of data elements in Y dimension
	  integer*2	cut 	! type of cut (0=none, 1=X cut, 2=Y cut)
	  integer*2	ctm 	! contour mode
	  UNION
	  MAP
	    integer*4	xcmp 	! X compression factor of non-cut level
	    integer*4	ycmp	! Y compression factor of non-cut level
	  END MAP
	  MAP
	    integer*4	indx	! x index of cross hair position at cut
	    integer*4	indy	! Y index of cross hair position at cut
	  END MAP
	  END UNION
	  real*8	rmin	! min absc value of entire file
	  real*8	rmax	! max absc value of entire file
	END STRUCTURE

	STRUCTURE /XRASTERBS/
	  record /M_PTR/buf
	  integer*4 	size,pad
	  integer*4 	ny,nx
	  integer*4 	xe,ye
	END STRUCTURE

c	Flags for ACCESSORIES routine, annt, bxpts, cross, pcuts
	integer*4 a_a, a_bp, a_c, a_p
	parameter (a_a=1, a_bp=2, a_c=4, a_p=8)

c	Flags for SETTINGS routine, coincides with SETTINGS menu item numbers

	integer*4 t_all, t_auto, t_autol, t_autorr, t_axes, t_cbar 
	integer*4 t_cmp, t_cross, t_ctm, t_ctc, t_ctl, t_fast, t_lpf 
	integer*4 t_mimic, t_msgid, t_pcuts, t_specs, t_xlab, t_ylab 
	integer*4 t_zlab, t_hold

	parameter (t_all	= 1)
	parameter (t_auto	= t_all+1)
	parameter (t_autol	= t_auto+1)
	parameter (t_autorr	= t_autol+1)
	parameter (t_axes	= t_autorr+1)
	parameter (t_cbar	= t_axes+1)
	parameter (t_cmp	= t_cbar+1)
	parameter (t_cross	= t_cmp+1)
	parameter (t_ctm	= t_cross+1)
	parameter (t_ctc	= t_ctm+1)
	parameter (t_ctl	= t_ctc+1)
	parameter (t_fast	= t_ctl+1)
	parameter (t_hold	= t_fast+1)
	parameter (t_lpf	= t_hold+1)
	parameter (t_mimic	= t_lpf+1)
	parameter (t_msgid	= t_mimic+1)
	parameter (t_pcuts	= t_msgid+1)
	parameter (t_specs	= t_pcuts+1)
	parameter (t_xlab	= t_specs+1)
	parameter (t_ylab	= t_xlab+1)
	parameter (t_zlab	= t_ylab+1)

	STRUCTURE /GX/
	  record /M_PTR/	lbuf	! buffer location
	  record /M_PTR/	rbuf	! raw data buffer for /INMEM switch
	  record /M_PTR/	mbuf	! buffer location for x,y and p cuts
	  record /XFACILITIES/  xf	! points, boxes, annotate modes
	  record /HEADER/       HIN	! input file header
	  record /XRASTERBS/   	bs	! keeps track of backing store buffer
	  record /XRASTERLEVEL/ lvl(L_stack)	! data layer structures
	  record /MAPSTRUCT/	xmap,ymap	! P Cuts map structures


	  real*8 retx,rety,retz	! absc coordinates at current mouse location
	  real*8 xmrk,ymrk,zmrk	! absc coordinates of mark for dx,dy readings
	  real*8 aretx,arety,aretz ! display specs actual
	  real*8 dretx,drety,dretz ! display specs deltas
	  real*8 xframe		! double frame length
	  real*8 start		! double first frame to read
	  real*8 end		! double last frame to read
	  real*8 offset		! double offset into 1st frame to start reading
	  real*8 yframe		! double number of frames per screen
	  real*8 xstart		! absc start
	  real*8 xdelta		! absc delta
	  real*8 ystart		! ord start
	  real*8 ydelta		! ord delta
	  real*8 dstart		! data start offset for piped reads
	  real*8 readmax	! inmem's counter of where we've read up to

	  real*4 zmin,zmax	! Z scaling bounds
	  real*4 rmin,rmax	! current Z scaling bounds
	  real*4 dbmin		! log mode min value
	  real*4 dbrange	! range for automin, autofull log scaling

	  integer*4 l,t		! specifies plotting field
	  integer*4 w,h		! specifies plotting field
	  integer*4 indx,indy	! x,y index location of crosshairs at cut

	  integer*4 autol	! number of lines in scaling average
	  integer*4 autom	! scaling mode (see Scale menu: -1=Thr,0=Par...)
	  integer*4 cmode	! current complex mode default
	  integer*4 cmp		! compression method (1=ave,2=max,3=decimation)
	  integer*4 iframe	! integer frame length
	  integer*4 istart	! integer frame start
	  integer*4 lpf		! base level request of raster lines per frame
	  integer*4 ncolors	! number of colors allocated
	  integer*4 nx,ny	! number of elements wide and high
	  integer*4 readlevel	! current level that is performing a reread
	  integer*4 top		! Y pixel location for next data image
	  integer*4 xc,yc	! x and y compression factors
	  integer*4 xe,ye	! x and y expansion factors
	  integer*4 x1,x2	! specifies X frame thinning for FORM_BUF
	  integer*4 ctm		! contour mode
	  integer*4 ctc		! contour color
	  integer*4 ctl		! contour lines
	  integer*2 lpb,lpb_ask	! lines per buffer, (how many frames / grab)

	  logical*1 axes	! TRUE: draw axes for the base level
	  logical*1 cross	! TRUE: draw cross hairs following mouse
	  logical*1 inmem	! TRUE: load entire file into local buffer
	  logical*1 pcut	! TRUE: pixel cuts are currently on
	  logical*1 reading	! TRUE: currently reading from file
	  logical*1 stopread	! TRUE: hit end of file you are reading
	  logical*1 specs	! TRUE: display specs at bottom
	  logical*1 cbar	! TRUE: display colorbar along right edge

	  logical*1 autorr	! TRUE: overlay reread on zooms
	  logical*1 pbar	! TRUE: need the pan bars
	  logical*1 cx		! TRUE: file is complex
	  logical*1 fast	! TRUE: use fast algorithm for LOG computation
	  logical*1 all		! TRUE: compress/expand in Y to fill window
	  logical*1 fill6
	  logical*1 fill7
	  logical*1 fill8

	  integer*4 iabsc	! abscissa mode (0=absc, 1=index, 2=1/absc)
	  integer*4 cmap	! Current colormap in use
	  integer*4 cntrls	! controls mode (neg=disabled) (-2,-1,0,1,2)
	  integer*4 cntrlsx	! controls symbol x location
	  integer*4 mimic	! primitive to mimic
	  integer*4 hold	! hold flag for messages
	  integer*4 xlab,ylab,zlab ! X,Y,Z units override indicators ( if >= 0)
	  integer*4 ixlab,iylab,izlab	! X,Y,Z units actual

	  character*20	xfmt,yfmt,zfmt	! user format for X/Y/Z specs readout
	  character*20	mouse	! results name prefix for X,Y absc crds

	  record /COLORTYPE/ map5

	END STRUCTURE

	record /GX/ Gx
	common /xraster/ Gx

	logical*4 XRASTER_MSG, XRASTER_EVENT, XRASTER_PAN_HANDLE
