
//***********************************************************
// 
// DIDAPI.H
// 
// Header file for the Planmeca DIDAPI interface
// 
//***********************************************************


#ifndef _DIDAPI_H_
#define _DIDAPI_H_

#ifndef FALSE
#define FALSE 0
#endif

#ifndef TRUE
#define TRUE 1
#endif

#ifndef DIDAPI_INT32 
typedef int DIDAPI_INT32;
#endif

typedef short DIDAPI_STATUS;


// Device codes
#define DIDAPI_XRAY_PAN                 1 
#define DIDAPI_XRAY_CEPH                2
#define DIDAPI_XRAY_INTRA               3
#define DIDAPI_XRAY_NONE                100


// Scan codes
#define DIDAPI_FM_LEFT                  1
#define DIDAPI_FM_RIGHT                 2
#define DIDAPI_FM_TOP                   3
#define DIDAPI_FM_BOTTOM                4


// File types
#define DIDAPI_RAW                      1
#define DIDAPI_RAW8B                    2
#define DIDAPI_TIFF                     3
#define DIDAPI_TIFF16B                  4

#define DIDAPI_JPEG_8					7
#define DIDAPI_JPEG_12					8

// Operation codes
#define DIDAPI_INQUIRE_PARAM            1 
#define DIDAPI_GET_PARAM                2
#define DIDAPI_SET_PARAM                3
#define DIDAPI_LAST_PARAM               4


#define DIDAPI_MAX_PARAM                30
#define DIDAPI_VALUE_NOT_USED           -32767

// Parameter indexes
#define DIDAPI_PARAM_COUNT					0
#define DIDAPI_PARAM_MODE					1
#define DIDAPI_PARAM_PROG					2
#define DIDAPI_PARAM_MAGNIFICATION			2
#define DIDAPI_PARAM_VOLTAGE				3
#define DIDAPI_PARAM_CURRENT				4
#define DIDAPI_PARAM_TIME					5
#define DIDAPI_PARAM_XPOSITION				6
#define DIDAPI_PARAM_YPOSITION				7
#define DIDAPI_PARAM_ZPOSITION				8
#define DIDAPI_PARAM_PHI_ANGLE				9
#define DIDAPI_PARAM_THETA_ANGLE			10
#define DIDAPI_PARAM_RHO_ANGLE				11
#define DIDAPI_PARAM_COLLIMATOR_NUMBER		12

// Ceph specific indices
#define DIDAPI_PARAM_CEPH_PROGRAM			13
#define DIDAPI_PARAM_CEPH_FLAGS				14 // Bit 0: use soft tissue filter?

// Panoramic specific indices
#define DIDAPI_PARAM_PAN_PROGRAM			13
#define DIDAPI_PARAM_PAN_CHILDMODE			14
#define DIDAPI_PARAM_PAN_JAW_FORM			15
#define DIDAPI_PARAM_PAN_JAW_WIDTH			16
#define DIDAPI_PARAM_PAN_EXP_COUNTER		17
#define DIDAPI_PARAM_PAN_PROGRAM_PARAM		18
#define DIDAPI_PARAM_PAN_TMJ_LEFT_ANGLE		19
#define DIDAPI_PARAM_PAN_TMJ_RIGHT_ANGLE	20
#define DIDAPI_PARAM_PAN_PA_RULER			21

// Intra specific indices
#define DIDAPI_PARAM_INTRA_FLAGS			14
#define DIDAPI_PARAM_SEND_KEY_CMD                       15
#define DIDAPI_PARAM_DIXI_SENSOR_TYPE		22

// Sensor's serial number must be passed in
// two part's, because the number don't fit in a 'short'
#define DIDAPI_PARAM_SENSOR_SERNUM_LOWORD	23
#define DIDAPI_PARAM_SENSOR_SERNUM_HIWORD	24

#define DIDAPI_PARAM_12BIT_CLIP_LEVEL_HIGH_FIXED 25
#define DIDAPI_PARAM_12BIT_CLIP_LEVEL_HIGH_USED  26
#define DIDAPI_PARAM_12BIT_CLIP_LEVEL_LOW_FIXED 27
#define DIDAPI_PARAM_12BIT_CLIP_LEVEL_LOW_USED  28

// Ceph Flags
#define DIDAPI_CEPH_FLAG_SOFTTISSUE_NEEDED		0x01

// Intra Flags
#define DIDAPI_INTRA_FLAG_INTRA_CONNECTED		0x0001 // Planmeca Intra connected, exposure parameters to PC
#define DIDAPI_INTRA_FLAG_kV_AND_EXPTIME_FROM_PC	0x0002 // kV and exp time can be set from PC
#define DIDAPI_INTRA_FLAG_mA_FROM_PC			0x0004 // mA can be set from PC
#define DIDAPI_INTRA_FLAG_KEY_CMD_FROM_PC               0x0008 // Key cmds can be send from PC and leds and modes can be read
#define DIDAPI_INTRA_FLAG_CHILD_MODE			0x0010 // Child Mode
#define DIDAPI_INTRA_FLAG_ADULT_MODE                    0x0020 // Adult Mode
#define DIDAPI_INTRA_FLAG_READY_LED                     0x0040 // Ready led is on (Not real-time updated)
#define DIDAPI_INTRA_FLAG_EXPOSURE_LED                  0x0080 // Exposure led is on (Not real-time updated)
#define DIDAPI_INTRA_FLAG_PRESET_SETTING		0x0F00 // Active preset setting at Intra
                                                               // no preset setting active = 0
                                                               // top left = 1
                                                               // bottom left = 6
                                                               // top right = 7
                                                               // bottom right = 10
#define DIDAPI_INTRA_FLAG_PRESET_MODE			0x3000 // Planmeca Intra preset mode

// Planmeca Intra modes
#define DIDAPI_INTRA_MODE_FILM                          0x0000
#define DIDAPI_INTRA_MODE_DIGI                          0x1000
#define DIDAPI_INTRA_MODE_PHOSPHOR                      0x2000

// Planmeca Intra Key Commands
#define DIDAPI_INTRA_KEY_CMD_PRESET_TOP_LEFT            1
#define DIDAPI_INTRA_KEY_CMD_PRESET_MIDDLE_LEFT         2
#define DIDAPI_INTRA_KEY_CMD_PRESET_BOTTOM_LEFT         3
#define DIDAPI_INTRA_KEY_CMD_PRESET_TOP_RIGHT           4
#define DIDAPI_INTRA_KEY_CMD_PRESET_MIDDLE_RIGHT        5
#define DIDAPI_INTRA_KEY_CMD_PRESET_BOTTOM_RIGHT        6
#define DIDAPI_INTRA_KEY_CMD_MODE_KEY                   7
#define DIDAPI_INTRA_KEY_CMD_SELECT_KEY                 8
#define DIDAPI_INTRA_KEY_CMD_DOWN_ARROW                 9
#define DIDAPI_INTRA_KEY_CMD_UP_ARROW                   10
#define DIDAPI_INTRA_KEY_CMD_SET_FILM_MODE              11
#define DIDAPI_INTRA_KEY_CMD_SET_DIGI_MODE              12
#define DIDAPI_INTRA_KEY_CMD_SET_PHOSPHOR_MODE          13




// Result codes
#define DIDAPI_OK                       1
#define DIDAPI_DEV_NOT_PRESENT          2
#define DIDAPI_NOT_INITIALIZED          3
#define DIDAPI_OS_ERROR                 4
#define DIDAPI_GRAB_TIMEOUT             5
#define DIDAPI_TRANSFER_ERROR           6
#define DIDAPI_GRAB_NOT_READY           7
#define DIDAPI_GRAB_BUSY                8
#define DIDAPI_GRAB_DONE                9
#define DIDAPI_BAD_PARAM_INDEX          10
#define DIDAPI_BAD_PARAM_VALUE          100
#define DIDAPI_BAD_PARAM_OPERATION      12
#define DIDAPI_ROI_OUT_OF_BOUNDS        13
#define DIDAPI_DEV_NOT_CALIBRATED       14
#define DIDAPI_CALIB_FAILURE            15
#define DIDAPI_FILE_NOT_OPENED          16
#define DIDAPI_FILE_WRITE_FAILURE       17
#define DIDAPI_HW_NOT_PRESENT           18
#define DIDAPI_BAD_MODE                 19
#define DIDAPI_BAD_PROG                 20

#define DIDAPI_IMAGE_UNFINISHED         21 // EJL 08.08.1997
#define DIDAPI_OUT_OF_MEMORY            22
#define DIDAPI_MISSING_TEMP_DIR			23 // HJK 07.03.2002
#define DIDAPI_NO_IMAGE_DATA			24 // HJK 01.04.2003
#define DIDAPI_WARNING_OLD_CAL_FILE		25 // TH 24.03.2004
#define DIDAPI_INCORRECT_PASSWORD		26 // for ethernet devices
#define DIDAPI_PAN_SENSOR_NOT_CONNECTED            27
#define DIDAPI_CEPH_SENSOR_NOT_CONNECTED           28
#define DIDAPI_XRAY_BUSY                           29
#define DIDAPI_PC_COMM_DISABLED_IN_XRAY            30
#define DIDAPI_UNABLE_TO_RESOLVE_HOST_NAME         31
#define DIDAPI_UNABLE_TO_MAKE_TCP_CONNECTION       32
#define DIDAPI_CONNECTION_TO_SENSOR_IS_BAD     33

#define DIDAPI_BUFFER_TOO_SMALL_PARAMS			34 
#define DIDAPI_BUFFER_TOO_SMALL_STRINGDATA		35
#define DIDAPI_VALUE_NOT_AVAILABLE				36
#define DIDAPI_CANNOT_SET_PARAMETER				37 
#define DIDAPI_DEVICE_NOT_SELECTED				38
#define DIDAPI_INVALID_PARAMETER_VALUE			39
#define DIDAPI_X_RAY_NOT_WORKING_PROPERLY		40
#define DIDAPI_REMOVE_3D_SENSOR					41
#define DIDAPI_TOO_OLD_DEVICE_SW				42

// Device specific modes
#define DIDAPI_PAN_MODE_NORMAL_RESOLUTION 4
#define DIDAPI_PAN_MODE_MEDIUM_RESOLUTION 3
#define DIDAPI_PAN_MODE_HIGH_RESOLUTION   2

#define DIDAPI_PAN_JAW_WIDTH_NORMAL 0
#define DIDAPI_PAN_JAW_WIDTH_LARGE  1
#define DIDAPI_PAN_JAW_WIDTH_NARROW 2

#define DIDAPI_PAN_JAW_FORM_NORMAL     0
#define DIDAPI_PAN_JAW_FORM_SQUARE     1
#define DIDAPI_PAN_JAW_FORM_PROTRUSIVE 2

#define DIDAPI_TOMO_JAW_BOTH	2
#define DIDAPI_TOMO_JAW_UPPER	1
#define DIDAPI_TOMO_JAW_LOWER	0

#define DIDAPI_TOMO_JAW_SIDE_LEFT	0
#define DIDAPI_TOMO_JAW_SIDE_RIGHT	1

#define DIDAPI_TOMO_IMAGE_SIZE_STD	0
#define DIDAPI_TOMO_IMAGE_SIZE_FULL	1

#define DIDAPI_ORIENTATION_UNKNOWN			 0 
#define DIDAPI_ORIENTATION_LEFT				 1
#define DIDAPI_ORIENTATION_LEFT_ANTERIOR	 2
#define DIDAPI_ORIENTATION_LEFT_POSTERIOR	 3
#define DIDAPI_ORIENTATION_ANTERIOR_LEFT	 4
#define DIDAPI_ORIENTATION_POSTERIOR_LEFT	 5
#define DIDAPI_ORIENTATION_POSTERIOR		 6
#define DIDAPI_ORIENTATION_ANTERIOR			 7

#define DIDAPI_CEPH_LATERAL					1
#define DIDAPI_CEPH_PA_OR_AP				2

#define DIDAPI_INTRA_MODE_NORMAL_RESOLUTION 2
#define DIDAPI_INTRA_MODE_HIGH_RESOLUTION   1

// Pixel depths
#define DIDAPI_DEPTH_BYTE 8
#define DIDAPI_DEPTH_WORD 16



#define DIDAPI_VALUE_TYPE_DOUBLE		 0
#define DIDAPI_VALUE_TYPE_UNICODE_STRING 1
#define DIDAPI_VALUE_TYPE_NOT_DEFINED	 2
// Parameter Tags
#define DIDAPI_PTAG_ALL_PARAMETERS		0

// Parameters X-Ray general
#define DIDAPI_PTAG_KV						100 // double
#define DIDAPI_PTAG_MA						101 // double
#define DIDAPI_PTAG_EXPTIME					102 // double

#define DIDAPI_PTAG_MAGNIFICATION			106 // double
#define DIDAPI_PTAG_DAP						107	// double
#define DIDAPI_PTAG_BINNING					108	// double
#define DIDAPI_PTAG_X_RAY_DEVICE_ID			109 // double
#define DIDAPI_PTAG_X_RAY_DEVICE_NAME		110 // UNICODE string
#define DIDAPI_PTAG_X_RAY_DEVICE_SW_VERSION	111 // UNICODE string
#define DIDAPI_PTAG_ORIENTATION				112 // double


// Parameters Intra Specific
#define DIDAPI_PTAG_SENSOR_TYPE				200 // UNICODE string
#define DIDAPI_PTAG_PM_INTRA_CONNECTED		201 // double 
#define DIDAPI_PTAG_INTRA_ACCEPTS_KV_AND_S	202 // double
#define DIDAPI_PTAG_INTRA_ACCEPTS_MA		203 // double
#define DIDAPI_PTAG_INTRA_ACCEPTS_KEYCMD	204 // double
#define DIDAPI_PTAG_INTRA_ADULT_MODE		205 // double
#define DIDAPI_PTAG_INTRA_CHILD_MODE		206 // double
#define DIDAPI_PTAG_INTRA_READY_LED			207 // double
#define DIDAPI_PTAG_INTRA_EXPOSURE_LED		208 // double
#define DIDAPI_PTAG_INTRA_PRESET_SETTING	209 // double
#define DIDAPI_PTAG_INTRA_MODE				210 // double
#define DIDAPI_PTAG_INTRA_KEYCMD			211 // double PC -> Intra
#define DIDAPI_PTAG_INTRA_IMAGE_FMH_FILTERED 212 
#define DIDAPI_PTAG_INTRA_CONE_INDEX		213 

// Parameters Ceph Specific
#define DIDAPI_PTAG_CEPH_PROG				300 // double
#define DIDAPI_PTAG_CEPH_SIZE_X				301 // double
#define DIDAPI_PTAG_CEPH_SIZE_Y				302 // double
#define DIDAPI_PTAG_CEPH_STF_NEEDED			303 // double
#define DIDAPI_PTAG_CEPH_ORIENTATION		304 // double

// Parameters Patient
#define DIDAPI_PTAG_PATIENT_NAME			400 // UNICODE string
#define DIDAPI_PTAG_X_RAY_ROOM_NAME			401 // UNICODE string
#define DIDAPI_PTAG_OFFICE_NAME				402 // UNICODE string
#define DIDAPI_PTAG_OPERATORS_NAME			403 // UNICODE string
#define DIDAPI_PTAG_DOCTORS_NAME			404 // UNICODE string
#define DIDAPI_PTAG_SCHEDULED_DATE			405 // UNICODE string
#define DIDAPI_PTAG_SCHEDULED_TIME			406 // UNICODE string
#define DIDAPI_PTAG_SCHEDULED_PROG			407 // double

// DIDAPI General
#define DIDAPI_PTAG_SENSOR_SERIALNUMBER		500 // UNICODE string
#define DIDAPI_PTAG_GAMMA_USED				501 // double gamma value 1.0 = no gamma
#define DIDAPI_PTAG_CLIP_HIGH_LEVEL			502 // double
#define DIDAPI_PTAG_CLIP_LOW_LEVEL			503 // double
#define DIDAPI_PTAG_HIGHEST_VALUE			504 // double
#define DIDAPI_PTAG_LOG_USED				505 // double on/off 1=on
#define DIDAPI_PTAG_S_CURVE_AFTER_LOG		506 // double on/off 1=on
#define DIDAPI_PTAG_LUT_SHIFT				507 // double 0-4095
#define DIDAPI_PTAG_EQN						508 // double 0-1000
#define DIDAPI_PTAG_SENSITIVITY				509 // double count / uGy
#define DIDAPI_PTAG_D						510 // double Dose
#define DIDAPI_PTAG_DICE_USED				511 // double on/off 1=on

//#define DIDAPI_PTAG_DEVICE_IP_ADDRESS		505
//#define DIDAPI_PTAG_DEVICE_IP_PORT			506
//#define DIDAPI_PTAG_DEVICE_HW_PORT			507 // For the Ethernet Box
//#define DIDAPI_PTAG_DEVICE_PASSWORD			508


// Parameters panoramic general
#define DIDAPI_PTAG_PROGRAM					1000 // double
#define DIDAPI_PTAG_PROG_MAIN_NAME			1001 // UNICODE String
#define DIDAPI_PTAG_PROG_SUB_NAME			1002 // UNICODE String
#define DIDAPI_PTAG_NUMBER_OF_FRAMES		1003 // double
#define DIDAPI_PTAG_JAW_SHAPE				1004 // double
#define DIDAPI_PTAG_JAW_SIZE				1005 // double
#define DIDAPI_PTAG_CHILD_MODE				1006 // double
#define DIDAPI_PTAG_SEGMENTATION_MASK_X		1007 // double
#define DIDAPI_PTAG_SEGMENTATION_MASK_Y		1008 // double
#define DIDAPI_PTAG_TOMO_TYPE				1009 // double
#define DIDAPI_PTAG_LAYER_POSITION			1010 // double
#define DIDAPI_PTAG_KV_BEFORE_AEC			1011 // double This may be used with future version of ProMax

#define DIDAPI_PTAG_MA_BEFORE_AEC			1013 // double This may be used with future version of ProMax

#define DIDAPI_PTAG_PA_RULER				1015 // double Proline program 30
#define DIDAPI_PTAG_TMJ_LEFT_ANGLE			1016 // double
#define DIDAPI_PTAG_TMJ_RIGHT_ANGLE			1017 // double

// Parameters panoramic 1st slice
#define DIDAPI_PTAG_F1_KV					1100 // double
#define DIDAPI_PTAG_F1_MA					1101 // double
#define DIDAPI_PTAG_F1_EXPTIME				1102 // double
#define DIDAPI_PTAG_F1_X					1103 // double
#define DIDAPI_PTAG_F1_Y					1104 // double
#define DIDAPI_PTAG_F1_Z					1105 // double
#define DIDAPI_PTAG_F1_LAYER_THICKNESS		1106 // double
#define DIDAPI_PTAG_F1_TMJ_LEFT_ANGLE		1107 // double
#define DIDAPI_PTAG_F1_TMJ_RIGHT_ANGLE		1108 // double
#define DIDAPI_PTAG_F1_TMJ_LEFT_POS			1109 // double
#define DIDAPI_PTAG_F1_TMJ_RIGHT_POS		1110 // double
#define DIDAPI_PTAG_F1_JAW_SHAPE			1111 // double
#define DIDAPI_PTAG_F1_JAW_SIZE				1112 // double
#define DIDAPI_PTAG_F1_CHILD_MODE			1113 // double
#define DIDAPI_PTAG_F1_TARGET				1114 // double
#define DIDAPI_PTAG_F1_JAW					1115 // double upper, lower
#define DIDAPI_PTAG_F1_SIDE					1116 // double left, right
#define DIDAPI_PTAG_F1_DISTANCE				1117 // double
#define DIDAPI_PTAG_F1_TOMO_ANGLE			1118 // double
#define DIDAPI_PTAG_F1_TOMO_SIZE			1119 // double std/full


// Parameters panoramic 2nd slice
#define DIDAPI_PTAG_F2_KV					1200 // double
#define DIDAPI_PTAG_F2_MA					1201 // double
#define DIDAPI_PTAG_F2_EXPTIME				1202 // double
#define DIDAPI_PTAG_F2_X					1203 // double
#define DIDAPI_PTAG_F2_Y					1204 // double
#define DIDAPI_PTAG_F2_Z					1205 // double
#define DIDAPI_PTAG_F2_LAYER_THICKNESS		1206 // double
#define DIDAPI_PTAG_F2_TMJ_LEFT_ANGLE		1207 // double
#define DIDAPI_PTAG_F2_TMJ_RIGHT_ANGLE		1208 // double
#define DIDAPI_PTAG_F2_TMJ_LEFT_POS			1209 // double
#define DIDAPI_PTAG_F2_TMJ_RIGHT_POS		1210 // double
#define DIDAPI_PTAG_F2_JAW_SHAPE			1211 // double
#define DIDAPI_PTAG_F2_JAW_SIZE				1212 // double
#define DIDAPI_PTAG_F2_CHILD_MODE			1213 // double
#define DIDAPI_PTAG_F2_TARGET				1214 // double
#define DIDAPI_PTAG_F2_JAW					1215 // double upper, lower or both
#define DIDAPI_PTAG_F2_SIDE					1216 // double
#define DIDAPI_PTAG_F2_DISTANCE				1217 // double
#define DIDAPI_PTAG_F2_TOMO_ANGLE			1218 // double
#define DIDAPI_PTAG_F2_TOMO_SIZE			1219 // double std/full


// Parameters panoramic 3rd slice
#define DIDAPI_PTAG_F3_KV					1300 // double
#define DIDAPI_PTAG_F3_MA					1301 // double
#define DIDAPI_PTAG_F3_EXPTIME				1302 // double
#define DIDAPI_PTAG_F3_X					1303 // double
#define DIDAPI_PTAG_F3_Y					1304 // double
#define DIDAPI_PTAG_F3_Z					1305 // double
#define DIDAPI_PTAG_F3_LAYER_THICKNESS		1306 // double
#define DIDAPI_PTAG_F3_TMJ_LEFT_ANGLE		1307 // double
#define DIDAPI_PTAG_F3_TMJ_RIGHT_ANGLE		1308 // double
#define DIDAPI_PTAG_F3_TMJ_LEFT_POS			1309 // double
#define DIDAPI_PTAG_F3_TMJ_RIGHT_POS		1310 // double
#define DIDAPI_PTAG_F3_JAW_SHAPE			1311 // double
#define DIDAPI_PTAG_F3_JAW_SIZE				1312 // double
#define DIDAPI_PTAG_F3_CHILD_MODE			1313 // double
#define DIDAPI_PTAG_F3_TARGET				1314 // double
#define DIDAPI_PTAG_F3_JAW					1315 // double upper, lower or both
#define DIDAPI_PTAG_F3_SIDE					1316 // double
#define DIDAPI_PTAG_F3_DISTANCE				1317 // double
#define DIDAPI_PTAG_F3_TOMO_ANGLE			1318 // double
#define DIDAPI_PTAG_F3_TOMO_SIZE			1319 // double std/full


// Parameters panoramic 4th slice
#define DIDAPI_PTAG_F4_KV					1400 // double
#define DIDAPI_PTAG_F4_MA					1401 // double
#define DIDAPI_PTAG_F4_EXPTIME				1402 // double
#define DIDAPI_PTAG_F4_X					1403 // double
#define DIDAPI_PTAG_F4_Y					1404 // double
#define DIDAPI_PTAG_F4_Z					1405 // double
#define DIDAPI_PTAG_F4_LAYER_THICKNESS		1406 // double
#define DIDAPI_PTAG_F4_TMJ_LEFT_ANGLE		1407 // double
#define DIDAPI_PTAG_F4_TMJ_RIGHT_ANGLE		1408 // double
#define DIDAPI_PTAG_F4_TMJ_LEFT_POS			1409 // double
#define DIDAPI_PTAG_F4_TMJ_RIGHT_POS		1410 // double
#define DIDAPI_PTAG_F4_JAW_SHAPE			1411 // double
#define DIDAPI_PTAG_F4_JAW_SIZE				1412 // double
#define DIDAPI_PTAG_F4_CHILD_MODE			1413 // double
#define DIDAPI_PTAG_F4_TARGET				1414 // double
#define DIDAPI_PTAG_F4_JAW					1415 // double upper, lower or both
#define DIDAPI_PTAG_F4_SIDE					1416 // double
#define DIDAPI_PTAG_F4_DISTANCE				1417 // double
#define DIDAPI_PTAG_F4_TOMO_ANGLE			1418 // double
#define DIDAPI_PTAG_F4_TOMO_SIZE			1419 // double std/full

// Codes 1500-1999 reserved for 5th,6th,7th,8th and 9th slices

// Set JPEG quality before calling DIDAPI_save_image
// Default quality is 100.
#define DIDAPI_PTAG_JPEG_QUALITY			2000 // double 

// Intra oral sensors
#define DIDAPI_DEVICE_DIXI1_ISA				1
#define DIDAPI_DEVICE_DIXI1_PCI				2
#define DIDAPI_DEVICE_DIXI2_PCI				3
#define DIDAPI_DEVICE_DIXI2_USB				4
#define DIDAPI_DEVICE_DIXI2_ETHERNET		5

// Panoramic devices
#define DIDAPI_DEVICE_PROLINE_DIMAX1		10
#define DIDAPI_DEVICE_PROLINE_DIMAX2_PCI	11
#define DIDAPI_DEVICE_PROLINE_DIMAX2_ETH	12
#define DIDAPI_DEVICE_PROMAX_DIMAX2_PCI1	13 // ProMax Sw. versions to 1.16.x
#define DIDAPI_DEVICE_PROMAX_DIMAX2_PCI2	14 // ProMax Sw. versions from 1.17.x
#define DIDAPI_DEVICE_PROMAX_DIMAX2_ETH		15
#define DIDAPI_DEVICE_PROONE				16

#define DIDAPI_TOMO_TYPE_NARROW_BEAM		0
#define DIDAPI_TOMO_TYPE_TRANSTOMO			1

#define DIDAPI_INTRA_SHORT_CONE_SSD_20CM		0
#define DIDAPI_INTRA_LONG_ROUND_CONE_SSD_30CM	1
#define DIDAPI_INTRA_RECTANGULAR_B0_SSD_31_2CM	2
#define DIDAPI_INTRA_RECTANGULAR_B1_SSD_31_2CM	3
#define DIDAPI_INTRA_RECTANGULAR_B2_SSD_31_2CM	4
#define DIDAPI_INTRA_RECTANGULAR_CONE_SSD_35CM	5


#ifdef __cplusplus
extern "C" {
#endif

extern short DIDAPI_initialize (
	short* versnr
	);


extern short DIDAPI_inquire_devices (
	short devIndex,
	char* typeID,
	short* devType,
	short* HWrevision,
	short* SWrevision,
	short* maxMode,
	short* maxProg
	);


extern short DIDAPI_select_device (
	short devIndex
	);


extern short DIDAPI_inquire_image (
	short mode,
	short prog,
	short enableCalibration,
	short* imageWidth,
	short* imageHeight,
	short* pixelSizeH,
	short* pixelSizeV,
	short* pixelDepth,
	short* scanDir
	);


extern short DIDAPI_init_grabbing (
	short enableCalibration
	);
				    

extern short DIDAPI_finish_grabbing (
	);


extern short DIDAPI_get_device_status (
	short* scanLen
	);


extern short DIDAPI_save_image (
	char* filename,
	short* OSerror,
	short format
	);


extern short DIDAPI_get_image (
	unsigned char *buffer,
	short depth,
	short skipFactor,
	short x,
	short y,
	short w,
	short h
	);


extern short DIDAPI_get_set_params ( // Deprecated
	short operation,
	short* paramData
	);

extern short DIDAPI_get_Dparam (
	DIDAPI_INT32 tag,
	double *value); // Returned double value

extern short DIDAPI_get_Sparam (
	DIDAPI_INT32 tag,
	wchar_t *buffer,	// Caller allocated buffer for returned parameter
	DIDAPI_INT32 length);    // The length of caller allocated buffer

extern DIDAPI_INT32 DIDAPI_get_param_type (DIDAPI_INT32 tag); // Gets the type of parameter double or Unicode String

extern short DIDAPI_set_Dparam ( // Sets a parameter of double type
	DIDAPI_INT32 tag, 
	double value); // Value to be set

extern short DIDAPI_set_Sparam ( // Sets a parameter of Unicode String type
	DIDAPI_INT32 tag, 
	wchar_t *value, 
	DIDAPI_INT32 length);

extern DIDAPI_INT32 DIDAPI_get_max_param ();

extern short DIDAPI_get_ready_request (
	short *flag
	);


extern short DIDAPI_patient_selected (
	short flag
	);


extern void DIDAPI_exit (
	);





#ifdef __cplusplus
} ;
#endif

#endif // _DIDAPI_H_
