Showing changes from revision #1 to #2:
Added | Removed | Changed
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 | |
|
32bpp | 0-255 | &BBGGRRSS gamma table entry | |
1 (Border) | – | 0 | &BBGGRRSS border colour |
2 (Pointer) | – | 0-3 | &BBGGRRSS pointer colour |
In 32bpp modes, the hardware gamma table is expected to be a set of three four 8bit lookup tables which translate the red, green green, and 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 three 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.
In On 16bpp modes, the hardware gamma table is expected to be a set of three 5bit lookup tables, which operate in an identical manner to the gamma tables in 32bpp modes. HoweverRISC OS supplies 5.21 and above, 16bpp modes use exactly the data same in rules a as convoluted 32bpp format modes. that Table matches the format required by VIDC20 hardware. This can be converted to a set of three 5bit table indices are 0-255 and a the set data of is three in 5bit & R,G,B values as follows: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;