About the Graphics Overview
This topic presents an overview of Macintosh graphics. It surveys the
with which it interacts, and how colors flow from your application to the
screen.
Read the information given here if your application uses color or gray scales.
original QuickDraw. The next figure below charts your path into the world of Macintosh graphics.
Macintosh graphics begin with QuickDraw and end with glowing phosphor. The early Macintosh systems, with their built-in screens and integral
graphics hardware, made well- defined and comparatively limited demands on
your understanding of graphics: if you learned QuickDraw, you were set. The Macintosh II computer introduced two features that greatly increased
graphics capabilities: slots and color. Slots allow the addition of specialized
hardware to the system. (In the original Macintosh II, the graphics hardware
was always added in NuBus standard slots. Current systems allow a number of
hardware expansion modes in addition to NuBus slots.)
With slots, the characteristics of the output device can vary from machine to
machine. With color, the extent of variation can be very great: screens not only
can vary in horizontal and vertical dimensions, but they can also vary in
depth. To the single-bit-per-pixel depth of the original Macintosh systems,
the Macintosh II added pixel depths of 2, 4, and 8 bits. Output devices range
from black-and-white systems to cards and screens capable of presenting
hundreds of colors from palettes of millions. Furthermore, users can combine
screens: a user may move your application's window so that it overlaps
screens of very different characteristics.
To remove the burden of worrying about output devices (for most
color can work in an abstract color space defined by three axes of red, green,
and blue (RGB). Your application can specify a color as an RGB value, in which
such a 48-bit value with the colors actually available on the hardware at
execution time and chooses the closest match. Precolor applications and those
not concerned with color or gray-scale graphics need not change, and those
concerned only with straightforward color usage can ignore the problems of
output devices.
When the Macintosh II was introduced, the maximum pixel value was limited
to a single byte. Each pixel's byte can specify one of 256 (28) different
values, and, rather than simply truncating the least significant bits of each
indexes into a color table. If your application asks for a 48-bit RGB color, the
Color Manager examines the colors available in the card. If the video device supports 8 bits per pixel, the card contains a color look-up table (CLUT) with
256 entries, each entry an RGB value. The Color Manager determines which the index for that color is.
Storage and movement of such indexed color values require a maximum of 8
bits, rather than 48, saving space and time. (The RAM needed to hold a
640-by-480 pixel screen at 8 bits per pixel is about 300,000 bytes.) And
because the table is variable-it can be loaded with different
colors- applications can display up to 16 million colors, although only 256
different colors can appear at once.
With the addition of direct pixel values, first made available with system
software version 6.0.5, the 256 simultaneous color limit has been removed.
or 32 bits to directly represent a color. Using direct color not only removes
much of the complexity of the color table mechanism, but it also allows the
display of thousands or millions of colors simultaneously, resulting in
near-photographic realism.
three-screen system-for example, with displays for gray-scale indexed
pixels, color indexed pixels, and direct pixels-the user can move your window
to span all three devices and each will show its best representation of your
image.
managers with which it works.
requests to the actual colors available. Most applications never need to
colors that it needs on a window-by-window basis, and makes the
colors available (within application- determined ranges) in a graceful
manner.
choice from the user in a standard way.
application can extract information, such as pixel depth and colors
used, from pixel maps and pictures.
images off screen, and it manages the data structures that track the
characteristics of the graphics hardware of a particular system.
all types, including video cards.
• introduce the basic graphics components and further defines the
differences between indexed and direct pixel images
• present overviews of the important color graphics data structures:
the color tables and palettes that hold colors, the pixel maps that hold
information about images, the color grafPorts that hold information
about windows, and the graphics device records that describe the
capabilities of a particular screen
• describe the startup process as it applies to graphics, to show how the
data structures are created and initialized
• trace the path of a user's request for a color through the graphics
system and onto a screen, in both the indexed and direct pixel systems
• tell you how to determine which version of QuickDraw is actually running