Specifications

117
Appendix Appendix BB
Calibration and Scaling Algorithms
Typically, SmartSet controllers are setup through software and/or NVRAM to
supply the host with calibrated and scaled touch coordinates, as described in
Chapter 5. If you cannot set up the controller with this procedure, you will receive
raw coordinates from the controller. The host software must then map these
coordinates within the calibration range (defining the position and size of the
screen image) and scaled into screen coordinates, such as 80x25. These operations
can be performed with the formula given below. (For more information on
calibration and scaling, see the tutorial in Chapter 4).
Figure 4-5, page 42, shows the bezel opening and the position of the image within
it. The touchscreen extends beyond the image into the overscan area, which is
inaccessible to a program. The points at the extremes of the image are given two
names, one in raw coordinates (denoted by "R") and one in screen coordinates
(denoted by "S"). Low points may be greater than high points and vice versa -- the
formula works with any orientation. The point of touch to be converted will be at
the "+". It is also given two names: Cx,Cy for the raw coordinates, and X,Y for
the screen coordinates.
The coordinates at the corners of the image are obtained by a calibration program
that you write. See Chapter 5 for an example. This program simply outputs a point
near one corner, lets the user touch it, then repeats the process near the opposite
corner. These points are then extrapolated to the actual corners of the image, to
reduce the effects of non-linearities in the display image. The calibration program
stores the raw coordinates for each corner in a file. The driver or application you
write will later load these points and use them in the conversion formula.