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

GraphicsV palette colours

GraphicsV
» GraphicsV palette colours

The number of entries in the palette and the format of the colour data supplied by RISC OS is dependent upon the palette type and the current colour depth.

Palette type Colour depth Range of indices Format
0 (Normal) 1bpp 0-1 &BBGGRRSS palette entry
2bpp 0-3
4bpp 0-15
8bpp 0-255
16bpp See below See below
32bpp 0-255 &BBGGRRSS gamma table entry
1 (Border) – 0 &BBGGRRSS border colour
2 (Pointer) – 0-3 &BBGGRRSS pointer colour

32bpp modes

In 32bpp modes, the hardware gamma table is expected to be a set of four 8bit lookup tables which translate the red, green, blue and supremacy components of a pixel to new values. When receiving a request to update the gamma table, the palette index is used to indicate which table entry to write, for all four tables. The supremacy table entry should be updated with bits 0-7 of the colour, the red table entry should be updated with bits 8-15 of the colour, the green table entry with bits 16-23, and the blue table entry with bits 24-31.

16bpp modes

On RISC OS 5.21 and above, 16bpp modes use exactly the same rules as 32bpp modes. Table indices are 0-255 and the data is in &BBGGRRSS format.

Prior to RISC OS 5.21, GraphicsV drivers were supplied the 16bpp gamma data in a format that was directly usable by VIDC20 hardware but required manipulation to be used elsewhere. Ignoring supremacy, the VIDC20 data can be converted to a set of three red, green and blue table indices (from 0-31) and data values (from 0-31) using the following code:

red_idx = idx & 0x1f;
green_idx = (idx>>1) & 0x1f;
blue_idx = (idx>>2) & 0x1f;
red_val = (val>>11) & 0x1f;
green_val = (val>>19) & 0x1f;
blue_val = (val>>27) & 0x1f;

See also

  • GraphicsV
Revised on January 10, 2014 13:29:03 by Jeffrey Lee (213) (195.72.173.131)
Edit | Back in time (2 revisions) | See changes | History | Views: Print | Source | Linked from: GraphicsV 10, GraphicsV 11

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 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