Extended PAL Format
The extended PAL format includes the following:
- A palette-header chunk
- A data chunk containing an RGB palette (consisting
of a LOGPALETTE structure) or some other palette type, including YUV and
XYZ palettes.
For an RGB palette, the extended PAL format is represented as follows:
RIFF('PAL' plth( <palette-header> ) data( <LOGPALETTE-data> ))
For a YUV palette, the extended PAL format is represented as follows:
RIFF('PAL' plth( <palette-header> ) yuvp( <YUV-LOGPALETTE-data> ))
Both the <LOGPALETTE-data> and <YUV-LOGPALETTE-data>
use the Windows 3.0 LOGPALETTE structure, described in "Simple PAL Format,"
earlier in this section. The <YUV-LOGPALETTE-data> contains
YUV values instead of RGB valves.
The "plth" chunk is defined as follows:
<plth-ck> PLT( struct {
ULONG ulMapType;
USHORT usWhite; /* Fields from this point on are */
USHORT usBlack; /* optional. If they are included */
USHORT usBorder; /* but not used, set them to 0xFFFF. */
USHORT usRegisteredMap;
USHORT usCustomBase; /* If an application encounters a */
USHORT usCustomCnt; /* 'PLT' chunk smaller than shown */
USHORT usRsvBase; /* here, it should treat the missing */
USHORT usRsvCount; /* fields as unused. */
USHORT usArtBase;
USHORT usArtCnt;
USHORT usNumIntense;
} )
The structure fields are described in the following:
Field
ulMapType
FOURCC code specifying the type of palette.
Currently, the following palette types are identified:
Code
'data'
Specifies an RGB palette. Data chunk contains a
LOGPALETTE structure.
'yuvp'
Specifies
a YUV palette. Data chunk contains a YUV palette.
'xyzp'
Specifies an XYZ palette. Data chunk contains a
XYZ palette.
usWhite,
usBlack
Specify palette-map indices corresponding
to the closest value of white and black. These identify the pair of colors
with the best contrast for use in cursors, calibration, etc. These values
are usually changed if the palette changes. Ignore these fields if they
contain 0xFFFF.
usBorder
Specifies
the index of the palette entry to be used for any display-border regions,
if supported by the display device. Ignore this field if it contains 0xFFFF.
usRegisteredMap
Specifies
how many palette entries correspond to a registered color map. Registered
entries are stored at the front of the palette. Ignore this field if it
contains 0xFFFF.
Registered map entries are always stored at the beginning of the palette,
so usRegisteredMap also indicates the index of the first custom color
in the palette. Registered color maps include predefined palettes for general
use, forest/nature, or seasides. Currently defined values are the following:
PAL_UNREGISTERED (0xFFFF)
Color map does not contain
colors from a registered color map.
PAL_VGA (0x0000)
Color map contains the standard 16 VGA colors.
PAL_AVC198 (0x0001)
Standard
AVC 198-entry palette.
usCustomBase
Specifies the index of the first custom color
of the palette. The beginning of the palette contains the entries of the
registered map, so usCustomBase also indicates the number of entries
in the registered palette. Map entries starting with usCustomBase comprise
additional custom colors used in the bitmap. Ignore this value if usRegisteredPalette
is PAL_UNREGISTERED, or if usCustomBase contains 0xFFFF.
usCustomCnt
Specifies the number of custom colors in the
palette. Ignore this value if usRegisteredPalette is PAL_UNREGISTERED,
or if this field contains 0xFFFF.
usRsvBase
Specifies
the index of the first reserved color of the palette. Reserved colors are
those reserved for menus, text, and other screen elements. Reserved colors
must be stored contiguously. Ignore this field if it contains 0xFFFF.
usRsvCnt
Specifies the number of reserved entries. Ignore
this field if it contains 0xFFFF.
usArtBase
Specifies
the index of the first art color of the palette. Art colors are colors
used for text and drawing. Art colors consist of a number of hues, each
of which has multiple intensities. The various intensities are used for
anti-aliasing, a method of using different shades of a color to improve
the quality of images displayed on low-resolution devices.
For example, if the first art color is red anti-aliased to black with three
intensities, the first three entries in the palette would be dark red, medium
red, and bright red. The art colors constitute an array, and all hues have
the same number of intensities. The user can set both the number of hues
and the number of intensities. Ignore these fields if they contain 0xFFFF.
usArtCnt
Specifies
the number of art colors. Ignore this field if it contains 0xFFFF.
usNumIntense
Specifies the number of palette entries reserved
for the anti-aliased levels of a given art color. This field must be present
if usArtBase is present. Ignore this field if it contains 0xFFFF.
[Back: Simple PAL Format]
[Next: Rich Text Format (RTF)]