0% found this document useful (0 votes)
7 views

Computer Graphics

This pdf covers all the topics of Wireless and Mobile computing.

Uploaded by

parulsingh1074
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Computer Graphics

This pdf covers all the topics of Wireless and Mobile computing.

Uploaded by

parulsingh1074
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 43

Computer Graphics

Definition: Computer graphics is using computers to create and manipulate


images.
Applications: 🤔
 Engineering (e.g. design of buildings, automobiles, aircraft, watercraft,
spacecraft)
 Science (e.g. simulation, data visualization)
 Medicine (e.g. medical imaging, simulation)
 Business (e.g. presentations, advertising)
 Education (e.g. interactive learning, simulations)
 Entertainment (e.g. movies, video games)
Computer-Aided Design (CAD) Systems ⚙️
Definition: CAD systems are software packages that provide a multi-window
environment for designing and modifying objects.
Features:
 Wireframe displays
 Multi-window environment
 Interactive design
 Standard shapes for electrical, electronic, and logic circuits
Example:
Window Display

Wireframe Color-coded wireframe display for an automobile wheel assembly

Color-coded wireframe displays of body designs for an aircraft and


Design an automobile

Circuit Circuit design application, using multiple windows and color-coded


Window Display

logic components

Animations 📹
Definition: Animations are a series of images displayed rapidly to create the
illusion of motion.
Applications:
 Testing the performance of a vehicle or system
 Determining how vehicle operators are affected by certain motions
 Used in virtual-reality environments
Example:

Animation Description

Vehicle
performance Simulation of vehicle performance during lane changes

Operator Simulation of operator experience in a virtual-reality


simulation environment

Note: The provided transcript is a partial segment of the lecture, and the
created study guide is a condensed version of the original content.## Virtual
Reality in Computer-Aided Design 🚧
Virtual reality (VR) technology is applied in computer-aided design (CAD) to
provide designers with a more immersive and interactive experience. This
allows them to explore and visualize their designs more realistically and
engagingly.

Design Process
The design process involves creating a virtual environment where designers can
manipulate and interact with 3D models of their designs. This can be done
using VR headsets, gloves, or other devices that track the user's movements.
"Virtual reality is a computer-generated simulation of a three-dimensional
environment that can be experienced and interacted with in a seemingly real or
physical way."
Applications in CAD
VR technology has various applications in CAD, including:
 Product Design: Designers can use VR to create and test product
prototypes, reducing the need for physical prototypes and improving the
design process.
 Architecture: Architects can use VR to design and visualize buildings,
allowing them to explore and interact with their designs in a more
immersive way.
 Manufacturing: VR can be used to design and simulate manufacturing
processes, reducing costs and improving efficiency.
Computer-Aided Manufacturing (CAM) 💻
CAM involves the use of computer systems to plan, manage, and control the
manufacturing process. This includes the use of CAD data to generate
instructions for manufacturing machines.
Numerical Control (NC) Machines
NC machines use numerical codes to control their movements and actions.
These codes are generated from CAD data and are used to manufacture parts
and products.
CAM Process
The CAM process involves:
 Design: Creating a CAD design and generating NC code
 Manufacturing: Using NC code to control manufacturing machines
 Inspection: Verifying the manufactured part or product
Presentation Graphics 📊
Presentation graphics involve the use of computer graphics to present data and
information in a visual format. This includes the use of charts, graphs, and
other visualizations to communicate information.
Types of Graphics
There are several types of graphics used in presentation graphics, including:
 2D Graphics: Two-dimensional graphics used to present data and
information
 3D Graphics: Three-dimensional graphics used to present data and
information in a more immersive way
 Interactive Graphics: Interactive graphics that allow users to interact
with the data and information being presented
Applications
Presentation graphics have various applications, including:
 Business: Used to present data and information in a business setting
 Education: Used to present information and data in an educational
setting
 Science: Used to present research data and findings
Computer Art 🎨
Computer art involves the use of computers to create art and animations. This
includes the use of software and algorithms to generate images, videos, and
other forms of digital art.
Types of Computer Art
There are several types of computer art, including:
 Fractal Art: Art that uses fractal geometry to generate images and
patterns
 Algorithmic Art: Art that uses algorithms to generate images and
patterns
 Digital Painting: Art that uses digital tools to create paintings and other
forms of digital art
Applications
Computer art has various applications, including:
 Fine Art: Used to create digital art and animations for exhibition and sale
 Commercial Art: Used to create digital art and animations for
commercial use, such as advertising and design
 Entertainment: Used to create digital art and animations for film,
television, and video games## Computer Art 🎨
Computer art created with the aid of mathematical relationships is shown in
Fig. 1-31. The artwork of this composer is often designed with frequency
variations and other parameters in a musical composition to produce a video
that integrates visual and aural patterns.
Fermat's Last Theorem: a mathematical theorem that states that there are no
integer solutions to the equation an+bn=cnan+bn=cn for n>2n>2.
Fractal procedures: a set of mathematical rules that generate a self-similar
pattern at different scales.
Commercial Art 📈
Computer graphics methods are also applied in commercial art for:
 Logos and other designs
 Page layouts combining text and graphics
 TV advertising spots
 Other areas
Photorealistic techniques: methods used to render images of a product
realistically.
Morphing: a graphics method employed in many commercials where one
object is transformed (metamorphosed) into another.

Entertainment 🎬
Computer graphics methods are now commonly used in:
 Making motion pictures
 Music videos
 Television shows
Morphing: a graphics method employed in many music videos where one
person or object is transformed into another.
Education and Training 📚
Computer-generated models of physical, financial, and economic systems are
often used as educational aids.
Simulators: specialized systems designed for practice sessions or training of:
 Ship captains
 Aircraft pilots
 Heavy-equipment operators
 Air traffic control personnel
Visualization 🔍
Scientists, engineers, medical personnel, business analysts, and others often
need to analyze large amounts of information or to study the behavior of
certain processes.
Scientific visualization: producing graphical representations for scientific,
engineering, and medical data sets and processes.
Business visualization: producing graphical representations for data sets
related to commerce, industry, and other non-scientific areas.
Color coding: a technique used to visualize a data set by assigning colors to
different values or categories.
Contour plots: a technique used to visualize a data set by drawing lines to
connect points of equal value.
Surface renderings: a technique used to visualize a data set by creating a 3D
representation of the data.
Visualizations of volume interiors: a technique used to visualize a data set by
creating a 3D representation of the interior of a volume.## Visualization 🎨
Applications of Visualization
 Numerical modeling of thunderstorms
 Study of crack propagation in metals
 Color-coded plot of fluid density over an airfoil
 Cross-sectional slicer for datasets
 Protein modeling
 Stereoscopic viewing of molecular structure
 Model of the ocean floor
 Kuwaiti oil-fire simulation
 Air-pollution study
 Crop growth study
 Reconstruction of Arizona's Canyon ruins
Examples of Visualization
Figures 1-53 to 1-69 show various examples of visualization, including:
Figur
e Description

A four-dimensional object is projected into three-dimensional space,


1-53 then projected to a video monitor, and color-coded.

Four views from a real-time, interactive computer-animation study of


minimal surface ("snails") in the 3-sphere projected to three-
1-54 dimensional Euclidean space.

A method for graphing and modeling data distributed over a spherical


1-55 surface.

... ...

Computer Graphics vs Image Processing


Computer Graphics: a computer is used to create a picture. Image Processing:
applies techniques to modify or interpret existing pictures, such as photographs
and TV scans.
Applications of Image Processing
 Improving picture quality
 Machine perception of visual information, as used in robotics
 Medical applications: enhancing the quality of pictures, tomography, and
simulations of operations
 Commercial art applications: retouching and rearranging sections of
photographs and other artwork
Medical Imaging
 Tomography: a technique of X-ray photography that allows cross-
sectional views of physiological systems to be displayed
 Computed X-ray tomography (CT)
 Position emission tomography (PET)
 Ultrasonics
 Nuclear medicine scanners
Computer-Aided Surgery
 Uses computer graphics and image processing to model and study
physical functions
 Designs artificial limbs and plans and practices surgery

Graphical User Interfaces


 Provide a window manager that allows users to display multiple window
areas
 Display menus and icons for a fast selection of processing options or
parameter values
 Icons: graphical symbols that represent processing options
Overview of Graphics Systems
 Graphics capabilities for both two-dimensional and three-dimensional
applications are now common on general-purpose computers
 A wide variety of interactive input devices and graphics software
packages are available
 Sophisticated special-purpose graphics hardware systems and
technologies are available for higher-quality applications
Video Display Devices
 Typically, the primary output device in a graphics system is a video
monitor
 The operation of most video monitors is based on the standard cathode-
ray tube (CRT) design
Cathode-Ray Tubes (CRTs)
A beam of electrons (cathode rays) emitted by an electron gun passes through
focusing and deflection systems that direct the beam toward specified positions
on the phosphor-coated screen.
Component Description

Electron gun Emits a beam of electrons

Focusing system Directs the beam toward specified positions on the screen

Deflection system Controls the movement of the beam

Phosphor-coated Emits a small spot of light at each position contacted by


screen the electron beam

Let me know if you need any further adjustments! 😊## Control Grid and
Focusing System in a CRT 📺
The control grid in a Cathode Ray Tube (CRT) plays a crucial role in controlling
the brightness of a display. It works by repelling electrons and stopping them
from passing through the small hole at the end of the control grid structure. A
smaller negative voltage on the control grid decreases the number of electrons
passing through, which in turn controls the brightness of the display.
Focusing System
The focusing system in a CRT is necessary to converge the electron beam into a
small spot as it strikes the phosphor. This is achieved through either electric or
magnetic fields.
Electrostatic Focusing
Electrostatic focusing is commonly used in television and computer graphics
monitors. It works by passing the electron beam through a positively charged
metal cylinder that forms an electrostatic lens.
"The action of the electrostatic lens focuses the electron beam at the center of
the screen, in the same way that an optical lens focuses a beam of light at a
particular focal distance."
Magnetic Focusing
Magnetic lens focusing produces the smallest spot size on the screen and is
used in special-purpose devices.
Deflection System
Deflection of the electron beam can be controlled either with electric fields or
with magnetic fields.
Magnetic Deflection
Magnetic deflection is commonly used in CRTs and is achieved by mounting
two pairs of coils on the outside of the CRT envelope. One pair is mounted on
the top and bottom of the neck, and the other pair is mounted on opposite
sides of the neck.
Electrostatic Deflection
Electrostatic deflection uses two pairs of parallel plates mounted inside the CRT
envelope. One pair is mounted horizontally to control vertical deflection, and
the other pair is mounted vertically to control horizontal deflection.
Phosphor Coating and Light Emission 💡
The phosphor coating on the CRT screen produces light when struck by the
electron beam. The electrons in the beam collide with the phosphor, causing
them to move up to higher quantum-energy levels. As they return to their
stable ground state, they emit light energy.
Phosphor Types
Different types of phosphors are available, with varying persistence (the time it
takes for the emitted light to decay to one-tenth of its original intensity).

Phosphor Type Persistence

Low-persistence 10-60 microseconds

High-persistence > 1 second

Intensity Distribution
The intensity distribution of a spot on the screen follows a Gaussian
distribution.
![Intensity distribution of an illuminated phosphor spot on a CRT screen](Figure
2-5)

Resolution and Aspect Ratio 📊


The maximum number of points that can be displayed without overlap on a
CRT is referred to as the resolution.
Resolution Definition
Resolution is the number of points per centimeter that can be plotted
horizontally and vertically.
Aspect Ratio
Aspect ratio is the ratio of vertical points to horizontal points necessary to
produce equal-length lines in both directions on the screen.
Aspect
Ratio Description

A vertical line plotted with 3 points has the same length as a


3/4 horizontal line plotted with 4 points

Raster-Scan Displays 📺
Raster-scan displays are based on television technology and are the most
common type of graphics monitor employing a CRT.
How it Works
The electron beam is swept across the screen, one row at a time from top to
bottom. As the beam moves across each row, the beam intensity is turned on
and off to create a pattern of illuminated spots. Picture definition is stored in a
memory area called the refresh buffer or frame buffer.
Pixel and Intensity Range
Each screen point is referred to as a pixel or pel. The capability of a raster-scan
system to store intensity information for each screen point makes it well-suited
for the realistic display of scenes containing subtle shading and color patterns.

Intensity Range Description

Bilevel One bit per pixel (on or off)

Multiple bits per Up to 24 bits per pixel, requiring several megabytes of


pixel storage for the frame buffer

Raster-Scan Displays
Raster-scan displays use a Cathode Ray Tube (CRT) to display images. The CRT
has an electron beam that sweeps across the screen, creating an image from a
set of discrete points.
Horizontal Retrace: The return of the electron beam to the left side of the
screen after refreshing each scan line.
Vertical Retrace: The return of the electron beam to the top left corner of the
screen to begin the next frame.
Interlacing
Interlacing is a technique used to reduce flicker on slower refreshing rates. The
beam sweeps across every other scan line from top to bottom and then returns
to sweep the remaining scan lines.
"Interlacing is primarily used with slower refreshing rates. On an older, 30
frame-per-second, noninterlaced display, for instance, some flicker is
noticeable. But with interlacing, each of the two passes can be accomplished in
1/60th of a second, which brings the refresh rate nearer to 60 frames per
second."

Random-Scan Displays
Random-scan displays, also known as vector displays, draw a picture one line at
a time. They are commonly used for lined drawing applications and can cannot
display realistic shaded scenes.
Refresh Rate: The rate at which the system cycles through the set of
commands in the display file, drawing each component line in turn.
Display File: An area of memory that stores the picture definition as a set of
lined drawing commands.
"Random-scan systems are designed to draw all the component lines of a
picture 30 to 60 times each second."

Color CRT Monitors


Color CRT monitors display color pictures by using a combination of phosphors
that emit different-colored light.
Beam-Penetration Method
The beam-penetration method uses two layers of phosphor, usually red and
green, coated onto the inside of the CRT screen. The displayed color depends
on how far the electron beam penetrates into the phosphor layers.
"Beam penetration has been an inexpensive way to produce color in random-
scan monitors, but only four colors are possible, and the quality of pictures is
not as good as with other methods."
Shadow-Mask Method
The shadow-mask method uses three phosphor color dots at each pixel
position, one emitting red light, one emitting green light, and one emitting blue
light.
"Shadow-mask methods are commonly used in raster-scan systems (including
color TV) because they produce a much wider range of colors than the beam-
penetration method."

Direct-View Storage Tubes


Direct-view storage tubes (DVSTs) store the picture information inside the CRT
instead of refreshing the screen.

Advantages:
 No refreshing is needed
 Very complex pictures can be displayed at very high resolutions without
flicker
Disadvantages:
 Ordinarily do not display color
 Selected parts of a picture cannot be erased
 The erasing and redrawing process can take several seconds for a
complex picture## Flat-Panel Displays 📱
Flat-panel displays refer to a class of video devices that have reduced volume,
weight, and power requirements compared to Cathode Ray Tubes (CRTs).
Characteristics
 Thinner and lighter than CRTs
 Can be hung on walls or worn on wrists
 Some flat-panel displays can even be written on, making them suitable
for pocket notepads
Applications
 Small TV monitors
 Calculators
 Pocket video games
 Laptop computers
 Armrest viewing of movies on airlines
 Advertisement boards in elevators
 Graphics displays in applications requiring rugged, portable monitors
Types of Flat-Panel Displays
Emissive Displays
Emissive displays convert electrical energy into light.
 Plasma Panels: Also called gas-discharge displays, constructed by filling a
region between two glass plates with a mixture of gases.
 Thin-Film Electroluminescent Displays: Similar to plasma panels, the
region between the glass plates is filled with a phosphor, such as zinc
sulfide doped with manganese.
 Light-Emitting Diodes (LEDs): A matrix of diodes arranged to form the
pixel positions in the display.
Nonemissive Displays
Nonemissive displays use optical effects to convert sunlight or light from some
other source into graphics patterns.
 Liquid-Crystal Displays (LCDs): Commonly used in small systems, such as
calculators and portable, laptop computers. Produce a picture by passing
polarized light from the surroundings or from an internal light source
through a liquid-crystal material that can be aligned to either block or
transmit the light.
Liquid-Crystal Displays (LCDs)
A liquid crystal is a compound that has a crystalline arrangement of molecules,
yet flows like a liquid.
Construction of an LCD
 Two glass plates, each containing a light polarizer at right angles to the
other plate, sandwich a liquid-crystal material.
 Rows of horizontal transparent conductors are built into one glass plate,
and columns of vertical conductors are put into the other plate.
 The intersection of two conductors defines a pixel position.
Passive-Matrix LCDs
 Picture definitions are stored in a refresh buffer, and the screen is
refreshed at the rate of 60 frames per second.
 Backlighting is commonly applied using solid-state electronic devices.

Active-Matrix LCDs
 A transistor is placed at each pixel location, using thin-film transistor
technology.
 The transistors are used to control the voltage at pixel locations and to
prevent charge from gradually leaking out of the liquid-crystal cells.

Three-Dimensional Viewing Devices 📊


Stereoscopic and Virtual-Reality Systems
Stereoscopic Viewing
Stereoscopic viewing is a technique that displays a different view to each eye of
an observer, creating a three-dimensional effect.
 Two views of a scene are generated from different viewing positions, one
for each eye.
 The views are presented simultaneously, with the left view seen by the
left eye and the right view seen by the right eye.
 The brain merges the two views into a single image, creating a scene
with depth.
Virtual-Reality Systems
Virtual reality systems allow users to step into a scene and interact with the
environment.
 A headset containing an optical system generates stereoscopic views.
 Interactive input devices are used to locate and manipulate objects in
the scene.
 A sensing system in the headset tracks the viewer's position, allowing
the viewer to "walk through" and interact with the display.
<table> <tr> <th>Technology of Flat-Panel Displays</th> <th>Type</th>
<th>Description</th> </tr> <tr> <td>Plasma Panels</td> <td>Emissive</td>
<td>Filled with a mixture of gases, uses electrical energy to break down into a
glowing plasma</td> </tr> <tr> <td>Thin-Film Electroluminescent
Displays</td> <td>Emissive</td> <td>Filled with a phosphor, uses electrical
energy to release light</td> </tr> <tr> <td>Light-Emitting Diodes (LEDs)</td>
<td>Emissive</td> <td>Matrix of diodes arranged to form pixel positions</td>
</tr> <tr> <td>Liquid-Crystal Displays (LCDs)</td> <td>Nonemissive</td>
<td>Uses polarized light to block or transmit light, creating images</td> </tr>
</table>## Interactive Virtual-Reality Environments 🚀
Interactive virtual-reality environments can be viewed with:
 Stereoscopic glasses and a video monitor, instead of a headset
 A lower-cost virtual-reality system

Raster-Scan Systems 📊
Raster-scan systems typically employ several processing units:
 Central Processing Unit (CPU)
 Video Controller or Display Controller (controls the operation of the
display device)
 Co-processors and Accelerators (implement various graphics operations)
Organization of a Simple Raster System

Frame Buffer:
 Can be anywhere in the system memory
 The video controller accesses the frame buffer to refresh the screen
Video Controller Architecture

Fixed Area of System Memory:


 Reserved for the frame buffer
 Video controller has direct access to the frame buffer memory

Coordinate System
"The screen surface is represented as the first quadrant of a two-dimensional
system, with positive x values increasing to the right and positive y values
increasing from bottom to top."
Scan Lines:
 Labeled from y, at the top of the screen to 0 at the bottom
 Along each scan line, screen pixel positions are labeled from 0 to x.
Refresh Operations

Video Controller:
 Retrieves the coordinates of the screen pixels
 Retrieves the value stored in the frame buffer for this pixel position
 Uses the value to set the intensity of the CRT beam
Lookup Tables
"A fast method for changing screen intensity values"
Raster-Scan Display Processor

Display Processor:
 Digitizes a picture definition into a set of pixel-intensity values for storage
in the frame buffer
 Performs scan conversion (digitizing a picture definition into a set of
pixel-intensity values)
Scan Conversion
"Scan converting a straight-line segment means that we have to locate the
pixel positions closest to the line path and store the intensity for each position
in the frame buffer."
Character Definition
 Can be defined with rectangular grids or curved outlines
 Array size for character grids can vary from about 5 by 7 to 9 by 12 or
more for higher-quality displays
Display Processors
 Generate various line styles (dashed, dotted, or solid)
 Display color areas (fill and hatch)
 Perform certain transformations and manipulations on displayed objects
 Interface with interactive input devices, such as a mouse
Frame Buffer Organization
Run-Length Encoding:
"Storing each scan line as a set of integer pairs, where one number indicates an
intensity value and the second number specifies the number of adjacent pixels
on the scan line that are to have that intensity."
Cell Encoding:
"Encoding the raster as a set of rectangular areas"
Random-Scan Systems 📈
Random-Scan Systems:
 Also known as vector systems
 Graphics patterns are drawn by directing the electron beam along the
component lines of the picture
Organization of a Simple Random-Scan System

Display File:
 Contains graphics commands in the application program
 Translated by the graphics package into a display file stored in the system
memory
Graphics Monitors and Workstations 📱
Graphics Monitors:
 Operate as raster-scan displays
 Survey of graphics hardware configurations available
Workstations:
 Range from small general-purpose computer systems with graphics
capabilities to sophisticated full-color systems designed specifically for
graphics applications## Graphics Systems
System Capabilities
Graphics systems vary in capabilities depending on size and cost. Some features
that can vary include:
 Diagonal screen dimensions: 12 to 21 inches
 Color selections: 16 to over 32,000
 Screen resolution: up to 1280 by 1024 with 8 to 24 bits per pixel (full-
color systems)
Graphics Workstations
Graphics workstations are designed for graphics applications and typically have:
 Higher screen resolutions
 Faster processors
 Larger screen diagonal (16 inches or more)
 Advanced graphics capabilities (e.g., 3D graphics)
Multi-Screen Display Systems
Multi-screen display systems, such as the MediaWall, provide a large display
area by splitting images into sections and distributing them across an array of
monitors or projectors.
 Resolution: up to 3200 by 2400
 Number of monitors: up to 5 by 5
 Monitor resolution: 640 by 480
Dual-Monitor Systems
Dual-monitor systems are commonly used in graphics workstations.
 One monitor displays the entire picture
 The second monitor displays details or graphics options (menus)
High-Definition Graphics Monitors
High-definition graphics monitors are used in applications such as air traffic
control, simulation, medical imaging, and CAD.
 Diagonal screen size: 27 inches
 Resolution: 2048 by 1536 to 2560 by 2048
 Refresh rate: 80 Hz or 60 Hz noninterlaced
Input Devices
Keyboards
Keyboards are used for entering text strings and are often provided with
features to facilitate entry of screen coordinates, menu selections, or graphics
functions.
 Cursor-control keys
 Function keys
 Numeric keypad
Mouse
A mouse is a small hand-held device used to position the screen cursor.
 Relative movement: measures movement of the mouse in various
directions
 Absolute movement: measures movement of the mouse relative to a
fixed point
 Buttons: typically 1-3 buttons that can be programmed to perform
specific actions
Trackball and Spaceball
 Trackball: a ball that can be rotated with the fingers or palm to produce
screen-cursor movement
 Spaceball: provides six degrees of freedom for spatial positioning and
orientation
Joysticks
Joysticks are used to steer the screen cursor around.
 Movable joystick: measures the amount of movement in any direction
from its center position
 Pressure-sensitive joystick: measures pressure on the stick to move the
cursor in the selected direction
Data Glove
A data glove is a device that can be used to grasp a "virtual" object.
 Sensors: detect hand and finger motions
 Electromagnetic coupling: used to provide information about the
position and orientation of the hand

Digitizers
Digitizers are devices used for drawing, painting, or interactively selecting
coordinate positions on an object.
 Graphics tablet: a device used to input two-dimensional coordinates by
activating a hand cursor or stylus at selected points## Input Devices

Graphics Tablets
Graphics tablets are used to input coordinate positions on a flat surface. They
contain cross hairs for sighting positions and are available in various sizes,
ranging from 12 by 12 inches for desktop models to 44 by 60 inches or larger
for floor models.
Types of Graphics Tablets:
 Electromagnetic Tablets: Use electromagnetic pulses to detect the
position of a stylus or hand cursor.
 Acoustic (or Sonic) Tablets: Use sound waves to detect a stylus position.

Examples of Graphics Tablets:

Tablet Description

Summasketch Desktop tablet with a 16-button hand cursor. (Courtesy of


111 Summagraphics Corporation.)

Desktop tablet with a 16-button hand cursor, designed for


digitizing larger drawings. (Courtesy of Summagraphics
Microgrid 111 Corporation.)

NotePad Desktop tablet with stylus. (Courtesy of CalComp Digitizer


Tablet Description

Division, a part of CalComp, Inc.)

Artist's Digitizer Pressue-sensitive, cordless stylus. (Courtesy of Wacom


System Technology Corporation.)

Image Scanners
Image scanners are used to store drawings, graphs, color and black-and-white
photos, or text for computer processing.
Types of Image Scanners:
 Hand-held Scanners: Small, portable scanners used to input either text
or graphics images.
 Desktop Scanners: Larger scanners used to input text or graphics images.
 Floor-model Scanners: Large scanners used to scan architectural and
engineering drawings up to 40 inches wide and 100 feet long.

Examples of Image Scanners:

Scanner Description

Hand-held Small, portable scanner used to input either text or graphics


Scanner images. (Courtesy of Thunber, Inc.)
Scanner Description

Desktop Full- Flatbed scanner with a resolution of 600 dots per inch.
color Scanner (Courtesy of Sharp Electronics Corporation.)

Selectable resolution from 50 to 4000 dots per inch. (Courtesy


Drum Scanner of Hautek, Inc.)

Large scanner used to scan architectural and engineering


Floor-model drawings up to 40 inches wide and 100 feet long. (Courtesy of
Scanner Summagraphics Corporation.)

Touch Panels
Touch panels allow displayed objects or screen positions to be selected with
the touch of a finger.
Types of Touch Panels:
 Optical Touch Panels: Employ a line of infrared light-emitting diodes
(LEDs) along one vertical edge and one horizontal edge of the frame.
 Electrical Touch Panels: Constructed with two transparent plates
separated by a small distance.
 Acoustical Touch Panels: Use high-frequency sound waves generated in
the horizontal and vertical directions across a glass plate.

Examples of Touch Panels:

Touch Panel Description

Touch screens designed for use with plasma displays. (Courtesy of


Plasma Panels
Photonics Systems.)
Touch Panel Description

Optical Touch Designed to match the color and contours of the system to which
Panel it is to be fitted. (Courtesy of Camtech, Inc.)

Light Pens
Light pens are pencil-shaped devices used to select screen positions by
detecting the light coming from points on the CRT screen.
How Light Pens Work:
A light pen is sensitive to the short burst of light emitted from the phosphor
coating at the instant the electron beam strikes a particular point. Other light
sources, such as the background light in the room, are usually not detected by a
light pen.
Example of Light Pen:

Light Pen Description

Light Activated with a button switch. (Courtesy of Intermute Graphics


Pen Products.)

Voice Systems
Voice systems are used to accept voice commands to initiate graphics
operations or to enter data.
How Voice Systems Work:
A dictionary is set up for a particular operator by having the operator speak the
command words to be used into the system. Each word is spoken several times,
and the system analyzes the word and establishes a frequency pattern for that
word in the dictionary along with the corresponding function to be performed.
Example of Voice System:

Voice System Description

Speech-
Recognition Designed to minimize the input of other background sounds.
System (Courtesy of Thornhill Technology, Inc.)## Hard-Copy Devices

Impact Printers
Impact printers press formed character faces against an inked ribbon onto the
paper. A line printer is an example of an impact device, with the typefaces
mounted on bands, chains, drums, or wheels.
Character Impact Printers: often have a dot-matrix print head containing a
rectangular array of protruding wire pins, with the number of pins depending
on the quality of the printer. Individual characters or graphics patterns are
obtained by extracting certain pins so that the remaining pins form the pattern
to be printed.

Nonimpact Printers
Nonimpact printers and plotters use various techniques such as:
 Laser techniques
 Ink-jet sprays
 Xerographic processes (as used in photocopying machines)
 Electrostatic methods
 Electrothermal methods
to get images onto paper.
Laser Printers
"A laser beam creates a charge distribution on a rotating drum coated with a
photoelectric material, such as selenium. Toner is applied to the drum and then
transferred to paper."

Ink-Jet Printers
Ink-jet methods produce output by squirting ink in horizontal rows across a roll
of paper wrapped on a drum. The electrically charged ink stream is deflected
by an electric field to produce dot-matrix patterns.

Electrostatic Printers
"An electrostatic device places a negative charge on the paper, one complete
row at a time along the length of the paper. Then the paper is exposed to a
toner. The toner is positively charged and so is attracted to the negatively
charged areas, where it adheres to produce the specified output."

Plotters
Pen Plotters: have one or more pens mounted on a carriage, or cross-bar, that
span a sheet of paper. Pens with varying colors and widths are used to produce
a variety of shadings and line styles.

Graphics Software 📊
There are two general classifications for graphics software:
 General Programming Packages: Provide an extensive set of graphics
functions that can be used in a high-level programming language, such as
C or FORTRAN.
 Special-Purpose Applications Packages: Designed for nonprogrammers,
so that users can generate displays without worrying about how graphics
operations work.
Coordinate Representations
Cartesian Coordinate Specifications: Most general graphics packages are
designed to be used with Cartesian coordinate specifications. If coordinate
values for a picture are specified in some other reference frame (spherical,
hyperbolic, etc.), they must be converted to Cartesian coordinates before they
can be input into the graphics package.
Modeling Coordinates: Used to construct the shape of individual objects, such
as trees or furniture, in a scene.
World Coordinates: Used to place the object into appropriate positions within
the scene.
Device Coordinates: Used to display the scene on an output device.
Graphics Functions
A general-purpose graphics package provides users with a variety of functions
for creating and manipulating pictures. These routines can be categorized
according to whether they deal with:
 Output: Routines for generating output primitives, such as character
strings and geometric entities.
 Attributes: Functions for setting attributes for individual primitives or
groups of output primitives.
 Transformations: Routines for changing the size, position, or orientation
of an object within a scene.
 Viewing: Functions for specifying the view that is to be presented and
the portion of the output display area that is to be used.
 Control: Routines for carrying out housekeeping tasks, such as clearing a
display screen and initializing parameters.

Graphics Standards
The primary goal of standardized graphics software is portability. When
packages are designed with standard graphics functions, software can be
moved easily from one hardware system to another and used in different
implementations and applications.## Computer Graphics Systems
Graphics Standards
Standard graphics functions are defined as a set of specifications that are
independent of any programming language. A language binding is then defined
for a particular high-level programming language.
 Graphical Kernel System (GKS): a two-dimensional graphics package
adopted as the first graphics software standard by the International
Standards Organization (ISO) and national standards organizations.
 PHIGS (Programmer's Hierarchical Interactive Graphics standard): an
extension of GKS with increased capabilities for object modeling, color
specifications, surface rendering, and picture manipulation.
 PHIGS+: an extension of PHIGS providing three-dimensional surface-
shading capabilities not available in PHIGS.
Language Bindings
A language binding is defined for a particular high-level programming language,
giving the syntax for accessing the various standard graphics functions from
this language.

Language Function Example

FORTRAN CALL GPL (N, X, Y)

C polyline(n, pts)

Graphics Functions
Graphics functions can be divided into the following categories:
 Output primitives
 Attributes
 Geometric and modeling transformations
 Viewing transformations
 Structure operations
 Input functions
 Control operations

Workstations
In PHIGS and GKS, the term "workstation" refers to various combinations of
graphics hardware and software.
 A workstation can be a single output device, a single input device, a
combination of input and output devices, a file, or even a window
displayed on a video monitor.
 To define and use various "workstations" within an application program,
we need to specify a workstation identifier and the workstation type.

PHIGS Program Structure


The general structure of a PHIGS program is as follows:
js
openphigs (errorFile, memorysize)
openworkstation (ws, connection, type)
{
create and display picture
}
closeworkstation (ws)
closephigs
Where error file is to contain any error messages that are generated, memory
size specifies the size of an internal storage area, ws is the workstation
identifier, connection states the access mechanism for the workstation,
and type specifies the particular category for the workstation.

Graphics Software and Hardware


Graphics software can be roughly classified as application packages or
programming packages. Applications of graphics software include CAD
packages, drawing and painting programs, graphing packages, and visualization
programs. Common graphics programming packages include PHIGS, PHIGS+,
GKS, 3D GKS, and GL.
Graphics hardware includes video monitors, hard-copy devices, keyboards, and
other devices for graphics input or output.## Raster Systems and Output
Primitives 📊
Raster Systems
A raster system is a type of graphics system that uses a rectangular grid of
pixels to display images. The system refreshes the screen at a rate of 60 frames
per second, and each frame is divided into a series of horizontal scan lines.
Resolution and Refresh Rate
Resolution: The number of pixels per unit of length on a screen. Common
resolutions include 640x480 and 1280x1024.
Refresh Rate: The number of times the screen is refreshed per second. Typical
refresh rates include 60 frames per second.
Calculating Pixel Access Time
To calculate the number of pixels that can be accessed per second in a raster
system, we need to know the resolution and refresh rate of the system.
Formula: (Resolution x Refresh Rate) / Number of Pixels per Frame
For a system with a resolution of 640x480 and a refresh rate of 60 frames per
second, the calculation would be:
(640 x 480 x 60) / (640 x 480) = 37,800,000 pixels per second
Access Time per Pixel
To calculate the access time per pixel, we need to divide the total time per
frame by the number of pixels per frame.
Formula: Total Time per Frame / Number of Pixels per Frame
For a system with a resolution of 640x480 and a refresh rate of 60 frames per
second, the calculation would be:
(1/60) / (640 x 480) = 26.04 microseconds per pixel
Non-Interlaced Raster Monitors
A non-interlaced raster monitor is a type of raster system that displays each
frame as a single, continuous scan.
Horizontal Retrace Time: The time it takes for the electron beam to move from
the end of one scan line to the beginning of the next.
Vertical Retrace Time: The time it takes for the electron beam to move from
the bottom of the screen to the top.
Output Primitives
An output primitive is a basic shape or object that can be used to construct a
picture.
Types of Output Primitives:
 Points
 Lines
 Circles and other conic sections
 Quadric surfaces
 Spline curves and surfaces
 Polygon color areas
 Character strings

Points and Lines


Point Plotting: The process of converting a single coordinate position into a
display operation.
Line Drawing: The process of calculating intermediate positions along a line
path between two specified endpoint positions.
Line Drawing Algorithms:
 Digital differential analyzer (DDA) algorithm
 Bresenham's line algorithm
Digital Differential Analyzer (DDA) Algorithm
The DDA algorithm is a scan-conversion line algorithm that calculates either Δy
or Δx using the slope-intercept equation for a straight line.
Formula: y = mx + b
Where m is the slope of the line and b is the y-intercept.
Example Code:
def dda_line(x1, y1, x2, y2):
m = (y2 - y1) / (x2 - x1)
b = y1 - m * x1
for x in range(x1, x2 + 1):
y = int(m * x + b)
plot_point(x, y)
Note: This is a simplified example and may not work for all cases.## DDA
Algorithm 📊
The DDA (Digital Differential Analyzer) algorithm is a method for calculating
pixel positions along a line path. It is a faster method than the direct use of the
line equation, as it eliminates the multiplication operation.
How it Works
The algorithm starts by calculating the differences in the x and y directions
(dx and dy) between the two endpoint positions. The difference with the
greater magnitude determines the value of the steps parameter. Then, starting
with the pixel position (x0, y0), the algorithm determines the offset needed at
each step to generate the next pixel position along the line path.
Pseudocode
void lineDDA (int xa, int ya, int xb, int yb) {
int dx = xb - xa, dy = yb - ya, steps, k;
float xIncrement, yIncrement, x = xa, y = ya;
if (abs(dx) > abs(dy))
steps = abs(dx);
else
steps = abs(dy);

xIncrement = dx / (float) steps;


yIncrement = dy / (float) steps;
setpixel(ROUND(x), ROUND(y));
for (k = 0; k < steps; k++) {
x += xIncrement;
y += yIncrement;
setpixel(ROUND(x), ROUND(y));
}
}
Bresenham's Line Algorithm 📈
Bresenham's line algorithm is an accurate and efficient raster line-generating
algorithm that uses only incremental integer calculations.
How it Works
The algorithm works by sampling at unit x intervals and determining which of
two possible pixel positions is closer to the line path at each sample step. The
decision is made by testing the sign of an integer parameter, whose value is
proportional to the difference between the separations of the two pixel
positions from the actual line path.
Key Concepts
Decision Parameter (pk): a parameter that determines which pixel to plot at
each step. Pixel Separations (d1 and d2): the vertical separations of the two
pixel positions from the mathematical line path.
Algorithm Steps
 Input the two line endpoints and store the left endpoint in (x0, y0).
 Load (x0, y0) into the frame buffer; that is, plot the first point.
 Calculate constants Ax, Ay, 2Ay, and 2Ay - 2Ax, and obtain the starting
value for the decision parameter as p0 = 2Ay - Ax.
 At each xk along the line, starting at k = 0, perform the following test:
 If p < 0, the next point to plot is (xk + 1, yk) and p += 2Ay.
 Otherwise, the next point to plot is (xk + 1, yk + 1) and p += 2Ay -
2Ax.
 Repeat step 4 Ax times.
Example
To illustrate the algorithm, let's digitize the line with endpoints (20, 10) and (30,
18). This line has a slope of 0.8.

Endpoint x y

(20, 10) 20 10

(30, 18) 30 18

The initial decision parameter has the value p0 = 2Ay - Ax = 16 - 10 = 6.


Pseudocode
void lineBresenham (int xa, int ya, int xb, int yb) {
int dx = abs(xa - xb), dy = abs(ya - yb);
int p = 2 * dy - dx;
int twoDy = 2 * dy, twoDyDx = 2 * dy - dx;
int x = xa, y = ya;
setpixel(x, y);
for (int k = 0; k < dx; k++) {
if (p < 0) {
x += 1;
p += twoDy;
} else {
x += 1;
y += 1;
p += twoDyDx;
}
setpixel(x, y);
}
}
```## Bresenham's Line Algorithm 📝

Bresenham's line algorithm is a way to draw lines on a raster grid using only
integer arithmetic. It is an efficient algorithm that eliminates the need for
floating-point calculations.

### How it Works

The algorithm determines which point to use as the start and end points of the
line. It then sets a pixel at the starting point and repeatedly moves one step
closer to the end point, plotting a pixel at each step.
> "The algorithm is generalized to lines with arbitrary slope by considering the
symmetry between the various octants and quadrants of the xy plane."

Here is a code snippet illustrating the algorithm:


```js
if (xA > xb) {
x = xb;
y = yb;
xEnd = xa;
} else {
x = xa;
y = ya;
xEnd = xb;
}
setpixel(x, y);
while (x < xEnd) {
x++;
if (lp < 0) {
lp += twoDy;
} else {
y++;
lp += twoDyDx;
}
setpixel(x, y);
}
Parallel Line Algorithms 💻
Parallel line algorithms calculate pixel positions along a line path
simultaneously using multiple processors. This approach can greatly increase
the speed of line drawing on parallel computers.
Partitioning the Line Path
To apply Bresenham's algorithm in parallel, the line path is divided into
partitions. Each processor calculates pixel positions over its assigned
subinterval using the starting decision parameter value for that subinterval and
the starting coordinates.

Partition Starting x Coordinate Starting y Coordinate Decision Parameter

0 xo yo pk

1 xo + Axp yk pk + Ay/Ax

2 xo + 2*Axp yk + Ay/Ax pk + 2*Ay/Ax

... ... ... ...

Assigning Processors to Pixels


Another approach to parallel line drawing is to assign each processor to a
particular group of screen pixels. Each processor calculates pixel distances from
the line path and plots the pixel if the distance is less than a specified line-
thickness parameter.

Loading the Frame Buffer 📈


When straight line segments are scan-converted for display, frame-buffer
positions must be calculated. This is accomplished using
the setpixel procedure, which stores intensity values for the pixels at
corresponding addresses within the frame-buffer array.
Calculating Frame-Buffer Addresses
Frame-buffer addresses are calculated incrementally using the following
formulas:

Operation Formula

Moving across a scan line addr(x + 1, y) = addr(x, y) + 1

Stepping diagonally up to the next scan addr(x + 1, y + 1) = addr(x, y) + x,,, - 1


line +2

Line Function 📊
A procedure for specifying straight-line segments can be set up in several
different forms. In PHIGS, GKS, and some other packages, the two-dimensional
line function is defined as:
polyline (n, wcpoints)
where:
 n is an integer value equal to the number of coordinate positions to be
input
 wcpoints is the array of input world coordinate values for line segment
endpoints
This function is used to define a set of n - 1 connected straight-line
segments.## Graphics and Coordinate Systems
Polyline Procedure
A polyline procedure is used to draw a series of connected line sections. This is
accomplished by performing a series of coordinate transformations, followed
by a sequence of calls to a device-level line-drawing routine.
Coordinate Transformations:
Transformation Description

Modeling Coordinates → World Convert input line endpoints from modeling


Coordinates coordinates to world coordinates

World Coordinates → Convert world coordinates to normalized


Normalized Coordinates coordinates

Normalized Coordinates → Convert normalized coordinates to device


Device Coordinates coordinates

Line-Drawing Routine:
The line-drawing routine is called n-1 times to connect the n coordinate points.
Each successive call passes the coordinate pair needed to plot the next line
section, where the first endpoint of each coordinate pair is the last endpoint of
the previous section.
Circle-Generating Algorithms 📈
A circle is defined as the set of points that are all at a given distance r from a
center position (x₀, y₀).
"A circle is defined as the set of points that are all at a given distance r from
a center position (x₀, y₀)."

Properties of Circles:
 A circle can be defined using the Pythagorean theorem in Cartesian
coordinates: (x - x₀)² + (y - y₀)² = r²
 A circle can be generated using parametric polar form: x = r \*
cos(θ) and y = r \* sin(θ)
Circle-Generating Methods:
 Naive Method: Stepping along the x-axis and calculating y values at each
position using the circle equation
 Problems: Involves considerable computation, uneven spacing
between plotted pixel positions
 Polar Coordinate Method: Calculating points along the circular boundary
using polar coordinates r and θ
 Benefits: Plots pixel positions that are approximately one unit
apart, eliminate unequal spacing
 Symmetry Method: Taking advantage of circle symmetry to reduce
computation
 Octant Symmetry: Circle sections in adjacent octants within one
quadrant are symmetric concerning the 45° line dividing the two
octants
 Quadrant Symmetry: Circle sections in the second quadrant can
be generated by noting that they are symmetric concerning the y-
axis

Midpoint Circle Algorithm


A more efficient circle algorithm based on incremental calculation of decision
parameters.
Midpoint Algorithm Steps:
1. Sample at unit intervals and determine the closest pixel position to the
specified circle path at each step
2. Set up the algorithm to calculate pixel positions around a circle path
centered at the coordinate origin (0,0)
3. Move each calculated position (x, y) to its proper screen position by
adding x₀ to x and y₀ to y
// Midpoint Circle Algorithm Example
function midpointCircle(x₀, y₀, r) {
// Initialize variables
let x = 0;
let y = r;
let d = 3 - 2 * r;

// Loop until x <= y


while (x <= y) {
// Plot pixel positions
plotPixel(x + x₀, y + y₀);
plotPixel(-x + x₀, y + y₀);
plotPixel(x + x₀, -y + y₀);
plotPixel(-x + x₀, -y + y₀);
if (d < 0) {
d += 4 * x + 6;
} else {
d += 4 * (x - y) + 10;
y--;
}
x++;
}
}

You might also like