Iota Software Ltd - TCA Files - The PALE chunk

The PALE chunk: Palette and screen-mode information

The Palette chunk is laid out as follows (explanations of the entries follow):
Offset  Size  Description
=========================
    0     4   Chunk ID ("PALE" or 0x454C4150)
    4     4   Chunk size (bytes)
    8     4   Pencil colour number (0-255)
   12     4   Paper colour number (0-255)
   16     4   Mode flags
   20     4   Log2BPP
   24     4   Log2BPC
   28     4   XEIGFactor
   32     4   YEIGFactor
   36  8-1024 Palette data
Pencil colour number
This indicates to The Complete Animator's painting tools what the current pencil (foreground) colour is. Other users of this format probably needn't worry about it.
Paper colour number
This indicates to The Complete Animator's painting tools what the current paper (background) colour is. You'll need to know this if, for instance, you're playing back an animation which takes over the screen and you want the whole of the rest of the screen to be the background colour. The paper colour n refers to the nth entry in the palette data, and so is in the range 0-255 even for 16bpp and 24bpp films.
ModeFlags
Acorn versions of The Complete Animator set bit 7 of this word to indicate the presence of a "true" or non-brain-damaged 256-colour palette. Films with this bit set won't necessarily play back in the right colours on Acorn machines prior to the Risc PC. When running on a Risc PC (or, of course, a PC or Macintosh) this flag can be ignored. (Even on older machines this bit may be superfluous if ColourTrans is used to build a translation table, like in our screen-saver.)
Log2BPP
The logarithm to base 2 of the number of bits per pixel, i.e. 0=>1bpp, 1=>2bpp, 2=>4bpp, 3=>8bpp, 4=>16bpp, 5=>32bpp (actually 24bpp).
Log2BPC
For all intents and purposes this is the same as Log2BPP. (For the interested, the difference only comes on Acorn machines prior to the Risc PC, which supported an abomination called "double-pixel" modes, now thankfully dropped.)
XEIGFactor
External to Internal Graphics factor: PC versions of Animator always use square pixels and set this value to 1, but on Acorn versions 0 means pixels half the usual width, 2 means twice, 3 means four times, and so on.
YEIGFactor
External to Internal Graphics factor: PC versions of Animator always use square pixels and set this value to 1, but on Acorn versions 0 means pixels half the usual height, 2 means twice, 3 means four times, and so on.
Palette data
Palette entries are 32-bit words, of the form 0xRRGGBBxx, where the bottom two hex digits should be ignored (but you can't assume they're zero). There are 2^(2^Log2BPP) of them, unless this is more than 256, in which case there are only 256. (You still need to know the palette data even in unpalettised, 16bpp and 24bpp screen modes so that you can interpret the paper colour number.)

On Risc OS you can pass this block of palette data directly to ColourTrans_SelectTable.




Home Page
Top of page