C       This file establishes the declarations and COMMON blocks for
C  use with the subroutines which communicate with SAOimage.
C
C			Donald H. Gudehus, July, 1994
C			Version 2, D. Gudehus, March 21, 2005
C			Dimensioned BUFFER_TEMP as 2 to handle systems with
C			big endian architecture
C			Version 3, D. Gudehus, July 24, 2006
C			Subdivided common block into those of different
C			data type, and added SAO suffixes to the variables
C			Version 4, D. Gudehus, February 3, 2008
C			Increased the length of TV_FILENAME
C
C  The following information is returned by SAOSTART:
C	CHANIN_SAO	The channel for input to the current process
C			from SAOimage (for OpenVMS)
C	CHANOUT_SAO	The channel for output from the current process
C			to SAOimage (for OpenVMS)
C	IFB_SAO		The numerical key for the frame buffer.  This
C			is only determined by SAOSTART if its initial
C			value is zero. If the user sets it to a nonzero
C			value, SAOSTART's operation is overridden.
C	MAXFB_COLS_SAO	The maximum number of columns in the selected
C			frame buffer
C	MAXFB_ROWS_SAO	The muaximum number of rows in the selected
C			frame buffer
C  The following information is returned by SAOLOAD or SAODELS (in MIIPS)
C  and is unique for each of up to 16 images:
C	NPIC_SAO	The number of the most recent picture loaded
C	XLOC_SAO	Starting x location of image measured in the frame
C	YLOC_SAO	Starting y location of image measured in the frame
C	NPTSX_SAO	Number of SAOimage pixels in the x direction in the
C			loaded image
C	NPTSY_SAO	Number of SAOimage pixels in the y direction in the
C			loaded image
C	SCF_SAO		Scale factor for grayscale
C	AMIN_SAO	Lowest intensity
C	AMAX_SAO	Highest intensity
C	IMSX_SAO	Starting column in map
C	IMSY_SAO	Starting row in map
C	MHED_SAO(1,N)	Map number
C	MHED_SAO(2,N)	Plane number
C	TV_FILENAME	The name of the file
C
	PARAMETER (MAXNBYTES_SAO=8192,MAXI2WORDS_SAO=4096)
	BYTE BUFFER_SAO(MAXNBYTES_SAO)
	CHARACTER*8192 CBUFFER_SAO
	INTEGER*2 IBUFFER_SAO(MAXI2WORDS_SAO)
	EQUIVALENCE (BUFFER_SAO,CBUFFER_SAO,IBUFFER_SAO)
	INTEGER*2 MAXFB_COLS_SAO,MAXFB_ROWS_SAO,NPIC_SAO
	INTEGER*2 XLOC_SAO(16),YLOC_SAO(16)
	INTEGER*2 NPTSX_SAO(16),NPTSY_SAO(16)
	COMMON /SAOFACTS_INTEGER2/ IBUFFER_SAO,
	1MAXFB_COLS_SAO,MAXFB_ROWS_SAO,
	2NPIC_SAO,XLOC_SAO,YLOC_SAO,NPTSX_SAO,NPTSY_SAO
C
	INTEGER*4 CHAN_IN_SAO,CHAN_OUT_SAO,IFB_SAO,NFRAME_SAO,
	1IMSX_SAO(0:3,16),IMSY_SAO(0:3,16),MHED_SAO(2,16)
	COMMON /SAOFACTS_INTEGER4/ CHAN_IN_SAO,CHAN_OUT_SAO,IFB_SAO,
	1NFRAME_SAO,IMSX_SAO,IMSY_SAO,MHED_SAO
C
	REAL*4 SCF_SAO(0:3),AMIN_SAO(0:3),AMAX_SAO(0:3)
	COMMON /SAOFACTS_REAL4/ SCF_SAO,AMIN_SAO,AMAX_SAO
C
	CHARACTER*80 TV_FILENAME(16)
	COMMON /CH_TVFACTS/ TV_FILENAME
C
	BYTE HDBUFFER_SAO(16),BUFFER_TEMP_SAO(2)
	INTEGER*2 IHDBUFFER_SAO(8),IBUFFER_TEMP_SAO
	EQUIVALENCE (HDBUFFER_SAO,IHDBUFFER_SAO)
	EQUIVALENCE (BUFFER_TEMP_SAO,IBUFFER_TEMP_SAO)
C
