You are on page 1of 1179

Foreword

TIle field of s)'$ICllL'S prognunming primarily grew OUI of the efforts of many programmers
and managers whose creative energy went into producing pnlCtical. utilitarian systems
programs oceded by the rapidly growing computer industry. Programming was practiced as
an art each prograIIlmc:l" inverllcd his (l'IlITI solutions 10 problems with lilde guidance
beyond that pn:widcd b)' his immediate associates . In 1968, the lale A.scher Opler, then 311
IBM. recognized thar 11 was necessary to bring programming knowledge together in a form
,hal would be accessible to all 5)'s&emS programmers. the of the an. he
decided lhatenougl'lll3(:ful matc;rial fO jiJSlify a significant codification effort. On his
recommend.tioo. IBM decided to sponsorlbe Systems Programming Series as a long term
project to collect, organize, and publish those principles and Ihal would have
lasting value throughout the industry. Since 1968 eighteen titles have been published in the
Series. of six are currently in print.
n.e Series consists of an open-ended collection of toll-reference books. The contents
of cadi book represent lhe individual author's view of the subject area and do not
refl ect the views of the IBMCorporarlon. Eadl fotcowse use but is
detailed enough for refe:rencc .
RepttK!&IA!M topic areas atrudy published. Of that are to be cxwered by
the Series, include: darahase s)'SIems, communkal:ion symems, graphics systems, expen
systems, and programming process management . Ckha- topic areL'I will be included as the
systems programming discipline Co'Olves and deYelops.
The EdilOl"1a1 Board
vii
Preface
grnphics is a field whose lime has come . Until recently it w.lS an esoteric
specialty involving expensive display hardwan:, substantial computer resources, and
idiosyncrlll:ic software . In the last few years. however, it has benefited from the steady
and sometimes even spectacular reduction in the hardware price/perfonnance ratio
(e.g . personal computers for home or office with their standard graphics terminals),
and from the development of high-lC\'eI, device- independent graphics package.'! thai
help make graphics programming and straightforward. Interactive graphiCll is
now finally ready to fulfill its promise to provide us with pictorial communication and
tbus to become a major fadlitalOr of manlmachine interaction. (From preface.
of interactiw COIfIPllter Graphics. James Foley and Andries van Dam.
1982)
This assertion that computer graphics had finally arrived was made before the rnoIution in
computer culrurc sparked by Apple's Macintosh and the IBM PC af1d it!; clones. Now even
preschool children are with interactive-grapbics techniques, such as the
do;klOp metaphor for window manipulalion and menu and icon selection with a mouse.
Graphics-based user interlaces have made productive u.sers of neophytes, and the desk
without its graphics computer is increasingly rare.
At the same time that interactive graphics has become common in L1SCT interfaces and
v;slt:Miiz.Alion of data and objects . the rendering of 3D objects has bel"Ome dramatically
mon: realistic, as evidenced by the ubiquitous computer-generated commercials and movi e
special effects. Techniques that \ere eApc:Timental in the eMly eighties arc: now standard
practice, and more remarkable "pholOrealistic" effects are around the corner. The simpler
kinds of pseudorea1isrn, which lOok hours of computer lime per image in the early eighties.
now are done routinely at animation rates (ten or more frames/second) on personal
computers. Thus "real-time" vector displays in 1981 showed moving wire-frame objects
made of tens of thousands of vectors without hidden-edge removal; in 1990 real-time raster
displays can show not only the same kinds of line drawings but also moving objects
composed of as many as one hundred thousand triangles rendered with Gouraud or Phong
shading and specular highligbts and with full hidden-surface removal. The highesl-
perfonnance systems provide real-time te;ltture mapping, antialiasing, atmospheric attenua-
tion for fog and hue, and other advanced effects.
Graphics software standards have also advanced sjgnificantly since our first edition.
1be SIGGRAPH Core '79 package, on which the first edllion's SOP package was based,
has all but disappeared, along with direct-view storage tube and refresh vector displays. The
much more powerful PHIGS package. supporting storage and editing of structure hierarchy.
has become an official ANSI and ISO standard. and if is widely available for real-time
viii
Preface ix
georJlelrK.: gOlphit.--s in !o(.;t:fKific;moJ enll!ina:ring ;doni: with PHIOS+ , which
supports iighling, shading. curves, and SUITaces. Official gmphics standards complemenl
lower-level. more efficienl de facto siandards, such as Apple ' s QuickDraw, X Window
Sy:>tem's Xlib :m integer raster graphics package , and Silicon Graphics' GL 3D libouy.
Also widely available are implemenlations of Pix3r's RenderMan interface for photonalis-
IX; rendering and PosIScrip( inlerprelus fot hardcopy page and screen image description.
Belief graphics has been used 10 make dramalic improvements in !he "look and
fl"of user interfaces, and we may expect use of 3D effects. boI:h for aesthetic
reao;ons and for providing new metaphors for organizing and presenting. and navigating
Ihrough information.
Jtmaps the ID<>M important new movement in graphks is the incrnWng concern fOt
modeling objeclS, nol JUSt for cre.ating lheir pi ctures. Furthennore, intt:n:S1 is growing in
describing the lime-varying geometry and behavior of 3D objects. Thus graphics is
increasingly concerned with simulation, animation. and a "bade 10 physics" movement in
boI:h modeling and rendering in order to creale objects thaI loot and behave as realistically
as possible.
As the 10015 and capabilities zvailable become more and ffior-e SOphisticated and
complex, we need 10 be able: to apply thc:m effeclivdy. Rendering is no longer the
boulenc:ck. Therefore researchers arc: besinning to apply Itx.:hniques 10
assist in the design of object: model s, in modcm planning, and in the IlQQUt of 20
and 3D grapbical presentalKKls_
Today the: frontiers of graphics are moving ery rapidly, and a text that sets out to be a
$l3ndard reference must periodically be updated and expanded. This book: is almost a
lotal rewrite of the: Fundo.mmtaJ.I of Inuractiw Compuu:r Grapilil"s. and although this
second edition contains nearly double: the original 623 pages, we remain painfully aware of
how much material have been to omit .
Major differences from the first edition include the following:
1be eCtor-graphics orientation is replaced by a raster orientation.
The simple 2D Hooting-point grnphics package (SGP) is replaced by '"010'0 packages -
SRGP and SPHIGS- lhat rlIfiect the two major schools of inter&etivt: graphics
proglllmming. SRGP combines features of the QuictDraw and Xlib 20 integer raster
graphics packages. SPHIGS, based on PHIGS, proYides the fundamenlaJ features ofa 3D
floaling-poinl package: with hic:ran;:hicaJ display lists. We e1Iptain how to do appltcations
programming in each of thc:sc: packages and show h<Joo,o.r to implemc:nl the basic dipping,
scan-conversion, viewing, and display list tra\It'fS3J algorithms that underlie these
systems.
User-interface issues are di.scu.ssc:d al considerable length, bolll for 2D dc:sJctop metaphors
and fOl" 3D inlenction devices.
Coverage of modeling is expanded to include NURB (noounifonn rational
curve<; and surfaces, a chaptet" on solid modeling. and a chapter on advanced modeling
techniques , such as physically based mcxk:Iing. procedural models. fractals, L-grammar
systems . and particle systems.
Increased covc:rnge of rendering includes a detailed tn:atment of anti aliasing and greatly
x Preface
o:hilpttni 011 determination. illumirudion. and shading. including
physfcaIly based illuminatiOfl models , ray tracing. and mdiosity .
Material is added on advanced raster graphics architectures IUld algorithms. including
clipping and scan-conversion of complex primiti-.es and simpl e image-processing
opc:r8tions. such as compositing .
A brief introduction to animation is added.
Thi s text can be used by tOOse without prior Dackgrouod in graphics and only sorne
background in Pascal programmi ng. basic daTa structures and algorithms . computer
architC(;"lUre. and simple linear algebra. An appendix reviews the necessary mathematical
foundations . The book CO\oU"S enough material fOf" a full-year course . but is panitioned into
ptlupsLt o make sdoctive COYc:I"IJ8C possible . The: reader, therefore . can progress through a
carefully designed sequence of units. starting wilh simpie. genera1 ly applicable fundamen-
tal s and ending with more complex and specialized subjects.
Basic Group. Chapter I provides a historical penpc:ctive and SOfl"le fundamental issues in
hardware:. software. and appl ications. Chapters 2 and 3 describe: . respectively, the use and
the implementatiOfl of SRGP. a simple 20 integer graphics package. Chapter 4 introduces
graphteS hardware. including some hints about how to use hardware in implementing the
operations described in the preceding chapters. 1be ne)!.! two chaptus. 5 aocl 6 , introduce
the ideas of transformations in the: plane and 3-space. Iq)rc::scnlations by matrices . the
of homogeneous coordinates 10 unify linear and affine transfOflllations . and the description
of 3D view!I , including the trani formations from arbitrary view ..oIumes to canonical view
l'Olumes. Finally. O\apler 7 introduces SPHIGS. a 3D Roating-poinl hierarchical graphics
package thai is a simplified ver-sion of the PfUGS wmdard. and describes its use in some
basic modeling operations. ChapfCf" 7 also di$CtlSSeS the advantages and disadYarllages ofme
hierardly available in PHlGS and the structure of apPIicalions that use thi s graphics
package.
User IllterUce Group. ChapterS 8-10 describe the current technology of interaction
devk:es and then address the higher-level issues in user-interface desjgn. Various popular
user-interface paradigms are described and critiqued. In the final Chapttt user-interface
software. such as window managers. interaction technique-libraries. and u..ser-interface
management systems, is addressed.
Mo*I Definition Group. The first two modding chapters. 11 and 12. describe the
cun-enI: technologies used in geometric modeling: the lepresentation of CUI'"YeS and surfaces
by panmetric functtons , especiall y cubi c and lhe lepitsentation of solids by
various tedlniques. including boundary tepresenta.tions and esc models. Chapter 13
iotroduces the human coloc-vision system, vuious color-dc:scription sySt ems, and
sion from one to another. This chapCer also b..-ieHy addn:sses rules for the effeetive use of
oolor.
lmage Synlbesis Group. Chapter 14, the first in a four-chapter sequence, describes
Ihe quest for realism from the earliest \'ector drawings to state-of-the-an shaded grapnics.
The artifacl5 caused by aliasing alt of crucial concern in ra.stel' graphics. ilHd this
chapter discolsses their causes and cures in considerable detail by introducing the Fourier
Preface xi

tnlnStOrm and oonvoiutlOn. Chapter 15 describes a variety of m-att'gie., for visible-SlIrl'1tce
detennination in enough detail 10 aJIOIW the reader to implement some of the most im-
portam ones. lIIuminalion and shading algorithms are (;OYered in detail in Chapter 16.
1be early part of this chapter discusses algorithms most (;Ommonly found in current
hatdware . white the remainder treats texture, shadows. u-anspallmcy. reflections, physicaJ
Iy based illumination models, ray trocing, and radiosity methods. 1be Last chapter in
group, Chapter 17. describes bofh image manipulations, such as scaling, shearing.
and rotating pixmaps. and image storage techniques. indudins various image-compre.s-
sion schemes.
Adnnced Techniqltes Gro.p. The last four Chlpters give an overview of the CUITent
state of the art (a moving target, of course). Chapter 18 describes advanced graphics
hardware used in high-end (:OI1lmerciai and research machines; this chapter was contributed
by Steven Mol nar and Henry Fudui, authorit.ies ora high-performance graphics architec-
tures. ChaplCr 19 dc.Kriba the complex ,';Uta usW for such tasks as
scan-M'lvcrtmg ;ubitary conics, generating antisliased teAt , and implementing page
de5criplion languages, such as fusr$a-ipt . The final tv,c daapter.l SUI"IIeY some of the most
imponant techniques in the fields of highlevel modeling and computei' animation.
The first two groups cover only elementary material and thus can be used for a basic
course at the undergraduate level. A course can then use the more advanced
chapters. Altemacivdy. instrucCors can assemble customized courses by piclc.ing chapters
OlIt of the various groups.
For example, a (;UUr5e designed 10 introduce students to primari ly 20 graphics would
include ClJapters I and 2. simple scan cooYersion and clipping from Chapter 3, a
technoloiY ove",iew with emphasis on raster an:hitectures and interaction devkes from
Chapter 4. homogeneous mathematics from Chapter 5. and 3D viewing only from a "how
co use it" point of v;e.... from Soctmns 6.1 to 6 .3. lbe User Interface Group. ChapterS
8 10, would be followed by selected introduclOf)' sections and 5i mple aJgorithms from the
Image Synthesis Group, ChapterS 14, IS, and 16.
A one-course general overview of graphics would include Chapters I and 2, basic
algorithms from Chapter 3, raster architectures and. interaction devices from Chapter 4 ,
Chapter 5. and mO!1 of Cbapter'!l 6 and 7 on viewing and SPHIGS. lbe lIOnd half of the
course would include sections on modding from Chapters II and 13, on image synthesis
from Chapters 14, 15. and 16, and on advanced modeling from Chapter 20 10 give breadth
of coverage in these slightly more advanced areas.
A (X) urse emphasizing 3D modeling and rendering -..oWd swt with Chapter 3 sections
on scan con...ening. cl ipping of lines and polyaons, and introducing antia1iasing. The
course lhen prOSre5S to Chapters 5 and 6 on !he basic mathematics of transfonna
ImnS and viewing, Chapter 13 on color, and then cover the key Chapters 14, IS, and 16 in
the Imlle Synthesis Group. Coverage would be rounded off by selcclions in surface and
solid modelIng, Chapter 20 on advanred modeling. and Chapter 21 on animation from the
Advanced TechniqUe!i GfOlIp.
Graphics Packqes. The SRGP and SPHIGS graphics pecklFS. designed by David
Sklar, alauthor of the two chapters on these packages. are available from the publisher b
xii Prefac"e
lhe J8M PC (lSBN 0-101-547007), the Macintosh aSBN 0 20154701 5), and UNIX
IM)rk:stalions running XII, an: many of lhe algorit:hms for scan conversion, dipping. and
viewi ng (see pagr: 1175).
AcknO'ft'ledgmeats. This book could nOl have been produced without the dedicated
work and the indulgence of many friends and colleagues. We acknowledge here OUl" debt to
those who have: contributed significantly to one or more chapters; many others have helped
by c:ommenling on individual chapters. and we are grateful to them as weU. We regret any
inadvertent omissions. Katrina Avery and Lyn Duprt did a superb job of editing. Additional
v-.a1uabJe editing an multiple vc:n;Jons of multiple chaplers was provided by Debbie van
Dam, Me1ilS8 Gold, and CIaTe Campbell. We are especially graldul 10 our production
Betle Aaronson, our arc directOr,.Joe Vetere , and our edi tor , Keith WOllman,
nOl only for their greal help in pnxl ucing the book, but also for their palterK:C and good
humor under admittedly adverse circumstances-if we ever made a promised deadline
during lhesc frantic five years, \\-"e can' , remember iI!
Compuler graphics has !)e(;ome too complex for even a t.eam of four main authors and
fhr= guest authors to be expert in all areas. We relied on colleagues and students fO amplify
our knowledge, catch OtIr mistakes and provide COI\structie criticism of (onn and content.
We take ful l responsibility for any remaining sins of omission and commission. Detailed
technical readings on one or more chaPIer5 were provided by JoIln Airey, Kur1 Akeley. Tom
Banchoff, Brian Barsky, David Bates, Cliff BeVters , Gary Bishop, Peter Bono, Marvin
Bunker, 8ill Buxton, Edward Chang, Norman Chin, Michael F. COMn, William Cowan,
lahn Dennis , Tom Dewald. Scott Draves, Steve Drucker, Tom Duff, Richard Economy,
David Ellsv.orth, Nick England, .Jerry Farrell. Robin Forrest, Alain Fournier, Alan Freiden,
Christina Gibbs, Melissa Gold. Mark Green, Cathleen Greenberg. Margaret Hagen, Griff
Haml in. Pal Hanrahan. John Rob Jacob, AbNt Kamran. Mike Kappel, Henry
Kaufman, Karen Kendler, DilVid Kurlander, David Lakltaw, Keilh Lantz, Hsic:n-Che Lee,
Aaron Man:us, Nelson Max, Deban.h Mayhew, Barbaro Meier. Gary Mc:ycr, Jim
Michener, Jakob Nid5Cll, MaTI\. Nodine, Randy Pausch, Ari Requicha, David Rosenthal,
David Salesin, Hanan Samel, James Sa.nford, James Sargent, Robin Schaufler, Robert
Scheifler, John Schnizlein, Michael Shantzis, Ben Shneidennan. Ken Shoemake, Judith
Schrier, John Sibert , Dave Simons, Jonathan Sieinttan, Maureen Stone, Paul Strauss, Seth
Tager, Peter Tanner. Brice Tebbs, Ben Trumbore , Vi Tso, Greg Thrie , kif Vroom. Colin
War-e. Gary Chuck Weger, Kevin Weiler, Turner Whitted , George \\Ulberg, and
Larry Wolff.
ScvenaI. colleagues, including Jack Brucnham, Brian Barsky, Jerry Van AUn. Dilip
Da Silva (who suggeued me uniform midpoi nt of Chapler 3) and Don Halfidd.
not only read chaplers closdy but also prO'Iided detailed suggestions on algorithms.
Welcome WDJd-processing relief W;I.S provided by Katrina Avery, Barbara Brinen, Clare
Campbel l , Tina Cantcw, Cavatoni, Louisa HOiJaD, knni Rodda, and Debbie van Dam.
Drawings for Cbapters 1-3 wen: ably created by Dan Robbins, 50011 Snibbe, Tina Cantor,
and Clate Campbel l. Figure and image sequences created for this book were provided by
Beth Cobb. David Kurlander, Allen Paeth, and George 'M:Ilberg (with I$$isunce from Peter
Karp). Plates 1I . 21-37, showing a progression of rendering techniques , werc: designed and
rendered 11.1 Piur by Thomas Williams and H. B. Siegel. under the direclion of M.W.
Mantle . using Pixac's PhotoR.e.aliuk RenderMan sot'twaR. Thanks to Industrial Light &
Preface xiii
Magic for the use of their laser scanner (0 create Plates 1I .24-37, and \0 Nonnan Chin for
computing vertex normals (or Color Plat es 11.30-32. L. Lu and CarJes Caslcllsague WI'Ofe
proervns 10 make figures.
Jeff Vogel implemented the aJgorithms of Chapcer 3, and he and Alul Butte vet"ified the
code in Chapters 2 and 7 . David Sklar wrote the Mac and XII implementations of 5RGP
and SPHtGS with help from Ron Balsys. Scon AtuJ BulCe. Alex ConlO'o'Ounesios ,
and Scon Draves. Randy Pausclt and his srudc:nts ported lhe packages to the PC
environment .
We have instal led an automated electronic mail set"YeI" to alkJw our readers to obtain
machinc-n:adable copies of many of the alpithrns , suggest eJl.e:rcises, report errors in the
lCJIt and in SRGP/SPHlGS, and obI:ain CIT8ta lists for the tf::l{t and softwaTe. Send email to
" gr-aphte.Kt @c-s. bnJwn.edu with a Subject line of " Help" to the CUfTCnt list of
lIYllilab1e scrviccs. (See page 1175 for information on bow 10 or-der SRGP and SPHlGS.)
Preface to the C Edition
Tbis ill_C ' , S ... iwota book"'ad dly Min p wiIh CUI., hi in P'aIcaI. h
ind t .u+ dIrouP-Dindlpo-1uoldter..c.l_'Ntdedtdon. UMlla
minor modifkMica to R'ME:ii" .. ." .............. ill PMcaI code .. been
in ANSI C. n.c i p I'a::ei., die SIWJP ... SPHIGS .... ict F '. are ROW
defined in C, .8tba daan PIiIQII .rid COi' Ii Nd to the new C irr,pa.w:: ... kIas of
me. J*" , (See NC b i.L ........ on obIaillilla lht
- wish 10 lhalt Noe'I ... Olin ror conoatire the code 0( the JCOOnd
edition to C, pooofJCild.ine: _. Iftd fooa ...... it !IIi .. the I)'POS ..... oic OOft\laltion$ of
the oritPna!. TlaMk.1o Matt Ayen for '*'IfuJ proofi"l olCbapcc,s 2, 3. and 7. and
for ...rill M'a 'ion& about poblems.
KWh;"8' Qn, D.C.
r,..,vUJ"Iff. R,/ .
y .... k. N,Y.
Pro'l,,;d,nc,. R.I
J.D. F.
A ,,,_D.
S. K. F.
1.F.H.
Contents
CHAPTER 1
'NTRODUCTION
1.1
1. 2
1.3
IA
1.5
; .
1.7
Image Processing as Picture Analysis . . . . . . ... . . . . .
The Advantages of Inl eractive Graphics " . . . . . .
Uses of Computer Graphics . . . . . .. . . _ . . ,"
Cla!>Sificatioll of Applications . . . . . . _ . . .. . . . . . .
Development of Hardware and Software for Computer GraphiOi
Conceptual Frallle\M'Jrk for Interactive Graphk s . . . . . . .
Summary . _ . . . . _ . . .
Exercises . . . . . . . . . . . . . . . . .. . . . . . . . . . . . .
CHAPTER 2
PROGRAMMING IN THE srMPLE RASTER
GRAPHICS PACKAGE (SAGP)
2.1 Dra ..... ing with SRGP
2.2 Basic Interaclion Handling
2.3 Raster Graphics Feature10
2.4 LimitalKlIlS of SRGP
2 .5 Summary
Exerrises
CHAPTER 3
. . . . . . . . . . . . . . . . . . . - .
- . . . . . . . . . . . . . . . . . .
BASIC RASTER GRAPHICS ALGORITHMS
FOR DRAWING 2D PAIMnlVES
3 .1
3.2
3.3
3.'
3.5
3 .
3 .7
3 .'
3.9
3. 10
3. I I
3 .1 2
Overview . . . . . . . . . .
Scan Converting Lines
Scan Converting Circles
Scan Ellipses
Filling Rectangles
Filling Polygons
Filling Ell ipse Arcs
Pattern Fill ing . . . . .
Thick Primiti'o'es . . . . . .
Line St}1e and Pen St}1e .
Clipping in a Raster \\4)rld
Clipping Lines
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . - . . . . . . . . . . . . . . . . . - . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . - . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . .
xv
1
2
3
4
6
,
17
2\
22
25
26
40
5 2
'"
63
64
67
67
72
81
"
91
92
99
100
\ 04
109
11 0
III
xvi Contents
Clipping Circles and
Clipping Polygons ..
Generating Characters
SRGP _copy Pixel
Antialiasing ..
. . . . . . . . . . . . . . . . .
. . . . . . . . . . .
3. 13
3. 14
3. 15
3. 16
3. 17
3. 18 Summary . . . . . . . . . .
E)(crcises
CHAPTER 4
GRAPHICS HARDWARE
Hardoopy Tcdtnologics
Display Technologies
RaSlcr...scan DlspJay Systems
The Video Controller ... . .... .
Random-Scan Display Processor
4 . 1
4.2
' .3
4.4
4. '
4.6
4 .7
Input Devices for Operator Interaction
Image ScanneJS
. . . . . . . . . . . . . . . . . . . . . .
E;\:ercises ... .... . . ........ . . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 5
GEOMETRICAL TRANSFORMATIONS
5. 1
5 .2
5. 3
5A
' .5
' .6
'.7
5.8
20 Tnmsformatrom
Homogeneous Coordinates and Matrix Representation 0(
20 Transformations . . . . . . . . . . . . . . . . .
Compo&iti on of 2D Tramfonnalions
The Window-to- Viewport Transformation
Efficiency . . . .. . . . . . . ...... . .
Matrill Representation of 3D Transformations
Composi ltoo of 3D Transformations . . . . . .
Transformations as a Change in Coordi nate System
Exercises . .. . . . ... ... .. . ..... . .. .. .
CHAPTER 6
VIEWING IN 3D
. . . . . . . . . . . .
Specifying an Arbitrary 3D View
Exampl e:; of 3D Viewing . ... . . .
. . . . . . .
6. 1
6.2
6.3
6A
6. 5
6.6
The Mathematics of Planar Geometric Projections
Implementing Planar Geometric Projections
. . . . . . . . . . . .
Coordinate Systems ... . .
ExetCi:geS ... . . .. . . .... .. . . .... .
12'
12.
127
132
132
140
142
145
146
155
165
179
184
188
195
197
201
20 1
204
208
210
212
213
217
222
226
229
230
2.'7
242
253
258
279
281
Contents xviI
CHAPTEA. 7
OBJECT HIERARCHY AND SIMPLE PHIGS ISPHIGS) 285
Geometric Modeling . ... . .... .. ... . . . . .
Characlerislics of Relained-Mooc Graphic5 Packages
7. ,
7.2
7.3
7.4
7.5
7.6
7.7
7 .
7. 9
7. 10
7. I I
7. 12
7. 13
7. 14
7. 15
7. 16
Defi ning and Displaying SrruCIUres ... . . . . . .. . .. . .
286
293
295
304
308
315
318
321
324
318
332
'34
340
341
343
34'
346
Modeli ng Transformal ions ...... .... . . . . . . .. . . .
Werarchical Structure Net WOf"ks ..... . . . . . . . . . ..
Mo.trix CornposniOfJ in Dillplay Traversal .. . . . . .. .. .. .
Appearance-Attribute Handling in Hierarchy . . .. . . _ . . . ....
Saun Updating and Rendering Modes .... .... . .. . . . . .. .
SlruClure Nelwort.: Editing for Dynamic: Effects _ .... . . ... _ .
Inleraclion . . ....... . . ... . . . ... . . . .
Addilional Output Fi:atures . . . . . ... _ . . .. ...
Impl(;mentation il;MtC>; . . . . ... _ .
Optimiling Display of Hierarchical Modds . _ . . . . . _ . .
Limi tations of Hierarchical Modeling in PHIGS . . . .........
Altemati"e Forms of Hierarchical Modeling . . . ... . .
SummHl)'
.. . ... . .
CHAPTER 8
INPUT DEVICES. INTERACTION TECHNIQUES.
AND INTERACTION TASKS
. ,
' .2
'.3
Internclion Hardware
Basic InteNW;tion Tasks
Compnsite InteraClion Tash
.... . .. .
CHAP"fER 9
DIALOGUE DESIGN
. . . . . . . . .
. . . . . . . . . . . .
. ,
9.2
9.3
9.4
9.5
9.6
The Fonn and Content uf User-Computer Dialogues
User-Interface Slyies . .... . .. .. ........ .
Important Design CQnsiderations . . .... .
Modes aod Syn' :U ...... . . ... .
Visual Design .... . . . ...
The Design Methodology . .... . . .
Exerriscs . .. . . . .. .
CHAPTER 10
USER INTERFACE SOFTWARE
10. 1 Basic Interaction- Handling Models
10.2 Window-Management Sysrems
10.3 OulpUt Handling in Window Systems . . . . . - . . . . . . . . . . . .
347
349
358
38'
388
391
392
395
403
4 14
418
429
431
435
43.
43.
443
xviii Contents
10.4 Input Ha.ndling in Window Systems ...... . .. . .. .. . . . ...... 447
10.5 Interaction-Technique Tool kits . .... . _ . _ . _ _ _ _ . ... . . 451
10.6 User-Interlace Management Systems .. .. _ . ............ . 456
Exercises . . . . . .. . . . ........ . . ...... . _ . . . _ _ . . . . . . 468
CHAPTER 11
REPRESENTING CURVES AND SURFACES 471
II . I Polygon Meshes . . . . . . . .. .... . ... . . . . . . . _ . . .... . 473
11 .2 Paramelrk Cubic Curves .............. . . . ... . .. . ..... 478
11.3 Parametric Bicubic Surfaces ... .. . . .. .. .. .. ... . . ...... ... 516
11.4 Qu.adric Surfaces . . .... . .. . . . . ... _ . . . . . . . . . . . . . . . 528
11.5 Summary .... . ....... . .. . _ . . .. . . . . . . . . . . . . . . 529
Exercises .. . . ... .... .. . . . . . . . _ ... . . . . .. . . . . 530
CHAPTER 12
SOLID MODELING 533
12. 1 Representing Solids ..... ... . .. . . . . . . . . . .. .. . .. . .. 534
12. 2 Regularized Boolean Set Opentionli .......... . .. . .. . . .... 535
12.3 Primitive Instancing ...... . . ..... .. . . . . . . .... 539
12.4 Representations .... . .... . .... . . .... . _ ..... ... 5-40
12.5 Boundary Representations . .... .. .. .. . .. . _ . . .. . 542
12.6 SpatialPanittoning .... ... . .. . . . ... . . .. 548
12.7 Constructiw: Solid Geometry . . . ...... . . . ....... .... .. . 557
12. 8 Comparison of Reprcsent.tions ..... . _ . . . . . . . .... 558
12.9 User Interfaces for Solid Modding ........ . ... . .. . . . . .. .561
12. 10 Sumlnlll'Y ... . . ........... . . . . . . ... ........ . . 561
Exercises .... . . . . ..... .... ... . . . ... . . . ... . . 562
CHAPTER 13
ACHROMATIC AND COLORED UGHT 563
13. 1 Achromatic Light ........ . ... . . . . . .. . ..... . . . 563
13.2 Chromatic Color ..... .. .. . . ... ... . .. _ . .. ... . . .... 574
13. 3 Color Modcls for Raster Graphks .... .. _ _ . . . . .. . . . . . .. 584
13.4 Reproducing CoIOl" ........ . ..... . .. ... . .. .......... 599
13.5 Using Color in Computer Grapfl i ..... . _ ................ 601
13.6 Sumlllary .. _ . .. . ..... . .... . . .. . . _ . . .. . . .. . . . . ... 603
EACrcisc:s . ...... . .... ........ . . _ . .. . . . . .. . . 603
CHAPTER 14
THE QUI!!ST fOR VISUAL REALISM 605
14 .1 Why Rcal ism? .. . . . . ........... . . .. . ... .. . . .. . . . 606
14. 2 Fundamental Difficulties ........ .. . . . . . _ _ .. . .. . .. . .. 607
14. 3 Rendering Techniques for Line Drawings ... .... ...... . .... .. (XJ9
Contents xix
14.4
14. 5
14. 6
J 4 . 7
14.8
14.9
14. 10
14. I 1
Rendering " ecnniques for Shaded Images .. . . ..... . .. ... .
Improved Objeet Models ......... . . . . . ... .
Dynamics . . . . .. .. . . . . . . . . . .... ....... . . . ..
Stereopsis . . . .... . . .... . . . . , . .. . .... . ..
Improved Displays . . . . .... . . . ... . . ... . . . .... .
Interacting with Our Other Senses .. . .. ...... . . ... . .. . .. .
Aliasing and Antialiasing . . . . . . ... . . . .
Summary _ . . . . . .. . ....... .
Exercises ... . ... .. . ... _ . . .. .. ..
CHAPTER 15
VISIBLESURFACE DETERMINATION
15. 1
15. 2
15 .3
15. 4
15.5
15.6
15.7
15.8
15.9
15. 10
15 . I I
Functions of'I'v.u Variables ........ . . . . . . . ... . .... _
Techniques for Efficient VisibleSurface Algorithms . . . . . ......
AJgorithms for Visible-Line Determi nat ion . . . .... . . .... . . . .
The zButrer Algorithm ...... . . . . . . .... _ . . . .. . .. .
List-Priority Algorithms . . . . . . . . . . . . . ..... .
s..:an-Unc Algorithms ... . .. . . . . . _ .
Area-Subdivision Algorithms . . . . . . . . . .. . . .. _ . . . .
AJgorithms for <:>ctrees .. . .. .. . . .. . ..
Algorithms for Curved Surfaces ... ... . . .. ......
Visible-Surface Ray Tracing ... _ . . . ... _ . ....... . ..
Surnmary . . . ........ . . . . _ .. . .
Exen:ises ... . . . ..... . .. .... .. .. ........ _ . . .
CHAPTER 16
6)2
615
615
6)6
617
617
617
646
641
649
Ii"
656
665
668
672
680
686
&;,
698
10)
115
118
.LLUMINATION AND SHADtNG 721
16. 1
16. 2
16. 3
16.4
16.5
16.6
16.7
16.8
16 .9
16. 10
16. II
16. 12
16. 13
16. 14
16. 15
Illumination Models .. ...
Shading Models for Polygons . . . . . . . . . . . . . . . . . . . . . . . .
Surface Detail .. ..... .
Shadows ........... . . . . . . . . . . . . . . . . . . . . . . . . . . .
~
. . . . . . . . . . . . . . . . . . . . . . . . . .
Interobjcct Reflect ions ..... . ...... .. . . .... . .. ....
Physically Based Illumination Modds ... . _ .. . .. . . ....
Extended Light Soun:c:s ....... ........ ... . ... ....
Spoctn1l Sampling . .............. . . .. .. .. . . . ..
Improving (he Camern Modd ...... ... .. . .. .. ...
Global Illumination Algorithms .. . .. .. . . . . ... ...
Recursive Ray Tracing .. . ..... .. . . . . . . . . . .
Radiosity Methods ......... ... .. ..... . .. .
The Rendering Pipe.line ..... . . .. .. .. ... . .. .. . . . .
Summary . . _ . .. . ... .
Exercises ... .... . . . . . . . . . . . . - . . . . . . . . . . . . . . . . .
722
134
14)
145
154
158
160
m
113
114
115
11.
793
'0<5
813
8J3
xx Contents
CHAPTER 17
IMAGE MANIPULATION AND STORAGE
What an Image?
Filtering
Image Processi ng
17. ]
17.2
17 .3
17 .4
17.5
17.6
17.7
J 7.8
17.9
Geometric Transfonnatioos of Images . . . . . . . . . . . . . . . . . . . . .
815
81.
811
820
820
828
835
843
850
851
851
Multipass . . . . . . . . . . . . . . . . . . . . . . . . .
Image Co mposi ting . . . . . . . .
Mechanisms for Image Stot"age
Special Effects with Images
Summary
Exerci ses
CHAPTER 18
ADVANCED RASTER GRAPHICS ARCHITECTURE
18 .1
18 .2
18 .3
18.4
18.5
18.6
UI. ?
18.8
18.9
18 . 10
18. I I
18 .1 2
Simple Raster-Display System
Display-PT()(.'O.<;S01" Systems
S tandard Graphics Pipeline
Introduction to Multiprocessing .
Pipeline Front-End Architectures
. . . . . . . . . . . . . . . . . .
Parall cl Front-End Architectures
Muhiprocessor Rastt:rization Architectures
Image-Parallel RasterizatiOfl
ObjectParall el RasterjzatiO!
HybridParallel
Enhanced Display Capabilit ies
Sum mllr y
Exercises .. .. . . . .
CHAPTER 19
ADVANCED GEOMETRIC AND RASTER ALGORITHMS
J 9. I
19.2
19.3
19.4
19.5
19.6
19. 7
19.8
19. 9
19 .1 0
Clipping. . . . . . . . . .
Scan-Converting Primitives
Anlialiasing . . .
. . . . . . . . . . .
The Special Problems of Text
Filling Algot"ith.ms . . . . . . ... . . . . .
Making copyPixel Fast . . .. . . . . . . . .. . . . .
The Shape Data Structure and Shape Algebrs. . . . . ..
Managing with bitSlt . . . . . . . . . .
Pugc- Dcscrip tio n Languages . . . . .... . . . . . . .. .
S ummary . . . . . . . . . . . . . . . .
Exercises
85S
"'6
861
866
873
877
880
882
.. 7
...,
9()2
9()7
920
920
923
924
945
965
976
979
986
992
996
998
. . 1006
. . 1006
Contents xxi
CHAPTER 20
ADVANCED MODELING TECHNIQUES 1011
W . I
20. 2
20. 3
20.4
20.'
20.6
20.7
20.1i
W .9
20. 10
EXlensions of Previous Techniques
. . . . . . . . . . . . . 1012
Prucedur.!.l ... . . .
Fractal Models . . . . .. .. .
. . . . . . . . . . . . . . . . . . . 10 18
. . . . . . . . . . . . . 1020
Grammar-Based Models . 1027
Particle Systems .... . . . . . . . . . . 1031
Volume Rendering . . ... .. . . ...... ... . . . . . . . . . . . . 1034
Physically Based Modeling . . . . . .. ... .
Special Model s for Natural and Synlhelie Objecl'i
AUlomaling Object Placement ...... . . . . .
Summary .... _ .... . .
Exercises ... . ... . . ... .. . . . . . . . .
. . . . . . . . . . 1 039
. . . . . . . . . . . 1043
. . . . . . . . . . . . 1050
. . . . . . 10.54
. . . . . . . . . . . . . . 10.54
CHAPTER 21
ANIMATION 1057
21.1
21.2
21. 3
21.4
2L5
21:6
Conventional and Compuler. Assisted Animation
Animation Langu:lges . _ .. , . . ........ . .
Methods uf Cuntrolfing Animation ..... . ..
Basic of Animalion . .... . .. .. ..
Probiems Peculiar to Animat ion
Summary . . . ..
E"ercises
. . . . . . . . . . . . . . . . . . . . . . .
APPENDIX: MATHEMATICS FOR COMPUTER GRAPHICS
. J058
. 1065
. 1070
. 1017
. 1078
. lOBO
. 1080
1083
A. I Vector Spaces and Affine Spaces ........ . ... . . ..... . . . 1083
A. 2 Some Standard Constructions in VectOf Spaces ...... . .. .. .. 1091
A .3 Dot Producls and Di stances . . .. ......... ..... . ... .... . 1094
A.4 Mau-iccs .......... .. . ... . . . . . . . . .. . ... . . .. . 1103
A.S Linear and Affine Transfonnations .. , . ...... . . . ... . . . .. 11 06
A.6 Eigenvalues and Eigenvector'S . ...... . . . . . ...... . ... . . IIOS
A. 7 Newlon-Raphson ileration for Root Finding .. .. . . . . . . . . , .. 1109
Exercis.!S . . . . . . . . . . . . . . . . . . .. . . . . . . .. . . . . . . . 1111
BIBLIOGRAPHY
1113
INDEX
1 153
1
Introduction
Computer graphics started with the display of data on hardcopy plotters and calhcxle ray
tube (CRT) screens soon after the introduction of computers themselves. It has grown to
include the creation, storage, and manipulation of models and images of objects. These:
models come from a diverse and expanding set of fieJds, and include physical . mathemati-
cal, engineering. architectural, and even conceptual (abstract) structures, natural phenome-
na, and so on. Computer graphics today is largely inleractiw: The user controls the
contents, structure. and appearance of objects and of their displayed images by using input
devices, such as a keyboard. mouse, or touch-sensitive panel on the screen. Because of the
relationship betv.een the input devices and the display, the handling of such devices is
included in study of computes" graphics.
Until the early 1980s, computer grdphics was a small , specialized field. largely because
the hardware was expensive and graphics-based applicatiOll programs that were easy to use
and cost-effective were fe'IN. Then. personal computers with buill-in raster graphics
displays---such as tile Xerox Star and, later, tne e<.oen less expensive Apple
Macintosh and the IBM PC and its c1ones---popularized the use of hirmap graphics for
user-computer interaction. A bitmap is a ones and zeros Icpiesentation of Ihe rectangular
amty of points (piMls or pels, short for "picture efemenls") on the screen. Once bitmap
grapflics became affordable, an explosion of easy-to-use and inexpensi"'C graphics-based
applications soon followed. Ciraphicllo_bMC'".d \JOIIer intrrfac.e millions of new users 10
control simple, Jow-cost application programs, such as spreadsheets, word processors, and
drawing programs.
The concept of a "desktop" nO'W became a popular metaphor for organizing screen
space. By means of a windmt.. tlWlUlger, the user could create, position, and resize
,
2 Introduction
reClaOiutar .screen areas. called windows. mat !iCled as vinual gl"3phics terminals. eadl
runni ng ao application. This allowed users to switch among multiple acrivities just by
pointi ng atttle desired window. typically with the mouse. Like pieces of papeT o n a messy
desk. could overlap arbi trarily. Also part of this desktop metaphor .... -ere displays
of icons that oat j us t data files and application programs, but also common
office objects. such as file cabinets, mailboxes, printers, and trashcans, thai pcrfonned the
computef--<lperalion equivalents of tht'ir real -li fe coumerpartS. Dirt manipulation of
objects via " poin,ing and diddng" replaced much of ,he ' ypi ng of the arcane: commands
used in earlier Optrdting systems Ind computer applications. Thus. users could select icons
to activate the cor responding programs or objects. or selen huttons on pul l-down or pop-up
screen menus 10 makt! choices. Today, almost all interactive application programs. even
tl'tose for manipulati ng tcU (e .g .. 'M>rd pnx:essors) or nunJerical data (t:.g .. spreadsheel
programs), use graphics extensively in the user imerface and for visualizing and
manipulating the application-specific obje(:ts. Graphical interaction via raster displays
(displays using bi ' maps) has replaced most teJI:tuaJ interaction with alphanumeric lenninaL<; .
Even people who do not use computers in their daily work encounter computer
graphics in televi sion commercials and as cinemat ic spcdal effects. Computcr graphics is
no longer a rarity. It is an integral part of all computer user interfa:S, and is indispensable
for visual izing IWI.)o-dimensionai (20 ), three-dimell5ional (3D), and higher-dimen.s>Onal
ob;ects: Ateali diverse as education, science, engineering. medicine, commerce, the
military. adverti sing, and entertainment all rdy on computer graphics. Learning hov.' to
program and u:r.e computers J>OW includes learning how to use simple 2D as a
maner of routi ne.
1,1 IMAGE PROCESSING AS PICTURE ANALYSIS
Computer ClKM;ell\S .he picmri al synthesis of reaJ 01' imagi nary from their
compu!C1"-based models, wherellS the related field of i'IWge prO:SJi'l8 (abo called piC:IIUt'
pf'C.lCeuing) treats the convasc process: the analysis of scenes , or reconstruction of
models of 2D or 3D objects from their pictures . PiclUre analysis is important in mall)'
aerial surveillance phocographs, slow-SC'.ln telev:isi()(J images of the moon nr of
planets gathered from space probe:.. tel evision im::lge!i taken from an industrial robot's
"eye." chromosome scans. X-11I)' images. computer;1.ed axial tomography (CAT) scans,
and fingerprint analysis all exploit image-processing technol ogy (see Color Plat e 1.1).
Image processi ng has the subareas ilfUlgt' ellh""cement . pultern tktection and recognition,
and scene analysis and computer Image enhancement deals with improving image
quali ty by eliminating noise (eJl traneous or missing pixel data) or by enhandng contrast .
PaUern detection and recognition deal with detecting and clarifying standard po.llcrns and
fi nding deviations (dis tortions) (rom these patteTnli . A particuhuly importanT eJtample ll.
optical chantcl er recognition (OCR) technology. which aJlows for the cc()(Jomical hulk
input of pages of typeset, typewrmen. or even handprinted characters. Scene analysis and
computer vision allQ\\l scientists to recognize and reconstruct a 3D model of a scene from
2D irn:lge5. An example is an industrial robot sensing thc relative !oizcs. shapc.-.
positions. and colors of paTt:l on a convoeyoc bell.
1.2
The Advant.g8s of Interactive Graphics
3
AllbouJh both compulCT ,graphi cs and imoge ptQCC$5i ng deal with compu.lee
of pictures . lhey have unt il recenlly been quite separate Now they
raster displays. the overlap bct'NCen the two is growmg. ItS IS parti cularly eVident In
two aJea.S. First, in interactive image processi ng. human input via menus and otller
graphical \ntenCUon tcchniquC& helps to control wrious subprocesses while lransfo.-ma-
ltons of continuous-tone images are shown 00 the screen in real time . For example ,
scanned-in photographs arc eicctronically lOuche<! up, cropped. and canbined with others
(even with synthetically generated images) before publication. Second. simple image.
pr'OCt:5Sing opentions are often used in computer graphics to help synthe!iize (he image of a
model . Cenain ways of transforming and combining synthet ic images depend lal1:c:ly on
image-proce$Sing opnattuns.
1.2 THE ADVANTAGES OF INTERACTlVE GRAPHICS
G11Iphics provides one of the most natural means of communicating wim a computer. since
our highly dcvdoped 20 and 3D paltem-l'C'JOO8nition abilities a11O'N us to perceive and
process pictorial data rapidly and efficiently. In many design, implementation, and
construction processes today, the infoonation piccurt:s can give is virtually indispensable .
Scientific visualization becKme an imponant field in the late 199Os. when scientists and
enjiDeCrS realized that they could DOt interpret the prodiBiow quantiTies of dara produced in
supercompulef'runs wilhoot summarizing the data and highlighting trc:Dds and phellOfllena
in various kinds of graphical representarions.
Crell(ing and reproducing pictures, presented technical problems that STood in
the w;ry of their widespread use. Thus , the ancient Chinese proverb ' a piclUre: is wonh len
thousand .. became a in our society only after the of and
simple technology fOf produci"l pictures--first the printing press. then photography.
IntenlC1rvc computer graphics is the most imponant means of prodocing pictures
the inventiOfl of pnolOgT.Rphy and television; il hjls the added advantage Ih:ll , wilh lhe
computer, we can make pictures n()( only of concrete, "real-world" objects but also of
abstract. syNhetic objeCtS, such as mathematkal surfaces in 40 (see ruor Plates LJ and
104), and of data that have no inherent geometry. such Il.<; survey results . Funhermore, we
are not confined to static images . static pictures are a good means uf
communicating infonnati on , dynami cally varying pictures are frequently even better-to
coin a phraK. a maving picture is YoQfth len lhousand static QflCS. This is especially true for
time-varyil18 phenomena, both real (e .g. , the deflection of an aircraft .... ing in supersonic
flighl, or the development of a human face from childhood through o.\d age) and abstract
(e. g., growth trends , such as IlUClear energy use in the United States or populati on
rnmoement from cit ies to s uburbs and back to the cities). Thus. a movie can show changes
over lime more graphicaJly than can a sequence of sl ides . Similarly, a sequenre of frames
displayed on a scrt:c:n at more than IS frames per second can convey smooth rfIO(ion or
changing form better than can a jerky sequence, wilh several seconds between individual
frames. n,e use of dynamics is especially effective when the user can control the animation
by adjusting the speed. lhe portion of the total scene in view. the amount or detail shown,
Ihe geometric relationship of the objects in the sne to OflC another. and so on. Much DC
4 Introduction
inleractivo: le(:hnology lherdon: contains hardware: and .!oOft'Wal'e for user
cootrol led fl'IO{ion dynami cs and update dynamics.
With fTUJlion dynamics, objects can be moved and tumbled with respect to a stationary
observer. The objects can also remain statKmary and the can move: around them. pan
to '!elect the portion in view. and zoom in or out fOI more or less delail, as though looking
through the viewfinder of a rapidly mO'iing video camera. In many cases . both the objects
and the camera are moving. A typal example is dle flight simulator (Coior Piales I.5a and
1.51, whi ch combines II mechanical platfomt supporting a mock cockpit with display
for windows. Computers conlrol platfonn mOlton, gauges. and the simulated
of Doth stationary and moving oojects throtlgh which the pilo( navigates. These
multimill ion-dollar systems trolin pi lOlS by IcUing the pilotsllUlneuYet a simulated craft over
a simulated 3D landscape And around simulated vehicles . Much simpler flisht si mulaton
are among the most popular game!; on personal computers and workstations. Amusemenl
parks abo offer "' motionsi mulator"' rides through simui;ued terrestrial and exlralern::strial
landscapes . Video arcade!i offer graphics-based dexterity games (see CoI Plate 1.6) and
racecar-driving simulators. video games exploiting mo(ion dynamics: The
can change speed and direct ion with the "gas pedal" and "steering wheel ," as tn::es,
buildings, and other cars go whi zzi ng by (5 CoJor Plate 1.7), Similarly, motion dynamics
lets the user Hy around and through buildings. molecuks. and 3D or 40 mathcmattcal
space. In anolhenype of motion dynamics . the "camera" is hekI fixed, and the objects in
t he scene are mO'lled relat iYC to it. For- example. a cornpJex mechanical linbge. such as the
link.age on a steam engine . can be animated by movingor I"OUlting all the pieces appropriatdy.
Vpdult'dyl1LU1ljcS is the actual change of the shape, color. or other properties of the
objects being vieo,o..oed. Rx- instance. a system can di splay the deformations of an airplane
structure in ft ight or the Slate changes in I bkrl diagram of a nuclear react in to
the operat's manipulation of gotphical representations of the many contrOl mechanisms .
l1le smoother the change. the more realistic and mellJlingful the result. Dynamic interactive
!1raphics offer.; a l.aqte number of II!:er-controliabJe modes wilh whim 10 encode and
communicate infonnation: (he 20 3D shape of objects. in a picture, their gray scale or
<."OIor . and tile: time variation. .. of these properties. With the recent development of digital
signal processi ng (DSP) and audio synthesis chips , audio feedback can now be provided to
augment the graphical feedbad. and 10 make the simulated environment evc:n more
realistic .
computer graphics tllus permiG extensive . high.blindwidlh UStt-<:omputcr
inu:raction. This significantly enhances our ability 10 understand data. to perceive trends,
and to visualize real or imaginary objects--indeed, to Create " vinual worlds" that \oW: can
explore from arbitrary points of view (see Color Plates I.IS and 1.16). By making
communication more efficient, graphtcs make; possmie higher-quality and mon: precise
results or prodUCG. greater productivity. and Jower and design cOsts .
' .3 REPRESENTATIVE USES OF COMPUTER GRAPHICS
Computer graphics is used today in many different areas of industry. business . govemment.
cducat iorr . elltettainmcnl . and. most recently. the home . The list of is
1.3

and ;s growing rapidly as computers with graphtcS capabililja become
commodity products . Let's look at a representative sample of these areas .
mUrfaca. As we menooned. most apphcations that run on personal computers
and 'AOf'kstalions, and even those thai run on temlinais attached to timeshared computers
and netYoOItt compute servers. !lave user interfaces tboat my on desklop win60w systems to
manage sjml.tltaneous activities. and on point-and-clidt facilities 10 allO'N users 10
select mcoo items, icons, and objects on the SCf'CM; typing is necessary only 10 inpulI.MI10
be stored and manipula1ed. "Mxd_ptOCess:ing. spreadsheet. 8M deo;:klop-publishing pro-
grams typical applications that take advantage of such userinterface techniques. The
authors of Ihis book used 5UCh prognuns 00 create both the text and the figures; then, the
publisher and meir COnttaclOf'S produced the book using similar rypc:setling and drawing
""'_.
plotting in sciel'JCl!. and udrn%gy. The /lCI(1 most common use
of a,raphicfl today is prob.ably to crute 20 W>d 3D gnpiu of malhcmatical, physio;:al , anU
eoofIOl1lic (unctions; hislOSrams, bar and pie charts; taSk_schedul ing charts: in'Yefltory and
prodUC1ion charts; and the like. AlIlhese are used 10 present meaningfully and concisdy the
trends and patterns gleaned from data, so as to clarify complex phenomena and to facilitate
infomxd decis;cm making.
Offiu OMIomoJion and 1!/tTOl'lic pJJJJi.Jhing. 1be use of gntphics for the creation and
dissc:minadon of information has increased enormously since the advent of desktop
publishing persona.I oomputers. Many organilJllions whose publications used to be
printed by OIJtsidc sptICialisfS call now produce printed materials inoouse. Office
tion and electronic publishing can produce both traditional printed (hardcopy) documents
and electronic (softcopy) documents that oontain Ittl, tables, graphs, and other forms of
drawn or scanned-in gnptJics. Hypermedia systCO\S thai: allow broYtIsina of networks of
Interlinked multimedia OOc:uments an: proliferating (see Color Plate 1.2).
Computer-aUkd cbrJ/ritrJ( and design. In design (CAn). interactive
graphiC5 is used to design components and S)'l'tem5 of mecbanicaJ, electrical . electrome-
chanical, al'd electronk devices, including stJ"uCt\Ua sud! as buildings, automobile bodies,
ai1"plane and ship huJls, very (VlSI) dtips , optical systems. and
telephone and computeT networks. Sometimes. the user merely wants 10 produce the Pfl'clse
drawings of componentS and assemblies, as fOl" online drafting or architectural blueprinlS.
Color Plate: 1.8 shows an example of such a 3D design program, intended fot nonprofession-
als: a "CU5tomiu)QUI own patio declc." program used in lumber yards. Mote frequenlly .
the emphasis is on interacting with a modd of the component or
system beinS designed in order to test, for example. its struclul":II.i, dcclrical. or thermal
properties. Often. the m<Xlcl is intefpreted by a simulator that feeds back the behaYior of lhe
system to the user fOl" funl1er inteJ1lClive design and ICSt C)'CJes . Afta" 'objects hIM; been
dcs.igncd. uti lity programs can the design database to make pans lists. 10
process "bills of materials, " to define numerical oontrol tapes for cutting or drilling partS,
and so on.
S;mll.kuiOll and alJimtJtion for scif!lIlijic visu.aJ.izario1t and f! nurrainmf!nt . Computer-
prodlJC'ed om;IIUlled movies and dUplays of the behavior of real "" sirnullllcd
8 In; tion
c'lmc, the representation of (he chip's geomety pmdUCc OlItpm hn<1 he riCfur
itself. In ft. the geometry shown on me bmay cotain i detail than the ulterlying
databas.
A fnal cateorization aises from t logical and tmporal relatiOip b_cn ubjc
af their pictures. The usemay deal, for eamplc, with only one picture at a time (typiLl
in plo tting). with a time-varying sequence of related pictures (I in motion or update
dynamics). \ wi l h a stuctured Lolk+tion of objts (a in many CAD applications that
contain hiearhic of M bl) and subs bly drawings).
1.6 DEVELOPMENT OF HARDWARE AND SOFTWARE FOR
COMPUTER GRAPH'CS
Tis bocncenlfates on f undamental priniple .nd techique that w derived in the
past ad Sill =pplicable toay-and Jlnrally wi ll b aplicable i t future. In this
setio, take a brief lok at tn nic development of ''O put gaphics, to plac
toa's tems in cotet. Fller treamlCts of th intesling evlution of this feld are
presented in (PRIN71], [MACH78J. [CHAS81 J. and [CCM84j. It is easier 10 chnicle
The evolmion of hardwar than 1 doument that of softwarc, since hardware evolution has
had a tc infuence on ho lhe fcd devlop. Thu, bin with hardware.
C ploting o hardcopy devic such as telelYs and line pme dates {r t
early das of LopUling. " Whirlwind Compute dvelo in 19 a t Mas u
In;tilUt o Tohnutogy (MIT) had wmpte-driven CRT displays for output, bt h for
oprator use nd for cameras prucing hrudcopy. 1 SAE air-dcs system devlope
in the mKfdle 195s was the frst to usc coman an contrl CRT displa consol es on
which OpralfS idenlifed targetS with light pens (hlIld-hed pointing device that sens
light eite hy objets on the Srtn). T bginnings o t interactiv graphics,
. U fund in Ivan Sutherlan's seminal dotor 'k on th Skethpd drawing
'tem [SU63). He intduced dD stuc'u for stoing symbl hieladli wih up via
esy rli cation of Standard components. a tecniquc akin to the u. of pslic templates for
drawing circuit symbols. H also develope mleccion tochniques that used Ihe keyboard
a light pn for making choices, pointing, and drawing, and fOCratd m@ny O
funamental ideas and tehniques still in us toay. Ie, man of the feature
iDlrouc in Sketchpa fnd in the PHIGS grlphics paage disus in Cnaptcr 7.
At the same t ime, iT bcoming ce to computer, automobile. and acropace
manufacturers that CAD and computer-aided manufturing (CAM) activitie had cnor
mous pottntial for automating drafting and other d1wing-intensive acti .. itie. The General
Motors PAC sySlem [JACK6) for automobile design, and the Ite Digitek system
(CHASKI j fr len dign, pionering etr(ts that sod the utilit)' of graphical
interation in t iterli\c dign cycle cm i cnering. By the mid-sillies. a
numbr of rearch projets and commerdal proucts had appeare.
Sine at tai timc computer inpuloutput (10) was done primarily in batch modt usin.
punched cad, hops *I high fnf; breakthrough in interactive user-computcr communi
cation. Imerdtfv graphics. as "the wiooow on the compute." wa lO be W interal pt
of vastly accclCted intetiv ign cylt:. Th rt er nOl nerly s draac,
1.'
hc/'W'eYer .... inr:c mlc...crive graphics remained bl;:yund the n:::;uun.:g; vf 1Il1 u..l the mOM
technology intensive organization!>. Among the reasons fOf Ihis v.c'e lhoe:
The high cO.n of me graphics hard .... 'are, when produced without benefit of economies
of a time when automobi les eO$I a few thousand dollars. computers cost several
milli ons of uullars, and the first commercial oomputa displays cost more than a hundred
dollars
The o.eed for targe-scaie. expensive computin..t rtsourr:es to suppon massive design
datOibiiscs . interaclive picture manipulal iOil. and the Iypically large suile of postproceSSing
programs input came from the graphics-design phase
10Ie dijJic"lly oj wriling large. i flleroctive programs for the fle'oOo' timeshari ng environ-
ment at it lime wnen both graphics and inlCr;Krion were new 10 predominantly batch-
oriented FORTRAN programmers
n<H1porwbf .. t ypically writte n for:a particular manuf:lClUrer' 5
display device and produced wiloom Ihe bene!h of modem software-engineering principles
for building modular, structured systems: when software j l> nOJlportable, moving 10 new
display devices necessitat.!s expellSi ve and l imc:--c(lnsuming rewril ing of W(JI'king programs .
II was t!'le advent of graphks-based penonal computers . such the Applt: Macintosh
ami the IBM PC, that finally drove down the CO'>ts of both hardware and software so
dramalically Ina, millions of grnphi cs computers wo-e sold it.'> 'lI.pplianl.:-es' for office and
home: .... hen the field started in the euly sixl ies, iu prnclil iollers never dreamed that
peno nal COlllpUU:r.. featuri ng !p"illphk,d inu:nK:lion \TIOUld become so o.'Ommon so soon.
1 . 5 . 1 Output TechnCJk)gy
The .l i"l>IH}, devkes developed in the mid silltie$ and in common use until tm
:lie called l 'l!ctO'. srroice, line dro""'lng , Of callw,aphir displays. The: term l ':t or is used as a
synonym for line here; a slroke is a l>hort line, and eharact<:n an:: mad(: of $CQuences of such
strokeS. We 6hall look briefly at veCtor-sYStem because many modern raster
graphiCS sysu: rno; use similar lethniques , A typical vector system consists of a display
processor connected an liD peripheral to the central processing W1i t (CPU), a display
buffer memo!)" and a CRT. The buffer stores the computer-produced display Ii.fl or display
program: it contains poinl- and line- plocling commands with (x. y) or (x , y , =) endpoint
coordinates. as well as character-plotting commands, Figure 1. 1 shows a typical vector
architectore; the display 1h,1 in memory is shown as a symbolic representation 0( the output
commands and their ( .... y) or charHcter values.
The commands for plotting points. lines , and challlCten are interpreced by the display
processor. It sends digi tal and point coordinates to a l'ector that convertS the
digital coordinate values to analog \Qltagcs for beam-deflection circuits that displace an
eieclron beam writ ing on the CRrs phosphor COAti ng (the details are given in Cnapl:er 4).
The essence of a vector system is thai the beam is deflected from eudpoi nllo endpoint, as
di ctated by tbe arbitrary order of (he display commands; this technique is called randam
sam. (Laser shows also use randomscatl dettection of the laser beam.) Since the light
output of Ihe phospho!-" decays in lens or at most hundreds of microseconds, the display
10 Intl"OducUon
.... -,
. I
""""
,.
..
UNO
...,
,..
CHAR
Co
t..il.
I
I
I
I
I
I
I
I
I
Refresh bull ..
lr'llef'face with hosI computer
I +
(DIsplay commands)
t I
De, t i ad! 'I (fX<)
Fig. ' . 1 Architecture of a vector displaV.
processor must c ycle through the display list to refresh the phosphor at k:ast )0 times per
second (30 til) to !{Void fl icker; hence. the buffer holding the display list is called a
nfrrsh buJ/rr. Not e Ihat . in Fig. 1.1. the jump imlruction loops back to lhe top of the
disptay list 10 provide the cydic refresh .
In the Si lllics, buffe r mClllOf)' and processors fast enough to refresh al (al least) 30 Hz
c)I;pensi'I.<C , and only n few thousand lines coul d be shown without notk:eable: flicker .
Then. in the: late sixties. the direct-view storage: tube (OVST) obviated bt.Jth the buffer and
the refresh proces!'., and e:lilninated all fl icker. This was the vital step in making interact ive
graphics affordabJe. A OVST stores an image by wriling that image once: with a relatively
slow-moving electron beam on a storage mesh in v.bich the phosphor is embedded. The
small, self-sufficient DVST tenninaf an order of magnitude less expensiYC than was the
typical refresh funher'. it was ideal for a Jaw-speed (3()()' toJ200-baud) telephone
interface to time.shaTing systems. DVST tenninals introduced many lISe1$ and prognun.
mers to interactive graphics.
Another major harclware advance of the lale sixties was. attaching the display to a
minicomputer. with this configuration. the cemral lime-l;luicing compUIc:r was relieved of
the heavy demands of refreshed display especially user-interaction handling, and
updating the: image on the screen. TIle typicall y ran applicatton programs as
1.'
of Hardware and Software for Computer Graphica 11
well. and could In turn be connlecI 10 the larger centra! mainframe 10 om large analYSIS
progl1lmS. Both minicomputer- and DVST configurations led 10 installations of thousands of
graphics sr--'cms. Also at Ihis lime, the hardware of the display itself was
becoming more sophisticated, laking OYCI" many routine but time-con'Wming jobs from the
graphics sorlwarc . Foremost .. mong !'oUch Ocvlces was the invcntiOfl in 1968 of refresh
display hardware tor geometric transformations thai could scale . f()(ale, and translate points
and Jines on the scn:en in realtime , could perform 2D and 3D cl ipping, and could produce
paralle! and penpeclivc project ions ( sa: Chapter 6).
The dC'odopment in the early seventies of inexpensiw:: raster graphiC!>, based Of!
tclevision technology. contributed more 10 the growth of the fidd than did any ocher
technology. ROSier displays 51Ofc: the display primiriws (such as line!!, cfJanlcters, and
solidly shaded or paucrncd in a refresh buffer in tCfTrlli of their component pixels, as
shown in Fig. 1.2 . In some rJ.ster dis plays. there is a hardware display controller that
receives and interprel$ .o;cquenceso( output commands si milar to those of the vccu:,..
( as shown in t he figure) : in si mpler. mon: common systems . such as those in personal
computers . the display controller exists only as a softwan: component of the graphics
library package, and the refmlt buft'er is just a P}ece of the CPU's memory thftt can be read
oot by the image display (often called the video cOnlroller) that produces the:
acrual image on the >;creen.
The complete image on a ruter display is formed from the rasrt!T, which is a sel of
horiumtai nult!T Jint!S, each a rOW of irxiividual pixds: the raster is thus stored as a mam!!;
of pixels reprr.senling the entire screen area. The entire image is scanned out sequentially by

AelrMh buffer
Fig. 1 .2 .A.rchilectlffe of a rter displa ... .
12 Introduction
The video controll er, 011e ra!'ter line at a time. from top to oo!(om and then hack to The lOp
(liS shQWll in Fig. 1.3). At each pi lle!' the: beam' inte nsity is set to reflect the pixel's
intensity; in color systems, three beams are conlro!led---one each for the red, green, and
blue primal) by the three color components of each pixel's value (S
Chapters 4 and 13). Figure 1.4 The d itfe:n:oce bel .... '!,!en random and rasler S(;an [or
db'playi ng a simpl e 20 line drawing of iI huuJ;C (part a), In part (b) , the vectOf' arcs are
notated wilh arrowheads :,oClwin,s tOe random deflection of lhe bem. [)oul!d li nes denote
deflection of the beam, which is nnt turncd on ( ' 'blanked' ' ), so Ihal J)<) WlCtor i:. drawn. Part
(e) YlOWS the unfill ed rendered by reclangl es, and arcs, whereas pari hI)
shows a tilled versi on . Note the jagged appearance of the lines and arcs in the r<lStcr scan
ima!;c:o; of parts (c) and (d); we shall that vi:rual ilrlifaci Short ly.
In the carly days of rUSler graphic:., T<;frc:;hing dOlle al to;;levj"it)(l rules o f 30 Hz;
loday, I16().. Hz or higher refresh rale is used 10 aVOid flic keri ng of the image::. Whereas in a
veCtor system t he: refresh buffer stored op-codes and endpoi nt coordinale val ues, in a raster
sysrem t he:: entire image of, say, 1024 line:. of 1024 pixeh each, IT'IUST be stored aplicitly,
The tcnn bitmap is .'iti J1 in common lJ."-C to descr ibe bot h the refresh bufler and the arr.ty oi
pixel val ues Ihat map one for one to pixel.-; on Ihe screen. Bitmap graphics has the <!dV',mtage
over \/OClor graphic!. thil t Ihe aClUal display of Ihc image handled by inexpen.'iI Ve scan-out
logic: The regular , scan far arxl lcss expensive lu implement than is
the random scan of vecTOr l"yMems, whose veCtor generators must he highly accUrd,le 10
provide:: linearity and h::pcaUi bil ily of the beam'" deflet: lion.
The avaibbi ht y of inc)(pensive wl id-state random-accc::ss memory (RAM) for bitmaps
in the early >e\>entics wa$ the breakthrough needed to make raster graphics the: dominant
hardware tcchnology , Bllcvel (also called m<mochrome) draw images in black and
v.'hite or bJad.. and grccn; some plas ma panels use orang.: and black. Bilevcl bitmaps contain
a single bi t per pi xel. and the entire bi tmap for a screen with a R'soJulion of 1024 by 1024
piKds is only 2
20
bits, t)C ahout 128,000 byles. Low-end color sy.'items have 8 bits per piM:l .
:dlo)Wing 256 simul(.;l. neow; Jy: mOre t'llpen.o;ive systems MY</: 24 bits per p.x<: I,
Honzontal ral1ace
'"'to"'"
. . :;;::::.
I '",, ___ ---- ,...c..
------
.. - --
-r-C=-
" -----
_ .... ----
_lo. ... ----
--""
Fig, 1 .3 Raster Kan.
,
, .5 Development of H.n:tware and Softwant for Computer Graphics

'"
o
(a) IdeaI l joe dTawing
.:(
.. -.....

_.. --
i:; 1 ,
o

(e) Raster scan WIth outline pnmrtoves
,
,
,
,
(b) Vector scan
(d) Raster scan li'lfith filled primitives
'3
Fig. 1.4 Random scan versus raster scan. We symbolize the screen as a rounded
rer-tangle filled with a light gray shada that denotes tt>e white background; the imag" is
drawn in black on this background.
allowing a choice of any of 16 million colors; and refresh buffers with 32 bits per pixel . and
screen resolut ion of 1280 by 1024 pixels are available even on personal computers . Of the
32 bit.<;, 24 bits arc devoted to represeming color, and 8 to control purposes , as in
Chapter 4. Beyond Ihat , buffe rs with 96 bits per pixel ' are ;wailable at 1280 by
1024 resolution on the high-end systems discussed in Chapler 18. A typical 1280 by 1024
cotor system with 24 bits per pixel requires 3. 75 MB of RAM-inexpensive by today ' s
standards. The term bitmap. strictly speaking, applies only to I-bitper-pixel bilevcl
systems; fOT multiph::-bil-per-pixel systems, we use the more genernJ term pumap (short for
pixel map) . Since pumap in common parlance refe", both to the contentli of the refresh
' Of 96 be.., typically 64 bi ... are used for two 3:lblt colorandcontrol buffers to 3.llow
timJJl,bujfmng of two images: while one image is being refreshed, the second one is being updated.
The remaining 32bit buffer is used to implement a DarowaR technique called z-bllffering , used 10 do
vis.iblesl>rface detenninalion for creating realistic 3D images (sec Chapters 14 and 15).
14 IntrOduction
lind 10 the buffer memory irsc: lf, "'"e use the lerm frame bUJlf!f when we mean the
ac1ual buff"r mt:'mory.
The m;;,jor advantages of ras1er graphics over vector gl"llphil;S include lower cost and the
ability to display arr:as fill ed with :<;olid cnloTS or an especially ,.ich means of
communicating informatioo that is C5'iCntial for realistk images of 3D objects. Further-
more , the refresh process is independent of the (number of polygons . etc.) of
the image. si nce the hardW"dre is enQUgh that each pixel in the buffer ca n be fCad ovt on
each refre$h cyde. Most people do nol pel"l:"eive flicker on screens refre.med abovt:: 70 Hz. In
comrast, vector displays nicker when the numbe" of in the buffer becomes too
huge; typically a maximum of a few hundre-d thousand short vecton. may be
flkker free.
The majoc disadvantage of coolJarcd to vector systems arises from the
discrete nalun: of the pille! rcpresenl3lion. First, primitives sud1 as lines and polygons are
specified in tenru. of their endpoints (vertices) and must be . ..can-<'<"Inw.rted into their
component pixel s in the frdrnc buffer . The tenn derives from the notion that the
programmer speci fi es endpoint or vertex in random-scan mode. and
information must be reduced by the system to piJrels for raster-sean-mode display. Sean
conversion IS commonly done with soft wan: in pefliiOnal computers and work-
Mal ions. where the microproxessor CPU responsible flK all graphics. For higher
performance , scan L'Onversion can be done by spo,:ial-purpose hardware . includ ing fasUr
image procnsor (RIP) chips used as coprocessors 01" accelerators.
Because e<w;h primitive must be scanconvened. real-time d)'llamic,; is far more
computat)onally demanding on raster sy"tems t han on vector systerm. Fir.;!. transformil18.
1000 lines 00 a veclOT system can mean 1r.:lOs forming 2000 endpoinls in the wor.>t In
the flC( t refresh c)'Cle. t he v=torgc:nerator hardware aUlOmatically redlTNS the transformed
li nes in their new flOl' itions. In a rasler system. however, not only must the endpoints be
transformed ( using hardware transformation units ident ical to Ihose used by vectOf
sy""cm:s) , but abo each transformed P'fimitive mUM lltell be Wiing its new
endpoinls, whi ch define its new sile and None of the of Ihe frame buffer
can be salvaged. When the CPU responsible for both e ndpoint trnnsfonnation and scan
conw.rsion, only a small number of primitives can be transf()("rned in real time.
Tr:msformalion and scan-.conversiUfl hardW"dre is thus needed for dynamics in raster
as 1I result of st eady In VLSI, rhal ha.<; become feasible even in low-end
s)'$lems.
The sortd dmwback of raster arises rrom the nature of the raster itselr.
Whereas 3 \"eC[(){" system 010 draw a cont inuous. )mooth line (and .:Yen some mtooth
curves) from essentially any point on 1he CRT face to any other, the raSler can
display mathematically smoo<h lines. polygons. and of curved primit ives such
as circle:; and ellipses only by approximating lhem wi th pixels on the raster grid. This can
cause the ramiliar problem or "iaggies" or as shown in Fig. 1.4 (c) and
{d) . Thi s vlsUlIi artifact is a manitestalion of a sampling error called aliasinf? in
signal-proces.<;ing theory; such occur when a function of a continuous variable (hat
sharp changes in intensit y is appnn,imated with discrete samplts. Bot h theory and
practic.:: ill mooern computer graphics an:: concerned with techniques for antlaliasing on
1.5
Deveklpment of H..-dware and Softwat'e for Computer Graphics
15
ur ,",..,Ior ;)Y:)icuz:;. Thc::.e g.ntdltliv .. :., iu jllt.:: .. :si!y of m:ighlJoriug
pixels 3t edges of pri mitives. rather than setting pbds 10 maximum or zero intensi ty only;
see Chapters 3, 14. and 19 for further discU5Sion of Ihis important topic .
, . 5 .2 Input TechnolosiY
Input technology has OIlso improved grcady over the years. 1lte clumsy, fragile: light pen of
sySlerns has been rep/actd by the ubiquitous mouse ( first by office-
Itutomation p ioneer Doug Engclban: in the- mid -sixties [ENGE68I) . the data table!, and the
transparent. louch sensitive panel moumed on the screen. Even fancier input devices that
supply not just (x, y) IOCaIKln ... on the screen, but also 3D aOO even higner-dimensional input
values (degrees of freedom), are becoming common, as di scussed in Chapter 8. Audio
communication also has exci li flj! poIcnl ial , since il allows bands-free: input and natural
output of simple instrocti ons. and so on. With the standard input devices. the
user can specify operations or pi CI\l1'e componcnl$ by typi ng or- drawi ng new inrunnaliun or
by pointing to e;o;isting informatioo on t he screen. These internetions require no knowledge
of programming and only a linle uyboard use: 'The user makes choices simpty by selecting
menu buttons or icons, answers questions by checking options or typing a few characters in
a foon, places copies of symbols on the screen, draws by indicatiflg consecutive
endpoinlS to be connected by suaighl lino or interpolated by smoOlh paints by
moYing the cursor over the screen. and fill s closed areas bounded by polygons or paint
contours with shades of gray, colon: . Of' vartous panerns.
, . 6 .3 Software Portability and Graphics Standards
Steady advances in hardware technology hiIYC thus made possible the! evolution of graphics
displays from one-of-a-kind special output device.<:. to t he standard human interface to 100
computer. We may well 'oW;)nder whether software has kept For C[3ffiple. to what
CIIlenT luIyc early difficulties with oYerly complex, cumbersome, tand expcrn.i...: grllphi cs
systems and software been resolved? Many of these: difficulties arose from the
primitive thaI was available, and In general there has been a long. slow
process of marur81ioJl in such soflware. We have mCM:d from low-level. devir:e-dl!peNil!nt
packages supplied by manui'oclUTen for thei r particular display devtct:$ to nigher-level .
packages. 1'ho.e packages can driYC a wide vari ety of display devices.
(rom laser pi' inlers and plouers to fi lm recorders lind high-performance real-time displays,
Tbe mai n purpose of using a device- independent package in conjunction with a nigh-level
programming language is to promote application-program ponabilir),. This portability is
provided in mudt lhe same way as a high-level , machine-independent language (such as
FORTRAN. PucaJ. or C) provides ponability: by isolating the programmer from most
machine peculiarities and providing language features readily implemoJted on a broad
range ofproccssors . Progrnmmer ponabi lity" is also enhanced in that programmers can
now rnoYe from system to system, or even from installalion to installation, and find familiar
software.
A generul awareness of the need for standards in sud! device-independent grapnk:s
padcages arose in Ihe and in a specification foe- a JD Cere
, 6 IrnrDduetion
Gruphicl S)3um (the Cun: . rur :JKJrtl produced by iUl ACM C",,,,nilta: i ll
1977 IGSPC77] and fC'fined in 1979 {GSPC79j. The firsl three authors of Ihili book were
activel), invol\.Ot!d in the design and documerllalion of the 1977 Core.
The Core specificalion fulfill ed ;t$ inlended role as 3 baseline spedfication. NO( only
did II have rnany impl.cmcutalion't , b UI alst) it WdS usr::d a.\ input 10 ufficial (guvemmelltal)
... t"ndar'ds projects within Ix)[h ANSI ( the American Nat ional Standards Institule) and ISO
(t he Irl tcrnaliOrl al Standards Orga nization) . The fi nit graphics specification to be officially
Wdli GKS (Ihe:: Grdphica l Kernd S)'!item [ANSI85b)) , 1111 elaborated. cleaned
up venion of the Core that. unlike tilt: Cure , ....... <; to 20. In 1988, GKS-3D
[TNTE881. a 3D eXlcnsion of GKS. becamr:: an official stOlndanJ. did a much mOf'e
btu mon: l."Omplo grdphics called PHIGS (Programmer' s
Hie rdTChical Interac{ive Graphics Sy<otem IANS[88J) . GKS lhe grouping 01
logically rdatcd primiti\'es--such as Jines, polygons, and character sni ngs-and lheir
intl> cotl ectiflfl s l.-alled :.q:me,lIs: these segment<; mlly not be nested. PHIGS. it:!;
name i mplies , does support nested hierarchical groupings of 3D primilives , called
)/ru(;/ure.f. In PHIGS , all incl uding invocations of Itf"e subject to
!,'Comctric transformiitLons (S(:"al ing. rotalion. a nd tnm.slation) 10 accomplish dynamic
movemenl . PH IGS also SUppoJb a retained dalabase of structures Ihalthe programmer may
edit Sc!lectivo!ly; PHIGS automaticall y updates the screen whenever (he d:uabase has been
altcn:d. PHIGS has been e;o; te nded wilh a scI of features for modem. pscudorcaJistic
rendering' of nbjccIs on raSler Ihis extensmn is catled PHtGS .,.. IPHIG88] . PHIGS
impl ementat ions are large packages. due to the many features and to the complexi ly of the
specification. PHIGS and especiall y PHIGS+ rmplementations nan best when lhere is
support for their transformation . clippi ng, a nd rendering fe alures.
This book graphics ... nmdards al some length. We first study SRGP
n he Si mple Ra.<;ter Gr.l.phics J';!ckage). which borrow:<; rrom Apple 's popular
QuickDrav.- integer rm.1Cf graphICS packagc IROSE85) and MIT's X Window Syste m
rSCHE8&:'J lo r OUiput and from GKS and PHIGS for input. HlOving looked ;:o r simple
appl ications in thi s low-level graphics package, wr: then study {tie SCltn-conversion
')IlQ clippi ng .. Igori thms sud! use to generate Images of primili ... es in Ihe frame
buffe r . Then. after building a mathematical foundation for 20 and 3D geomerric
ar.d for paraUel and perspective "i<!Wing in 3D. we study a far more
powerful pad:age called SPHIGS (Si mple PHIGS). SPHIGS is a subset of PHIGS mat
operalt'$ on pri mit ives defined in OJ floating-point. abslract . 3D worldcoordinate system
'StGGRAPH r5 t/"le SpectallntCl"C:!iI Group on Gr..phic:s. ODe of the profCSlionaJ groups within ACM.
the Assoctatiolo for Computing Madlinery. ACM is one of the {VoQ mn" professional for
OOmPUler {be IEEE O.mpuler Society is the other. SIGGRAPH poblillhc:s rcsea:"dl
journal "nd an annllal cvnfeTCnce tnPt fea(urcs of research papers in the field
and an t<luipmenl lbe Computet" Sooo.:icty .. I .... publil>hes & m;earchjoumal Ifl
'A nont"k"ring is one that simulal h the . imrl e ["""" of opl'''' d,,"ribin& how light i:.
by Photorealistic renderin" uses bener 10 tbe way objects rdlcel
refract flil'll; lhesc require more C"OIllpuLation but produc-e thaI are more
nearly ptKMognphic in "ual ilY (:see Color PIaIC E).
.. 6
Conceptual Fr.mewcwk for Inta,.ctIQ Graphic. 17
independent of IIny type of display technology, and IhaJ ..... 1;U1Jle simple P HIGS+
fealures . We have oriented our discusston 10 PHIGS and PHIGS + because we believe (he),
will nave much more influence on interactive 3D graphics than will GKS-3D, especially
gi...en the increasing avai labil ity of t hai supports real -time transformaltonS and
rendering of psevdorealistic image:>.
1.6 CONCEPTUAL FRAMEWORK FOR INTERACTIVE GRAPHICS
1.6. 1 Overview
The: hign-leveJ conceptual shown in Fig. 1. 5 can be used 10 describe almost any
interactive graphics system. Al l hc. level (I)O( shown explici!Jy in the diagram). a
computer inptJI from interaction devices , and outputs images to a display device.
The software has three components. 11te firM is the application program: il creates ,
inlo, and retrieves from the second component, I1Ie application trIOdef , which represents the
dala or objects 10 be. piccurcd on the screen. The applicat ion program also handles IIStt
input. II produces views by sending 10 the third component , the graphics series of
graphics output commands that contain both a detailed geomelric description of what is to
be viewed and the 3uributeo; de:;.. ribing how the objects should appear. 1be graphics system
is. responsible fur actually producing the picturc: (rom the detailed descriptions and for
passing the user's input to the applicatton program for
The graphics is thus an intermediary betwocn the application program and the
display hardware that effects an OWput IransjormatiOll from objects in the application rnodeI
to a view of the model . Symmetrically, it effects an lnput trons/omwtiOfl from user actions
to inputs to the application program that will cause the appl ication to make changes in the
model andlm picture. TIle fundamental task of tne designer of an interactiw: graphics
appiication program is to specify what classes of data items or objects are to be generated
and lepcescnted pictori ally, and how t he user and the: applicatiotl prugr.m iU'e to intenw::t in
order to create and modify the model and its visual representZllion. Most of me
programmer's task concttns creating and editing the model and handli ng user interaction,
not actually creating vkws , since that is handled by the system.
Fig. 1 .5 COrlCeptual framework 'or mteractive graphics.
, 8 Introduction
1 .6.2 ApplicatkHl Modeling
The applicalion modd captures all the data. objects , and relationships am()ng Ihem that are
relevant to the display and interolCtion part of the application program and 10 any
nungtaphical. roqprocessing modules. Examples of such postprocessi ng modules arc
analy!'es of the trans ient behavior (Jf a circuit or of the stresses in an aircraft wing.
si mulatiun of it population model or a weather system, and pricing computati ons (or a
building . In the cl3ss of applkations typified by " painting" progralTl" :weh as MacPaint
and t"C}'ai nl . the mtent or the progr3m IS 10 produce an image by lett ing the user set or
modify indi vidual pixels . Here an e:< plid t appl icat ion model is not needed--the picture is
both means and end. and bilmap O!" pix map in cffCl.'I 3S the application
made!.
More typically, however. there h an idenlifiHhk application model representing
applit'at ion objccts through some combinalton of data and procedural description that is
inlkpendent of It pactiCtJlar displ ifJ deVice. Procedural descriptions are used , forellaillple, to
define fmclals, 3S described in Sectilm 20.3. A data model can be as rudimentary as an
array of data points or as complex a" II li nked 1b.1 representing a nelwort dall;l structure or a
relational d3laha.o;e storing a set of relations. We often speak of stori ng the appliLYl tion
11UXkf in lhe upplication l.UlIa/xIu ; the lerms are used inten:hani:cabl y here. Models
typically stOfe descriptions of primith'fl'J' (points. lines and polygons in 20 or 3D, and
polyhedra and free form !;Urfac;cs in 3D) thai defi ne the shape of components of the object ,
objecl atuibutes such as line style , c(JI()(, or surface Texture: and C(mllriviry relaTionships
and posit ioning data thai describe how \he fit together.
The objeclS stored in the .. nodel can differ great ly in the: amount of irurinsic geometry
needed to specify them. At the end of the spectturn, an industrial
robot of the type discus.sed in Olapter 7 is describcrl almost completely in tenns of Ihe
geometry of in component polyhedra, each of which is a collection of 3D polygonal f.teets
connected at common edges defined in tenns of common verti ces and a vnlum .. _
A spreadsheet has much less intrinsic geQmctry. The spatial relationships between adjacent
cell s are SION:d , bUI the cxact .size or pJ.acement of each cdl on the "paper" i s not stored;
instead, these values are detennirted dynami cally by the spreadsheet program as a function
of the conteills of cel ls. At the geometry-free end of the spectrum, a demographic model
stori ng S(atistics, such as income and age of indi viduals in some populal;OO, ha.s no intrinsic
geometry. 1bcsc statistics can then be operated on by a procedure to derive some
gnJI71eJrical illterprel ation, suet. as a 20 graph. scatter diagram. or hiSCogram.
Another class of applicalions .... ithout intrinsic geometry deals with the directed-graph
nel:v.orks uud in various fields such as engineering and project managemenT. 1bese
netv.urts may be represented inlemally by 8djacency matrices describing how nodes are
conllCCted, plus some property data (or nodes and edges, and the applicati on must then
derive a layout in a predefined format in ()f'der 10 create a view of the graph. This
reprucnt 81ion might be created once and subsequently edited, as for a VLSI circui t layout
.:omputc:U over many hours. The model would then contain both a oongeornetriC and an
almost purely geometric description of the circtli t . Altemati-.ely, if a layout for a particular
applicat ion i!l 5imple and fast enough 10 derive, such as a project-schedul ing chan wi th
1.6
Concept".1 Framework ftx Interactive
,.
labele<l boxes and IUTQWS, it can be created on the: fl y each time the data on which jt is based
change.
Geometric data in the application model often are accompanied by nongeometric
teJI:tuaJ or numeric property informotion useful 10 a postpnxessing progrdm or dte
irlteractivc Exampl es of such dalli in CAD applications include manufaclUring data;
"price and data; thenna!. mechan ical, electrical. or electronic properties; and
me<:hanical or ciectrical lOic:rollccs.
1 .6 .3 De.cribing to the Graphics System What Is to Be Viewed
The appHcalion program creates tile 3pplicali()n modc:l either a priori as a rc:sul! or prior
computat ion. as in an engineering Of scient ifi c simul ation on a supcn:ompUIC1'. or pan or
an intetaCtivc session al the display devIce during >Wi ieh the ILo;c:r guides the conSlruct ion
proces.s by step 10 choose components and geometric and nongcomettic propeny dat a .
TlJe user c.n ask the application program at any time to show a vIew .. 'It' the model il has
cn::;lcd SO far. (The 'MIrd vit'w r., use<! incenltonally !)ere, bolh in [he sense of It visual
rendering of some geometric properties of Ihe objern being modeled and in the technical
database sense of a 20 presentation of some propertio; of some: subset of the model.)
Models are applicat ion-specific; and are created independently of M,)' pankular display
system. Therefore, the application program must conYer( a description 0' the portion of the
mood to be "iewed from the internal representation of the geometry (wi"k:thcT C":Xplicitly
SlOT"ed in the model 01" dc:rM;:d on the fl y) 10 whale\ler porocroure calls or command:; lhe
graphics system uses 10 c.-eale 1m imase . This 1;Ofl.w:ru0fl pnx:t:SS has pha.<ieS. Fil"llit, the
appl ication program t rdvt':r.iCS tht" application database lhat stores the: modeJ in order to
extract the ponions to be using some selection or query criteria. 1nen, Ihe
Qtracted geometry is put in a format thai can be sem to Ihe graphics system. The sclect iOfl
criteria can be gc:orncuk in natun:: (e. g . the: ponion of the model to be viewed !\as been
shifted via the eraphics equivalent of a pan or zoom camera operation). I)r they can he
similar to traditional database query criteria (e .g. , create a view of all the activities after
March IS, 1989 in Ihe scheduling c;han for producing Ihis book).
The data extracted during the database traversal must either be geometrk in nature or
must be converted 10 geomeuic dala; the data can be described to the graphi cs system in
lerms of both primitives Ihal the system can display direcCly and attributes thaI contnX the
primitives ' appearance. Display primili ves typically match Ihose stored in geometric
model s: lines , rectangles, polygons , circles, ell ipses , and Celtt in 2D. and polygons.
polyhedra, and text in 3D. Advanced graphks systems such as PHIGS+ support additional
primitives. including eul""VeS and s!..lJfaces defined by polynomials of higher degrocs.
If Ihe model SIOres geometric primi th"1$ not directly supported by the graphics
package, the application program must reduce them to those thai an: accepted by the
system. For ex.ampte , if spheres arxl free-form surfoces are nm supp:.x1.ed, Ihe application
must appfO"-imate such surfaces by li/ing or with meshes of pruygons that
the gfaphks Ulrt handle. Appeiltlince u.ttrlbutes supponed by (he graphlc;ji package
also tend to cOITeSpotJd to the ones stored in the model, such as color. Hrte style, and line
width. In addil jnn (0 primitives Hnd anributes . oovanced gnaphics packages such as PHIGS
20 Introduction
support faolLties for specifym!!- geometric transfonnations for sc:aling. rolali ng. and
po!>il ioning component s. for spccifyinM hvw component s are 10 be viewed in 3D. and for
grouping logically related primiti ves. attributes . and transfoonations so that they can be
invoked by it !>ingh: reference 10 a nll med SlJ"ucture.
The gOlph,cs system typically consists of a set or output subrout ines corresponding to
the various pri mitives . attribute!>.. and other clements . Thcse are collected in a graphics
subroutine lIbrary or JXlckuge that "an from high-levellangu.ages such as C. Pascal ,
or LISP. The application program geometr ic and all rihulc!>. 10 lhesce
and the subrout ines then dri-..e the speci fi c display device and cause ilto display
the image . Much a,\ n mvent;onal ltD create logical 110 unils 10 !lhie1d the
II pplicatio n progrnmmcr from the messy detail s of hudwarc and device drivers , graphics
systems a lug ;n,,1 Thus, tho:: grdphics programmer can ignore such.
dctail :<l as wbich part of image generdt icm is done: in the display hardw.uc and which is done
by tho:: xraphics package. or whac: the coordi nate li)'!'o1cm of the display is. This abstractiOJl of
the di spl ay tlevice pertains both [0 the Output of image!> and to intcract ion via logical input
devices . For cumpl c. the mouse. data tabl et. touch panel. 20 joystick. or trad:.b31l can all
be trcated 3\ the locator logical input devicc that returns an (.t:. y) screen location. The
applicat ion program can ask the graphics either to samplf' the input devices OC" to
wait 81 a specified poinl until an I"Hml b generated when the user ;A(:ti"lltt:S It device being
waited on. With input values obtained from sampling or waiting for an CVCtlt , the
application progr.tm can handle user interactions thaI alter the model or the display or that
change its operating mode.
, . 6 .4 In1eractton Handaing
The typical appl ication-program schema for interact ion handling is the loop. It
is easily visualized as a fi ni te-state machine with a central wait state and transitions to other
states that are caused by user- input events . Processing a command rna)' entail nested event
loops of .hc !>ltmc format thaI havr Illeir own and illput trdnsit iuns . An application
program may also sample input devices such as the locator by asking for their values at any
lime: the program then uses the returned value as input to a processing pf'oc."edure that also
t.-hanges the stal e of the application p!'Ogram, the image, or the database . The eveot-driven
loop is charactttized by the following pseudocode schema:
lfIitial display, deri yedfrom appl;("Q.tiOtl model tl5 appropriate
""'lie (!qs.it ) { , . hu not se!ccted !.he "quit" oplilNl . /
)
tno.bk .refection of commo.lUb obje.ty
/ " Program palL...c1 indefi nitely in "wail sl.3.!e" until user acu. . /
MiU/l jt,r IHLt
strill:n (selrct;C>II ) {
)
Pt"(l('t"SJ selrctiOtl 10 rompltte C(>mnIDttd or proce . , comnwnd,
"pda/;n/l model and scrun a.f lIuded
Let's the appl ication's react ion to input in more detail. The applK:8ti on progrdm
Iypically responds to user internctions in one of 1\IoQ modcs. First . the user ItCtion may
require only that the S(;reen be updated-for example . by highl ight ing of a selected object
1.7
21
or by making ava i lable It new mel'll! o f cho icn. T he applic:u ion Il\.!n needs o nly to upda te
internal slate and to caJl the gruphi c!> package tu update the scree n: it does IlOt need no! to
update the database . If, howeycr, the user action calls fur a change in the modeJ- r",
t':Aample . by adding or deleting a componcnt- lhe appiicalion must update the model and
(hen callihe graphic!> package 10 update the screen from Inc model. Either the entire model
is relr3\-er..ed 10 regt'M' rolle .be Image from scl1ttch . or, with sophi5ticatoo incremen-
tal -update alsorithms . the s<:reen is updated selectively. It is important to understand that
no signifiCant change can lake place in the obja:l:' on the screen without;) corresponding
r.:hange in the model. The indeed the windO'o'<' 00 the computet" in that The user, in
gen.::raJ. is manipulating 001 an Image but the model that is literally and figuratively behi nd
the:: image . Only in pa inl ing and image-enhanccment appliCAtions are the model and the
um.ge iuc:nticll.l . Tllcrcfon:. il is lhe application'S jot! 10 intcrpKt user inpul . The graphiCS
system has no responsibility for building or modifying the model. either initially or in
re!i>pOnse 10 user interactKm; ils only job is 10 imaes from geometri c de<;criplmns ,100
10 pass alung the user's input Uala .
TIle eYefll-loop model, allhough fundamental to current practice in computei' graphics,
is limiled in that the user-computcr dialogue is a sequemial. ping-pong mOdel of alternati ng
US(:r actions and compute r reactions . In the fUiuTe . we may expect 10 see more of parallel
conven;ati ons, in which input and output using multiple \,'OfTlmuni(:iltions
channels- fOf both graphics and place . FonnaIisms. nOl to mendon
programminglanguage constructs, fur Sl.-d1 free fl)(m COf1vcn;.alions are not yet well
devdoped: we shall not discuss them further here .
1 . 7 SUMMARY
Graphical ilnCTfaccs have replaced lexlual interf(ICes as the standard means for user-
computer illlernction. GfHphic5 has alliO become a k.ey technology for communicat ing
ideas, dala. and trend!l in most IlI'CIU uf commct"Ce. e"J;illc:c::ring. and eduollkm.
With graphi . \.1Ie can c reate artifi ci al realitte:s. each a computer-based "eJ.pIorntorium"
fl)( examining objeds ",nd phenomena in a natural aBC! intuit ivc way that o.pkJits our highly
deYeloped skills in visuaJ pallC1'D recognition.
Until tl\e late eighties . the bulk of computef-graphics applications dealt with 20
objects; 3D applications .... 'Cre relatively rare . both because 3D wfi'Nate is intrinsically far
fDOI'C complex than is 2D software and because II great deal of comput ing is required
to rendCT pseudorealistic images . Thctcfore, until !'eC'Cntly. reaJ time UJer internction wilh
3D models and pseudoreal iSlic images \lIaS feasible on only very expensive high.
performance WOf'ks1alkms with dedicated, .special-purpose graphi cs hardwan: . The spectac
ular progress of VLSI semiconductor lechnology that was responsible fl)( the advent of
inexpensive microprocessors and memory led in t he early 19805 to the c reation of 20.
bitmap-graphics---based personal computers. That same technology has made it po&."ible,
less Ihan a decade later. to c reate of only a few chips that do reallime 3D
animation with color-shaded images of objects, typically described by thousands
of polygons . These can be added as 30 accelerators to workstations or even 10
pcBOnal cornpulcr.> using commodity microprocessors. II is clear that an o.plosive growth
{If 3D applicalKms will parallel the c urrent growth in 20 applications. Furthermore. topics
22 Introductlon
such as phOiorea l islk rendering that were: \,:onsldered exotic in t he: 1982 cdlt ion of thi" book
ate now part or t he of the art and tire: available routinely in i!raphio; soflwllfe and
Increas ing ly in graphics hard"""3.re.
Much of thc (I f c reating effect h'e graphic com munic ation. whether 20 or 30. li es
in modeling the objects .... 'hose images we want 10 prodlll.:e. The g raphics system acts as the
intermediary bel .... '!!cn t he application model and output device. The appl ication
program is responsible for c rea t ing and updating. the model ba-.ed on user interaction: t he
graphics system Ihe rflQ!,t murine part of the job when it create." view ..
of objel:ls and user events 10 the applic ation. It is i mporlant ttl !}Ote that. allhoogh
separation between m()dding and graphics \I."llS an:epted pract ice 3! the t ime thi s boo);
Wo"IS written, our chapleTS o n modeling (Chapters II . 12. and 20) and animation (Chupler
2 1" liS ..... ell as the gmwinl! l iterature 0 10 of physical ly b;]sed modeling,
Ihll l gr-.Iphics is e-.-olving to include a great deal more th an rendering and inter-dcl iOn
handl i l1. Images ;]nd a nimati(lIlS are IlU lonA,>er merely Illu!o.lrJt ions in SClenl."C ancl
eny inotring--thcy h a\'C becume parI of tho! conlcni of science and engineering and are
influenci ng how -.cienlists and eng ineer!'> L .... mduct their dai ly "WOrk .
EXERCISES
1. 1 Lisl the ir,teracllvc graphics progr.um)'-'U uSC om a routine lxIsis in )OUr .. k....-ledge work" :
",rili ng, caklilating.gn.phing. programmml;. debugging, and \.0 on. Which of these prognlIn!. -...ould
worI; ahnO$l. as wel l nn an alptlanu"""rics-(ml)"
1.2 nOt: phrase " Iook fc.-e l" has been a pplied 10 tho: user of gniphic,
P"'"'l1Iran"l5, Itemize' t he ma';"' r ictwts , wi ndu ..... , 1>Cro/l hars , :lnd meou::.- -of the
lor)/( of the graphics mlcrf:h'e I,f )Qur fa'-'Orit,- or winJ.:--managcr program. List thc
k.indt. nf graphics these require. Whal upportunities do you see fur apl'J)'lIlC
color and 3D depictions 10 the look. ? hOl\' ,,'ighl c!ullercd <)fr .... 'C .. be a more
spiit ial rroct:tpho<- for O1"p.t1\ling and dC<,;"",ing mf'lI"fllation i! it " mess\, dc . b op)"
1.3 In .. s imilar vein 10 thll or E. ... 1. 2. wtl:lI CIp90ClUllities do you ..ee for dynamK" iCOM 10
augme1ll or o:"eI1 10 n:pbcc the J1alic of ("um:, u dc:tIl lop metaphOf$?
1.4 Break. )'O ... r f:lOri te gaphics inlo ib . .... ing lhe concept ... al
model of Figure 1.5 a::; it guide. How mU(.-n of Ihe appli cal lOllaCluaily deals willi glllphics per 50: ? How
mu("h dab with data-structUre ("realion and mai6latnance? How much deal s with Cilkulauons. rwch
lIS simulalLon'?
1.5 1l1C lerms simulation and animation a", nflen used togetheT ilOO even interchangeably in
computer grnphics. This ;s nltlural ... ben the bo::h:.vi oral (or structural) changes over time of some
physical or .. bsCntct S}'5tem are bo:ill8 .. tXI . COf\$truct oome of that could
benefit from sudl visual ization".. Specify what (onn lhe silnul:!.lions -..v ... 1d lake and how they v.ould

1.6 As a varialLon on Exercise 1.5, create a hlgh-!t:\--d dc5rgn of a inlphical " clpl nratorium" foc a
nolllrivjai ropi<: in Kietlce. or englnccri ng . Discuss how the interaclion >equences
"""uld v.orl.: and what facilitieco . M " ..... shotlld h:tVe (or C)I"per imcnlat ion .
1.7 Consi der an image containing a of J 0 .000 I-inch unconnected Cootr,l.s.t the storaie
requiml for a display hs.t with that for a I-bit rlll>lef image for a I 024-b)rI024 display to
stCKe t his image. Assllm" thai il fakes a 8 bil " op-<ode " 10 . ..pecify "vector-dnw, "' .md four IO- bil
Exercises 23
coordi nales (I.e_ . 6 bytes) [0 >.to", d vn-to.- in the vector display li"t. H""" do tbesc numbr= vary as a
function of tbe number and size of the vectors. the fllIJIIber of bits per pixel . and the resolution of the
raster What conclusion can )UU draw aboul {he rdatiw sizes of refresh memory re\juired?
1.8 WitAout peeking at Chapter 3, c:on.<;truct a straightforward algoritllm foc scan oon"'C:ning a line in
the fi rst quadrant.
1.9 AliiO$illg is a serious problem in thaI it produces unplCil5l1nt 01" eYen misleading viSllal artifacts
Discuss situations in which these artifacts maller, and ill wbi<.:b they do not. Discuss various
ways 10 minimi ze the e ffects of j nggies. and .,;pl.ain what the "costs" of remedla; might be.
132 Basic Raster Graphics Algorithms for Drawing 2D Primitives
3 . 16 SRGP copyPixel
If onl)' WrilePixel and Rc.,dPilo:cJ I'IW-Ic:vel prOl:edures are availabl e, the SRGP_copyPixe!
procedure can be impl emenlal a doubly nested (or loop for each pixel . fur si mplicilY.
:! SS\llTle fohl thai we arc worki ng with a bik"Vt."l display and do nOl need 10 deal with the
low.level of writing hits that are nOl word-aligned; in Section 19.6, we CO...ef
uf these more reali stic i,sues Ih:lI lake hardware-mcmory organi zat ion inw account.
In the inner loop of our lo. implc SRUP_l'OpyPixeJ. we du a Reildl-'ixel of the source and
d(:<)litl.3tion pi.\.CI s. logically comhi ne them 3COOtdlng to the SRGP wr ite nlOde. and then
WritcPixcl the result. Treating replace mode. the mo::,t common write mode. as a special
l 'a."C all ows a si rnpler inner loop (hal dOo:!S only a Re<ldPixell WrilePixel of the soun.:e into lhr::
dl:lo.li natiun. wll hout having III do a IngicOlI operation. The clip is used duri ng
addreslo. call.ul aliun to reSlrict lhe region imo whi .:h ckstinaliun arc wrillen .
3 . 17 ANTIALIASING
3 . 1 7 . 1 Increasing Resolution
The drawn so far have a CUlllJll(l1l problem: They have jaru;cd edges .
o;:ff'-:cl , known as tnt' j ilxgif'l' or Sl(lircasing , is the resul l of an
approach to scan col1vcn ion in whicll <:a<.:h is rcplaced Wllh tM primitive' s color
or is len unchant,>ed. Jaggies arc 3n inslance of a phenumenon known as oliojing. The
application of lCchnjqucs Ihal rc:dlX:C: 1)( elimi nale aliasing is referred 10 ofll ialilJing. and
primitives or image" produced usi ng these tel'hnlqUCS arc :-.ai d to be In Chapler
14 . d iS\.:u"" hasic ideas from signal that expiain how aliasing got lIS name.
why it oceun- , and hO\\,' tn rooUIX Of eli mi nate it when creating picture; . Hert , we conlenl
with a more intui live explanil tion tlf why SRGP's primilives exhibit aliasing. and
dbcribt- how tt) modify the line S<. "an-('onvel'Sion algorithm lk:veloped in thi s chapler 10
gcnerol te anl ialiaseJ l ines.
the midpoint alJ.'Ofithm 10 draw a J-piAe!thick black line. Wil h
between 0 and I , on a whit e bockground . In tach column t hrough whieh the linc passes, the
a!gOl'i tl'l m seb the col or of the plXcll hil l is closest to the line . Each time the lint: moves
bet y,-een columns in which the pixels clw;csl 10 the line are not in the row, there is a
s harp jag in the line drawn inlo the Carl vas, is clear in Fig . 3.54(3). The same is tfue for
other scan'CQn Ye n er! primitives thai clln 3.u isn o nt y one of two valueili to piKcl s.
Suppose we now UM: a dilo. play device with (wice the hori7.ontal iltld vert ical reM)j ut ion.
As !ohown in Fig: . ] . .'i4 (0). Ihe li ne- through twice as many columns and therefore has
as many jagili. bUI each jag IS half 3S b lge in x lnd in y. Although the roulting picl ure
loub t he improvement come!> at the price of quadrupling the memory COSI. memory
bilndwidt h. an<.l ..can-conversion lime. Increasing rew!ulion is an expensive sol ution that
onl y dimini shes the problem of jaggies- it does nOI eliminate Iftc problem. In lhc followi ng
we look at il nt ialiasing Ihat arc Jess costly. yet result in significantly
hcner
3 . 17. 2 Unweighted Area Sampling
The: lirst approach \0 improvinJ,: ph; turc qual ity can developed b) fa:ogni l.i ng that .
a lthoug h on ideal p ri mitive .. s Ihe line l.ero \Oidth. lhe primi tive we .:m:: drdWinJ; has
4
Graphics
Hardware
In this chapter. we describe how the imporuml hardware eJemenLS of a computer graphics
display system work. Section 4.1 ccwers hardcopy technologies: printer.>, pen plotters,
electrostatic pfotters , laser printers, ink-jet plotters . thennal-transfc:r ploners. and film
recofder.,;. The basic technological concepts behind each type of device are described
briefly, am.! a (;onduding section compares the various devices. Section 4.2, on display
technologies, discusses monochrome and color shadOVr'-mask CRTs, the direct-view storage
tube (DVm, liquid--crystal displays (LCDs) , plasma panels, electroluminescent disp:lays,
and severnl more specialized technologi es. Again. a concluding section discusses the pros
and cons of the various display technologies.
Raster display systems. which can use any of the display technologies discussed here,
are discussed in Section 4.3. A simple. straightforward raste." system is first introduced, and
i.s then enhanced with respect (0 gr;"phics functionality and integration of TaSter- and.
genend-purpose processors into the system address space. Section 4.4 describes the role of
the look-up table and video controllet" in image display, color control . animation, and
image mixing. The almost-obsolete vector (also cal!ed random. calligraphic, stroke)
display system is discussed briefly in Section 4.5, followed in Section 4.6 by user
interaction devices such as tablets. mice, touch panels, and so on. Again, operational
concepts rachet" Ihan technological details are stressed. Section 4.7 briefly treats image-
input devices, such as film scanners. by means of which an eJlisting image can by input to a
computer.
Figure . 1 shows the relation of t!lese hardware devices 10 one another. The key
element is Ihe integrated CPU and display processor known as a graphics workslation,
typically coosisting of a CPU capable of executing at least severa.l miJ1ion instructions per
second (MIPS), It large disk, aOO a display with resolution of at least 1000 by 800. The
145
146 Graphics Hardware
Inleraction
6eYices
, ____ __________ Wo..xstatiorl ___ - - - - - - - - - - - I
Local area network - connects
to other WOfI<.stalioM. file 5efVet$.
laser primers. high-resolution
film recorders, and so on.
FiiI. 4.1 Components of a typicllll interactive graphics system.
local-area networic C(InneclS multiple workstations for file sharing. electronic mail, and
access to shared peripherals such as high-Quality film ploners, large disks, gateways to other
networks, and higher-performance computers.
4.1 HARDCOPY TECHNOLOGIES
In this section. we discuss various hardcopy technologies, then sumnuu-ize their character-
istics. ScYerai important terms must be defined first.
The image Quality achievable with display devices depends on both tt.e addressability
and the dot size of device. Dot size (also called spOt sire) is the diameter of a single dot
on the device' s output. Addressability is the number of individual (not necessarily
distinguishable) dots per inch thaI can be created; it may differ in the horizontal and vertical
directions. Addressability in x is just the reciprocal of the distance between the centers of
dots al addresses ( x, y) and (x + I, y ) ; addressability in y is defined similarly.
disUUlce is the reciprocal of addressa.bility.
4.1
(a) Inte<dOl spacing
&qlJilllo dol size
(b) Interool spacing
one-half ciot size
Hardcopy Technologies 147
(d) Interdal spacing
one.quarter dot size
Fig. 4.2 The effects of varfOUS ratios of the dot size to the int&t'dot distance.
II is usu:llly desirable: thai dOl size 1x: somewhat grealer than the i!llema! dis tance , so
that smooth shapes can be created. Figure 4.2 illustrates this reasoning. Tradeoffs arise:
here, however: dot size several times the intardot distance allows very smooth shapes to be
printed, wher-eas a smaller dOl size allows finer detail.
ResollllioTi . which is related to dot s ize and can be no grealer than addressability, is the
number of distinguishable lina per inch that a device can create. Resolution is defined as
the closest spacing at which adjacenl black and wllite lines can be distinguished by
observers (this again implies that horizontal and vertical resolution may differ). If 40 black
lines interleaved with 40 while lines can be distinguished across one inch, the resolution is
80 lines per inch (also referred 10 as 40 line-pairs per inch) .
Resolution also depends on the cross-sectional intensity distribution of a spot. A spot
with sharply delineated edges yi elds higher resOilution than does one with edges that trail
off, as shown in Fig. 4.3.
(b)
(0) (d)
Fig. 4 . 3 The effect of cross-sectional spot intensity on resolution. (a) A spot with
well-defined edges. (b) Several such overlapping SPOts. (el A wider spot, wim less
height since the energy is spreCld out over a fatQef area; its edges are not well defined,
as are those in (a) . (d) Several of these spots ovef1apping. The distinction between (he
peak.s in Ib) is much clearer in (d) . The actual image intensity is the sum of each spot's
intensity.
'48 Graphics Hardware
Many of the devices to be discussed can ereate only a few colors at ilI1Y OIK point.
Additional rotors can be obtained with dither patterns, described in Chapter I) , at the cost
of decreasc:d spatial of the resul ting imll&(: .
DOl-matrix prinurs use a print head of from 7 to 24 pins (thin, stiff pieces of wire).
each of whir;h can be individually jiruJ, w strike a ribbon agalnst the paper. 1be print head
moves across the paper one step at a lime, the paper is advanced one line, and di e prill( head
makt:s another pass across the paper. Hence, these printers are raster" output devices,
requi ring scan conversion of vector images prioc to J)f"inling .
The: addressability of a dot-matri). printer does not ncod to be limited by the physical
distance betv.een pi ns o n the print head. can be: two columns of pin.s, offset vertically
by one- bal f the inteTpin spacing, as seen in Fig. 4.4. Alternat ively. two passes over the
paper can be: used [() achieve the same effect , by advancing die paper by one-half the
interpi n spacing the firSt and second passes.
Colored rilmons cJl n be used to produce color Iurdcopy. Two approachoes ani po5Sibie.
The first is ming multiptc print beads. each head .... ith a ditfennt color ribbon. Alternat ively
and more commonly, a single print head is used with a mult icolOttd ribbon.
More than aJ'C actual I}' on (he ribbon can be created by overstriking two different
colon at the dot on the paper. The color on top may be somewhat stronger than that
underneath. Up 10 eight colors be created at any one dot by overmiking with three
colors---cypiclily cyan, magenta, and yellow. However, the black rc:suhing from suiking all
three is quite muddy. so a ltUC black is often added to (he ribbon.
JuS( as ltw:re are random and m ter displays , SO too there are modom and raster plottt:ni.
p/otu/'"S move a pen oYer a piece of paper in I1lIldom, vector-drawing style. In drawing a
line, the pen is positioned at the start of the line, [0 the paper, moved in a straight
path to the endpoint of tbe line, raised, and moved 10 (he start of the next line . There are
tv.o basic varit'ties of pen plotters. IlIOVC5 the pen in .l' and y on a sheet of
papa spread out on a table and hdd down by electroswic ch arge. by vacuum. Of simply by
bl::i ng stretched tightly ( Frg. 4 .'). A carriage m0Ye5 longitudinally over the fable . On the
carriage is a pen mount moving lat itudinally along the carria&e: the pen can be mised and
lowered. Flatbed plotters are avai lable in sizC;>i tfOm 12 by 18 inches to 6 by 10 feet and
""
""
""
: ;"01-' Print pins
":-
""
""
""
Fig. 4 .4 A dot-matril( prim head with two columns of print pins . offset vertically by haff
the interpin spl!ICing '0 increase resolution.
4.1
Hardcopy Technologies
149
Fig. 4.5 A flatbed pkmer. (Courtesy of CaIComp-California Computer Products,
Inc.)
larger. In some cases. the "pen" is a light source for exposing photographic negatives or a
knife blade for scribing. and often pens of multipl e color.; 01" widths are used.
In contrast, drum plotlers move the paper along one axis and the pen aiCHIg the othe.-
axis. Typically, the paper is sU'eu;hed lightly across a drum. as shown in Fig. 4.6. Pin:.; un
the drum engage: Pf"CPunched holes in the paper to prevent slipping. The drum can rotate
both fOf"W.lI'd and backward. By contras(, many duJ:-top plotters mOYe the paper back and
forth betweee pinch rollers . while the pen moves across the papeI" (Fig. 4. 7).
Pen plotters include a microproccssoc that accepts oommands such as "draw line, "
" move," "draw circle," "draw text." "set line style, " and "seaect pen." (The
microprocessor sometimes also optimizes pen movc:ments to minimize the distance the pen
rn<JYeS while up; Andcr.lon (ANDES3] has developed an efficient aJgcwilhm for doing this.)
The microprocessor- decomposes the output p r i m i t ~ s Inlo incremental pen movements in
any of Ihe eight principal directions . A feedback system of position sensors and
seJ"'.UmotOf"S implements the motion commands, and an electromagnet raises and towers the
pen. Plotting speed depends on the acceleration and velocity with which .he pen can be
moved. Tn turn, pen acceleration is par1ially a function of the mass of the plot head; many
multipen plouers keep all but the active pens at the side of the plotter to minimize this mass.
In contrast 10 Ihe pen plouer, the ela:tr05tatk ptoJter placc.o;; a negative charge on those
parts of white paper that are to be black, then flows positively charged black tone.- over the
paper (Fig. 4.8). The loner particJes adhere to the paper where the charge has been
deposited. The charge is placed on the paper, which in current systems can be up 10 72
150 G r ~ i c . Hard .........
Fig. 4 . 8 A drum plOttsr. (Cour tesv of Hewhltt-Packard Company.)
inches wide , one row al a rime. The paper moves at speeds up to 3 inches per second under
A fine comb of electric contacts spaced horizontAlly 100 to 400 to the inch. Eacfl contact is
eirher on (to impart a negative charge) or off (to impart no ckarge). Each dot on an
eleclroStatic pia! is either black or white; gJ1l)' levels must be c reated wiIh dither patterns.
Fig. 4 . 7 A dllsk-10 P ploner . (Courtesy o f Hewlett-Packard Company.)
4 . ,
Herdeopy Techn060gi_
Bath of
w ... _
,-,
panicles
Fig. 4 . 8 Organization of an electrostatic plotter.
'5'
Electrostatic plotters may include II scan-oonversion capability. Of scan conYCr$ion can
be done by the: CPU. In the latter case , because the demity of information on a 400 by 4()Q
inch electrostatic plotter is quilt high (see Exercise 4 . 1), cotTeSpOndingly
high uansfe rates arc needed.
Some color elcctroSIlUic plotters make mul tiple passes over the paper, rewinding to the
stan of the pl ot after each pass. On the ti rst pass, black calibnllion marks ate placed near
the edge of the paper. Sulequent pas5ClJ complete the plot with blaclr. , cyan , magenta. and
)dlow lOOet"S, using the cal ibration mns to maintain alignment. use multiple heads
to deposit all the colon: in a single pus.
Electrostatic pl otters are after! rNter than pen plottef"S, and can also double as
high.qual ity pt'inlers. On the otber hllIld. pen plotten create images with higher contraSt
than [hose; m&de by electrostatic plotters, si nce the lalter deposit a toner eveo in areas where
the paper is not negalrvcly charged.
Laser pri"ten scan a laser beam across a posjlively chl1l"Bed tOIating drum coated with
selenium. The areas hit by the laser beam lose their charge. and the positive charJ:e remai ns
only whel'e tile copy is 10 be black. A ncaati-..ely charged po'III'dered toner adheres to the
positive areas of the drum and is then tnmsferred to blank to form the copy. In coJoT
xeroaraphy. lhis process is repeated thTee times . once for each primary color. Figure 4 .9 is
a partial schematic of a monochrome laser prifl(er.
Just as with tbe electrostatic plotter. the positive charge is either pr-esent or not present
al anyone spot on the drum, and there is eitl'ler black or not black at the correspondina spot
Scan
line
Fig. 4 . 9 Ofg8nizlttion of. laser pri nter (the toner-applicat ion mechanism 800 the paper
feed,", at'8 not shownl .
1 52 Graphics Hardware
on the copy. Hence . the printec a two-level monochrome device: or an c:igllt-cOIQT
color device.
Laser printers have il to do conversion and to conlrolthe printcr.
An iocrcasing number of lascr printers accept the Postscript document and image
dCM:ript:ion langua),:c il ddacto standard IADOB85aJ . POstscript provides a prOCedural
description of an image to be pr inted. and can also be used to store image descriptions
(Chapler 19). Most l.be, prinleTS 'M')t"k with 8. 5- by II-inch or 8 .5- by l4-ind'l paper. but
considerably wider (30-inch) bser printers are available for engineet"ing drawing and
map_making appl ications .
Ink-jet printers spray cyan. magenta. yellow. and sometimes black ink ontu paper. In
most cases. the ink jet:'! are mounted on a head in a printr:t'likc mechanism. The print head
mcves tne pIlge 10 draw one scan lir\C. I"t:lUms wll ik the paper advances by one
inlu-scan-line spacing. and draW5 the nexl scan line:. Slight irregularities in interli ne
spacing can arise if the lransport moves a bil 10(1 much Of' too lillie . Anotller approach
is 10 wrap the paper around a drum; the drum then rotates rapidly ....nile the print head
slowly moves along the drum. Figure 4 . JO shows this arrangement. In bolh cases . all the
coJOf'S are deposited simultaneously. unlike the mUltipass laser and elcctrostatic ploners and
printers . Most ink-jet primers are limited to on--ctr (i. c . bilevel) control of each pixel: a
few have a Ydriable dot-size capability.
Some ink-jet printers accept 'IKieo input as well as digital. which makes them aUractive
for creating hardcopy imagc::s of nslel" display screens_ Note thai the resolution of a multing
image is limited by the resolution of the video inpur-typically between 640 by 480 and
1280 by I 024. pOlltCrs tend 10 require more maintenance: than do many of tnc ()( her
types.
Thc:rmal-Ifflnsjer prin1er:s. another raster hardcopy device. 3rc reminiscent of electro-
sUltie ploners. Finely spaced (typically 200-per-inch) healing nibs transfer pigmentii frum
cofored wall paper to plain paper. The Wall paper and plain paper are drawn together over
the strip of heating nibs. which are selectively heated to cause the pigment transfer. For
color printing (the most common usc: of this technology). the wax paper is on a roll of
alternating cyan. magenta. yellow. and bLadt strips. each of a Ic:ngth equal to thc: papet' siu.
Because the nibs heat and cool very rapidly. a color hardcopy image can be in
less than I minute. Some thermal-transfer printCf'S accept a video signal and digital bitmap
inpul. making them convenient f(lr hardcopy or video imagc$.
Fig. 4 . 10 A rOtary ink-jet plotter.
4 . 1
Hardcopy Technologies 153
Thermal f ubftntation transfer printc;:rS \l.Qrk similarly to the thennaJ Iranster
pri nters. exccpl the heating and d}'e t r.ms fcr proce<O." permit 256 intensities each of cyan.
magenta, and 10 be tmnfcfTed, creating high-quality full-colO( images with a spat ial
resolUlKID of 200 dot" per inch . The is slower than W".u hut Ihcl quality
near- photogrophi c,
A ('amera {hil i photographs an image displayed on a cathode-ray (televis ion) lube can be
considered anoIhcr hard(:opy device . This Is the most common harrlcopy technology we
discuss tbat yields II large number of colon; at II single resol ution point; film can caplUre
many different colors.
There are two ba.o;ic techniquCl> for CO]lH" film recorden.. In one, the camer..! recoros the
color image dil''t1y from a colnT CRT. Image rew lution is limiled because of the shatfo-..v
ma:.k of the color monitor (see Seel ion 4 . 2. 2) and the need 10 use a raster scan with the
cok>r monitoc. In Ihe oc:OCr approach. a CRT is through color
lilltf"$. and the diffau.( wLur c;omponents of tbe image are displayed in 5Cquenct; ( Fig
4. I I). This technique yield5 very high-qualit)" rasle<" or vector- images . Colors are mixed by
double-expo!>ing parts of the image throtlgh two Or more filters , usually with different CRT
intensities.
Inpul to film reconjen can be a rdsler video signal. a bitmap, or
insuuctioos. Either the video signal can drive a color CRT directl y. or the red . green. and
blue oompooeJ\lS of the signal can be dectronically iiqJ3.rnted fOf" display
through tilter:s . In either ca.;e, the video signal trMlSt Slay constant during the entire
recording c)'CIr: . which can be up 10 1 minute if relatively sJOIIo' (lowsensitivity) Ii 1m is being
used. high-resolulion bitmap or VC(:t(lt"" systems are expensive, because the
drive electronics and CRT itself must be designed and calibrated carefully . As speed and
resol UliOll decrease . COSl5 arc reduced dramatically.
The recently developed C ) ""c<HQr technique embeds in paper millions of microcapsuLes
filled with one of Ihrtt colored dyes---cyan. ma.l:C"nta. Of" yellow. The capsules harden
seleCtively when exposed to light of a specifi c color. For instance , when exposed to green
Camera
Motor to
rQUlte colOr
-
Fig. 4 .11 A film recorder tot making color photographs uslng colored fi lters.
- - .. ..
164 Graphfcs Hardwar.
TABLE 4.1 A COMPARISON OF SfVERAL MONOCHROME HARDCOPY
TECHNOLOGIES
"'"
"'"
Ekro- '0k
p'"uer malri" , Ialic
1._
i
TMnnal
leveh per clot 2 2 2 2
2_many
,
addressabilily. per inch
1000+ w 250 "' 400
<01500 m 200 to ZOO
clot o.i''c. thou!I.andth5 of inch 6- IS
1(}-18 8
,
8- 20 7-10
relative cool nnge L -M VL-L M ... H L- M L -M
relallve COSI per i mage I. VI. M M I. M
image quality

L--M M H M M
'po'"
I. M H- H M-H M M
" 'il L ' "') I ...... L" 1,_. M - ,na.lj .. ",. H - hij;h.
1'100,.
m ."
10800
6-20
C-H
H
H
I.
light, chemicals in l ho:: capsule that C'.ipsule to harden. The paper
paS!.e<lthrough pressure rollen :md pressed against a sheet of plain paper. The unhardened
capsules (c)'lln and yellow, in this example) brealr.:, but the har<kned capsule (magenta) does
not. The c)'lln and yellO'W colors mix and are transferred to lhe plain paper. creating a
high-quality green image. Unlike mmt other technologies. thi s one requim; only a single:
pass.
Table 4 . 1 summarizes differences among black-and-white hardcopy devices; Table
4.2 COYc:rs most of Ihe: color hardcopy devices. Considerable detai l on the technology of
hardcopy de ... ices can be found in rOURBS8j . The Cllrrent of te1:hnotogical innovation
is. of course, so great that the relative: advantage;; and disadvantages of some of the:se
device:s will surely change. Also. some of the technologies are av.Bablc: in range of
prices and performances. Film and pen ploue:rs. !Of' inSiance:, can cost from about
$1000 10 $100.000.
N()(e thilt, of all the color only (he film reoorder. Cycol.or, and ink-je:t
printers can :l wide range of All Inc otOcr te:ctmo logies UK Q!>enlially a
binary on-otf control for the three or four colors they can record difIXtiy . Note also that
color control is tricky: there is no guarantee that the eight colors on one will look
anything like the eight colors on the: display or on another hardcopy device (Ct\apter 13).
Wide lascr printers are becoming available : they will slowly prttmpt electrostatic
ploueB, which have a lower contrast ratio black and whi te and are I1lOn diffi cuillo
maintain.
TASLE 4 _2 A COf.APAAISON OF SEVERAL COlOR HARDCOPY TECHNOLOGIES
"0
Do< Electro-
I"
,.,...Iri" Sllic '=<
F
"""".1
""",'
color le\'cls per dOl 1<> 16 8 8 8 8- many m ."
uddressabilily, poim$ rer inch 1000+ 10250
,. 4()0
to 1500 \0 ZOO ( 0 200 800
dot $izc. (If inch
IS-"
]8-10 8 5 20-8 10-7 :ID-6
re]ll.l l <'e COSI r311FJ: L- M VI. M- H M-H C-M M M ...
COS! per image L VI. M M I. M H
image qualily C-M I. M H M M- H M- H
I. C-M M M M C-M I.
YL ... law. L - low. M - medium. H high.
4.2
Diaplwr T_ctn0f0gie8
,.,
4.2 DISPLAY TECHNOLOGIES
Interactive computer demands display devices whose images can be changed
quickly. Nonpermanent image displays allow an iml8c to be changed. making possible
dynamic mo'<'emcnl of portions of an imll8c . The CRT is by far the I1lOSt common display
device and will remain so for many )'UTS. However. solid state technologies are being
developed Ihat rna). in the lana:: term. substantially reduce the dominance: of the CRT.
The monochromatic CRTs used for graphics are essentially the same as those
used in black-Bnd-white home television scts. Figure 4 . 12 shooNs highly stylized
CTOSSsecUIH1.iJ of a CRT The electron gun emits a stream of electrons thai is
accelcn.led toward the phosphor-coaled 8Creen by high poa:itive voltage applied near the
face of the lube. On the way to !he screen. the electrons are forced inlO a lW'l'!JW beam by
the focusing mechanism and are directed toward a paniculu point on the scru:n by the
magnetic field produced by the defl:tion coils. When the eJectrom hit ttle screen, the
phospt.o emil$ IIghL Because the phosphor's light output decays exponentially with
lime. the enCire pi(:ture must be (redrawn) many times per second, SO thai the
viCl/loQ' $eCS ....... at appean to be 1\ constant. t1nft ick.c.ring pK:lure .
The refresh fIlte for raster-scan displays is t1suaJly III ieasl 60 frames per second, and is
independent of piclUre complexilY. The refresh rate for veclor systems; depends dinlctly on
picture complexity (numba of lines. poinl!J . and chancten); TIle greater the >mpk:K.iIY,
the lonaer thc time taken by It single refresh and tbe lower the refresh rate.
11Ie stream of electrOns from the heated catOOde is accelerated toward the phosphor by
II high \oOItage . typicaUy 15.000 to 20,000 '-OIlS. whkh determines lhc wlocilY achiCYed by
the ek ..... t.iQns before they hit the phosphor. The controlgrid voltage detcnnines how many
electrons are aclually in the electron beam. The mort negative the control-grid vollll8e is,
tnt fewer the c1U'Ons lhal pass through tnt grid. 'rbis phenomenon a1kl1N$ the
HeatlnQ
f,lament
Ele<:lron
0""
COntrol
0""
Defl,chon
=1.
ImerlOr metaUIC coating
at hJgh po.rtive Voltaga
Scr ...,
Fig. 4 .12 Cross-section of iii CRT (not to seale),
, 56 Graphics Hard_are
intensity to be controlled, because t he light OUtpuf of the pholiphor threases lIS the nwnber
of eieclro m in the beam decreases.
TIle focusing system conccnlf'8tes the eiecl10n beam so thaI the: beam \::OfIverges to a
small point when it hits the phosphor coating . II is nex enough for fhe d ectroos in the beam
to move parallel 10 one: another. They would bel::ause of electron repul sion . SO the
focusing syste:m most make them converge to counteract the divergence. With the exceJl(ion
of this tendency 10 diverge, focusing an electron beam is analogous to focusing a light
beam. An optical lens and an ek:clfOn lem both haw: a fOQ.] dist.ance, whk:h in the Ca.5C of
the: CRT is sel such that the beam is focused on the screen. The crms-sectional electron
density of the belltn is Gaussian (thaI is. /101lTIlll). and t he intensity of tile light spot created
on the phosphor has the same distribution, as was shown in Fig. 4 .3. The spot thus has no
distinct edge>, and hence spot siu is usually specified as Ihe: diameter at which the intensify
is 50 percerx of that at the: celll:er of the spot. 1bc typical spot size in a highresoIution
monod>rofm' CRT 0 .005 inches.
Figure 4. 13 ilIustnltcs both the focu.s.ing system of and a diffi cul ty with CRTs. The
beam is shown in two positions. In one case . the beam converges at the point at which it
stri kes In me second case, the convergence poinl is behind the screen.
and tt\e image is therefore somewhat blurred. why bas this tmppened? The
faceplates of most CRTs are neatly flat . and hence tuve a radius of curvature far greater than
fhe distance from the lens to the screen. Thus. not all poinls on the screen are equidil;tant
from the: len!. and if the beam is in focus it is directed at the centC!r of the 5CreeTI. il is
nOl in focus anywhere else OIl the screen. The funher the beam defk:cted from the cerMCT.
the more dc:focused if is. In high-precision displays, the system solves this problem by
focusing the lens dynamically as a function of the beam's position: making CRTs with
sharply curved facqMtes is not a gocxI solution.
When the electron beam strikes the phosphor-coatcd scn:en of the CRT. the individual
are moving with kinetic energy proponioMJ 10 the a<::celeration voltage. Some of
thi s energy is disSiJlted as tlc:at. but tile rest transferred to the c:k:ctrons of the phosphOI'
De/lected beilm
converQh Inside
faceplate
unoef\ec1ed beam
COfl\o>ergas at
faceplate
10---- Focal
Fig . . , 3 Focusing of the electr on beam. The 'ocal /engl" varIes as a function of the
deflection angfe .
4 .2
Di .. "..V Technok)gie.
157
atoms. milking IIlt'm j ump to higha quanlum-CfM:fXY levels. In returning lu their previous
quantum levels, t.he:se excited d ec'"'"' giYe up lkelr Clltra energy in the form of light, al
frequencies (i.e., col on;) predict.cd by quantum theory. Any given phosphor has several
different quantum levels to whkh eloctrons can be excited, each oorTe$pOfKl.ing to 8 color
associated with the return to an unexcited stale. Further, electrons on some: k:Yt:)s arc k:s.s
stable and refum 10 the unexcited Wile more rapidly than others. A phosphor's
is the: light emitted as these very unstabte electrons lose thc:ir excess energy whi le the
phosphor is being suuck by doclrons. is the liglll giYCn off by the return of
lhe rdatively more stable Cllciled electrons 10 their unexcited state once the decltOfl beam
Cllcitation is reJJ'lOYCd . Witl1 typica.l phosphors, mOSl of the light emitted is phosphores-
cence, since the excitation and hence the fluorescence usually last j WII a fl1lCtion of a
microsecond. A phosphor's peniSl/!na is defined as the time from the rentOYai of excitat ion
10 the mometlt when phosphorescenex has decayed to 10 percent of the inilial light OtJlput.
The range of pcr$i Slence of different phosphors can I'C4Ch many sccCJn<b. WI 100 ll101M
pOOsphor.; used in graphics equipmenl II is usual ly 10 1060 microsc;(l()I'\(js . This lighl outpul
decays expoIlCntially wilh time. Chanc1eristics of phosphors are detailed in [SHER79].
The refrt:Sh rote of a CRT is the number of t imes per second the image is m:lrawn; if is
Iypically 60 per second fur raster displays. All the refresh rate decreases. jlicter develops
because the eye Clln no longer irMCgrate Ibe individual light impulses coming from a pixel.
The nne aboYe which a picture Mops flickering and fuses iNO a steady image is
callod the criJicai or CFF. 1bc process of fusion is familiar 10 all of us; it
OCCUJ'S whenever watch tele\lision or motion pictures. A flicker-free pkture appears
constant or Sleady 10 the viewer, even though. in facl . any given poillt is "ofr' much longer
than it is '.' 011 . "
One detenninant of lhe CFF is the phosphor' s persistence: The longer the persistence.
the lower the CFF. The relation bclween fusion frequency and penistmce is nonlinear.
Doubl ing pusistenoe does not halYC the CFF. As per5istcnce increases into the SC\'ef"3.1-
second range. the fusion frequency becomes quite small. At the other extreme. even a
phosphor wilh absolutely no perSi stence at all can be u.'iCd, since all.he eye really requires is
10 see some light for a short period of time, at a fre<juency 81love the CFF.
Persistence is 110( the only factor affecting CFF. CFF also increases with im.
intensilY and with ambient room lighting, and varies with different wavdenglhs of emiacd
ligh! . Finally. i( deperxb OIl the observer. Fusion iii:, afier all . a physiological phcllo menon.
and diffCf"eI1Ct: among viewcn of up to 20 Hz io CFFhave been reported [R0G083J . Cited
fusion frequencies 8f'C thus usually averages for a luge number of obsenooers. Eliminating
fltcker fOf 99 percenl of VieweR of high-intensity images (especially prevalent with
blaclt-on-wnitc r8S1er displays) requires refresh rates of 80 to 90 Hz.
The horizrmlal scan is lhe number of SCln lines pel" second dw the circuiby driving
CRT is able to disptay. "The rate is approximately the product of the refresh role and the
number of scali lines. For a scan rate, ItO increase in the refresh nile means a decrease
i" the number of scan lines.
The of a monochromatic CRT is defined jusl 3$ is resolution for hardcopy
devices. ResoIlition is usually measured with a shrinki"R A known number of equally
spaced paralJel li nes that altemale belween black and while are displa)'ed. and the intttliite
spacing is uniformly decreased until the lines j ust begin 10 mn-ge togcther inlo 8 uniform
158 Graphics Hardwllre
field of gtay. This merging happens at OIbout tht= point where the ineerline spacing equal to
the diamet er at which the spot intensit y is 60 percent of tile intensity at the center of the
spot. The resolut ion is the distance between the tWO outennostlines. divided by the number
of lines in the raster. There IS II cley dependence bet...een spot size and achievable
resolution: The larger the iipOt size. the lower the achievable resolution.
In t he shri nking-raster ptoCe5ll. the interline spacing is dc:ereased nol by modifying tne
contents of a raster bitmap. but by changing the gain (amount of amplification) of the
vcnical or horizontal deflection amplifiers, depending on whcthet" the or horizontal
resolution is being measured. These amplifiers control how" large an on the SCfUn is
covered by the bitmil.p image . Thus. CRT resolution is (properly) not a fllnction of the
bitmap resolut ion, but may be either higher or lower than that of the bitmap_
Resolution is nOC a canMan!. As the number of electrons in the heltm increases ,
resolution tends to decrease, because a bright line is wider than a dim li ne. This effect is II
result of blocM. the tendency of it phosphor's excitation 10 spn::ad $Omcwhat beyond tbe iU'eM
being bombarded, and also occun. because the &pol size of an intense electron beam is
bigger than that of a .....eak beam. Vertical resolution on II. rasteI" monitor is detennined
primarily by spot size; irthe vertical resolution is nlines per ioch, the spot size needs to
about lIn inc:hes. Hori zontal resolution (in which the line_pairs are vertkal) is determined
by both spoc siz.e i\nd the speed with which the clcctron beam can be turned 011 and off as it
movcs horizonlally ac:ross the: screen. This rate is related to the bandwidth or the d.ispiay. as
discussed in lhe nett paragraph. Research on defining the re$Olution of a di splay precisely
and on our ability to perceive images is ongoing. The nwduialiQl1 trollsftr jwtcliolf, used
extensively m this research, relates a device' s inpuisignal to its output signallSNYD8S j.
Tht bandwidlh of II. monitOf has to do with the speed with whkh lhc: electron gun can be
turned on or off. To achteve a horirontal resolution of If pixels per- scan line, it must be
possible to tum the electron gun on at least nI2 times and off another nl2 times in one 5(:an
line . in on:Ier to create alternating on and off lines . Considu a raster scan of 1000 lines by
tOOO piXels. displayed at a bO-Hz refresh rate. One pix.el is drawn in about 11 nanoseconds
(WHITB4J. SO the period of an on--<Jtf cycle is about 22 nanoseconds. which 10
a frequency of 45 MHz. This frequency is the minimum bandwidth needed to achieve 1000
lines (500 of resolution. but is not the actual bandwidth because we have ignored
the effect of spot size. The nonzero spot sil:e must be compensated fOI with a higher
bandwidth whieh QlUse.s the beam to tum Of! and off more quickly, giving the pixels sharp
edges than they v.oukt have Otherwise. It is not unusual for the actual bandwidth ofa 1000
by 1000 monitOl" to be 100 MHz. The actual relationships among resolut ion, bandwidth.
and spot size IU"C compl ex, and only recently has progress been made in quamifying them
[INFA8S1.
Color televisioo sets and eclor raster displays use some form of lhado'W-mask CRT.
Here . the inside of the tube' s viewing surface is covered with closely spaced groups of red ,
green, and blue phosphor dots. The dot groups are so small thai light emanat ing frum the
indivi dual dOlS is perceived by the viev.er as II mixture of the mree ooIors . Thus. II wide
range of colors can be produced by each group, depending on how strongly each individual
phosphor dol is excited. A sluJdow maJk. which ;5 a thin metal plate perfOr1lled with many
small hates and mounted clOC to the viewi ng surface. is c:.arefuUy aligned so that each 0(
4 .2
Diaplay Twd.lOIogl .. 159
t he: Ih," dearoo. beams (one c:itCh (or red, arceo., aud blue) c.o hit only one type o f
phosphor dot . The dots thus can be exciled selec:livdy.
Figure 4. 14 shows one: of the mosc common types of shadow-mask CRT. a della-ddta
CRT. The phosphor dots are ammged in a triangular triad pattern, as ace the three eiecuun
guns . The guns are denected together. and are aimed (converged) at the same point on the
vi ewing surface. The shadow m!tSk has one small hole for each triad. The ttoles are
preci sely aligned with respect to both the triads and the eJectroc\ gWlS, so thai each dot in the
triad is exposed to electrons from only one gun. High-precision deJta-de]u e RTs are
particuwly difficult to keep in alignmenl . An :lIternau\Oe /UTangemenl. the precision inline
rklla CRT shown in Fig. 4.15, is easier to convcrge and is gainina in popularity for
hiJ!:h-precision monitor'S. In this case, the three beams si mul taneously
ClIOpo!oC three phosphor dots . However, t be: in-line arnlngement cSocs sliJhtly reduce
image sharpness at the ooges of the tube. Still in the resean:h laboralOf)' but likely to
become commercially viable is color e ll. in whkh the eleetron beams mOYe
parallel 10 the viewi ng surface. and arc: then turned 90" to strike the surface.
The need for tnc shadow mask and Diads imposes a limit on the resolut ion of co/or
CRTs not present with monochrome CRTs. In very high-resolution tubes , the triads are
placed on abool O.21millimeter centers: Ihose in home television lubes are on about
O.60-millimeter cenlers (this distance is llll so cal led the pitch of the lube). Becaw;e a finely
focused beam cannot be guaranteed to hit ex.actly in the center of II shadoo.v-mask hole. the
beam diameter ( the diameter al which the intensify is 50 pcn:ent of the maximum) rowl be
about t times tile pitch. Thus, on a mast with a pitch or O.25-millimetef (0.01 inches).
Fig. 4 .14 Oelta-delta snadow-mask CAT. The three guns and phOspl"\or dots life
arranged in II criaogular (delta) pattem. The shadow mask anows electrons from each
gun to hit onl.,. the cor'esponding phospnor dots.
160 Graphics Hardware
PhOSpI'Iors
on glass
fllcttplllte


mllsk
Fig. 4.15 A precision in-line CRT: the tnree election guns ire in ;) lina.
the beam is about 0 .018 inches across. 3nd the resolution can be no mon: than about
"" 55 li nes pel' inch. 00 a O.25-mill imeter pilch. 19-inch (di ag<lnal measure) mI.InilOT.
whkh is about 15.5 inches wide by 11 .6 inches high lCONR85). lhe resolution achKvable
is thus only 15. 5 x 55 ,. 850 by 11 .6 x 55 = 638. This value compares a Iypicil l
of 1280 by 1024. or 1024 by 800. As illustrated in Fig. 4 .2. a resolut ion
somewhat less than the addressability is useful.
The pitch of the shadow mask is clearly an important limit OIl the resoluti on of
shadow- mas!.:. CRTIl . As pitch decrease!i. n$Ol ution can increas.e (lI.SSurni ng bandwidth. "'od
dOl size are appropriate). The ","aller the pitch is. however. the more difficult the tube to
manu(ao..1.ure. A yuan-pitch shOOow mask is more fragi le. making it mCM"e d ifficult to
mount . It is also TIlOI'e likely to "'-'arp from heating by the electron beam. The
fio' -It:nsiOll.mast lube has 1:1 Rat faceplaTe , with the mask stretched tightly to ffilIinlain it. ..
position; a pitch of 0. 15 millimeter is achiev8bie with this techlKllogy.
The shadow mask also limits CRT brightne&S. Typically, only 20 percent of the
electrons in the beam hit Inc phosphors--the TCSt !-ii! the mask. Thus. few.-: r elcctrons make
lighllhan in a monochrome CRT. The number of electrollS in the beam ( the beam current )
be incrc.ascd. btlt a higoo- currenl makes focusi ng more difficult lllld also
more beat on the shadow funher eJllICerbating mask warping . Bea.use the ftatlension
mm is more resistant [0 heating distort ions, it I:IlIows a higher beam current and hence a
brighter image .
Most high-quality CRrs have diagonals of 15 to 21 inches, with slightty
curved faceplates that creale optical distortions for the Several types of nat-fllec
CRTs are bccoming available, induding a 29-indi-diagonal tube with a pitch of 0 . 31
millimeter. Of eoun<e, the price is high. but it will \."Ome lIuwn as demand
4 .2
,.,
TIle dinet-.,iew tub>.: ( DVST) ." ;'i imile to the stlUldard CRT, uccp( mat il docs
nO( need to be refreshed because the image is stom:! as I distribulKm of charges on the
inside surface of the screen. Because no ttlTe5h is I'()r'ded, the DVST can dispfay complex
images withoul: the high Sl;:an nne and bandwidth requinxl by a conventional CRT. 'The
major disadvantage of the DVSl is that modifyi ng any paI1 of an imnge requires redrawing
lhe entire modified image to establish a new charge disu-ibulion in the DVsr. Thil> redraw
can be: unacceptably slow (many $CConds for a complex image).
The ubiquitous Tcktronill 4010 display terminal, based on the DVST, was die: first
IOW<OSl , widely avai lltblc inteotC1ive grapbil;S lenninaJ. It was the Model T of computer
graphics . and was so pervasive thai its instruction set became a defacto standard. Even
loday. many dispfay systems iJ)(:lude a Tetrroni,ll compalibiHty feature, so thai buyers can
continue to run their (often large) libraries of older software developed for the 4010. NO'W" ,
DYSTs hayc been superseded by ruler displays and have essentially disappeared
from the graphics scene.
A liqllid-crproJ display i s made up of six layers, as shown in rig. 4. 16. The
front layer is a polarizer platt: . NeJIOt is a layer with thin grid wires d ectrodeposited
on .he surface adjoining the crystals. Neel is. thin (about: OJ)005 inc:h) liquid-crysrallayer,
then a layer with hori zontal grid wires on the surface DCXt to the crystals. then a horizontal
polarizer , and finally II reflector.
The liquid-crystal material is made up of long crystalline molccu.les. The indi vidual
molecules normally are arnmgcd in a spiral fashion such that the direction of polarization of
polarized I ight passing lhrough is rotated 90". Ught entering through the front layer is
polarized YerticalJy. As the light passes through the liquid crystal, the polarization is l'I)IatOO
90" to horizoncal, so the light flOW passes through the rear horizontal polarizer, is re"ecled,
and returns through !.he two polarizcrs and crystal.
When the crystals are in an electric field. they all iinc up in t he the same direc.ton, and
thus have no polarizing effect. Hence . crystals in the dectric ficld do not change the
poJarizatton of the transmitted light . l'O light remains vertK-aJly polarized .00 doeEl 1lQ'
pass through the rear polarizer: The l igh. is absorbed, so the viewer sees a dark spoc on the
display.
..
RBfIect.ive HQfllOllial HorilOM.1I Uqu.id.
layer pOiill'izer grid wife'S crystal
lay .. ,
Verticlll WrtOeaI
grid polarizer
..
Fig. 4 . 16 Tne layers of a liqvic:!-crystal d isplay (LCD), all of which ate s.mdwiched
together to form a thin panel.
162 Graphics Herctw.r.
A dark spot at point (x" ),,) is created via matrix addres..ri"/i:. Tile poi", I,. by
applying a nexalive vollage -v 10 (be horizontal grid wire x, and a positive + V [0 tnc
vertical grid wire ),,: Neither -v nor + V is iarge enough to cause the c:ryl>!als to line up , bur
their difference is large enough to do so. Now the crystah at ( XI' Yl) no longer rotate the
direction of polarization of the transmined ligl1t. so it Temai1l3' v.::rticall ) polarized and does
m)( pass through the: rear polarizer: The light is absorbed. so the vie\>.er a dart.:spot on
the display.
To display dots at (x,. Yl) and (Xt . yJ. we cannO! simply apply the positive voltage to X,
and and [he negative voltage to YI and that would cause dob to appear at ( XI ' '1) '
(x). )'t). (xt . >'j). and (x,: . yJ. because all these pointS will be affected by the vo llage. Rather,
the points must be selected in succession. one after the {)(hcr. and this selection must
be repeated. to refresh Ihe activation of c3(;h point. Of course. if >" - )'2. then both point"
on the: row can be selel;ted at the time.
1be di splay is refreshed one row at!!. time, in raster-scan fas hion. Those points in a row
that are "on" (i.e. , dark in the case: of a black-on-white LCD display) are .-elected only
about liN of the time, where N is the number of rows. For(unatcJy, once the <.:rystals art':
IiIlCd up. they stay milt way fOT :.everal hundred millisa;onds, even the voltage is
withdrawn (Ine crystals ' equivalent of pho:<.phofS' persistence) . But even so. the crystal is
!lOt switched on all the time.
Aeli,.... ffWlrix are LCD pands thai have a transisl(N"" al cadI (x. y) grid point. nle
(ransislcm; I'W"C used to cause the cryslal s to cnange their state quickly. and also 10 control The
degree 10 which the state been changed. These I'M) properties allow LCOs to be used in
miniature television 5C1l> wid!. o,;o ntinuous tone images. The crystal s can also be dyed 10
provide color. Most important. the transistor can serve: as a memory lor the Slate of a cell
and can hold the cell in tnat state until it is changed. Thai is , (he memory provided by tho:
transistor enables a cell to remain on all the time and hence to be brigh ter than it would be if
it had to be refreshed periodially. Color LCD panels with resolutions up 10 800 by 1000 on
a l4-inch diagonal panel have been built.
Advantages uf LCOs are low (;051. low weight . small size, and low power <.:onsumption .
In the pll.!.t , the major disadvantage was that LCr>.. were rcftecting only ifK"ident
light and crealing no light of thei r own (although thi$ could be with hacklighting):
Any glare "'ashed out the imaBe. In recent years. u.o;e of active pands ha, f"t': lTlO\Ied this
conCern.
Nonacti ve LCD technology has becn adllpted to color di!>play.>. and I:. sold commen:ial -
Iy as the Tektronix Iiquid-crystal shutler (lCS). The LCS , in front of II standllrd
black-and-white CRT, consisUi of three layers . The back layer. cl osest to the CRT. II
verlical polarize1". to pob-rize light emitted from tl1c CRT. The laya- idltotl hill> a thin coating
of a conducti ng material. The next la)'er is the liquid cry"tal. and the third
(front) layer is a color polarizer that transmits venially pulari7.ed light I"" red and
ooril'onta.lly polarized light as green. This front layer also a thi n co:lt ing of tn.:
transparent conductor. If tile crystals are in their normal state. J"Otllte the polarization
plane by 9O
Q
so the lighl huri zontally polarized as it the c(llor polarizer of the
third and is. SCCTl as green. If the approprillte is applied tu the conduo:t i-ve
o:oating:. on the front and had; then tht': line...: p and do not affect Ihe "'t:"rt ical
polarizalion, so (he lighT is seen as red.
4.2
Display TechnokJgie.
,.3
The crystals are switched back and fonh betwt:1::n their ['AA) states at a rate of 60 Hz. At
Ike same time and in synchrony. images to be seen as red and green are alternated 0Jl the
monochrome di:splay. MixlUres of red and green are created by intensifying the same spot
during the red and green phases , potentially with different intensities.
The LCS is an alternative to the shadow-mask CRT, but has limited oolor resolution. It
is possible, however, that this technology can be extended to \OoQI'Ic with three colors. If it
can be, the shadal.oi mask will no klRger be a limiting facto!' in achieving higher-resolulKln
full-color displays. Spot size and bandwidth will be the major determinants, as with
monochrome CRTs . Eliminating the shoo.ow mask also will increase ruggedness. Because
LCD displays an:: small and light, tRey can be used in head-mounted displays such as that
discussed in Section 8.1.6.
The plasma paru!1 is an array of tiny neon bulbs . Each bulb can be put into an "on"
(intensified) state or an . 'off'" state, and remains in the state until explicitly changed to the
other. This memory property means that plasma panels need noI be refreshed. Plasma
panels typically have 50 to 12.5 cells per inch, with a 10- to 15-inch but 40- by
4O-inch panels with 50 <;:eils per inch are sold commucially, and even larger and denser
panels can be custom-made.
The neon bulbs are not discrete units, but rather are part of a single integrated ()Ilnel
made of three layers of glass . as seen in Fig. 4.17 . The inside of the front la)'ef has
thin Yert.ical strips of an electrical conductor; the cenler !ayes- has a number of holes (the
bulbs), and the inside surface of the rear layer has thin horizontal strips of au electrical
conductor. Matrix addressing is used to tum 011 and off. To tum on a bulb, the system
adjusts the voltages on the com::sponding lines such that their difference is large enough to
pull electrons from the neon molecules, thus tiring the bulb and making it glow. Once the
glow starts , a lower voltage is applied to sustain it. To tum off a bulb, the system
momentarily decn:ases tbe voltages on the appropriAte lines to less than tbe sustaining
,
,
,
,
,
,
,
Horizontal
...

(y address)
Glass
plate
w;m
",",
"
"
"
, Vanical
.",
wire.
( x .sorBSI)
..
Viewing
.. '1ion
Fig. 4.17 The levers of a plasma display. all of which are sandwiched togetller to form
a then panel.
164 Graphics Hardw'are
voltage. Bulbs can be turned on or off in alxxit 15 microseconds. In pane! desiJ;llS. the
inuividual cells are replaced with an open cavity, because the neon glow is contained in a
klcaliz.c:d area . 1n Ihis case:, the from and back glass layers are separated by spacers. Some
plasma panels can al so dispby muhiplc: gray leYels.
The panel has the ad .... "'ntages of hein! flat, transparent , and rogge<! , and of 1I0t
needing a bitmap refresh buffer. It can be used with a rear-projectiOfl system to mix
photographIC slides as Slatic bitCkground for computu-generated dynamic graphics, but has
found most use in military applications , where small size and ruggedness are important.
H(7IotoTVC!'. itll cost, althouSh UKllinually decreaSing, is still relatively high fl)f illS limited
resolUlion. Color nas been demonstrated in the 1aboratory , but is not commc.TCially
available.
(EL) consist of the same gridlike SUUC1ure as used in Lm
and plasma di splays. the front and back panels is a thin (typically 5QO-nanometers)
layer of an electroluminescent material , such as zinc sulfide doped with manganese, that
light wh<:n in a high cl<:(;tric field (alo"ut 10' vul ts pt:r cen1imeter-). A point on the:
panel is illuminated via the matri)(addrcssing scheme . sevc:11ll hundred volts being placed
across the hori zontal and vertical selection lines . Color d ecroluminescent displays are also
available.
These displays are bright and can be switched on and off quickly, and transistors al each
pi)(el can hi: used to the image. Typical panel sizes arc: 6 by 8 inches up 10 12 by 16
indteS. with 70 addressable dots per inch. These displays' major disadvantage is Ihal their
consumpt ion is higher than that of the LCD panel . their br'igttlrlC:SS has led
to their Il.<>e in some portable <:omputen; .
ElectrophoretiC displays use posiliw:ly chargc(j colored particles suspended in a solution
of a contrasting color. sealed between tWll parallel. doseJy spaced plates that
matrix-addressing sekc tion lines. A negative VOltage on the front selection line and a
positive YOltage on the rear selection line pull s the colored par1icles toward t he (ront plate,
where they are seen instead of lhe <:olored liqu id . Re..crsing the WJltages pulls Ihe patticles
t('!Ward the n:ar plate , so the CIll ored liquid is seen . The display has a Im:mory: 1be particl es
Stay wtlef'e the)' have been placed until moved eJ!. plicitly.
Most large-screen displays use some fonn of proftoion CRT, in which the light from a
mall (sevcral-inchdiameter) but very bright monchrome CRT is magnified and projected
from a curved mirror. Color use three pi"ojectors with rod, geren, and blue fil ters.
1\ CRT UUQ nOt creal!! enough light to be projected onto a laq;e
(2 meler-diagonal) screen.
Thc GE lixht-mlve .lptem is used for very large screens, where the light
output from the projection CRT would nQl be sufficient. A light valve is just what its ruune
implies: A mcchani,;rn for cuntroJling how much light passes through a valve. 1be light
source can have much higher intensity than a CRT. In the most common approach, an
eleclron gun image 00 II thin oil 11 1m on a piece of glass. 1bc: dtTOn charge
cauSCl; the film 10 vary in thickrte:;s: A charged atea of the film is
our . " >IS electrons repel one another. causing rhe film 10 beCQmc thinner. Light from the
high-intensit), source directed at the glass, and is refracted in different directions because
of the variation in the thickness of the oi l fi lm. Optics involving &:hlieren bars and lenses
projecl light Ihat is rc:fractcd in cettain directions on the screen. whil e other light is not
4 . 3
Rast er-searl Di..,..., Systems
, ..
TABLE " .3
COMPARISON OF DfSPlAY TECHNCl..OGES
El"""'- UquMi PWma
CRT luminescent

power (:oosunlpcion fai r fair- good

fair
KI"CCn site
Q<celknt good fair ucel!.!.n!
d<p<h
""'"
exccBent acellent good
weight
""'"
uocl k:nt CJlcelJcnl excellent
l'1.IUedness fair-g<JOd good-a.ccllent ... exeelk:nt
briahtness ex.cellent exccl lmc tair-soo<J
exoeUent
good-aceJknl good fair"""1fDOd
""'"

good--aoeJlent good fair good
intensity levels ptt dot ... fair fair fait
viewi", angle c:xoelknl
""'"
po<>"
pxw:I-cxcel lent
color- capMlility excellent
good good rair
CO&! range low medilun-ttig,h low

projeclcd. Color is possible with these sysLeans. through use of either three projectors or II
more sophislkated sec of with a single projector. More detai ls are given in
(SHER79I . Other si milar light-val\'(; systems use LeOs to modulate the light beam.
Table 4.3 summarizes me characteristiCs of Ihe four m:Uot display techllologies. 'The
pace of technological innovation is such, that some of the relationships may
change over the flQt few years. Also, llOle thaI the liquid-crystaJ comparisons are for
addressi ng: with active matri x addressing; gray leo.ds and colors are achievable.
More detailed information on rhese display tcclJnologies is giYen in (APT85; BALD8.5;
CONR8S; PERR8S; SHER79; and TANNSS).
4 .3 RASTER-SCAN DISPLAY SYSTEMS
The basic concepts of raster graphics systems were presented in Ch.apter I , and Chapter 2
provided further insight inlo the types of OperaliOllS possible with a raSler display. In this
section. discuss the various elemenbi of a raster display, sttessing 1\\0 fundamental ways
in which ..viOU5 raster systems ditrc:r one from another.
First, most raster displays have some specialized h.atdware to assist in scan converting
output primitives into the pixmap, and to perfonn the raster operations ofmovi ng . copying.
and modifying piJ[e1s or blocks of pillels. We call this hardwan:: graphicJ dispilly
procasor. The fundamental difference among display systems is how much the display
processor- docs YerSUS bow much must be done by the: gnprucs subroutine package
elleCuting on the gencr.t.I -purpose CPU thaI d r iYeS the raster display. Note that the graphics
display processor is aha sometimes called a (trophies cmurolkr (emphasizing its s imilarity
to the control unils for olila' peripheral devices) or a display coprocasor. The soc:ond key
ditrerentiator i. ra5(er systems is the relat ionship between the pixmap and lbe address space
of the general. purpose compl.uer s memory. whether the pixmap is part of the general-
purpose computer's memOf")' or is sep:u-nle .
In Section 4.3. 1, we introduce a Simple r!Wer display consisting of a CPU contai ning
lhe piltmap as pan of its memory. and a vKJeo controlhdriving a CRT. There is no display
processor. so .he CPU does both the appl ication and graphics In Section 4 .3. 2, a
, 88 HlIrctw.re
graphics wilh a sepanllc pixmap is inr:roduccd, and a wide range of graphic,,
procnsor functionalities is di"'!Jsreri in Section 4 .3.3. Section 4 . 3.4 discusses ways in
which the pixmap can be intcgllltcd back imo the CPU's address space, given the existence
of a ir.lphics processor.
4 .3 . 1 Si mple R ter Disptay System
1l1e simplesl and mosc common I1lner display syslCm organization is shO'-'ln in Fi8. 4 . 18.
The relal ion between memory and the CPU is exactly Inc same as in a nongr.lphks
compulCr HOWCIICr. a porti on of the memary also serves as t!le pixmap. The video
controlk' r displays the image defined in the frame buffer. accessing tbe memory through a
separate access port as often as the raster-scan ralC dictates . In many systems, a fixed
portion of memory is pennanenlly Ililocalcd 10 the frame buffer. whereas .some
have: se.-eral interchangeable memory areas (sometimes called pages in the persolllll -
compucer world). Yet Q(1\er systems can designate (via a register) any part of me:mory for the
frame buffer. In this case. the lystem may be organized as shOW"n in Fig. 4 . 19 . or the ent ire
sYSlem memory may be dual-ported.
The 8Wltcation program and graphics subf"Outine packaie share the system memory
and are executed by the CPU. The graphi cs package includes scan-l;O!lversion procedures ,
so that when lhe appl ication program calls, say. SRGP_ lineC(IOI"d, (xl, )"1, xl , ),2) , the
araphtcs package can set the appropriate piJr.cls in me frame: buffer (details on scan-
cORYCI"Sion procedUIU were in Chapter 3). Because the frame buffer is in the address
space of tM CPU. tM graphics package can easily access it to set pixels and to implement
the PixBlt instructions described in Chapter 2 .
The video control ler cycles through the frame buffer. one scan lioe at a time, typical ly
60 times pet" second. Memory addresses are generated in synchrony with the
raster scan. and the contents of the memOt-y are used to contTOl the CRT beam's. intenllil)' or
CPU p-,
"""""
"
System Frame
""""
/

""""'
.....-
""""'"
'-
Fig. 4 , 18 A common raster dispfay sys.tem arenitBCtUr . A dedicated portion of the
system memory is du.ported, 10 that it can be accessed directly by the video
controller, without t he system bus being t ied up.
4 . 3
,.7
CPU
Peripheral
. .-.
'"
~
.
,)'
Srllem V 1 d ~
,
"""'''''
mem<>O'
controller
./
Fi 1il . 4 .19 A simp le raSter display system arcnitect Ufe. BltClluse the frame buff81 may
be stOted anywhere ill system memory. the lIideo controller accesses the memor y via
the syst em bus.
colOr. 1be video controller is organized as shown in Fig. 4.20. 11K raster-scan generator
produces defl ection signab [hat generate tbe raslcr scan; it aJso colltl'Ol$ the X and Y address
registers . which in tum define the memory location to be acc;:essed next .
Assume that the frame buffer is addressed in x from 0 to..f ..... and in y from 0 to Y ... , ;
then, at the start of a R;fresh c)'Cle . the X addre51i ' eaiS1el" is set to zero and the Y register is
set to y.,... (tne top scan line) . As the first scan line is generated. lbe X addre. ..... is
illCremented up through x_. Each pixel value is felciled and is used to control the intcn$i lY
of lhe CRT beam. Afiu the first scan li ne, the X address is reset to zero and the Y address is
decremented by one. The pnxess cont mues until the last scan line (y :0: 0) I!> genentled.
Set or incrllm8l'l1
..

.......
~ ...
m
0
y ... en ... ,.., Sel (If deentment
,
'Y
Oala
" " ' ~ 1---------0 .... Intensity
nlue(e) I . or color
Fig. 4 .20 loglClIl 0(98nQ81ion of the video controller.
168 Grepf'lics Hardware
In this simpli slic situation, one tllCmoL)' l1<;l;e!>S is made 10 the: f,alne l ...... ife' for-
pixd to be displayed. For a medium-resolution display of 640 piuls by 480 lines rerreshcd
60 lime; pet" scoond . a simple W3)' fO lite time for displaying a single l-bit
pixd is to calculate:: 11(480 x 640 x 60) = 54 nanoseconds. This calculation igllOre..'i lhe
fact thai pixds are nOI bodng l.iisplayo:d during horizontal and venical retrace (see ExeJ"CIse
4 . 10). 8Ul typical RAM memory chips have cycle limes around 200 nanoseconds; They
cannot support one acress each ,54 nanoseconds! Thus, the vkloo controller mUSI fetch
mulliple pixel values in one memory cycle. In the lit hand. the controll er fetch 16
bits in one memOfy thereby taking care of 16 pixels x ,54 nslpil'd "" 864
mmosc:conds of refresh time. The 16 bits are 10lkkt.! into a register on the video controllu,
Ihen are shifted 001 10 control the CRT beam intcllSilY, one each 54 nanoseconds. In the 864
Ihis takes, thc::re is time:: for about four memory cyck'i: one for the video
controller and three for the CPU. This. snadng may force the CPU to wait ror memory
accesses, polenlill.lly redw;:ing the spc::ed of the CPU by 25 percent . or course, cache
memory on the CPU chip Clin be used to arueiorale this problem.
It may not be possible to fe tch 16 in one memory C)t:le. Consider Itte situation
when tile pixmap is implemented with five 64- KB- rnemory Chips . with each chip able:: 10
deliver 1 bit pet" cycle (this is <:alJed a 64-KB by I chip U'Tganillltion), for a total of 5 bits in
the 200-nanoseconds cycle li me . This is an average of 40 per bit (i.e. , per
pixel) . which is not much faster than the 54 nanoseconds/pixel scan nue and leaves hardly
any time lor lK"CeSSeS to the memory by Ihe CPU during the approximately
7microserond inlef-scanline retrace time and 1250-miaosccond interframe vertical
rc:trace time) . With five l2-KB by 2 chips. however, iO pixels are delivered in 200
nanoseconds, leaving slightly over half the time available for rhe CPU. With a 1600 by 1200
display, the pixel lime is 1/ ( 1600 x 1200 )( 60) = 8.7 nanost";(;()oos. With a 200-
nanoseconds memory cycle lime, 20018. 7 "" 23 pilcls rum! he fe tched each cycle, A 1600
x 1200 display needs 1.92 M8 of memory, whkh call be: provKted by eighl256-KB chips.
Again. 2S6-KB by 1 chrps can J'lmvNi" only 8 pi)(.eh per cycle; on the other hand. 32 KB by
8 chips can deliver 64 pi)[ei s , freeing ['Ml-thirds of the memory cycles fOl" the CPU.
Access to memO<)' by Inc CPU ami vioJl:o cOl1twller is clearly a problem: Table 4.4-
shows that problem' s. magnitude. solutton is RAM architectures that 3l;commodatc the
needs of raster Chapter 18 discusses these archilectures .
We tnus br assumed monochrome: , \ bil pef-pixcl bitmaps. This 'lSsumplion is
fine for some applications , but is grossly unsatisfactory for others. Additional cOlluol over
the intensilY of ea...-tl pi)[el is obt:tined hy storing multiple bits for each pixel: 2 bits yield four
intensities. and 50 on. The bits can be used to cootmillot only intensity, but also colOf'.
How many bits per pixel. are needed (Of" a stored image to be percl:ived as naving cont inuous
s hlides of gray? Fi ve or 6 bilS are often enough. but 8 or morc:: bits can be Thus,
fex color displays, a somewhat simpli lic::d argument suggests that three tiJllCS as many bits
are needed: 8 bits for each of the three additi ve primary red, blue , and green (see
Chapter 13) ,
Systems whll 24 bits per pixel are still rel:mvely however, despite the
decreasing cost of RAM. Furthe::rmore , many color applications do not
2:100 differem in ;1 single pi , lure ( which typkally ha'J onJy 2'" to 201) pi xels ), On the
other hand. there h often need for bot h a small number of colors in a given picture or
4 .3
Rast e r-5Can Syst ems 169
TABLE 4 .4
PERCENTAGE OF TIMe AN IMAGE IS BEING TRACED
DURING WHICH THE PROCESSOR CAN ACCESS THE MEMORY
CONTAINING THE BITMAp
!JS between Percent of time
ViSolbk are.:! Number Pixels accesSC$ by r<.)r pro<."'eMOr
)( Chie of chil2s access
accesses
!i12 x 512 x 1

64 0
512 x 512 128K x 2
,
'"
0
:i l l x 512 64K x 4

' 54
20
512 x ,S/2 32K x 8

=
J
512 x 512 16K x 16

10 17 80
1024 x 1024 x 1
, ,
... 0
1024 x lOlA 121lK x 2
,
."
0
1024 X 1024 64K X 4


""
20
1024 X 10'24 J2K X 8 4
"
407 60
1024 x 1024 16K x 16

64 1011 80
1024 x 1024 1M X I

I 16 0
1024 x 1024 MK x 16 I

' 54
21
\024 x 1024 32K x 32 I 32 '509
"
A 200 nano.econd memory .' ycle lime 6O.Hz d15pJay rare are asstlmed througooill . The pi xcllimc for ..
X 5 12 .;Ii<pLoy n<.urnt:d 10 64 """"""'o" .... ,h (0'1 1024 x 1014. 16 ... The"" time>! ""'
liberal in<:e they do no( inch>de t he honzonUll and "'Crlical rtU'lCt: limes; the l.re KluaJ ly about 45
and I J.5 rnpectivcly_
application and the ability LO chang<:: colors from picture to pkture Of" from application to
applicatM>n. Also, in many image-anal ysis and image-enharx:emcnt applications , it is
desirilble \0 ch:mge the visual appearance of an image wi thout changing the underlying data
the image , in order. say, to di splay all piu:1s with values below some threshold as
black, TO e.'IJm1KI' an intensity IOInge , or to create a pseudocolor display of a monochromatic
image .
For these various reaoons, the video controller of raster displays often includes a video
look-up rable (also called a look-up table or Lun. The Iookup table has as many entries as
there are pixel values. A pixel's value is used not to control the beam direcll y, but rather as
an indo; into the look-up table . The table entry's value is used to control lhe intensity or
color of the CRT. A pixel value of fi 7 WOIJ ld thus cause: t he contents of table enny 67 to be
accessed and used to conrrol the CRT beam. This look-up openltion is done ror each pixcl
on each display cycle, so the table mUSl be 8ICS'libk: quickly, and the CPU musl be: able to
load the look. up !able on pTOgl1lm command.
In Fig . 4.21 , the look-up table is interposed bet ..... een the frame buffer and the CRT
display. The frame buffer has 8 bits per pixel. and the Iook-up table therefore has 256
enlries,
The si mpk raster display system organizations of Figs. 4. 18 and 4. 19 are used in many
inexpensive personal Such a system is inexpensive 10 bui ld, but has a number of
disadvantages . First. scan conven;ion in software is slow. For instance, the (x. y) address of
ellCh pixel on a line must be calculated, then must be translated into a memory address
consisting of a byte: and bit-within-byte pair. Although ellCh of me iooilljdual .steps is
simple, e3Ch is repeated many limes. Software-ba.sed scan convnsion slows down the
170 Gf"aphics Hardware
I
y
Pixel In
bilmap
al ....... y '
o 0-----=-=-----,0'
o 11_ 11"..,.
Frame buffer
255
1 1
67 100110100001
Look-Up lable
'00'
R G
Rod
Green


o
Pixel
displayed
8 1 It', y'
Ml)(lilor
Fig. 4.21 Organization of iI video look-up table . A pixel With value 67 (binary
010000 111 is displaved on the screen w ith the red electron gun 3t,\of maximum. green
8t"*. and blue alTS"' This look-up t able is shown with 12 bits per entry. Up to 24 bits are
common.
overall pace of user interaclion with the application, potentially creating user dissatisfac-
tion.
The second disadvantage of thi s architecture is that as the addressability or the refresh
rate of the display increases , the number of memory accesses made by the video controller
also increases, thus decreas ing the number of memory c,."ydes available 10 the CPU. The
CPU is thus slOW'Cd down, eo;pecially wi th the architecture ift Fig. 4.19_ With the
dual-porting of part of the system memory shown in Fig. 4.18. the slvwdown occurs only
when the CPU is accessing the frame buffer, usually for scan conversion or raster
operations. These two disadvamages mus t be weighed again!>l tbe ease with which the CPU
can access the frame buffer and agaillSt the an:hitcctural si mplicity of the system.
4.3.2 Raster Display System with Peripheral Display Processor
The roSIe(" display system with a peripheral display processor is a common architecture (see
Fig. 4.22) that avoids the disadvantages of the SImple raster display by introducing a
separate graphics processor 10 perform graphics fllnctions s uch as scan conversion and
raster operations, and a separate frame buffer for image refresh. We now have two
processors: ttle general-purpose CPU and Ihe speciiiJ-purpose display processor. We also
have three memory areas: the syslem memoJ)', the display-processor memory, and Ihe
frame buffer. The system memory holds data plus thC)Se progrums that execute on the CPU:
the application program, graphics pac1::age, and operating system. Similarly, the display-
processor memory holds data pillS the programs that perform scan conversion and raster
operations. The frame buffer contains the displayable image created by the scan-conversion
and raster operHtKms.
10 s imple cases , the display processor can consist of specialized Ingic to perform the
mappirtg fmm 2D (x , y ) coordinates to a linear memory address. In this case, the
scan-conversion and raste(" operations are s ti ll perlOrmed by lhe CPU, so the displHY-
processor memory is not needed; only the frnme buffer is presenl. Mos( peripheral display
processors also perform .scan (."Onversion. In this sectioft, we present a prototype system. Its
4.3
Raster-scan Display Systems 171
CPU PWlpheral
devices
<'
.
'>
.
.
[);splay S ysl',lrn
processor memory
Display
Frame VICl eo
processor
buff .. ccntrollef
MOOllOr
_ 0,
"-
./
F;g. 4.22 Raster system architecture with a peripheral display processor.
features an: a (sometimes simplified) composite of many typical commercia1ly availabl e
systems, such as the plug-in cards used with IBM' s PC. :<T. AT, PS , and
compatible computers.
The frame: buffer is 1024 by 1024 by 8 bits per pixel, and there is a 25b-entry look-up
table of 12 bits, 4 each for red, green. and blue. The origin is at left, but OfIly the first
768 rows of the pixmap (y in the: range of 0 to 767) are displayed. 1be display has six status
registers, which are set by various instructions and affect the execution of other instructions.
These are the CP (made up of Ihe X and Y position registers), FILL, INDEX. WMODE.
MASK. and PATTERN registers. Their operation is explained
The instructions for the simple raster display att as follows:
Move (x , y) The X and Y registers that define the current position (CP) are set to x and y.
Because the pill map is 1024 by 1024 , x and y must be between 0 and 1023.
MoveR (dx, dy) The values dx and dy are added to the X and Y register.>, thus de fining a
new CPo The dx and dy values must be between -1024 and +1023, and are
represented in 2's-complement notat ion. The addilt<m may cause overHow and hence a
wraparound of the X and Y register values.
Line (x. y) A line is drawn from CP to (x, y) , and this position becomes the new CPo
Line.R (d", dy) A is drawn from CP to CP + (th, dy) , and becomes the
new CPo
Point (x. y) The pixel al Ct" . y ) sef , and this position becomes the new CPo
PointR (dx. dy) The pixd at CP + (dx, dy) is set, and thi s position become:> the new CPo
172 Graphic. Hardware
Reel (.." y) A rectQnglc is d..-n bclw=n the cr and (x, y), The C P ullltrTOXII;:U.
RectR (d:c, dy) A rectangle is drawn between the CP and CP + (d..: , dy). The parameterdx
no be thought of as the rectangle width, and dy as the height . The CP is tlnaffected.
Te:>. t (n , address) The" "haracten. at memory location addreSS displayed. starting at
the CPo Char3(;te rs are defi ned on a 7_ by 9-pixel grid, with 2 e:>.tra pi xels of vertical
and hor izontal Sp;ldng to separate (.-haractef1 and li nes. The CP is updated to the
Jower-Ieft corllC1'" of the area in which cnaral..' ter n + I \WlUld be di5iplaycd.
Circle (mditls) A ci rcle drawn centered at the CP_ 'I be CP is unaffected.
Arc startAnxfe, endAng{e) An arc of a ci rcle cenlered at the CP h" drawn. Angles
are in tenths or It degree . meas urro positively counterclOCKwi se from tho<: x ax is. Thr
CP ImaffC"Ctt.xL
CircleSector (radius . f/artAnx/e, endAnK/1.") A ' ' pie sl ice" is drawn consisting o f a dosed
an:a with lines going ftom the CP 10 the of the arc_ Tile CP is unaffec ted
Polygon ( n . uddrt.'!;s ) At addr"-f is stored a vertex list (XI' ,Y,. xz.)',o. Xa' )'3' , . . Xo' y.). A
polygon druwn starting al (XI' )"1 )' through all the verte:<es up to Y.). anc11hcn
back 10 ( Xl ' >"1) ' The CP is unaffected.
AreaFil1 (flux) The flag i:o. u.;e(\ 10 set the FILL flag in the raster dispu y. When thoe Hag
set to (by a nonzero value of all the areas c reated by the commands Reel,
RectR, Circle. CircleSect()(, Pulygon an: filled in as they are created , using the panem
defined with the Pattern command.
PiltclVa!ul;: (vu/e.() pixel V"dlue index is loadI::d into the INDEX legi.ner. yalue is
lo"dcd inlo the pixm"p when any of Ihc output primitives in the preceding list are
.scan-convened.
PaHem (rnwJ. T"{,w2. __ , mwl6) The 16 2-bylc argumenL\ define tho: paltem used lu fill
areas created by Rect, Rcc!R, Circle. CircICSecl0 .... and Polygon. The pattern is a 16 by
16 "ITa)' of bi ll>. stored in the PATT(;RN .-.:;giste. . When a filled alea is being c realed
and the FILL register is ON, then , if a bit in the PATTERN register is a I. the pixel
value in the INDEX regi ster is loaded into Ihe pix map; otherwise. the pix map is
unaffected. A solid fi ll is CTCated if all the bits of the PATTERN register are ON.
W8 lockR (dT, dy. addres:y) 1be 8-bi t pixel YdlUC5 s ton:d starting at address in main
memory an: "'finen intu n:clangular n:giofl uf the pixmap from ep to CP + (ax,
dy) . Wriling begins at the upper-left corner uf the regM.lfl and proceeds row by row. top
to bottom.
RBlockR (dx . dy, A rectangular region of the pix map. from CP 10 CP + (d..t ,
dy) . is read rnto the main memory area begjnning at adJreJs. Reading begins at the:
upper. left corner of the: regKm and prucr:cds row by row. top to bottom.
RasterOp (d..rt, dy .niI'SI , )deSI) A rectangular regiun of the frame buffer, (rom CP to CP +
(dx. dy), is with the region or the Sllme sin."; with corner at (mest,
)Ut!ll ). ovcrwriting that region. Tltc combination is controlled by the: WMODE regbte r.
WMode (motk) Th.e value of IS J(Ja(kd into the: WMODE This fCgister
controls how p".el s in the fr .. me buffer arc: combined wit h any value being written
into the framc buffcr, TIlt:re are four mode values; replace. xor, and. and or. The
4 .3
Raster-scan Display Systems 173
mocks behave described in 2. NUl .: t li at , It,,- simplicit y . the pn:c eding
command des.criptions have been wriucn as though ft!place wt:re the only write-mode
value. In xor mode . nC\' val ue!. WTinen into the frame buffer are combined with the
current value usi ng a bit-by-Ilit exct usivC-QT operation.
Mask (ma sk) The R-bit masl.: value h loaded inlo the MASK regIster. This register
controls which hit .... of the frame buffer mlXlified during writing to tne frame buffer:
1 modification of the c orre!oponding bi l; 0 modification.
LuT (indeA. red, green , h lue ) Entry i l!(in: in the look-up table h imtl.h:lf with the given
colo r s pecificalion. Tbc low -order 4 bi t .... o f each color component are loaded into the
tahle.
Table 4 .5 summari zes commands _ Notice that the MASK and WMODE R'gisters
affeet all comma nds that ""Tite intu the frame bufti..-t-.
The oommand!> and imme diate dat a are to the display pruccs.:.or via a
fiTSt-in _ fi l'it-out (FIFO) buffer (I.e . , a queue) in a dedicated portion of the CPU address
space. The graphics package places commands into the queue . and the display accesses the
and t hem. F'I)inte rs to the start and e nd of the buffe r are also in specifi c
memory localions, aCl: essible 10 both the C PU and display . 1be pointer to the start ( )f Ihe
buffer is modified by the display processor each time a byte is removed: the poinler tu the:
end of the buffer i!> modilied by the CPU each time a byte is added. Appropriate testing is
done (0 ensun: thai an empty bulfer is not read and that a full buffer is 001 wrinen. Di rect
memory b used to fetch the addressed dat a for the instructions.
A queue IS more anractivt: fUT command pa!.Si ng than is a single inslructiOl'l or
localion accessed by the di splay. First. the varia ble lengt h of the instructions favor.; the
queue concept. Second, the CPU can get ahead of the and queue up a number of
di splay Wht:n the CPU display commands . it can proceed
to do other '-".Jrk whi le the empties out the queue .
Programming examples. Programmi ng the dis play similar to using the SRGP package
ufChapter 2. so only a t(>w examples will be given here . A "Z" that a hexadecimal
value is being speci fied ; an . . A" thaI the address of the following pare nthetkallh'l is
used.
A white line on a completely hl ack hackground is created as
L,T
L,T
WMode
AreaFil1
Pancrn
Mask
PixdValue


Pixt:lYatue

LineR
5, 0. 0.0
6, Z' F', Z f' . Z'F"
","oc,
'roo
32Z' FF
Z' FF'
,
o. 0
]()23, 167

100. 100
.">00. 400
Look up-lable ent ry 5 is black
Look-up-table entry 6 is white
Turn on the FILL lIag
32 bytes of :111 Is , for w lid pallern
Enable wr iting tu a ll plana
s... .. n ";''''",,11 ..... In!!. plM'1 value 01 5
Visihle p"rl of frame buffel n{M' black
Scan .,-,Iiue of 6
DrdW (he Ii ...,
TABLE 4,5 SUMMARY OF THE RASTER DISPLAY COMMANDS'
CommarKI
mlltmonic
MM,
MoveR
Line
UneR
Poinl
Poi rnR
R<d
ReclR
Text
Circle
A.
CirdeSet.1nc
""-
Are.FiJi

Pancm

RBlodR


WMod,
LoT

and Icogills
.t(2),
dx(l), dy(2)
l(2). y(2)
d1'(2),
.J(2), Jl 2)
d.(1l, d){l)
.1'(2), )'(2)
dx(2), dy(2)
nt l) , udd/'f'SJ(4)
Tildius(2j
r.:ldius(2), stufl,\rwIt'(2), tlldAlI,I'lc(2)
radiIlS(2) , llw'rAngft(21. tndAlI$/t(2)
11( 1),
.JI<:l&( I)
intk.t{ 1)
addms(4)
df( 2), Qdduu(4)
d)(2),
d,f(l ), dy(2), .uk.Jt(2), dm(2}
musl{1)
"""" II
mdr.f(l), rtd(l), Nfl'm(l), blut{J)
How CP IS
atrcclat
CP := (x, y)
CP: "" CP + (Ib:, dy)
CP :"' (x, y)
CP:= Cp + (.lx, dy)
CP;= (:C, y)
CP ,- (1) + (dx, tlyl
CP: = m:X[ po, ' n
iU:&l\IlM chal
alfccl COOlIl\lOO
CP
CP, INDEX, WMODE, MASK
CP, INDEX, WMODE, MASK
cp, INDX, WMDDE, MASK
CP, INDEX, MASK
CP. INDX, WMOO{ , MASK, FILL, PAlTERN
CP, INDBX, WMOOE. MASK , ALL, PATrHRN
CP, INDEX, WMODE, MASK
CP, INDEX, WMODE, MASK, fiLL, PATTERN
CP, INDEX, WMQDE, MASK
ep, INDEX, WMOOE, MASk. ALL. PATfER,N
cr, INDEX, WMODE. MASK, ALL, PATTERN
cp, (NDl:X, WMDDE. MASK
cp, INOEX, WMOOE, MASK
CP,INDEX, WMOOE, MASK
' The ptrcntllc..e. deer no;lI ;s IIw I.Ikr' l It"ilh in Irytn 1\1100 Il'IIIicatcd 3'" IhI: elkC1 of the C<1mmlnoJ on lbe: C'P, ano.i "'hith
rqJ.<.icrs affecl b(rw IhI: commaII'.! ope' Bld,


"



I

4 .3
Raster- scan OisP'iIIY Systems 175
A red c llcle a blue' triang le . all on II black hackgTOUncI . are c real ro wilh:
L.T
L.T
L.T
WM(>t.ie

Panent
Mask
Pikel Value
..
"'"'
Pi:>.eIVatuc

PixelValue

Ci rcle
5.0,0, 0
7.Z'F',O,O
S, 0 , 0, Z 'F'
repl>l<.-'t:
Z'FF'
32Z' FF'
Z ' FF'
S
0 .0
Look-up--table entry 5 is blitd:
Lool:-up--tabk entry 1 is red
Look-uP-labk entry 8 is blue
00
32 bytes of all Is , for solid patient
Enable wnling 10 all planes
<Xl for bl.iock rcctal1t le
1023, 767 Visible: part of frame buff", now black
II Next do bl u.e triangle"" a Ihreeveru:x polygon
3, A(200 . 200. 800, 200, j()(), 100)
7 Put cirde 0<1 lop of triangle
5 1 I . 3ft) Put CP at cenl.,! of .. ;..,,!lor
100 Radius- IOO circle at CP
4.3.3 A.dditional Display Processor Functionality
Our simple display processor perfonns only some of the graphics-related operations thaI
might be implemented. The temptation faced by the system designer is (0 offload the main
CPU and more by addil1g fuoctMlnalit y to the processor, such as by using a
local memory to store lists of display instruct;ons, by doing clippi ng and the wind()ll,1l-lo-
viewport Iransfonna tion. and perilaps by prOYiding pick-correlation logk: and automatk:
feedback wh!:n a segment is picked. Ullimatel y. the: display processor becomes another
geocal purpose CPU doing interactive graphics work. and t he designer is again
tempted to pl"Q\'tde spedal-function hlU"dware to offload the display processor.
This 'l4'Nel of rrincarrwlion was identified by Myer and Sutherland in 1968
[MYER68 ). These aUlhors point....-a..ll that there i5 a tradeoff between , pedal -pur poo.:ee and
general-purpose functionali ty. Special-purJX>SC:: hardware usually does the job faster than
does a general -purpose proces.sor. On the other hand. special-pur pose hardware is more
expensiv!: aoo cannot be used for other purposes. This tradeoff is an enduring theme in
graphics system design.
If cljppil' (Chapler 3) is added 10 the d isplay processor . then output primitives C".m be
speci fi ed to the processor in coordinates other t han device coordinates . Thi s :.-pecification
a n be done in " oatingpoi nt coordinates. a lthoug h S() me d isplay processors Oper.ite on only
integers (thi s is changing rapidly as inexpensive floating-point chips become available). If
only integers u....ro.. the coordinates u!>l hy (he applicatIOn program must be integer. Of"
the graphics package must !Dap float ing-point coordinates into integer coordinates . For this
mapping to be possible. applkalion program must. give the graphics package a ra:langle
to enclose the of all output primitives specifi ed tn the p."\Cbgl'". The
rectangle mu; then be mapped illlo t he maximum integer range . w t!\at everything withi n
the rectangle is in the: integer coordinate ,.. .. nge.
If the liuhn">uti ne pw.:kage is 3D. then the display pruce. .... <;or can peTform the far more
complex 31) geomcuic and I.:Jipping desc.:ribed in Chapters S and 6. Alw . if
the package includes 3D surface pri mi tives, such as polygonal areas , the di splay processor
176 Graphics Hardware
can also perform Ihe visible s U1face-determimuioo and rendenng steps discussed in
Chapters I S and 16. Chapter 18 di!>CuS$:s SOniC of the fundamental approaches to
organi l ing and special -purpose VLSI chips to perform these Sleps quickly. Many
commercially avai lable display. provide Ihcse fealures.
AnO<her fUflClion thai is often added to the processor is locol s torage ,
also called displuy l;sl .florUgt! . Di ,"p1lty inS' ructions , grouped into named and
having uoclipped inleger courdinates, are sloud in the display-proccs.'\Or memory,
perll1illing Ihe display proces...wr to operat e more aUlOnomously fTom Ihe CPU.
What cuctly ca.n a display processor do with these stored segmen(.<;? II can transform
and redraw them, as in :rooming or scrol ling. Local dragging of sq;ments inlO new position5
can be pmvide<i. Local pickin
b
can be implemented by having (he display processor
compare the cursor to all the graphics primilives (more effident ways of doing
aTe discussed in Chapter 7). Regener.t tion, n:quired to fi ll in the holes whc:n a
segmeot is erased, can abo be done from segment storalC. Can be creal.ed,
deleted. edited, and made vi sible or invis ible.
Segments can al so Ix copied or referencc:d, bot h reduci ng Ihe amount of information
that must be sen! frum the CPU 10 the processor and eeollOmi1.ing on in the
displ ay processor itself. For instaoce . the display to create a VLSI chip pad
configuration 10 Ix used many limes in II drawing can be scnt to lht:: processor just
once and can be stOJ"Cd as a segment. Each ()t:CUtrenee of the pad is then sent as II display
instruction rrfcrencing [he segment. It IS possible to build up a complex hier3.TChical data
strUCture using capability. and many commercial display processors with local segmcnl
memof)' can copy or reference other segments. When the segments are displayed, a
10 another segment muSI be preccde<! by savi ng Ihe display proceSSOr" S (.-urrcnt
stllte. just as a call is preceded by saving the CPUs curn:nt stme . Rcferen(;es
can be nested. living ri!;C In II displuy fill! or displo.y lisl . u in PHlGS
lANSI88), .... hich is funher in 7. In the GKS graphics package
[F.NOFJl;7; HOPG86] , which UM.!S II linear. unncsled di!<play Ii SI, au c.>;i sting segment can be
copied imo a segment that is beIng
The segment data Mructures need. 1101 be in the memory (Fig. 4. 22);
They can be built dice(:tly by the graphi cs package in system memO{)' and acco:ssed by the
display proct'5..;m. Thi s opeion, of course , rC<juires that me display processor be able 10 read
rrom memory, which implies that the; dispby processor mUSl be dirccdy on thc
system bus----RS-232 aod Ethernct -speed eonna.:tions are nOC viable.
[f all the in iormati on being displayed is represcnted in a segmenl da{a structure, tllen
the display processor can also impiemcnt operatiOfls such as rT)()VC, open,
clO6C. resize. 50;1011. 11u.\Jl . and pop. When a window is panned, lite segment. .. are
retraversed with a new viewing transfonnation in effect. At some point. the wheel of
reincamatKm will again come into play, bul we must also keep in mind Ihe startlingly low
cost of special -purpose VLSI chi p!': By lhe time this book becomes (l utdated. window
manager .. 'hips are likely to cost only a few dollars each. Indeed. . the pace of technological
innovation such that the graphi cs functionalifY found in display processors will continue
irs dramatic increase in scope: and decrease in cost .
Although thi s mslcr system architet .. .. ure wilh its graphics di splay and separate
frame buffer has many advantages over the si mple raster display system of Section 4.3. 1. it
4 .3
Raster-scan Dbp"'y Systems 171
abo has "Om" disat:hamage<i . If [he is <K:t:es..'>cd by 1111,; CPU as <l p;riVItt:tal
on a direct-memory-access pori or on an RS-232 interlace. Ihen there is
oper.)ling-system overhead each li me an instruClion is pa.''iCd [0 il (thi s is not an iss ue:: for:l
di splay p!"OCessoT whose instruction register is memory-mapped inw the CPU's address
sp3Cc, since then it is easy for (he: graphics package to set up lhe n:giSlers direclly).
Thcre also a marked partitioning of the memories, as was shown in Fig. 4 .22 .
Building Ihe display in (he display-li st memory is slow because of the need 10 is.sue a
di splay-procesSOf 10 add or delete element s. The list may have. to be
dupliClUed in the main processors memory. bct;.lIuse il cannot always be read back. An
environment in whidl the di splay list built directly in main memory by the graphi cs
subroutine packagc can Ihu5 be more tleJl.ible, fal;(er , and easier 10 program.
The conmund is a patl kular difficulty . Conceptually , it have
four potcntial pairs: system memory 10 system memory,
memory 10 frame buffet", f1'1lme bulTer to SystCfll memory. and framc buffer to frame b uffer
(here, [nc frame buffer and display of Fig. 4 .22 are considered identical ,
they are in (he same addrr.;s space) . In display-processor s)'Slems. however. the
diffe rent soun::c-dcstin:tlkm pain arc handled in different ways. and the system-mcmoryto
system-memory em;(: may nor exist. Thh lack of symmelry compl icates Ihe
task and reduces f1e.\ibility . Foe example, j l' the otfscrccn portion of the pixmap becomes
fi ll ed with menus, fonts . a nd so on, then it is difficul t to use main memory as an overfl ow
area. Funhermore. because the use of piltmaps is so failure lu support rastet
openItions on pixmaps in main memory is no( really viahle.
Another problem is that the output of scan-con\Cf'Ston must go to the: frame
burrer. This requirement preclude!; scan corl'tt1ing a new image into
system memory. the n copying it into the pi xmap 10 replace the image currently stored there.
In addilion. certain window manager slntlcgies and animation techniques require part ially
or completely llbS(:ured windows 10 be kcpl current in canvases, again requi t in.g
sean con",.,rsOon into (Chapters 10 flnd 19) .
The display processor defined earlier in this section, like many real di s.play processors,
moves raster images bet ween tho! s)'lilem memory and frarTlC buffer via 110 transfers on the
system bus. Unfortunately, this movement ca n be 100 slow for real rime operations , .such as
animation. dragging , and popping up winduws and menus: The time taken in the operating
system 10 initiate the transfers and the traMfer rate on the !''IllS get in the way. This probl em
can be partially relieved by the display processor 's memory to ho!.d more
offscreen pixmaps , but then that memory is not available for other pUrpo5CS.......;Ind there is
almost IleYeT e nough memory anyway!
4 .3 .4 Raster Display System with Integrated Display Processor
We can ameliorate marlY uf the shortcomings of the peripheral display processor
in the previous section by making the frame buffer part of the system memory, thus creatin,!:
the single-addre.u-space (SAS) display system architecture shown in Fig. 4.23. Here (he
di splay processor. the CPU, and the video controller are all on the system bus and can thus
all access l,y!;1em memory. The origin and. in some cases. the size of Inc frame buffer ute
held in registers. making double-buffering a si mple maner of reJoading rhe- register: The
178 Graphics Hardware
CPU
DIsplay
Penp/'leral
processor
devices
L-

..-
">
System "ideo I
MorIllO!"
mo"""Y controller I
'-
Fig. 4.23 A single-address-space (SASI raster display system architecture with an
integral di splay processor. The display processor may ha .... e a p ri .... ate memCH'"Y for
algOl'"ithms and working sto rage.
of scan u mven,;ion can go eithe into the frame buffer for immediate display. or
elsewhere in system memory for later display. Similarly. the source and destination for
raster operations performed by tbe disptay processor can be anywhere in system memory
(now the only memory of interest to us) . This arrangemenl is also attractive because the
CPU can directly manipulate pixels in the frame buffer simply by reading or writing the
appropriate bits.
SAS architecture has. however, a number of shortcomings. Contention for access to the
system memory is tbe most serious. We can solve this problem at least panially by
dedicating a special portion of system memory 10 be Ihe frame buffer and by providing a
second access port to the frame buffer from the vi deo controller, as shown in Fig. 4. 24.
Another solution is to use a CPU chip comaining inslruction- or data-cactle memories, thus
reducing the CPU's dependence on frequent and mpid access to the system memory. Of
course, these and olher solutions can be integrated in various ingenious ways, diM:Ussed
in more detai l ill Chapter 18. In the limit, the hardware PixBlt may work on only the frame
buffer. What Ihe application program01el" sees as a single Pix Bit instruction may be trealed
as several different cases , with Mlftware simulation if the source and deslinalion are not
supponed by the hardware. Some processors are actually fast enough 10 do this, especially
if they have an instruction-cache memory in which the tight inner loop of the software
simulation can remain _
As suggo.ted e-dfIier , nuntr.1ditionaJ rnemory-chip organizations for frame buffers also
can help to avoid the memory-contention problem. One approach is to tum on all the pixels
on a scan line in one access time . thus reducing the number of memory c)'l:les needed to
scan convert mto memory, especially for tilled areas. The video RAM ( VRAM)
orgllllizalion, devdopc::d by e .. n rr:ad out .. II the pix.c:ls on a selin line in
one cycle, Ihus reducing the number of memory c)'l:les needed 10 refresh the display. Again,
Chapter 18 gives more detail on thesr i!)!Sues.
'.4
The Video Controller 179
CPU
Display
Penpheral
processor
"'''''ti

,
(
...
.I
I
System Frame
V...,
Moni1Ot
memory bv' M
controller
Fig. 4.24 A more common singJe-addf"ess-space raster display sy stem architecture
wit" an integral display processor (compare to Fig. 4 .23). The display processor may
have a private memory for aJgorithms and working storage. A dedicated portion of tile
system memory is dual-po.-ted so that it can be accessed directly by me video
controller, without the system bus being tied up.
AnOlheJ" design complication arises if the cpe has a virtual address space. as do the
commonty used Motorola 68OXO and Intel 80x86 families, and vareous redoced-instruclion-
set-computer (RISC) processon. In this case memory addresses generated by the display
processor must go through the same dynamic address translation as other memory
addresses. In addition, many CPU architectures distinguish bel\o\lCc:n a kernel operating
system virtual address space and an applK:ation program virtual address space. It is often
des4rnble for the frame buffer (canvas 0 in SRGP tenninology) 10 be in the kernel space , so
that the operating display device driver Can access it directly. Howevoer. the
canvases allocated by the application program mUS( be in lhe application space. 1berefore
display instructions whkh access the frame buffer must distinguish between the kernel and
apptication address spaces . If kernel is to be accessed. then the display instruction must
be inYOked by a time-consuming operating system service call mther than by a simple
subroutioe call .
Desptte these potential complications . more and mon: raster display systems do in fact
have a single-address-space architecture, typically of the type in Fig_ 4.24. The fleAibility
of allowing both the: CPU and display processor to access any pari of memory in a uniform
and homogeneous way is very compelling, and doe!. s implify prugrilmming.
4.4 THE VIDEO CONTROLLER
The most important task for the vKfeo controller is the constant refresh cl the display. There
IU"e two fund.:lmenlal types of relresh: interlaced and noninterlDad. The fonner is used in
broadcast televi sion and in rasler displays designed to drive regular televisions . The refresh
cycle is broken into ('M) fields. each lasting thus, a full refresh lasts*sccond. All
180 Graphics Hardware
odd-numbcrc:d scan lines d l"playcu In lhe: tir:.1 field , .. nd .. 1/ even-numbered arc
displayed in Ihe second. lnc purpose: of inu:riace:d scan is 10 place new
information in 311 areas of the ",: r.-en al a 6O-H'l rate:, s mC!:: a 30 H:I! refrt:l>h Tale lends to
(:ausc: flicker. The nct effect of interlacing is 10 produce: a pictuTC who.o;c: dfectiYC refresh rate
is clOM:r 10 (lI) thall to 30 H. TIm. It:dmi'lw: worb long adjocem lines do in fact
display similar inft1rmation; an illlage consi sTing of horiuntal lines nn alternating scan lines
would fiicker badly. Most vide:o controllers refre5h 31 6IJ or mort: Hz and usc a
noninlerlacc:d :.can.
The output from Ihc video control ler ha.'i Ilnc of three ROB , monochrome. or
NTSC. For ROB (r<XI . green, blue). S<:p3rale carry Ihe red , green. and blue s ignals to
control the threc electron gum 1)1' a CRT, and anOIheJ- cahle: carri es the
synchroni zation to signal the Slilrt of verti cal and i'lQri,w ntal retrace . There are standardii foc
Ihe wave shapes. aoo timings of RCD Signals. For 4.8O-scan-lim::
monochrome: 1oignals, RS-1 70 is the standard; lor color. RS- J70A; frn- higher resolution
monochl'Ol'lW signal:. , RS-343. Frequently. the synchnmization timings included on the
same: cable as the grcc:n signal. m which case the signals are eall.:d composite video.
Monochrome use the same Slandards but have only intensity and synchronization
cables . or merety a single c:'lble carrying intensit y and synchroni L3tion.
NTSC (Natiofiil l System CommiUee) video is the signal format U!>ed in
North Amera;an ennllnercialtdevision. Color. intensit y. and !>ynchronizatiun infomlation
is combined Into a !ignal witll it b.mdwidth oralxlul 5 MHz. bruadcast as 525 scan lines. in
I'NO fields of 262.5 lines eadl . Just 480 lines are visible; the: resl occur during 1M vertical
retrace: periods al the eoo nf each field. A m(>flochromc: television seluscs the intensity and
synchronization infonnation;:1 color television set abo the color information to control
the three color guns. The tJandwidth limit allows many different television channels 10
broadcast oYl:r the frequency rdngc allocated to televi ston. Unfortunately. this bandwklth
limits pk:turc: quality to an effective reS()l ulion of about 350 by 350. Neverthel ess. NTSC is
the standard for videotape-recording il<quipmcnl. Malic..,. may improve, IK.M-C""CI , willI
increasing interest in lOOO-line high-definition televi!>ion ( HOTV) for videOiaping and
sate:llile broadcasting. European and Soviet tclevision broadcast and videotape s tandards
arc 1\\0 625-scan line. 5O-H SECAM and PAL.
Some video controllers superimpose a pJOgrammable CUniOr. stored in a 16 by 16 Or" 32
by 32 pIX map. on lop of the buffer. Thi s the need 10 Pix Bit the CUTSOJ' shape
int o lhe: frame butftr each relfa.h cycle . slight ly rcduci ng CPU overhead. Simi larly. some
video conlrollers superimpose multiplr small , fiM:d'$ize (called sprites) on lop of
the: frame buffer. This leaturc: is used often in 'video game!>.
4 .4 . 1 Animation with the Lookup Table
Raster image:! can be: animated in !;cveral W.i)'S . To show a rotating object. we Clln scan
conven inlo lite: pixmap sucL"essi\e views of the objttt from slightly different locations. one
after the other. This scan mUM be done at 10 (preferably 15 to 20) times per
.second to give a reasonably effect . and hence a new image be creat.ed in no
more than 100 mill i$eConds . HO"o"ever. if scan-\.'Onverting the objec:t lakes mudl of this 100
miJli:o;cconds-say 75 milliseconds _dtc:n the complc:tc object can be displayed (or only 25
4.4
The Vid.o Controeler
,.,
mill iseconds t:N: fOfl:' if must be: I:'ntSt:tJ and EaJrifWn--<l uislrdCli ll8 efft:t;L Duuble buITerin,g
is used to avoid this problem. The frame buffer is divided into Iv.o images . each with half of
the bits per of the overall frame buffer. If we call the: two hal ves of the piunap ;mageO
and we citn describe t he a nimatio n as follows:
LaGd lookup lobi" /0 display " II n ,/ .. <" a$ backxrourtd c% r,
Scan ob}"" f i" ,o imugdJ:.
Load look-up lab/I! /0 d ... p lay Qtl t)'
d. {
Sea" oom'u l obi t'., i1l '" im<lgd:
Load look-up labl", u> display only imag .. l :
Rofote obj t er dLJra .tlrUClu('f' deJcriplion:
Sron obj ect into imageO;
lDiJd ltd-up tabl .. to duplay (ml), inlallt'O:
obj .. , t iWta Sl fllClurt du cript;oll;
} ..,hUt, (rim U l71I inau d) ;
Of course. if rOtatilli: and !'.Can convertIng the objecllakes more than 100 milliseconds, [he
animalion is quite jerky, but the IransilKm frOm one image to lhe next appears to
inslanLaneous, as loading the look up table lypK:ally Iakt::s less than 1 millisecond.
Another form of animal ion di spl3)'!l a short, repetit ive sequence: of
Images lSHOU79] . Suppo!oC" .... 'C "'lIn ! 10 "isplay It bouncing ball . Figure 4. 25 shows how the
framc buffer is loaded; the numbers indicate the pixel values placed in ea(..il region of the
frame buffer. Figu re 4 .26 shOVo's how 10 load the look-Up table at each step to display all but
one of the ball s at back.ground ullor O. By cycling the contents of the look-up table , we can
achi eve mocton effects. Not only can balls be bounced, bUI the effect of moving lights on
movie marquees can be simulated, as can the mOrion of fluids rhrough pipes and the mllt ion
of wheels. This is discussed further in Section 21. J.4.
Fo,- more complieated animation. such as rotating OJ complex wi re-frame object,
it may be impossi ble to keep the images from overlapping in the frame buffer. In
that case, some of the dispJayed images will hllVC " holes" in Ihem. A few such holes are not
o; po=ciaIJy distracting. especially if realism is no< essent ial. As more hole'S appeaT. however,
the animation loses its and doublebuffering becomes more attrac:liYe .

3
(3)


(il
,
o
Fig. 4 .25 Contents of It-e frame buffer for a bourocing-ball animation.
'82 Graphi cs HtM'dw are
Colon loaded i n IabIc &I each saep In 8l'limallolJ
En<",
6 7 8 9 10
"

2 3 4
,
0 .... hite white whlle whilll! white wflile .... hite while wttite while whirt
I blrl black b ....
b_
b"""
_.
hI"'"
b"""
b_
bl""
"'"
2 ....
""
J
""
"" 4
,
,.d
6
7
""
Fig . " .28 Look ...... p table to bounce a red 00 a black slA"face against a wnl1e
background. Unspecified entries ate all whit e .
4 . 4 . 2 B;rmap Trans forma1ions and W indowing
With some video CQn(rollc:rs , the pilo:.map is decoupled from tnc view surface; that is. the
direcl , fixed com::spondence Ixtween posi tions in the fmme bulfer and positions on the::
display is removed. An image trans/ormoriol! then defines Ihe correspondence. The image
transformation transforms from the frame buffet to tnc view s urface . n.e trartsformation
can. in include a translation , scaling. roIation. and an additional clippil\i
oper.ition.
Figure 4.27 shows the type .,f transformation found on some raster displays . Part of the
frame buffer, defi ned by a rectangular clip region. is enlarged 10 fill the entire view surface.
The ratio between the size of the window and the view surface mUSl be an integer (3, in the
figure). Pi:tds in the frame: buffer t he window are not used, and none of the: pixel
values are modi fi ed; the rransronnal ions are applied by the video controller at the refresh
rate.
1lw: image transformation can be changed many times per second SO as to give the
real-lime-dynamics effect of scrol ling 0\= or zoofuing intu an Also, a sequence of
arbitrary images can be shown rapidly by loading each image: into a d.iffe:rent area of tnc
frame buffe:r. The: image transformalion is changed perKxiically fa display a full -screen view
first of ooe area, then of the ne;( t . and so on.
The scaling needed 10 e: nJazge an image is trh'ially accompl ished by repeati ng pi:td
values from within the windO'N as the image: is displayed. Fat- a scale factor- of 2. each pixel
Clip reglOfl
011 lrame
bull e.
J
F me bulle' View surl.ce
Blown up
comer 01
'''angle
Fig. 4 .27 Ponton of the fr&me buffer enlarged o n 1he view surface.
4.4



Before scaling, as defined
in frame ouffer
The Video ConTroller



Aftet" scaling, as displayed
Fig. 4.28 Effect of scaling up a pixmap by a factor of 2 .
'83
value is used four limc!S, twice on each of two sU(:cClisive scan lines. Figure 4.28 shCIWS the
effect of scaling up a leiter and adjoinir\l1. line by a factor of 2. Unless the image' s storage
has higher resolution than docs its display , scaling up does not reveal more detail: the image
is enlarged but has a more jagged appearance . Thus, this animation effect sacrifices spatial
resolulKln but maintains a full range of colors, the dOUble-buffering described in
tne previous section spatial resolution but decreases the number of colors
available in anyone image.
In a more general application of image tmnsfonnations . the scaled image covers only
the part or the view surface defined by a viewport, as in Fig. 4.29. Now we must define to
the system what is to appear on the view surface outside of the viewpmt . One possibility is
to display some constant color or intensity; another, shown in the figure , is to display the
frame buffer itse lf. The hardware implementation (01" the jailer option is simple. Registers
containing tbe viewport boundary coordinates are compared to the X, Y registers ddining
the raster scan' s current position. If the beam is in the viewport, pixels le tched from
within the wiftdow area of the frame buffer .and are replicated as Otherwise ,
are. fetched (1U1ll the in the frame buffer with the iWUllC ( x, y) coordinates as the
beam.
Frame buffer ClIP region
on Irame buffer
Enlarged
viewport
j
Monitor
Fjg. 4.29 A porlion of lhe f rame buHe.-. specified by I;'e elip region on the frame
buffer, scaled up by a faclor of 2 and overlaid on the unsealed fTarne buffer.
1 B4 Graphics HiM'dw'are
I

"'*
I

..-
r
00 .. 11=1
v_
Ilgnal
IOUfC8
Fig. 4 .30 A video contr oller mixing images fr om frame buff(!l" and video-signal
source_
Then: arc VLSI chips {hal implement many of these image display functions_ These
Yarious transfonnatiom arc special cases of ge:neral window-manager operattons thaI might
be desired. Window-manager chips an: available: for use in the video controller (SHIR86).
Each window has a separale pix map in t he system memory, and a data structure in the
memory defines window sizes and origins. As a scan line is displayed , the chip knows
which window is visible and knows from which pumap to feld! pillClS. and
other more advanced hanJwarc issues are discussed in Chapter 18.
4 .4 _3 Vi deo Mixing
Another useful video-controlJer funct ion is video mixing. Two images. one defi ned in the
frame buffer and t he otheT defined by a video signal coming from a tel evisi on camera,
recorder. or ot ho!T soun:c, call be merged to rorm a composi te image. Examples of this
merging are sceo regularly on telr::vision news , sports . and weather shows . Figure 4.30
shows the generic system organization.
1bere two types of In one, a graphics imagt' is set into a vtdeo image . Tht'
chart or graph displayed O'It'r the shoulder of a newscaster is typical of style. The mixing
is accomplished wi th hardware thaI treats a designaTed pixel value in the frame buffer as a
flag to indicate that the video should be shown instead of the signal from the frame
buffer . Nonnall y. tnc desigmued pixel value \,.'UtTCSponds to the background color of the
frame-buffer image. although inlerest ing effcclS can be achie .. -ed by using some other pixel
value insTead.
n.c seIfld type of mi xing places the vidCQ image on top of the frame-buffet image. as
.....ncn a weather reponer stands in front of a full-screen weather map. The reporter is
actually standing in ((Q{Jt of 11 backdrop , whose color ( typical!y blue) is used 10 control the
mixi ng: Whenever the incoming video is blue , the frame buffer is shown; otherwise, the
" ideo imalle is shown. Thi5 lechnioque works well all long as the l epooter is noc wearing a
Ii<: or shirt!
4 . 6 RANDOM-SCAN DISPLAY PROCESSOR
Figure 4. 31 s hows a typical random (vector) display system. It is generically similar 10 the
display-procebof-based raster sy.oaem architecture discussed in Set;tiun 4. 3. 2. There is of
course no piJl map for refreshing the display. and the display procCSSOf has no local memory
4.5
Random-scan Display ProcesSOT
,85
CPU
Peripheral
d.""",
-
'""
,L
<-
Olsplay System
processor m.mo<y
~
,
Monitor
Fig. 4.31 Architecture of a random display system.
for scan-conversion algorithms , since that functionality is typically implemenled IJsing
programmed logic arrays or microcode.
The random-scan graphics-display processor is often called a display processing unit
(DPU) , or a graphics controller. The DPU has an instruction set and instruction address
regislcr, and goes through Ih.c classic instruction fetch, decode, execute cycle found in any
computer. Because there is no pixmap, the dis play pru.:cssor must execute its program 30 to
60 limes per second in order to provide a flicker-free display. The program executed by the
DPU is in main memory, whkh is s hared by the gClleral CPU and the DPU.
The application program and graphics subroutine package also reside in main memory
and execule on the general CPU. TIn: graphiC!> package: creates a display program of DPU
instructions and tells tbe DPU where to start the program. The DPU then asynchrotlOl.ls\y
executes the display program until it is told to stop by the graphics p!"II;kage . A JUMP
instruction at (be end of the display program transfers control back [0 ilS start, so that the
display continues to be refreshed without CPU intervention.
Figure 4. 32 shows a set of instructions and mnemonics fOl" a simple modom-scan DPU.
The procesSOf' has X and Y registers and an instruction counter. The instructions !If'e
defined for a 16-bit 'Mlrd length. The RIA (relative/absolute) modifier on the LD
instructions indicates whether the following coordinate is to be treated as an II-bit relative
coordinate or a IO-bit absolute coordinate. In tne former case, the II bits are added to
either the X 01' the Y register; in the latter. the 10 bils replace [he register oontents. (Eleven
bits are needed for rd ative moves fOC' a 2 's-complement representation of vaJues in the: range
-1024 to + 1023.)
The same RIA interpretation is used for the JUMP instruction, except the instruction
counter is modified, thereby etJecling a change in the flow of control. The SM, SP, and SL
instructions atronf compact representation of oontour lines , scatter plots, and the like.
186 Graphics Hardware
LD (XfYJ {Al AI M Load &. move
LO (XIV) (RIA, P lQad &. point
LD tXfYJIAIA) L Load &.
LO t XIYI (AtA) Load
SM Shor1 move
S P Shan point
SL Stlort line
CHAR Che:rec:rers
JUMP {RIAl II
Key 1'0 MJtIllion
XN: 0 ==- Load x , 1 ==- Loe<! V
I " I
I' ,
I' ,
I'
,
Instrl.lction form .. 1
1 1 1 11 1 1 111 11' 1
o X or V or &X or AV -----1
1 X Of" Y or &X 01' AY -----1
o Xx} X or Y or AX or 6.Y -----1
1 Xh}--- X or V or AX or AY ----I
1 '
I '
1 '
1 '
I '
, '-I
I
1
I
,
, -I
,
, -I
,

10 teo-mlneta code
Char I

4V
I 1 1 1 X L I
Ab50Me or re:atiVe addro5'S
RIA: 0 ==-11 brts 01 AX or AY, 1 10 bitS of X or Y
t I : Ctloose 01. lor use In mnemonIC CO(Mj
L: Frame lock bit. 1 0:> delay j.Hnp until nell! dock tidI
t: Interrupt DIt, 1 0:> interrupl CPU
Fig. 4.32 Instruction set for the random-scan display syslem.
Figure 4.33 is a DPU program, written in as5embltt style, th.", many o f
instructions. NOIi how the square and diamond are drawn: The fir.;-{ IJlOV'C
instruction is absolute . but the res! are relative, so as to facilitate dragging the obj toCts
lIl'Ound (he screen. If relaliw: inslructions were nOi used, then dragging would require
modifying the coordinatc:s of all the instructions used 10 di splay the object. Thc final
instruction jumps back to the star. of the DPU program. Because .he frame lock bit i'l set,
as indicated by the L modifier, aeculion of the jump is delayed until the I'eXt tick of a
3O-Hz ckx.:k in order tl) all ow the DPU to refresh al 30 Hz but to prevent more frequent
refreshing of small programs . which could bum the phospbor.
Notice that . with this instl'l.lction set. only one load command (mnemonic LD) is
needed to draw or I1lOYe either horizontally or the OIhe.. coordinate is
beld constant; oblique movements, however , require I'M) load commands. The t'M) loads
can be in ehher x- then-), or y-then-..1' ordcr , with tbe second of the I'M) aJV',llYS specifying a

You might also like