typedef struct joycalibrate_tag {
UINT wXbase; // x-axis base calibration value.
UINT wXdelta; // x-axis delta calibration value.
UINT wYbase; // y-axis base calibration value.
UINT wYdelta; // y-axis delta calibration value.
UINT wZbase; // z-axis base calibration value.
UINT wZdelta; // z-axis delta calibration value.
} JOYCALIBRATE;
Calibration values for the three axes of an absolute position device. Use the base and delta values returned in this structure to convert values retrieved from the device to values within the logical range specified by the driver.
The logical value returned for any axis is expressed by the following formula:
LogicalValue = Delta * DeviceValue + Base
The following formula is used to calculate delta values:
Delta = (LogicalMax - LogicalMin) / (DeviceMax - DeviceMin)
LogicalMax and LogicalMin represent the maximum and minimum logical coordinate values that the driver supports for the axis, as defined by the JOYCAPS structure. DeviceMax and DeviceMin represent the actual values returned by the device.
The following formula is used to calculate the base values:
Base = DeviceMin * Delta - LogicalMin
DeviceMin represents the minimum value returned by the device, Delta represents the multiplier of the device value, and LogicalMin represents the minimum value returned by the driver as defined by the JOYCAPS structure.
JDD_SETCALIBRATION, JOYCAPS