KCMS Calibrator Tool Loadable Interface Guide

Chapter 1 Overview

In This Chapter

This guide describes how to create a dynamically loadable module that interfaces with Kodak Color Management System (KCMS) Calibrator Tool to calibrate color devices.

This chapter provides an overview of calibration. The chapter

Color Calibration

KCMS color calibration uses software to adjust the output of a color device for accurate color reproduction. Currently KCMS Calibrator Tool supports calibrating color monitor devices only. Monitor calibration is accomplished by displaying a programmed sequence of test colors and measuring the output of the display. The KCMS library then computes color correction factors necessary to compensate for discrepancies between the programmed colors and those actually displayed, and it updates profiles with the resulting data.

About KCMS Calibrator Tool

Purpose of Calibrator Tool

KCMS Calibrator Tool is an interactive program designed to allow users to calibrate their own monitors to later display color-corrected data. The Calibrator Tool program is executed by the kcms_calibrate(1) command. (For details on kcms_calibrate(1), see the man page description.)

KCMS Calibrator Tool obtains color measurements from the measurement gathering device handler. It uses the data it collects to update the monitor's profile. A profile describes a device, including its type, chromaticities, and generic color response values.

KCMS software uses profiles to achieve the device-independent display of color data. The values KCMS Calibrator Tool writes to profiles represent the color response of the specific monitor from which the measurements were taken. The result is data whose color values are adjusted for that monitor to provide accurate color that is more consistent across different device types and under different viewing conditions.

(For details on the C-function interface between Calibrator Tool, the KCMS color management library, and the profiles, see the KCMS Application Developer's Guide.)

When one of the updated profiles is later used to display an image on the monitor, updated color data are used in place of the monitor profile generic data. The new profile more accurately represents the color image viewing conditions, monitor settings, and the state of the monitor (such as brightness and contrast). As such, the image rendered is a significant improvement over the one created by the generic profile.

This color correction process is similar to gamma correction. It can be more accurate, however, because it represents color correction at a finer level of detail than a single gamma value.

Colorimeter Software

You provide the device handling software for your colorimeter to measure the color monitor response. Using software functions, Calibrator Tool loads your module dynamically as a shared library. This guide refers to the user-written colorimeter device handler sample software as the loadable module to distinguish it from the KCMS Calibrator Tool (main program) with which it interacts.

Platforms and Support

KCMS Calibrator Tool currently calibrates color monitors only and is supported on workstations running the Solaris environment. The tool requires a color frame buffer and a color monitor. The code for one of the two sample loadable modules provided describes an interface to a colorimeter.

The ability to add loadable modules to Calibrator Tool is part of the KCMS portion of the Solaris SDK.

Features

Calibrator Tool provides the following features:

Note that, although Calibrator Tool and the sample loadable modules provided with the KCMS portion of the SDK implement their GUI using Motif library routines, this is not a requirement for your loadable module. It can use alternate GUIs.

Installation

The kcms_calibrate(1) command is installed in the /usr/openwin/bin directory and the manual page, in the /usr/openwin/man/man1 directory.

How Calibrator Tool Works With A Loadable Module

Software Components

There are two main software components to calibration: Calibrator Tool (main program) and one or more OEM-written loadable modules. Calibrator Tool is started with the kcms_calibrate(1) command. Then it works together with loadable modules to obtain color data and to update color profiles.

Calibrator Tool Responsibilities

Calibrator Tool obtains measurements to update a monitor's color profile. It obtains the data it needs from the loadable software module.

Calibrator Tool obtains the measurement data through two data structures that it passes to the loadable module. It allocates and deallocates the memory for the structures and sets up their formats based on the number and types of X11 visuals that the X Window System supports. Using standard X11 routines, it determines which X visuals are supported on the system. Then it creates a profile copy for each visual. Finally it hands off this information formally packaged in the data structures to the loadable module.

Once it retrieves the measurement data from the loadable module, Calibrator Tool updates the X visual profile copies on the local machine.

Loadable Module Responsibilities

The loadable module doesn't need to know anything about the color profiles or where they are stored. It simply performs the required measurements and fills out the data structures passed in by Calibrator Tool. Then it returns the information to the main program.

This is a simplification, of course. The module uses some mechanism for obtaining the calibration data from the monitor device. The KCMS portion of the Solaris SDK provides two sample dynamically loadable modules. One module (colorsense.so.1) requires the use of a hardware colorimeter connected to a serial port on the local system to obtain color data measurements. The other module obtains measurement data without a colorimeter. In either case, the module provides a GUI for interaction with an end user.


Note -

KCMS includes a loadable driver for the X-Rite DTP92 colorimeter. The driver is very similar to the colorsense() module described in this guide. It supports the X-Rite colorimeter, which connects to the serial port to obtain color measurement data.


Calibrator Tool and Loadable Module Interaction

Calibrator Tool and the loadable module interact with each other using three application programming interface (API) functions. These are

Each programming interface identifies a phase (initialization, data collection, or closure) in the interaction between Calibrator Tool and the loadable module. To indicate the success or failure of a phase, each module returns status information. A zero status value indicates success; any nonzero value indicates that an error has occurred. If a nonzero status value is returned at any point in the calibration process, the loadable module application is terminated and Calibrator Tool displays a status message. (For details on Calibrator Tool status messages, see the section entitled "Customizing Your Monitor" in Chapter 10, "Customizing Your Environment," in the Solaris Advanced User's Guide.) The loadable module may have its own custom error and status messages.

The following summarizes the three phases in the interaction between Calibrator Tool and the module.

Initialization

During initialization, Calibrator Tool takes a handle to the dynamically opened module and accesses the KCMSCMonInit symbolic name using dlsym(3DL). If it finds the name, it initializes and allocates space for the visual data.

The tool calls KCMSCMonInit() to allow the loadable module to initialize the serial port for the hardware colorimeter (if it uses one to take measurements), to start its own GUI-based application, and to make any additional preparations necessary to measure monitor data.


Note -

The sample modules described in this guide set up the application user interface during initialization using included source code from TeleUSE (Motif GUI builder) and the X Toolkit library (available with Solaris 2.5 and later). (Refer to the colorsense() and XSolarisVisualGamma() source files.) Be aware that you are not required to use this code in the design of your module. The examples are an implementation only. All or parts of them can be used as a template, depending on your needs.


Data Collection

Calibrator Tool initializes and sets up the data structure to gather data. It makes standard X11 Window System calls to establish the number and types of X visuals for which it needs measurement data. The function's interface structure includes the array of visuals supported by the system, which is provided by the main program, and the matching array of measurements, which is supplied by the loadable module.

Calibrator Tool calls KCMSCMonMeasure() to "fill in" the measurement data.

Closure

If the loadable module successfully supplies the data measurements, it returns status value 0 (status OK) to Calibrator Tool. Calibrator Tool then calls KCMSCMonClose() to allow the loadable module to free any resources it is using, for example, to unlock the serial port and to close the associated file descriptor.

If, however, the status value returned is any other nonzero value, Calibrator Tool disregards all previously obtained data and informs the end user that calibration has not properly completed. In this case, the calibration process must be restarted from the very beginning with another call to the loadable module.