#ifndef RQOfflineInternal_H
#define RQOfflineInternal_H

/*
 *	 __cplusplus, __declspec(...), and __stdcall are Microsoft specific.
 */

#ifdef __cplusplus
extern "C" {
#endif

#include "RawScanOffline.h"
#include "RawScanError.h"

typedef struct
{
	NDTS_Boolean *pIsThisSampleNoise ;
	unsigned long sampleNoiseSize  ;
	RawScan_ReturnCode offlineErrorCode ;
} RawScanOffline_State ;

RawScanOffline_State *pOfflineState ;


NDTS_Boolean RawScanOffline_Initialise() ;
NDTS_Boolean RawScanOffline_Uninitialise() ;
void RawScanOffline_BuildNoiseArray(NDTS_RawScan *pRawScan, unsigned long channelIndex, unsigned long gateIndex) ;
short RawScan_ExtractGateAmplitudeValue(NDTS_RawScan *pRawScan,  unsigned long bscan, unsigned long channelIndex, unsigned long gateIndex);
short RawScan_ExtractGateDepthValue(NDTS_RawScan *pRawScan, unsigned long bscan, unsigned long channelIndex, unsigned long gateIndex);
// Not a pure offline extract function.  Downloads the AScan from the card if a better match is found.
// Only extract if the selection is a better match than the existing contents of *pAmplitude / *pDepth
void RawScan_ExtractIsThisSampleNoiseArray(NDTS_RawScan *pRawScan, unsigned long channelIndex, unsigned long gateIndex, NDTS_Boolean* pNoiseArray) ;
NDTS_GateOutput RawScan_ExtractReturnGateValue(NDTS_RawScan *pRawScan, unsigned long bScanIndex, unsigned long aScanIndex, unsigned long gateIndex, unsigned long overSampleIndex) ;
NDTS_Boolean RawScan_ExtractIsGateValueValid(NDTS_RawScan *pRawScan, unsigned long bScanIndex, unsigned long step, unsigned long gateIndex, NDTS_Boolean isMetricAmplitude, unsigned long overSampleIndex);

#ifdef __cplusplus
}
#endif


#endif
