#ifndef RQRAWSCANINTERNAL_H
#define RQRAWSCANINTERNAL_H

#include "RQRawScanProtected.h"

#ifdef __cplusplus
extern "C" {
#endif

	typedef struct
	{
		int				hasTrailer : 1 ; // hasTrailer no longer used because encoder data always in the scan.
	} RQ_DataAHeader ;					// Left it in here because we may need the header for other features in the future

	typedef struct
	{
		int				hasTrailer : 1 ; 
	} RQ_DataBHeader ;

	NDTS_Boolean CALL_CONV RQ_GetRawScanDataAHeader(RQ_RawScan *pRawScan, RQ_DataAHeader **ppHeader) ;
	NDTS_Boolean CALL_CONV RQ_GetRawScanDataBHeader(RQ_RawScan *pRawScan, RQ_DataBHeader **ppHeader) ;

	NDTS_Boolean CALL_CONV RQ_GetRawScanAScanHeader(RQ_RawScan *pRawScan, unsigned long aScanIndex, unsigned long bScanIndex, RQ_MemoryHandle **ppData) ;
	NDTS_Boolean CALL_CONV RQ_GetRawScanAScanBody(RQ_RawScan *pRawScan, unsigned long aScanIndex, unsigned long bScanIndex, RQ_MemoryHandle **ppData) ;

	// This function is equivalent to RQ_GetRawScanAScanHeader(pRawScan, 0, bScanIndex, &pData)
	NDTS_Boolean CALL_CONV RQ_GetRawScanBScanBody(RQ_RawScan *pRawScan, unsigned long bScanIndex, RQ_MemoryHandle **ppData) ;
	NDTS_Boolean CALL_CONV RQ_GetRawScanBScanTrailer(RQ_RawScan *pRawScan, unsigned long bScanIndex, RQ_MemoryHandle **ppData) ;

	NDTS_Boolean CALL_CONV RQ_GetRawScanGateValuesBody(RQ_RawScan *pRawScan, unsigned long bScanIndex, RQ_MemoryHandle **ppData) ;
	NDTS_Boolean CALL_CONV RQ_GetRawScanGateValuesTrailer(RQ_RawScan *pRawScan, unsigned long bScanIndex, RQ_MemoryHandle **ppData) ;

	NDTS_Boolean CALL_CONV RQ_GetRawScanBScanMemoryBlockList(RQ_RawScan *pRawScan, unsigned long bScanIndex, RQ_MemoryHandle **ppData) ;
	NDTS_Boolean CALL_CONV RQ_GetRawScanGateValuesMemoryBlockList(RQ_RawScan *pRawScan, unsigned long bScanIndex, RQ_MemoryHandle **ppList) ;


	// Bytes: The size of an a-scan body.
	unsigned long CALL_CONV RQ_ReturnRawScanAScanBodySize(RQ_RawScan *pRawScan, unsigned long aScanIndex) ;
	// Bytes: The size of an a-scan header.
	unsigned long CALL_CONV RQ_ReturnRawScanAScanHeaderSize(RQ_RawScan *pRawScan) ;
	// Bytes: The size of a b-scan trailer.
	unsigned long CALL_CONV RQ_ReturnRawScanBScanTrailerSize(RQ_RawScan *pRawScan) ;
	// Bytes: The size of a b-scan body.
	unsigned long CALL_CONV RQ_ReturnRawScanGateValuesBodySize(RQ_RawScan *pRawScan) ;
	// Bytes: The size of a b-scan trailer.
	unsigned long CALL_CONV RQ_ReturnRawScanGateValuesTrailerSize(RQ_RawScan *pRawScan) ;
	// Bytes: The size of an encoder values block in the raw scan. Is 0 if raw scan does not contain encoder values.
	// Is RQ_NUMBER_OF_ENCODERS * the size of a single encoder value.
	unsigned long CALL_CONV RQ_ReturnRawScanEncoderValuesSize(RQ_RawScan *pRawScan) ;
	// Bytes: The size of a CRC value in the raw scan. Is 0 if raw scan does not contain CRC's.
	unsigned long CALL_CONV RQ_ReturnRawScanCRCSize(RQ_RawScan *pRawScan) ;

	// The number of memory blocks used to store an a-scan.
	unsigned long CALL_CONV RQ_ReturnRawScanAScanMemoryBlockListSize(RQ_RawScan *pRawScan) ;
	// The number of memory blocks used to store a b-scan.
	unsigned long CALL_CONV RQ_ReturnRawScanBScanMemoryBlockListSize(RQ_RawScan *pRawScan) ;
	// The number of memory blocks used to store gate values.
	unsigned long CALL_CONV RQ_ReturnRawScanGateValuesMemoryBlockListSize(RQ_RawScan *pRawScan) ;

	unsigned long CALL_CONV RQ_ReturnBytesPerSample(RQ_SampleSize sampleSize) ;

#ifdef __cplusplus
}
#endif


#endif