Microchip Technology AC164127-9 数据表

下载
页码 34
AN1368
DS01368A-page 2
 2011 Microchip Technology Inc.
In general, to divide 16 bits among Red, Green and
Blue, two schemes are used: 
• Scheme 1 (R<5> G<6> B<5>): In this scheme,
there are 5 bits of Red, followed by 6 bits of Green
and 5 bits of Blue. Green is given more bits
because of the property of the human eye, which
can distinguish more shades of Green than Red
and Blue. 
 illustrates these 64K colors.
• Scheme 2 (T<1> R<5> G<5> B<5>): In this
scheme, there is one transparent bit, followed by
5 bits each of Red, Green and Blue. The
transparent bit indicates if the color should be
used or not. 
Currently, the Microchip Graphics Library (Version 2.11)
supports only Scheme 1. 
FIGURE 2:
COLORS IN 16-BIT 
REPRESENTATION
Grayscale is usually represented in a byte, with 0 as
Black, 1-254 as the shades of Black, getting lighter as
the number increases, and 255 as White, as shown in
. Sometimes, only 4 or 2 bits are used to
represent 16 or 4 shades of Black, respectively. If only
one bit is used to represent either the on or off of a
color, then it is called ‘Monochrome’. 
The number of bits required to represent a color is
called the ‘Color Depth’. For example, a color depth of
16 bits means it requires 16 bits to represent a color,
and therefore, we can represent 2
16 
different colors.
FIGURE 3:
GRAYSCALE VALUES OF 
0 TO 225
Alternatively, color may be represented using a Color
Look-up Table (CLUT), also called a palette table, where
the color is specified by the index of the table, as shown
in 
. Depending on the size of the table, the bits
used to represent the index will vary as 256 entries of
RGB (8-bit index), 16 entries of RGB (4-bit index),
4 entries of RGB (2-bit index) and 2 entries of RGB (1-bit
index). This scheme is mainly used to save memory. For
more information on this scheme, see 
.
FIGURE 4:
COLOR LOOK-UP TABLE 
(CLUT)