h6. [[GraphicsV]] h6(. » 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 | |/6^. 0 (Normal) | 1bpp | 0-1 |/4^. &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 | | 3 (TCK) | - | 0-1 | See below | h4. 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. h4. 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: <pre>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;</pre> h4. Palette type 3 Palette type 3 is used for transparency colour key (TCK). * Entry 0: TCK value. This is a raw pixel value, rather than a &BBGGRRSS palette entry. * Entry 1: TCK mask. This indicates which bits of a pixel are significant when the hardware performs the TCK check (e.g. in a 15bpp mode, the top bit of the halfword may be ignored). Drivers can implement these as read-only values if the values can't be changed. Drivers should ignore the call if TCK isn't in use (e.g. alpha blending is being used instead). h4. See also * [[GraphicsV]]