RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Page "Message_SetAlarm 0/versions/1" does not exist. Please create it now, or hit the "back" button in your browser.

ColourTrans Colour Calibration

Programmer's Reference Manuals
» Part 8 - Non-kernel input/output
» ColourTrans
» Technical Details
» Colour Calibration

Colour Mapping

Colour calibration is achieved by the ColourTrans module using a table that maps device colours (physical colours) to standard colours.

When requesting a colour, ColourTrans takes the palette colour and uses a calibration table to convert the device colours to standard colours, giving a transient palette that maps logical colours to standard colours. The closest match to the standard colour is then selected.

Calibration Tables

A calibration table is used to map device colours to standard colours. Three separate mapping exist for each component of the device space. e.g red, green and blue on a monitor. Each mapping consists of a series of device component/standard colour pairs.

The format of the pairs is &BBGGRRDD

Where
|<^. BBGGRR|<^. Standard colour (Blue, Green and Red)|
|<^. DD|<^. Amount of device component|

The calibration table format is as follows:
|<^{width:8em}. Word|<^. Meaning|
|<^. 0|<^. Number of pairs of component 1 (n~1~)|
|<^. 1|<^. Number of pairs of component 2 (n~2~)|
|<^. 2|<^. Number of pairs of component 3 (n~3~)|
|<^. 3|<^. n~1~ words giving pairs for component 1|
|<^. 3 + n~1~|<^. n~2~ words giving pairs for component 2|
|<^. 3 + n~1~ + n~2~ |<^. n~3~ words giving pairs for component 3|

The size of the table is therefore 3 + n~1~ + n~2~ + n~3~ words.

The three separate mappings for each device component must be sorted in ascending order. To fill the device colour space there must be entries for device components of 0 and 255. This results in at least two pairs for each component.

An example of a calibration table is shown below.

Word Meaning
&00000002 2 pairs of red component
&00000002 2 pairs of green component
&00000002 2 pairs of blue component
&02010300 Device colour 000000 corresponds to standard colour &020103
&0203FDFF Device colour 0000FF corresponds to standard colour &0203FD
&02010300 Device colour 000000 corresponds to standard colour &020103
&03FC02FF Device colour 00FF00 corresponds to standard colour &030FC02
&02010300 Device colour 000000 corresponds to standard colour &020103
&FF0302FF Device colour FF0000 corresponds to standard colour &FF0302

The default mapping is for device colours and standard colours to be the same.

ColourTrans converts a device colour to a standard colour by the following process:

  1. Splits the device colour into its three component parts
  2. Looks up each component in the calibration table
  3. Entries not found in the table is calculated by performing a linear interpolation between the two device components ‘surrounding’ the required device component
  4. The standard colour obtained for each component is then added together to give the final calibrated standard colour
Revised on September 24, 2009 19:12:20 by Alan Robertson (52)? (127.0.0.1)
Edit | Back in time (1 revision) | See changes | History | Views: Print | Source | Linked from: ColourTrans Technical Details

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys