Page 185 - DCAP504_Computer Graphics
P. 185
Computer Graphics
a palette. A palette can be used to map color index values into RGB values for the destination object.
When the contents of the destination object are submitted to the physical device then the RGB values
from the palette are either:
1. Passed directly to the physical device (that is by calling Draw() function).
2. Loaded into the lookup table of the physical device.
Lookup table of indexed color model is used to store and index the colors of an image.
The indexed color model requires less memory and has limited color available on displays. Therefore, it
was easier to support in hardware. However, it has become a norm to use RGB color model in modern
systems.
The RGB color model is an additive color model in which the primary colors red, green, and blue light
are combined together in different ways to reproduce a wide range of colors. The name RGB color
model has originated from starting letters of the three additive primary colors, red, green, and blue.
When red color is mixed with green color we will get yellow color. Same way when all
Did you know?
the three primary colors are added, it produces white color.
The basic principle of RGB color model is that, a display requires only three primary colors to generate
the three tri-stimulus values essential for a human visual system. Various colors can be produced by
varying the intensity of each primary color.
Cathode Ray Tube (CRT) is a technology used in modern computer monitors to
Did you know?
produce a perceived color by adding primary colors.
The CRT uses additive color model. With the usage of primary colors, a CRT can add light to an initially
black display and produce the desired color.
The three primary color additive system includes separate buffers for three primary colored images.
Corresponding to memory location, each pixel maintains individual buffer for red, green, and blue
components. A typical system may include an array of 1280 x1024 pixels and each pixel might consist
of 3 bytes with one byte for each of red, green, and blue.
A programmer would like to specify any color that a frame buffer can store.
24
If there is any image that takes 24-bits then there will be 2 possible colors,
sometimes referred to as 16M colors, where M =l024.
Other systems may have maximum of 12 bits per color or minimum of 4 bits per color. Therefore, it is a
good practice to specify a color independently of the number of bits in the frame buffer and to let the
drivers and hardware match the specification as closely as possible to the available display. A color can
be specified by using a color cube as shown in figure 12.5, where the color components are specified as
numbers between 0.0 and l.0. A value of l.0 represents the maximum (or saturated value) of the
respective primary color and 0.0 denotes a zero value of that primary color.
178 LOVELY PROFESSIONAL UNIVERSITY