	PRO ImgParam, val=inbuf, cadence=cadence, noOfROIs=noOfROIs, $
			compress=compress, imgRes=imgRes
;	-------------------------------------------------------------
;+							12-Aug-91
;	NAME:
;		ImgParam
;	PURPOSE:
;		Decode the ImgParam BYTE field into the four component 
;		values exposure cadence, noOfROIs, compression, and 
;		image resolution.
;	CALLING SEQUENCE:
;		ImgParam, [val=inbuf, cadence=cadence, noOfROIs=noOfROIs, 
;			compress=compress, imgRes=imgRes]
;	INPUT/keyword:
;		inbuf	is the ImgParam byte-type field value.
;	OUTPUT/keyword:
;		cadence		is the decode exposure cadence:
;				(e.g. 0=2sec, 1=1sec, 2=.5sec)
;		noOfROIs        is the decode # of ROIs in the FFI:
;				(e.g. 0=1 ROI, 1=2 ROI, 2=3 ROI, 3=4ROI).
;		compress	is the compression algorithm for the
;				12bit CCD output: 
;				0=compress, 1=Low8, 2=Hi8
;		imgRes		is the image resolution
;				(e.g. 0=1x1, 1=2x2, 2=4x4)
;	History:
;		Written by GAL 31-July-91
;		12-Aug-91, changed formal parameters to keywords
;-		
;	-------------------------------------------------------------
;	ON_ERROR, 2	;force a return to caller on error

	cadence = inbuf AND 192b	;mask out all bits but 6&7
	cadence = ISHFT(cadence, -6)	;get value with 0 to ...range

	noOfROIs= inbuf AND 48b		;mask out all bits but 5&4
	noOfROIs= ISHFT(noOfROIs, -4)

	compress= inbuf AND 12b		;mask out all bits but 3&2
	compress= ISHFT(compress, -2)

	imgRes  = inbuf AND 3b		;mask out all bits but 2&1

	RETURN
	END 
