KCMS Calibrator Tool Loadable Interface Guide

Chapter 4 Measuring Monitor Response

In This Chapter

This chapter touches on the rationale Calibrator Tool uses to set up the structures for measuring data. In addition the chapter identifies precautions you can take in the design of your loadable module to be sure that it provides Calibrator Tool with accurate and meaningful measurement data.

Determining Displayable Visuals

When measuring monitor response, Calibrator Tool has to determine what X Window System visuals the frame buffer is capable of displaying. This is important because some frame buffers have their own gamma correction tables while others output directly to the monitor. Typically, however, frame buffers do not provide gamma correction, and gamma values are approximately 2.22 for SPARC systems. To identify the display capabilities of different visuals, Calibrator Tool calls the standard X Window System library routine XGetVisualInfo(3) and the Solaris library routine XSolarisGetVisualGamma (3). This combination of routines returns a list of all the visual structures and their gamma values. (For details on XGetVisualInfo(), see the Xlib Reference Manual listed in "Related Books" in the Preface to this guide. For details on XSolarisGetVisualGamma (3), see the man page description.)

Visuals Not Measured

Currently Calibrator Tool does not measure GrayScale or StaticGray visuals, because they are not color visuals.

Furthermore, it does not measure StaticColor visuals (24-bit TrueColor being the exception). This is because the loadable module has to display an exact color on the screen when it is measuring a color. To accomplish this, the loadable module must be able to access the writable color cell to modify the color at will. The loadable module has no direct control over the RGB values for StaticColor visuals, so it does not measure them.

Slow and Fast Mode Measurements

Calibrator Tool provides two modes of measurement: slow and fast. In fast mode, the Calibrator Tool main program requests the loadable module to return the minimum number of measurements to increase the speed of acquiring the measurement data. In slow mode, it requests that the loadable module return measurements for all the visuals whose color it has writable control over. These distinct modes provide support for frame buffers that might have different color responses at different depths.

In slow mode, visuals are considered to be equivalent if they have the same gamma and depth. In this case, measurements are required for one representative of a class of equivalent visuals. If, for example, 24-bit DirectColor and 24-bit TrueColor have the same visual gamma, they are considered to be equivalent, and measurement is performed for TrueColor only. Since measurement is a response of the monitor to a particular depth and gamma, the measurement is not repeated for DirectColor. Instead, the DirectColor visual profile is updated with the TrueColor measurement results.

In fast mode, visuals are considered to be equivalent if they have the same gamma, regardless of depth. This mode is provided for monitors whose response is believed to be the same for varying numbers of planes. If, for example, 8-bit PseudoColor and 24-bit TrueColor have the same gamma, the PseudoColor measurement is the only one performed, with the result being used to update the TrueColor as well as the PseudoColor profiles. In this case, it doesn't matter which visual generates the color patches as long as the visuals represent the same color.

Precautions While Taking Measurements

The sample modules display a color patch that changes between cyan, magenta, and yellow as the end user takes measurements. When taking measurements from the monitor display using a hardware puck, it is important to ensure that the window displaying the patch is not obscured inadvertently by some other window tool. The sample modules prevent interference by using Motif's override shells, which are always on top of every other window. If by chance another window is moved into the color patch display region, that window passes under the override shell window and does not disturb the color patch display.

Recommended Number of Measurements

Although there is no specified number of measurements for visuals, it is recommended that the number be large enough for the KCMS API library to perform a reasonable interpolation of data for each color channel. The XSolarisVisualGamma() (or colorsense()) module determines the number of intensity levels based on the bits_per_rgb value of the visual (that is, 2 bits_per_rgb). Then it measures every fourth intensity level to speed up measurement. If, for example, it is measuring a 6-bit frame buffer with 64 intensity levels, it performs 17 measurements. For an 8-bit frame buffer, it performs 65 measurements (including intensity 0). For intensity levels that are less than 8 bits_per_rgb, you must skip fewer intensity levels to achieve a more accurate resulting response curve.

Allocating and Deallocating Structures For Measurement Data

Calibrator Tool handles allocation and deallocation of KCMSCVisuals and KCMSCData structures. Once the loadable module completes the shared data structure KCMSCData (by filling in the output portion of the KcsCalibrationData structure for each of the measured X visuals) it returns, leaving the data in the shared structure.

Handling the Measurement Data

Calibrator Tool uses the data provided by the loadable module to update the X Window System profiles using calls from the KCMS API library.