Title: Andries van Dam September 7, 2004 Introduction 1/56
1Andries van Dam September 7,
2004 Introduction 1/56
2Andries van Dam September 7,
2004 Introduction 2/56
What is Computer Graphics? (1/2)
- Computer graphics is commonly understood to mean
the creation, storage and manipulation of models
and images. - Such models come from a diverse and expanding set
of fields including physical, mathematical,
artistic, biological, and even conceptual
(abstract) structures.
Frame from an animation by William Latham, shown
at SIGGRAPH 1992. Latham uses rules that govern
patterns of natural forms to create his artwork.
3Andries van Dam September 7,
2004 Introduction 3/56
What is Computer Graphics? (2/2)
- The term computer graphics was coined in 1960
by William Fetter to describe new design methods
he was pursuing at Boeing. - He created a series of widely reproduced images
on a pen plotter exploring cockpit design, using
a 3D model of a human body.
Perhaps the best way to define computer graphics
is to find out what it is not. It is not a
machine. It is not a computer, nor a group of
computer programs. It is not the know-how of a
graphic designer, a programmer, a writer, a
motion picture specialist, or a reproduction
specialist. Computer graphics is all these a
consciously managed and documented technology
directed toward communicating information
accurately and descriptively. Computer Graphics,
by William A. Fetter, 1966
4Andries van Dam September 7,
2004 Introduction 4/56
What is Interactive Computer
Graphics? (1/3)
- User controls contents, structure, and appearance
of objects and their displayed images via rapid
visual feedback - Basic components of an interactive graphics
system - input (e.g., mouse, tablet and stylus, force
feedback device, scanner, live video streams) - processing (and storage)
- display/output (e.g., screen, paper-based
printer, video recorder, non-linear editor) - First truly interactive graphics system,
Sketchpad, pioneered at MIT by Ivan Sutherland
for his 1963 Ph.D. thesis
Sketchpad in 1963. Note the use of a CRT monitor,
light pen and function-key panel.
5Andries van Dam September 7,
2004 Introduction 5/56
What is Interactive Computer
Graphics? (2/3)
- Before Sketchpad, output via plotters/printers,
input via keypunch, both in batch - Batch (1950s now)
Card punching (left). The IBM 704 (right) took up
a whole room and was capable of about 4,000
arithmetic operations/second. Cool facts
Whirlwind, built in the early 50s at MIT, cost
4.5 million and could perform 40,000
additions/second. Mac 512K, list price 3,195 in
1984, could do 500,000. Today, commodity PCs
perform approximately two or three billion
operations/second.
6Andries van Dam September 7,
2004 Introduction 6/56
What is Interactive Computer
Graphics? (3/3)
- Almost all the key elements of interactive
graphics system are expressed in the first
paragraph of Sutherlands 1963 Ph.D. thesis,
entitled, Sketchpad, A Man-Machine Graphical
Communication System - Today, still use batch mode for final
production-quality video and film (special
effects fx), where one frame of a 24 fps movie
may take 8-24 hours to render on the fastest PC!
The Sketchpad system uses drawing as a novel
communication medium for a computer. The system
contains input, output, and computation programs
which enable it to interpret information drawn
directly on a computer display. Sketchpad has
shown the most usefulness as an aid to the
understanding of processes, such as the motion of
linkages, which can be described with pictures.
Sketchpad also makes it easy to draw highly
repetitive or highly accurate drawings and to
change drawings previously drawn with it
7Andries van Dam September 7,
2004 Introduction 7/56
Environmental (R)evolution (1/6)
- Graphics has been a key enabling technology in
the evolution of computing environments - graphical user interfaces
- visual computing, e.g., desktop publishing,
scientific visualization, information
visualization - Hardware revolution drives everything
- every 12-18 months, computer power improves by
factor of 2 in price / performance Moores Law - 3Com Palm organizers, Compaq I-Paq as a full PC
- Hallmark singing card, LeapFrog Pad
- graphics memory and network speeds are on even
faster exponentials - Graphics chips in particular have major
improvements every six to nine months (e.g.
nVidia GeForce series, ATI Radeon series)
8Andries van Dam September 7,
2004 Introduction 8/56
Environmental (R)evolution (2/6)
- Character Displays (1960s now)
- Display text plus alphamosaic pseudo-graphics
- Object and command specification command-line
typing - Control over appearance coding for text
formatting (.p paragraph, .i 5 indent 5) - Application control single task
9Andries van Dam September 7,
2004 Introduction 9/56
Environmental (R)evolution (3/6)
- Vector (Calligraphic, Line Drawing)
- Displays (1963 1980s)
- Display line drawings and stroke text 2D and 3D
transformation hardware - Object and command specification command-line
typing, function keys, menus - Control over appearance pseudo-WYSIWYG
- Application control single or multitasked,
mainframe host-minicomputer satellite distributed
computing pioneered at Brown
10Andries van Dam September 7,
2004 Introduction 10/56
Environmental (R)evolution (4/6)
- 2D bitmap raster displays for PCs and
workstations - (1972 at Xerox PARC - now)
- Display windows, icons, legible text and flat
earth graphics - Note late 60s saw first use of raster
graphics, especially for flight simulators - Object and command specification minimal typing
via WIMP (Windows, Icons, Menus, Pointer) GUI
(Graphical User Interface) point-and-click
selection of menu items and objects, widgets and
direct manipulation (e.g., drag and drop), the
messy desktop metaphor - Control over appearance WYSIWYG (which is really
WYSIAYG, What You See Is All You Get) - Application control multi-tasking, networked
client-server computation and window management
(even X terminals)
11Andries van Dam September 7,
2004 Introduction 11/56
Environmental (R)evolution (5/6)
- 3D graphics workstations (1984 at SGI now)
- Display real-time, pseudo-realistic images of 3D
scenes - Object and command specification 2D, 3D and nD
input devices (controlling 3 degrees of freedom)
and force feedback haptic devices for
point-and-click, widgets, and direct manipulation - Control over appearance WYSIWYG (still WYSIAYG)
- Application control multi-tasking, networked
(client/server) computation and window management - High-end PCs with hot graphics cards (nVidia
GeForce, ATI Radeon) are supplanting graphics
workstations - Such PCs are clustered together over high speed
buses or LANs to provide scalable graphics to
drive tiled PowerWalls, Caves, etc.
12Andries van Dam September 7,
2004 Introduction 12/56
Environmental (R)evolution (6/6)
- Classical time-sharing is dead, 1n g n1
- PCs and Workstations merging in distributed
heterogeneous computer networks (e.g., LANs,
WANs, Internet and clusters) - But file-, print- and compute-servers and network
are still shared - Client/server computing, component software
technologies are dominant paradigms - NCs (Network Computers), thin clients attached to
powerful servers reprise dumb terminals and
provide central control havent really taken off
13Andries van Dam September 7,
2004 Introduction 13/56
New Forms of Computing1990-2004
(1/7)
- Multimedia text and graphics synchronized with
sound and video - Hypermedia multimedia with hypertextual links
(also called Interactive Multimedia) - Discredited term Digital Convergence, the
merging of digital television and distributed
computing, consumer electronics set-top
computers (e.g., for Interactive TV,
Video-On-Demand) - The Internet and Internet appliances
- Embedded computing (information appliances,
Personal Digital Assistants) - Ubiquitous/pervasive/invisible/nomadic computing,
active badges a la Xerox PARC, with hundreds of
devices per person seamless computing is the
dream
14Andries van Dam September 7,
2004 Introduction 14/56
New Forms of Computing1990-2004
(2/7)
fully immersive VR(via Head-mounted Displays,
Cave 180 George St.)
CAVE
15Andries van Dam September 7,
2004 Introduction 15/56
New Forms of Computing1990-2004
(3/7)
Cave Painting
Archeological research and analysis tool
CMU CUBE
16Andries van Dam September 7,
2004 Introduction 16/56
New Forms of Computing1990-2004
(4/7)
Blood flow through an arterial bypass graft
Use feet for navigation, freeing hands for other
uses
17Andries van Dam September 7,
2004 Introduction 17/56
New Forms of Computing1990-2004
(5/7)
Fishtank VR on a monitor
Barco, Immersadesk
GMDs Responsive workbench
Elumens VisionStation
18Andries van Dam September 7,
2004 Introduction 18/56
New Forms of Computing1990-2004
(6/7)
- augmented VR(via video see-through optics)
Video or optics superimposes computer-generated
data on real world (e.g., Columbias MARS, led by
our Ph.D., Steve Feiner)
19Andries van Dam September 7,
2004 Introduction 19/56
New Forms of Computing1990-2004
(7/7)
- New Interaction technology
- Inexpensive interaction devices from research lab
into marketplace - makes 2D and 3D graphics no longer special
- 3D (even time-varying, 4D) interactive
illustrations as clip art/clip models coming - Kids using computer graphics in gaming consoles
VR games and rides (e.g. Aladdin, Pirates of the
Caribbean, LBEs) with HMD and force-feedback
input devices - New forms of user-interface (UI Lecture)
- 3D Widgets gestures-based UI (Browns Sketch)
VR demands new interaction technology - Social interfaces (Microsofts Bob bombed, other
avatars may not) - Agents for indirect control
20Andries van Dam September 7,
2004 Introduction 20/56
Powerful, Inexpensive Processing
- Chips are Key in graphics subsystems
- Advances driven by Moores Law
- price/performance improves 2x every 18 months due
to doubling of number of transistors - only exponential in technology except growth of
WWW - CPU
- 64-bit computing enters the mainstream
- Server Intel Itanium, AMD Opteron
- Consumer IBM G5, AMD Athlon64
- AMD Athlon XP
- Intel Pentium 4
- Sun UltraSPARC IV
- Graphics subsystems
- Commodity cards have taken over the mainstream
market (nVidia GeForce, ATI Radeon)
21Andries van Dam September 7,
2004 Introduction 21/56
Chip Technology Advances in
Games Commodity Graphics
Cards
- New game platforms and set-top boxes use high-end
processors (128-bit architectures, great graphics
capabilities) - Nintendo GameCube (powered by ATI)
- Sony Playstation 2
- Microsoft Xbox (powered by nVidia)
- nVidia GeForce 6800 Ultra and ATI Radeon X800
XT are the top graphics cards (approx. 400 -
500) - Significant advances in commodity graphics chips
every 6 months, outrunning CPU chip advances - Intels newest Pentium 4 chip (Prescott) has 125
million transistors, compared with only 55
million in a previous Pentium 4 (Northwood) - GeForce 6800 chip (NV40) has 222 million!
- GPUs are now arguably more powerful than CPUs and
programmable ? CPU OS losing their hegemony as
the GPU co-processor becomes the tail to wag the
CPU dog! - Workstation market (and vendors) bowing to
commoditization (e.g., Suns losing client market)
22Andries van Dam September 7,
2004 Introduction 22/56
Application Distinctions
- Two basic paradigms
- Sample-based graphics discrete samples are used
to describe visual information - pixels can be created by digitizing images, using
a sample-based painting program, etc. - often some aspect of the physical world is
sampled for visualization, e.g., temperature
across the US - example programs Adobe Photoshop, GIMP , Adobe
AfterEffects (it came out of CS123/CS224!) - Geometry-based graphics a geometrical model is
created, along with various attributes, and is
then sampled for visualization (this process is
called rendering) - often some aspect of the physical world is
visually simulated, or synthesized - example 2D vector graphics Adobe Illustrator,
Macromedia Freehand, Corel CorelDRAW ! - example 3D programs AliasWavefronts Maya,
Autodesks AutoCAD2005, Discreets 3D StudioMax
23Andries van Dam September 7,
2004 Introduction 23/56
Sampled-based Graphics (1/2)
- Images are made up of a grid of discrete pixels
for 2D picture elements
light intensity
1 pixel
- Pixels are point locations with associated sample
values, usually of light intensities/colors,
transparency, and other control information. They
are not little circles or little squares, as
well see.
24Andries van Dam September 7,
2004 Introduction 24/56
Sample-based Graphics (2/2)
- Samples created directly in paint-type program,
or as a sampling of continuous (analog) visual
materials. E.g., a photograph can be sampled
(light intensity/color measured at regular
intervals) with many devices including - flatbed and drum scanners
- digital still and motion (video) cameras
- add-on boards such as frame grabbers
- Sample values can also be input numerically
(e.g., with numbers from a computed dataset) - Once an image is defined as a pixel-array, it can
be manipulated - Image editing changes made by user, such as
cutting and pasting sections, brush-type tools,
and processing selected areas. - Image processing algorithmic operations that are
performed on an image (or pre-selected portion of
an image) without user intervention. Includes
blurring, sharpening, edge-detection, color
balancing, rotating, and warping. A
pre-processing step in computer vision.
25Andries van Dam September 7,
2004 Introduction 25/56
Sampling an Image
- Lets do some sampling of the CIT building
- A color value is measured at every grid point and
used to color a corresponding grid square - Note this poor sampling and image reconstruction
method creates a blocky image
The 3D scene
0 white 5 gray 10 black
26Andries van Dam September 7,
2004 Introduction 26/56
Whats the Advantage?
- Once image is defined in terms of colors at (x,
y) locations on grid, can change image easily by
altering location or color values - E.g., if we reverse our mapping above and make 10
white and 0 black, the image would look like
this - Pixel information from one image can be copied
and pasted into another, replacing or combining
with previously stored pixels
27Andries van Dam September 7,
2004 Introduction 27/56
Whats the Disadvantage
- WYSIAYG (What You See Is All You Get) There is
no additional information - no depth information
- cant examine scene from a different point of
view - at most can play with the individual pixels or
groups of pixels to change colors, enhance
contrast, find edges, etc. - But recently, strong interest in image-based
rendering to fake 3D scenes and arbitrary camera
positions. New images constructed by
interpolation, composition, warping and other
operations.
Capture of Hair Geometry from Multiple Images,
Siggraph 2004
28Andries van Dam September 7,
2004 Introduction 28/56
Examples of 2D Image
Manipulation (1/3)
- There are many things one can do with sampled
images uses of computer imaging range from
military applications to entertainment, medicine,
art, and design. - The news digitally enhanced images are more
and more common. Usually just sharpening, color
balancing, but sometimes a lot more. To
Photoshop something in - National Geographics Pyramid cover
- TV Guides Oprah cover
- Time Magazines O.J. Simpson cover
- University of Wisconsin application
29Andries van Dam September 7,
2004 Introduction 29/56
Examples of 2D Image
Manipulation (2/3)
- People can now mutate into other people or
objects through morphing, and can carry on
conversations in different times and places - Interactive Digital Photomontage, Siggraph 2004
- The belief in a very strong connection between
photorealistic images, still or moving, and
reality is being severed
30Andries van Dam September 7,
2004 Introduction 30/56
Examples of 2D Image
Manipulation (3/3)
- In artwork the processes and techniques of
photography and painting are merging in the art
of digital imaging - Michele Turre the artist, her daughter, and her
mother, all at 3 years of age - CS123 emphasizes geometry-based graphics but we
do two assignments on sample-based graphics to
learn simple image processing. - image processing in general includes image
transformation, and is used for feature
detection, pattern recognition, and
machine/computer vision, and most recently, for
image-based rendering
31Andries van Dam September 7,
2004 Introduction 31/56
Geometry-Based Graphics
- Geometry-based graphics applications store
mathematical descriptions, or models, of
geometric elements (lines, polygons,
polyhedrons) and their associated attributes
(e.g., color, material properties). These
elements are primitive geometric shapes,
primitives for short. - Images are created as pixel arrays (via sampling
of the geometry) for viewing, but are not stored
as part of the model. Images of many different
views can be generated from the same model. - One cannot usually work directly with the
individual pixels in a geometry-based program
one manipulates the geometric elements, then they
are resampled and redisplayed. - Increasingly rendering combines geometric and
sample-based graphics, both as a performance hack
and to increase quality of the final product
32Andries van Dam September 7,
2004 Introduction 32/56
What is Geometric Modeling?
- What is a model?
- Captures the salient features (data, behavior) of
the thing/phenomenon being modeled - data includes geometry, appearance attributes
- note similarity to OOP notions
- Real some geometry inherent
- physical (e.g., actual object such as a pump)
- non-physical (e.g., mathematical function,
weather data) - Abstract no inherent geometry, but for
visualization - organizational (e.g., company org. chart)
- quantitative (e.g., graph of stock market)
- Modeling is coping with complexity
- Our focus modeling and viewing simple everyday
objects - Consider this
- Through 3D computer graphics, for the first time
in human history we have abstract, easily
changeable 3D forms. This has revolutionized the
working process of many fields science,
engineering, industrial design, architecture,
commerce, entertainment, etc. This has profound
implications for visual thinking and visual
literacy.
33Andries van Dam September 7,
2004 Introduction 33/56
Lecture Topics
- Primitive shapes are manipulated with geometric
transformations (translation, rotation, scale).
These transformations are essential for model
organization, the process of composing complex
objects from simpler components. - Hierarchical models and the same geometric
transformations are also essential for animation. - Once objects geometry is established, must be
viewed on a screen. Must map from 3D to 2D for
viewing and from 2D to 3D for 2D input devices
(e.g., the mouse or pen/stylus). - In the process of mapping from 3D to 2D, object
(surface) material properties and lighting
effects are used in rendering ones
constructions. The rendering process is also
called image synthesis.
34Andries van Dam September 7,
2004 Introduction 34/56
Decomposition of a Geometric
Model
- Divide and Conquer
- Hierarchy of geometrical components
- Reduction to primitives (e.g., spheres, cubes,
etc.) - Simple vs. not-so-simple elements (nail vs. screw)
Head
Shaft
Point
composition
decomposition
35Andries van Dam September 7,
2004 Introduction 35/56
Hierarchical (Tree) Diagram of Nail
- The object to be modeled is (visually) analyzed,
and then decomposed into collections of primitive
shapes. - The tree diagram provides a visual method of
expressing the composed of relationships of the
model. - Such diagrams are part of 3D program interfaces
(e.g., 3D Studio MAX, Maya). - As a pointer data structure to be rendered, it is
called a scenegraph
root node
Nail
Head (cylinder)
Body
Shaft (cylinder)
Point (cone)
leaf nodes
tree diagram
36Andries van Dam September 7,
2004 Introduction 36/56
Composition of a Geometric
Model
Translate
Translate and Scale
Translate and Rotate
Primitives in their own modeling coordinate system
Composition in the world (root) coordinate system
- The primitives created in the decomposition
process must be assembled to create the final
object. This is done with affine
transformations, T, R, S (as in the example
above). - Other composition operators will be very briefly
discussed later (e.g., Constructive Solid
Geometry (CSG) with Boolean operators).
37Andries van Dam September 7,
2004 Introduction 37/56
What Kind of Math do We Need?
- Cartesian Coordinates
- Typically modeling space is floating point,
screen space is integer - x, y Cartesian grid
Integer Grid - NBOften, screen coordinates are measured top to
bottom, based on raster scan - (0,0)
38Andries van Dam September 7,
2004 Introduction 38/56
Example 3D Primitives
Polyhedron
Polyline
Patch
Sphere
39Andries van Dam September 7,
2004 Introduction 39/56
Conceptual Framework for
Interactive Graphics
- Graphics library/package (e.g., OpenGL, DirectX
) is intermediary between application and the
display hardware (Graphics System) - Application program maps application objects to
views (images) of those objects by calling on
graphics library - User interaction results in modification of model
and/or image - Images are usually means to an end synthesis,
design, manufacturing, visualization, - This hardware and software framework is nearly 4
decades old but is still useful, indeed dominant
Graphics Library (GL)
Application model
Application program
40Andries van Dam September 7,
2004 Introduction 40/56
Graphics Library
- Primitives
- Attributes
- color
- line style
- material properties for 3D
- Lights
- Transformations
- Immediate mode vs. retained mode
- immediate mode no stored representation, package
holds only attribute state, and application must
completely draw each frame - retained mode library compiles and displays from
a scenegraph, a complex DAG
41Andries van Dam September 7,
2004 Introduction 41/56
2D Hardware/Algorithms Outline
- Display Hardware Raster scan vs. random scan
- Drawing primitives by scan conversion
- lines
- polygons
- circles and ellipses
- characters
- attributes (color, line style, fill pattern)
- Clipping to clip rectangle three methods
- analytically compute intersections and draw
clipped primitives - test each pixel and write only if inside
- compute spans inside the primitive and fill
entire span without testing - Color Table
- indirect specification of (pseudo) color
- color correction, simple types of animation
- BitBlt/RasterOp for operating on blocks of pixels
42Andries van Dam September 7,
2004 Introduction 42/56
Graphics Display Hardware
- Vector (calligraphic, stroke, random-scan)
- still used in some plotters
- Raster (TV, bitmap, pixmap), used in displays and
laser printers
43Andries van Dam September 7,
2004 Introduction 43/56
Vector Architecture
- Vector display works with a display list/file
stored in refresh buffer - Display controller draws all vectors at lt 60 Hz
(often at variable rate) flicker is a problem
44Andries van Dam September 7,
2004 Introduction 44/56
2D Raster Architecture
- Raster display stores bitmap/pixmap in refresh
buffer, also known as bitmap, frame buffer can
be in separate hardware (VRAM) or in CPUs main
memory (DRAM) - Video controller draws all scan-lines at
consistent
45Andries van Dam September 7,
2004 Introduction 45/56
Drawing Lines
- For horizontal, vertical and diagonal lines all
pixels lie on the ideal line special case - For lines at arbitrary angle, pick pixels closest
to the ideal line (Bresenhams midpoint scan
conversion algorithm) - For thick lines, use multiple pixels in each
column or fill a rotated rectangle - Sampling a continuous line on a discrete grid
introduces sampling errors the jaggies
46Andries van Dam September 7,
2004 Introduction 46/56
Drawing Filled Polygons
- Find intersection of scanline with polygon edges
- Sort intersections by increasing x
- Fill the polygon between pairs of intersections
(spans)
47Andries van Dam September 7,
2004 Introduction 47/56
Drawing Circles and Ellipses
circle outline
filled ellipse
48Andries van Dam September 7,
2004 Introduction 48/56
Thickness Attribute
- Thick circle drawing by tracing a rectangular pen
- Treat such primitives as regions and fill them,
e.g., approximate them as sequences of connected
quadrilaterals
49Andries van Dam September 7,
2004 Introduction 49/56
Drawing Characters (1/2)
- For characters defined by small bitmap
- selectively write pixels of refresh buffer
corresponding to true bits of character bitmap - Transparent mode dont write 0s BitBlt with
OR - Opaque mode write background color for 0s
- Descenders proportional spacing easily
accommodated
50Andries van Dam September 7,
2004 Introduction 50/56
Drawing Characters (2/2)
- Outline fonts defined in terms of (mathematical)
drawing primitives (lines, arcs, splines) and
thus scalable, but more CPU intensive (e.g. Adobe
PostScript, Microsoft TrueType) - Font design (typography is a highly skilled
specialty, involving graphical and algorithmic
design)
51Andries van Dam September 7,
2004 Introduction 51/56
1-bit Bilevel Display
- Digital intensity value Digital to Analog
Conversion (DAC) analog signal to drive
electron beam - Black White (or any 2 colors, depending on the
monitor phosphor color) - Original Mac resolution was 512x384 pixels, now
from 640x480 up to 1280x1024, even 3Kx3K in IBMs
Roentgen display. Our PCs are 1280x1024 - 1280x1024 memory 15 nanosec/pixel gt 32 pixel
chunks stored in shift registers/buffers
Set or
X address
Address
increment
Raster scan generator
Frame buffer
Set or
Y address
Address
decrement
Deflection
Pixel value
Intensity
DAC
Data
Video Controller
52Andries van Dam September 7,
2004 Introduction 52/56
n-Bit Display
- 2n intensities or colors 1 (grayscale) or 3
(color) DACs guns
53Andries van Dam September 7,
2004 Introduction 53/56
Image Display System
Look-up Table
- Any specific 2n colors may be inadequate (n
typically 16-24 in low-end systems) - Look-up table allows 2n colors out of 224 colors
to be used in one image, some other 2n in another
image - 224 approx. 16.7 million, exceeds eyes ability
to discriminate (somewhere between 7-10 million) - Color table is a resource managed (usually) by
window manager
54Andries van Dam September 7,
2004 Introduction 54/56
Color Look Up Table Operation
- Pixel value is indexed to color look up table
(CLUT) where color is stored. Here we use only
12 bits (4bits per color) for clarity
typically, 24bits are used - CLUT look up done at video rates, overlapped with
fetch and DAC! - In 24-bit true color systems, 3 x 8 bits for R,
G, B each color has its own 8-bit CLUT (0-255) - CLUT allows variety of effects
- pseudo coloring (LandSat images, stress diagrams,
thermograms) - fast image changes change table rather than
stored image - multiple images select or composite/blend
- animation hack
55Andries van Dam September 7,
2004 Introduction 55/56
BitBlt/RasterOp (1/2)
- Logically operate on each pixel in rectangular
source and destination regions in same or
different pixmaps to achieve dynamics, e.g., to
move/scroll windows on screen - RasterOp (Source, Destination) g Destination
- In some implementations either S or D may be
masked, and need not be same size
pixmap
56Andries van Dam September 7,
2004 Introduction 56/56
BitBlt/RasterOp (2/2)
- Replace (S,D) S destructively replaces D, i.e.,
is deleted and copied on top of D (also called
Move) used for making opaque characters, icons,
scroll - Copy (S,D) as above, but S is not deleted
- OR (S,D) S is non-destructively added to D
used for painting, transparent and kerned
characters (where characters extend beyond their
boxes) not as useful in n-bit systems - AND (S,D) S can mask out pixels in D
- XOR (S,D) S selectively inverts D used in 1-bit
systems for rubber-banding/dragging, cheap
cursors - Note effects in color systems for all but
replace may be weird
S XOR (S XOR D) D 0 W, 1 B
XOR
S D D
XOR
S D D