SlideShare a Scribd company logo
1 of 102
CG
Chapter Two
Video Display Devices
Tips: Install MinGw on you Computer
Integrate freeglut with CodeBlocks(Optional)
Class on Tuesday 16, April @10:30AM-Venue VIII-1
Note
How computers store Image in memory?
Look at the following figures:
2
…Note
Unicode(Hexa decimal)
3
CHAPTER OUTLINE
Raster Scan Displays
Random Scan Displays
Color CRT Monitors
Direct View Storage Tube
Flat panel Displays
Three Dimensional Viewing Devices
Stereoscopic and Virtual Reality System
4
OVERVIEW
The display systems are often referred to as Video Monitor or Video
display Unit(VDU).
The primary output device in a graphics system is a monitor.
5
CRT (CATHODE RAY TUBES)
1. Electron Guns
2. Electron Beams
3. Focusing Coils
4. Deflection Coils
5. Anode Connection
6. Shadow Mask
7. Phosphor layer
8. Close-up of the phosphor coated
inner side of the screen
6
…CRT(CATHODE RAY TUBES)(CONT’D)
.
7
…CRT(CATHODE RAY TUBES)(CONT’D)
.
8
…REFRESH CRT
Light emitted by the Phosphor fades very rapidly.
Refresh CRT: One way to keep the phosphor glowing is to redraw the picture
repeatedly by quickly directing the electron beam back over the same points.
Electron Gun: Heat is supplied to the cathode by the filament.
9
…ELECTRON GUN
The free electrons are then accelerated toward the phosphor coating by a high positive
voltage.
High Positive Voltage: a positively charged metal coating on the inside of the CRT
envelope near the phosphor screen.
1
0
… HIGH POSITIVE VOLTAGE
accelerating anode.
Intensity of the electron beam is controlled by setting voltage level on the
control grid.
smaller negative voltage on the control grid simply decrease the number of electrons
passing through. 1
1
…FOCUSING SYSTEM
The focusing system is needed to force the electron beam to converge into a small
spot as it strikes the phosphor.
Electrostatic focusing is commonly used in computer graphics monitor
With electrostatic focusing, the electron beam passes through a positively charged
metal cylinder that forms an electrostatic lens.
1
2
…FOCUSING SYSTEM
The distance that the electron beam must travel to different points on the screen varies
because the radius of curvature for most CRTs is greater than the distance from the
focusing system to the screen center.
The electron beam will be focused properly only at the center of the screen.
As the beam moves to the outer edges of the screen, displayed images become
blurred.
Dynamically focusing lens work based on beam position.
1
3
…DEFLECTION SYSTEMS
Deflection of the electron beam can be controlled either with electric fields or with
magnetic fields.
The magnetic deflection coils mounted on the outside of the CRT envelope.
1
4
…DEFLECTION SYSTEMS
Two pairs of coils are used, with the coils in each pair mounted on opposite sides of
the neck 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.
1
5
…DEFLECTION SYSTEMS
Horizontal deflection is accomplished with one pair of coils, and vertical deflection
by the other pairs.
The proper deflection amounts are attained by adjusting the current through the coil.
Electrostatic deflection: Two pairs of parallel plates are mounted inside the CRT
envelope.
One pair of plates is mounted horizontally to control the vertical deflection, and the
other pair is mounted vertically to control horizontal deflection.
1
6
…DEFLECTION SYSTEMS
.
Persistence: The time it takes the emitted light from the screen to decay to one tenth of
its original intensity
1
7
…RASTER SCAN DISPLAYS
Raster: A rectangular array of points or dots
Pixel: One dot or picture element of the raster
Scan Line: A row of pixels
In a raster scan system, the electron beam is swept across the screen, one row at a time
from top to bottom
1
8
…RASTER SCAN DISPLAYS
.
1
9
…RASTER SCAN DISPLAYS
As the electron 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.
2
0
…RASTER SCAN DISPLAYS
Refresh buffer or frame buffer: This memory area holds the set of intensity values for
all the screen points.
Stored intensity values then retrieved from refresh buffer and “painted” on the screen
one row (scan line) at a time.
2
1
…RASTER SCAN DISPLAYS
Intensity range for pixel positions depends on the capability of the raster system.
A black-and-white system: each screen point is either on or off, so only one bit per
pixel is needed to control the intensity of screen positions.
On a black-and-white system with one bit per pixel, the frame buffer is called bitmap
For system with multiple bits per pixel, the frame buffer is called pixmap
Sometimes, refresh rates are described in unit of cycles per second, or Hertz (HZ)
Refreshing on raster scan displays is carried out at the rate 60 to 80 frame per second
2
2
…RASTER SCAN DISPLAYS
Horizontal retrace: The return to the left of the screen, after refreshing each scan line
Vertical retrace: At the end of each frame (displayed in 1/80th to 1/60th of a second)
the electron beam returns to the top left corner of the screen to begin the next frame
23
…RASTER IMAGE
The quality of a raster image is determined by the total number pixels (resolution), and
the amount of information in each pixel (color depth).
Raster graphics cannot be scaled to a higher resolution without loss of apparent
quality.
24
Random scan Display
CRT has the electron beam directed only to the parts of the screen where a picture
is to be drawn.
are also referred to as vector displays (or stroke-writing or calligraphic displays)
because Random scan monitors draw a picture one line at a time
A pen plotter operates in a similar way and is an example of a random-scan, hard-copy
device.
Refresh rate depends on the number of lines to be displayed.
 Picture definition is stored as a set of line drawing commands in an area of memory
referred to as the refresh display file/display list.
25
Random scan Display
The refresh display file is called the display list, display program, or simply the
refresh buffer.
To display a specified picture, the system cycles through the set of commands in the
display file, drawing each component line in turn.
Random-scan systems are designed for line drawing applications and cannot display
realistic shaded scenes.
vector displays generally have higher resolution than raster systems.
26
Random scan Display (Cont’d)
A random-scan system draws the component lines of an object in any order specified
27
Exercise(get a Reward)
1. Discuss the difference between Raster scan Random Scan?
2. What is the difference between Vertical and Horizontal retrace?
28
Raster Scan Vs Random scan Display
.
29
Base of Difference Raster Scan System Random Scan System
Electron Beam The electron beam is swept across the
screen, one row at a time, from top to
bottom.
The electron beam is directed only to the parts of
screen where a picture is to be drawn.
Resolution Its resolution is poor because raster system
in contrast produces zigzag lines that are
plotted as discrete point sets.
Its resolution is good because this system
produces smooth lines drawings because CRT
beam directly follows the line path.
Picture Definition Picture definition is stored as a set of
intensity values for all screen points, called
pixels in a refresh buffer area.
Picture definition is stored as a set of line
drawing instructions in a display file.
Realistic Display The capability of this system to store
intensity values for pixel makes it well
suited for the realistic display of scenes
contain shadow and color pattern.
These systems are designed for line drawing and
can’t display realistic shaded scenes.
Draw an Image Screen points/pixels are used to draw an
image
Mathematical functions are used to draw an
image
Color CRT Monitors
A CRT monitor displays color pictures by using a combination of phosphors that emit
different-colored light.
Two basic technique is applied to produce color display:
Beam-penetration method:
•used with random-scan monitors
•usually red and green, are coated onto the inside of the CRT screen, and the
displayed color depends on how far the electron beam penetrates into the
phosphor layers.
• A beam of slow electrons excites only the outer red layer.
30
Color CRT Monitors
Beam-penetration method:
•A beam of very fast electrons penetrates through the red layer and excites the
inner green layer.
•At intermediate beam speeds, combinations of red and green light are emitted to
show two additional colors, orange and yellow.
•The speed of the electrons, and hence the screen color at any point, is controlled
by the beam-acceleration voltage.
•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.
31
Color CRT Monitors
Beam-penetration method:
32
Color CRT Monitors(Cont’d)
Shadow-Mask Method:
Commonly used in raster-scan systems (including color TV) because they produce
a much wider range of colors than the beam-penetration method.
has three phosphor color dots at each pixel position.
One phosphor dot emits a red light, another emits a green light, and the third emits
a blue light.
This type of CRT has three electron guns, one for each color dot, and a shadow-
mask grid just behind the phosphor-coated screen.
The three electron beams are deflected and focused as a group onto the shadow
mask, which contains a series of holes aligned with the phosphor-dot patterns.
33
Color CRT Monitors(Cont’d)
…Shadow-Mask Method:
When the three beams pass through a hole in the shadow mask, they activate a dot
triangle, which appears as a small color spot on the screen.
The phosphor dots in the triangles are arranged so that each electron beam can
activate only its corresponding color dot when it passes through the shadow mask.
Another configuration for the three electron guns is an in-line arrangement in
which the three electron guns, and the corresponding red-green-blue color dots
on the screen, are aligned along one scan line instead of in a triangular pattern.
This in-line arrangement of electron guns is easier to keep in alignment and is
commonly used in high-resolution color CRTs.
34
Color CRT Monitors(Cont’d)
…Shadow-Mask Method:
35
Color CRT Monitors(Cont’d)
.
Three electron guns, aligned with the triangular color-dot patterns on the screen, are directed to each
dot triangle by a shadow mask.
36
Color CRT Monitors(Cont’d)
…Shadow-Mask Method:
37
Color CRT Monitors(Cont’d)
Shadow-Mask Method:
We obtain color variations in a shadow-mask CRT by varying the intensity levels of
the three electron beams.
By turning off the red and green guns, we get only the color coming from the blue
phosphor.
Other combinations of beam intensities produce a small light spot for each pixel
position, since our eyes tend to merge the three colors into one composite.
The color we see depends on the amount of excitation of the red, green, and blue
phosphors.
A white (or gray) area is the result of activating all three dots with equal intensity.
38
Color CRT Monitors(Cont’d)
Shadow-Mask Method:
Yellow is produced with the green and red dots only, magenta is produced with the
blue and red dots, and cyan shows up when blue and green are activated equally
Color CRTs in graphics systems are designed as RGB monitors.
 These monitors use shadow-mask methods and take the intensity level for each
electron gun (red, green, and blue) directly from the computer system without any
intermediate processing.
High-quality raster-graphics systems have 24 bits per pixel in the frame buffer,
allowing 256 voltage settings for each electron gun and nearly 17 million color choices
for each pixel.
39
Color CRT Monitors(Cont’d)
An RGB color system with 24 bits of storage per pixel is generally referred to as a
full-color system or a true-color system.
Direct-View Storage Tubes :
An alternative method for maintaining a screen image is to store the picture
information inside the CRT instead of refreshing the screen.
A direct-view storage tube (DVST) stores the picture information as a charge
distribution just behind the phosphor-coated screen.
Two electron guns are used in a DVST.
 the primary gun, is used to store the picture pattern;
 the flood gun, maintains the picture display. 40
Color CRT Monitors(Cont’d)
advantages compared to the refresh CRT: Because no refreshing is needed, very
complex pictures can be displayed at very high resolutions without flicker.
Disadvantages: they ordinarily do not display color and that selected parts of a picture
cannot he erased. To eliminate a picture section, the entire screen must be erased and the
modified picture is redrawn.
The erasing and redrawing process can take several seconds for a complex picture.
 For these reasons, storage displays have been largely replaced by raster systems
41
Color Models
R, G, and B represent the colors produced by red, green and blue phosphors, respectively.
42
CMY Color Model
CMY(short for Cyan, Magenta, Yellow, and key) is a subtractive color
model.
43
CMY Color Model(Cont’d)
44
Color Depth, Bit Depth
The number of discrete intensities that the video card is capable of generating for each
color determines the maximum number of colors that can be displayed.
The number of memory bits required to store color information (intensity values for all
three primary color components) about a pixel is called color depth or bit depth.
A minimum of one memory bit (color depth=1) is required to store intensity value either
0 or1 for every screen pixel.
If there are n pixels in an image a total of n bits memory is used for storing intensity
values (in a pure black & white image)
45
Bit Plane
The block of memory which stores (or is mapped with) intensity values for each pixel (B& W image) is
called a bit plane or bitmap.
46
3Bit color display
Color or gray levels can be achieved in the display using additional bit planes.
47
True Color
For true Color three bytes of information are used, one for each of the red, blue and green signals that
make a pixel.
 A byte can hold 256 different values and so 256 intensities setting are possible for each electron gun
which mean each primary color can have 256 intensities (256*256* 256 color possible) .
48
Flat-Panel Displays
The term flat-panel display refers to a class of video devices that have reduced
volume, weight, and power requirements compared to a CRT.
A significant feature of flat-panel displays is that they are thinner than CRTs, and we
can hang them on walls or wear them on our wrists.
Since we can even write on some flat-panel displays, they will soon be available as
pocket notepads.
 Current uses for flat-panel displays include small TV monitors, calculators, pocket
video games, laptop computers, armrest viewing of movies on airlines, as advertisement
boards in elevators, and as graphics displays in applications requiring rugged, portable
monitors.
49
Flat-Panel Displays
Two categories of flat-panel:
 emissive displays : displays (or emitters) are devices that convert electrical
energy into light. Plasma panels, thin-film electroluminescent displays, and Light-
emitting diodes are examples of emissive displays.
Non-emissive displays: use optical effects to convert sunlight or light from some
other source into graphics patterns.
The most important example of a non-emissive flat-panel display is a liquid-
crystal device.
50
Three-Dimensional Viewing Devices
Graphics monitors for the display of three-dimensional scenes have been devised using a technique that
reflects a CRT image from a vibrating, flexible mirror.
51
Three-Dimensional Viewing Devices
From figure above, as the varifocal mirror vibrates, it changes focal length.
These vibrations are synchronized with the display of an object on a CRT so that each
point on the object is reflected from the mirror into a spatial position corresponding to
the distance of that point from a specified viewing position.
This allows us to walk around an object or scene and view it from different sides..
52
Pixel Resolution and Aspect Ratio
Resolution is technically the number of pixels per unit of area, rather than the total number of
pixels.
Pixel resolution refers to the total number of count of pixels in an digital image. For example, if
an image has M rows and N columns, then its resolution can be defined as M X N.
Pixel resolution can be defined with set of two numbers:- the first number the width of the
picture, or the pixels across columns, and the second number is height of the picture, or the pixels
across its width.
We can say that the higher is the pixel resolution, the higher is the quality of the image
Resolution can affected by: the type of phosphor, the intensity to be displayed, the focusing and
deflection systems.
53
Pixel Resolution and Aspect Ratio(Cont’d)
Aspect ratio is the ratio between width of an image and the height of an image.
 It is commonly explained as two numbers separated by a colon (8:9).
This ratio differs in different images, and in different screens.
Example: If you are given an image with aspect ratio of 6:2 of an image of pixel resolution of
480000 pixels given the image is a gray scale image. Then calculate two things.
Resolve pixel resolution to calculate the dimensions of image
Calculate the size of the image
Aspect ratio: c:r = 6:2
Pixel resolution: c * r = 480000
Bits per pixel: grayscale image = 8
54
Pixel Resolution and Aspect Ratio(Cont’d)
Number of columns = ?
𝑐 𝑥 𝑟 = 480000
𝑐
𝑟
=
6
2
⇒ 𝑐2 = 480,000𝑥 3 ⇒ 𝑐 = 1200
Number of cols = ? 1200 * 𝑟 = 480,000 ⇒ 𝑟 = 400
Size = rows * cols * bpp
Size of image in bits = 400 * 1200 * 8 = 3840000 bits
Size of image in bytes = 480000 bytes
Size of image in kilo bytes = 48 kb (approximate).
What if the image is colored image?
55
Pixel Resolution and Aspect Ratio(Cont’d)
Consider two raster systems with the resolutions of 640x480, 1280x1024, and 2560x2048.
a) What size frame buffer (in bytes) is needed for each of these systems to store 12 bits/pixel? How much
storage is required for each system if true color image is to be stored?
56
Pixel Resolution and Aspect Ratio(Cont’d)
P's, and I's about screen resolutions
You may have seen the screen resolution described as something like 720p or 1080i.
What does that mean?
The letters tell you how the picture is "painted" on the monitor
A "p" stands for progressive, and an "i" stands for interlaced.
The interlaced scan is a holdover from television and early CRT monitors.
The monitor or TV screen has lines of pixels arranged horizontally across it.
The lines were relatively easy to see if you got up close to an older monitor or TV.
57
Pixel Resolution and Aspect Ratio(Cont’d)
P's, and I's about screen resolutions(Cont’d)
but nowadays the pixels on the screen are so small that they are hard to see even with
magnification.
 The monitor's electronics "paint" each screen line by line, too quickly for the eye to
see.
An interlaced display paints all the odd lines first, then all the even lines.
58
RASTER-SCAN SYSTEMS
Interactive raster graphics systems typically employ several processing units.
In addition to the central processing unit, or CPU, a special-purpose processor, called
the video controller or display controller, is used to control the operation of the display
device.
 The frame buffer can be anywhere in the system memory, and the video controller
accesses the frame buffer to refresh the screen.
In addition to the video controller, more sophisticated raster systems employ other
processors as co-processors and accelerators to implement various graphics operations.
59
…RASTER-SCAN SYSTEMS
Architecture of Raster system with a fixed portion of the system memory reserved for the frame buffer.
60
…RASTER-SCAN SYSTEMS
Video Controller:
A fixed area of the system memory is reserved for the frame buffer, and the video
controller is given direct access to the frame-buffer memory.
Frame-buffer locations, and the corresponding screen positions, are referenced in
Cartesian coordinates.
For many graphics monitors, the coordinate origin is defined at the lower left screen
comer (see fig on next page).
The screen surface is then 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.
61
On some personal computers, the coordinate origin is referenced at the upper left
comer of the screen, so the y values are inverted.) Scan lines are then labeled
from 𝒚 𝒎𝒂𝒙 , at the top of the screen to 0 at the bottom. Along each scan line, screen
pixel positions are labeled from 0 to 𝑿 𝒎𝒂𝒙 .
[The origin of the coordinate system for identifying screen
positions is usually specified in the lower-left corner]
…RASTER-SCAN SYSTEMS
62
The basic refresh operations of the video controller are diagrammed on the next slide.
Two registers are used to store the coordinates of the screen pixels.
Initially, the x register is set to 0 and the y register is set to 𝒚 𝒎𝒂𝒙 .
The value stored in the frame buffer for this pixel position is then retrieved and used to set the intensity of
the CRT beam.
Then the x register is incremented by 1, and the process repeated for the next pixel on the top scan line.
This procedure is repeated for each pixel along the scan line.
After the last pixel on the top scan line has been processed, the x register is reset to 0 and the y register
is decremented by 1.
Pixels along this scan line are then processed in turn, and the procedure is repeated for each successive
scan line.
After cycling through all pixels along the bottom scan line (y = 0), the video controller resets the registers
to the first pixel position on the top scan line and the refresh process starts over.
…RASTER-SCAN SYSTEMS
63
Since the screen must be refreshed at the rate of 60 frames per second, the simple
procedure depicted in the figure on the next page cannot be accommodated by typical
RAM chips.
The cycle time is too slow.
To speed up pixel processing, video controllers can retrieve multiple pixel values from
the refresh buffer on each pass.
The multiple pixel intensities are then stored in a separate register and used to control
the CRT beam intensity for a group of adjacent pixels.
When that group of pixels has been processed, the next block of pixel values is
retrieved from the frame buffer.
…RASTER-SCAN SYSTEMS
64
.
…RASTER-SCAN SYSTEMS
65
Raster-Scan Display Processor:
…RASTER-SCAN SYSTEMS
66
Raster-Scan Display Processor(Cont’d):
The purpose of the display processor is to free the CPU from the graphics chores. In addition to the
system memory, a separate display processor memory area can also be provided.
A major task of the display processor is digitizing a picture definition given in an application program
into a set of pixel-intensity values for storage in the frame buffer.
This digitization process is called scan conversion.
Graphics commands specifying straight lines and other geometric objects are scan converted into a set
of discrete intensity points.
Scan converting a straight-line segment, for example, 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.
 Similar methods are used for scan converting curved lines and polygon outline.
…RASTER-SCAN SYSTEMS
67
Raster-Scan Display Processor(Cont’d):
[A character defined as a [A character defined as a curve outline]
rectangular grid of pixel
positions]
Additional functions of Display processor include generating various line styles (dashed, dotted, or
solid), displaying color areas, and performing certain transformations and manipulations on displayed
objects.
Also, display processors are typically designed to interface with interactive input devices, such as a
mouse.
…RASTER-SCAN SYSTEMS
68
An application program is input and stored in the system memory along with a graphics package
Graphics commands in the application program are translated by the graphics package into a display
file stored in the system memory.
RANDOM-SCAN SYSTEMS
69
A graphics package is an application that can be used to create and manipulate images
on a computer.
There are two main types of graphics package:
painting packages
A painting package produces images by changing the color of pixels on the screen.
These are coded as a pattern of bits to create a bitmapped graphics file.
Bitmapped graphics are used for images such as scanned photographs or pictures taken with a
digital camera.
drawing packages
Graphics Packages
70
This display file is then accessed by the display processor to refresh the screen.
The display processor cycles through each command in the display file program once during every
refresh cycle.
Sometimes the display processor in a random-scan system is referred to as a display processing
unit or a graphics controller.
Graphics patterns are drawn on a random-scan system by directing the electron beam along the
component lines of the picture.
Lines are defined by the values for their coordinate endpoints, and these input coordinate values are
converted to x and y deflection voltages.
A scene is then drawn one line at a time by positioning the beam to fill in the line between specified
endpoints.
…Random-scan Systems
71
Chapter Three
Output Primitives
72
Introduction
Points and Lines
Line Drawing Algorithms
DDA algorithm
Bresenham Line Drawing Algorithm
Parallel Line Algorithms
Loading The Frame Buffer
Circle Generating Algorithms
Ellipse Generating Algorithms
Chapter Outlines
73
In a raster display, a picture is completely specified by the set of intensities for the
pixel positions in the display.
Graphics programming packages provide functions to describe a scene in terms of these basic
geometric structures, referred to as output primitives, and to group sets of output primitives into more
complex structures.
Each output primitive is specified with input coordinate data and other information about the way that
object is to be displayed.
 Points and straight line segments are the simplest geometric components of pictures.
Additional output primitives that can be used to construct a picture include circles and other conic
sections, quadric surfaces, spline curves and surfaces, polygon color areas, and character strings.
Introduction
74
Point plotting is accomplished by converting a single coordinate position furnished by an application
program into appropriate operations for the output de-vice in use.
With a CRT monitor, for example, the electron beam is turned on to illuminate the screen phosphor at
the selected location.
 How the electron beam is positioned depends on the display technology.
A random-scan (vector) system stores point-plotting instructions in the display list, and coordinate
values in these instructions are converted to deflection voltages that position the electron beam at the
screen locations to be plotted during each refresh cycle.
 For a black and white raster system, on the other hand, a point is plotted by setting the bit value
corresponding to a specified screen position within the frame buffer to 1. Then, as the electron beam
sweeps across each horizontal scan line, it emits a burst of electrons (plots a point) whenever a value
of 1(one) is encountered in the frame buffer.
With an RGB system, the frame buffer is loaded with the color codes for the intensities that are to be
displayed at the screen pixel positions.
Points and Lines
75
Line drawing is accomplished by calculating intermediate positions along the line path between two
specified endpoint positions.
An output device is then directed to fill in these positions between the endpoints.
For analog devices, such as a vector pen plotter or a random-scan display, a straight line can be
drawn smoothly from one endpoint to the other.
 Linearly varying horizontal and vertical deflection voltages are generated that are proportional to
the required changes in the x and y directions to produce the smooth line.
Digital devices display a straight line segment by plotting discrete points between the two endpoints.
Discrete coordinate positions along the line path are calculated from the equation of the line.
For a raster video display, the line color (intensity) is then loaded into the frame buffer at the
corresponding pixel coordinates.
Reading from the frame buffer, the video controller then "plots" the screen pixels.
…Points and Lines(Cont’d)
76
Screen locations are referenced with integer values, so plotted positions may only approximate actual
Line positions between two specified endpoints.
A computed line position of (10.48,20.51), for example, would be converted to pixel position (10,21).
Thus rounding of coordinate values to integers causes lines to be displayed with a stair step appearance
("the jaggies"), as represented in the figure on the next page.
The characteristic stair step shape of raster lines is particularly noticeable on systems with low
resolution, and we can improve their appearance somewhat by displaying them on high-resolution
systems.
More effective techniques for smoothing raster lines are based on adjusting pixel intensities along
the line paths.
For the raster-graphics device-level algorithm, object positions are specified directly in integer device
coordinates.
Pixel positions are referenced according to scan-line number and column number (pixel position
across a scan line).
…Points and Lines(Cont’d)
77
Scan lines are numbered consecutively from 0, starting at the bottom of the screen; and pixel columns are
numbered from 0, left to right across each scan line.

fig 2.1 a fig 2.1 b
[Pie1 positions referenced by scan-
line number and column number.]
…Points and Lines(Cont’d)
78
The Cartesian slope-intercept equation for a straight line is:
𝑦 = 𝑚𝑥 + 𝑏 (2.1)
with mrepresenting the slope of the line and b as they intercept. Given that the two endpoints of a he
segment are specified at positions (x,, y,) and (x, y), as shown the following figure, we can determine
values for the slope mand y intercept b with the following calculations.
𝑚 =
𝑦2 − 𝑦1
𝑥2 − 𝑥1
(2.2)
𝑏 = 𝑦1 − 𝑚𝑥 (2.3)
[fig 2.2 Line path between endpoint positions (𝑥1, 𝑦1) and (𝑥2,𝑦2]
Line-Drawing Algorithms
79
For any given x interval 𝜟𝒙along a line, we can compute the corresponding y interval 𝜟𝒚from
equation 2.2 and 2.3 above.
Δ𝑦 = 𝑚Δ𝑥 (2.4)
Δ𝑥 =
Δ𝑦
𝑚
(2.5)
These equations form the basis for determining deflection voltages in analog devices.
For lines with slope magnitudes |m|< 1, Δ𝑥can be set proportional to a small horizontal deflection voltage and the
corresponding vertical deflection is then set proportional to Δ𝑦 as calculated from Eq. 2-4.
For lines whose slopes have magnitudes |m|< 1, 𝛥𝑦can be set proportional to a small vertical deflection voltage with the
corresponding horizontal deflection voltage set proportional to Δ𝑥, calculated from Eq. 2-5.
For lines with m = 1, 𝜟𝒙= 𝜟𝒚and the horizontal and vertical deflections voltages are equal.
In each case, a smooth line with slope m is generated between the specified endpoints.
…Line-Drawing Algorithms(Cont’d)
80
On raster systems, lines are plotted with pixels, and step sizes in the horizontal and vertical directions
are constrained by pixel separations.
That is, we must "sample" a line at discrete positions and determine the nearest pixel to the line at each
sampled position. This scan conversion process for straight lines is illustrated below.
[Straight line segment with five sampling positions along
the x axis between 𝑥1 and 𝑥2]
Fig 2.3
…Line-Drawing Algorithms(Cont’d)
81
DDA Algorithm: The digital differential analyzer (DDA) is a scan-conversion line algorithm based on
calculating either 𝜟y or 𝜟𝒙, using Eq. 2-4 or Eq. 2-5.
We sample the line at unit intervals in one coordinate and determine corresponding integer values
nearest to the line path for the other coordinate.
Consider first a line with positive slope, as shown below. If the slope is less than or equal to 1, we sample
at unit x intervals (𝜟𝒙 = 1) and compute each successive y value as:
𝑦 𝑘+1 = 𝑦 𝑘 + 𝑚 2.6
fig 2.4
Subscript k takes integer values starting from 1, for the first point, and increases by 1 until the final endpoint is
reached. Since mcan be any real number between 0 and 1, the calculated y values must be rounded to the nearest
integer.
…Line-Drawing Algorithms(Cont’d)
82
…DDA Algorithm:
For lines with a positive slope greater than 1, we reverse the roles of x and y. That is, we sample at unit y
intervals (𝜟y = 1) and calculate each succeeding x value as:
𝑥 𝑘+1 = 𝑥 𝑘 +
1
𝑚
2.7
Equations 2.6 and 2.7 are based on the assumption that lines are to be processed from the left endpoint to
the right endpoint. If this processing is reversed, so that the starting endpoint is at the right, then either we
have 𝜟𝒙= -1 and
𝑦 𝑘+1 = 𝑦 𝑘 − 𝑚 2.8
or (when the slope is greater than I) we have 𝜟y = -1 with
𝑋 𝑘+1 = 𝑥 𝑘 −
1
𝑚
2.9
…Line-Drawing Algorithms(Cont’d)
83
…DDA Algorithm:
Equations 2.6 through 2.9 can also be used to calculate pixel positions along a line with negative slope. If
the absolute value of the slope is less than 1 and the start endpoint is at the left, we set 𝜟𝒙 = 1 and
calculate y values with Eq. 2.6.
When the start endpoint is at the right (for the same slope), we set 𝜟𝒙= -1 and obtain y positions from Eq.
2.8.
Similarly, when the absolute value of a negative slope is greater than 1, we use 𝜟y = -1and Eq. 2.9 or we
use 𝜟𝒚 = 1 and Eq. 2.7.
Advantages of DDA Algorithm over the equation: 𝑦 = 𝑚𝑥 + 𝑏 :
faster method for calculating pixel positions than the direct use of 𝑦 = 𝑚𝑥 + 𝑏.
Eliminates the multiplicationby making use of raster characteristics, so that appropriate increments are
applied in the x or y direction to step to pixel positions along the line path.
…Line-Drawing Algorithms(Cont’d)
84
…Disadvantages of DDA Algorithm :
The accumulation of roundoff error in successive additions of the floating-point increment, however, can
cause the calculated pixel positions to drift away from the true line path for long line segments.
Furthermore, the rounding operations and floating-point arithmetic in procedure lineDDA are still time-
consuming.
We can improve the performance of the DDA algorithm by separating the increments m and l/m into
integer and fractional parts so that all calculation are reduced to integer operations.
…Line-Drawing Algorithms(Cont’d)
85
Bresenham's Line Algorithm:
An accurate and efficient raster line-generating algorithm, developed by Bresenham, scan converts lines
using only incrementa1 integer calculations that can be adapted to display circles and other curves.
Fig 2.5 a fig 2.5 b
[Section of a display screen where a straight line segment [Section of a display screen where a negative slope line
1s to be plotted, starting from the pixel at column 10 on scan segment 1s to be plotted starting from the pixel at
Line 11 ] column 50 on scan line 50]
…Line-Drawing Algorithms(Cont’d)
86
Bresenham's Line Algorithm:
…Figures 2.5(a) and 2.5(b) above illustrate sections of a display screen where straight line segments are
to be drawn.
The vertical axes show scan-line positions, and the horizontal axes identify pixel columns.
Sampling at unit x intervals in these examples, we need to decide which of two possible pixel positions is
closer to the line path at each sample step.
Starting from the left endpoint shown in Fig. 2.5(a), we need to determine at the next sample position
whether to plot the pixel at position (11, 11) or the one at (11, 12).
 Similarly, Fig. 2.5(b) shows-a negative slope-line path starting from the left endpoint at pixel position
(50, 50). In this one, do we select the next pixel position as (51,50) or as (51,49)?
These questions are answered with Bresenham's line algorithm 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.
…Line-Drawing Algorithms(Cont’d)
87
Bresenham's Line Algorithm:
…To illustrate Bresenham's approach, we first consider the scan-conversion process for lines with positive
slope less than 1.
Pixel positions along a line path are then determined by sampling at unit x intervals.
Starting from the left endpoint (𝑥0, 𝑦0) of a given line, we step to each successive column (x position) and plot
the pixel whose scan-line y value is closest to the line path.
[Fig 2.6Section of the screen grid showing a pixel in column 𝒙 𝒌on scan line 𝒙 𝒌 that is to be plotted along the path of a
line segment with slope O<m<l. ]
…Line-Drawing Algorithms(Cont’d)
88
Bresenham's Line Algorithm:
…Figure 2.6 above demonstrates the 𝒌𝐭𝐡 step in this process. Assuming we have determined that the
pixel at (𝒙 𝒌, 𝒚 𝒌) is to be displayed, we next need to decide which pixel to plot in column𝒙 𝒌+𝟏.
 Our choices are the pixels at positions (𝒙 𝒌+𝟏, 𝒚 𝒌) and ((𝒙 𝒌+𝟏, 𝒚 𝒌+𝟏).
At sampling position 𝒙 𝒌+𝟏, we label vertical pixel separations from the mathematical line path as 𝒅 𝟏and
𝒅 𝟐. See the following figure.
fig 2.7
[Distances between pixel positions and the line y
coordinate at sampling position xk+1]
…Line-Drawing Algorithms(Cont’d)
89
Bresenham's Line Algorithm:
…They coordinate on the mathematical line at pixel column position 𝒙 𝒌+𝟏 is calculated as:
𝒚 = 𝒎 𝒙 𝒌 + 𝟏 + 𝒃2.10
Then
𝑑1 = 𝑦 − 𝑦 𝑘
= 𝑚 𝑥 𝑘 + 1 + 𝑏 − 𝑦 𝑘
And
𝑑2 = 𝑦 𝑘 + 1 − 𝑦
= 𝑦 𝑘 + 1 − 𝑚 𝑥 𝑘 + 1 − 𝑏
The difference between these two separations is
𝑑1 − 𝑑2 = 2𝑚 𝑥 𝑘 + 1 − 2𝑦 𝑘 + 2𝑏 − 1 2.11
…Line-Drawing Algorithms(Cont’d)
90
Bresenham's Line Algorithm:
…A decision parameter 𝒑 𝒌 for the kth step in the line algorithm can be obtained by rearranging Eq. 2.11
so that it involves only integer calculations. We accomplish this by substituting m =
𝜟𝒚
𝜟𝒙
, where 𝜟𝒚 and
𝜟𝒙are the vertical and horizontal separations of the endpoint positions, and defining:
𝑝 𝑘 = Δ𝑥 𝑑1 − 𝑑2
= 2Δ𝑦. 𝑥 𝑘 − 2Δ𝑥. 𝑦 𝑘 +𝑐 2.12
The sign of 𝒑 𝒌 , is the same as the sign of 𝒅 𝟏 − 𝒅 𝟐since 𝚫𝒙> 0 for our example.
Parameter c is constant and has the value 2Δ𝑦 + 𝚫𝒙(2b - l), which is independent of pixel position and will be
eliminated in the recursive calculations for 𝒑 𝒌.
If the pixel at 𝒚 𝒌 is closer to the line path than the pixel at 𝑦 𝑘+ l (that is, 𝒅 𝟏<𝒅 𝟐), then decision parameter
𝒑 𝒌 is negative.
In that case, we plot the lower pixel; otherwise, we plot the upper pixel.
…Line-Drawing Algorithms(Cont’d)
91
Bresenham's Line Algorithm:
…Coordinate changes along the line occur in unit steps in either the x or y directions.
Therefore, we can obtain the values of successive decision parameters using incremental integer
calculations.
At step k + 1, the decision parameter is evaluated from Eq. 2.12 as
𝑝 𝑘+1 = 2Δ𝑦. 𝑥 𝑘+1 −2Δ𝑥. 𝑦 𝑘+1 +𝑐
Subtracting Eq. 2.12 from the preceding equation, we have
𝑝 𝑘+1− 𝑝 𝑘 = 2Δ𝑦(𝑥 𝑘+1 − 𝑥 𝑘) −2Δ𝑥(𝑦 𝑘+1 − 𝑦 𝑘) but 𝑥 𝑘+1 = 𝑥 𝑘 +1, therefore,
𝑝 𝑘+1 = 𝑝 𝑘 + 2Δ𝑦 − 2Δ𝑥 (𝑦 𝑘+1 − 𝑦 𝑘) 2.13
where the term 𝒚 𝒌+𝟏 − 𝒚 𝒌 is either 0 or 1, depending on the sign of parameter 𝑝 𝑘. This recursive
calculation of decision parameters is performed at each integer x position, starting at the left coordinate
endpoint of the line.
The first parameter, 𝑝0 is evaluated from Eq. 2.12 at the starting pixel position (𝒙 𝟎, 𝒚 𝟎) and with m
evaluated as Δ𝑦/Δ𝑥: 𝑝0 = 2Δ𝑦 − Δ𝑥 2.14
…Line-Drawing Algorithms(Cont’d)
92
Bresenham's Line Algorithm:
…We can summarize Bresenham line drawing for a line with a positive slope less than 1 in the following listed
steps. The constants 𝟐𝚫𝒚and 𝟐𝜟𝒚 - 𝟐𝜟𝒙 are calculated once for each line to be scan converted, so the arithmetic
involves only integer addition and subtraction of these two constants.
Algorithm: 1. Input the two line endpoints and store the left endpoint in (𝒙 𝟎, 𝒚 𝟎)
2. Load (𝒙 𝟎, 𝒚 𝟎) into the frame buffer; that is, plot the first point
3. Calculate constants 𝜟𝒙, 𝜟𝒚, 𝟐𝜟𝒚, and 𝟐𝜟𝒚 − 𝟐𝜟𝒙, and obtain the starting value for the decision
parameter as: 𝑝0 = 2Δ𝑦 − Δ𝑥
4. At each 𝒙 𝒌 along the line, starting at k = 0, perform the following test:
If 𝑝 𝑘< 0, the next point to plot is (𝒙 𝒌 +1, 𝒚 𝒌) and
𝑝 𝑘+1 = 𝑝 𝑘 + 2Δ𝑦
Otherwise, the next point to plot is (𝒙 𝒌 +1, 𝒚 𝒌+ 1) and
𝑝 𝑘+1 = 𝑝 𝑘 + 2Δ𝑦 − 𝟐𝜟𝒙
5. repeat step 4 𝜟𝒙 times
…Line-Drawing Algorithms(Cont’d)
93
Bresenham's Line Algorithm:
Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope
of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for
calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒.
We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the
decision parameter as
…Line-Drawing Algorithms(Cont’d)
94
k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1)
0 6 (21,11) 5 6 (26,15)
1 2 (22,12) 6 2 (27,16)
2 -2 (23,12) 7 -2 (28,16)
3 14 (24,13) 8 14 (29,17)
4 10 (25,14) 9 10 (30,18)
Since the circle is a frequently used component in pictures and graphs, a procedure for generating either
full circles or circular arcs is included in most graphics packages.
A circle is defined as the set of points that are all at a given distance r from a center position (𝒙 𝟎, 𝒚 𝟎). This distance
relationship is expressed by the Pythagorean theorem in Cartesian coordinates as:
𝑥 − 𝑥c
2 + 𝑦 − 𝑦c
2 = 𝑟2 2.24
Fig 3.8
[circle with center coordinate (𝑥c,𝑦c) and radius r.
…Circle-Generating Algorithms
95
We could use this equation to calculate the position of points on a circle circumference by stepping along the x
axis in unit steps from xc - r to xc+ r and calculating the corresponding y values at each position as
𝑦 = 𝑦𝑐 ± 𝑟2 − 𝑥 𝑐 − 𝑥 2 2.25
but this not the best method for generating a circle.
it involves considerable computation at each step.
spacing between plotted pixel positions is not uniform
Fig 3.9
[Positive half of a circle plotted with Eq. 2.25 and with (𝑥 𝑐, 𝑦𝑐 = (0.0)]
…Circle-Generating Algorithms (Cont’d)
96
To eliminate the unequal spacing shown in Fig. 3.9 above is to calculate points along the circular boundary using
polar coordinates r and 𝜃(Fig. 3.8). Expressing the circle equation in parametric polar form yields the pair of
equations.
𝑥 = 𝑥 𝑐 + 𝑟 cos 𝜃
𝑦 = 𝑦𝑐 + 𝑟 sin 𝜃 3.26
… Circle-Generating Algorithms (Cont’d)
97
Bresenham's Line Algorithm:
Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope
of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for
calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒.
We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the
decision parameter as
…Line-Drawing Algorithms(Cont’d)
98
k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1)
0 6 (21,11) 5 6 (26,15)
1 2 (22,12) 6 2 (27,16)
2 -2 (23,12) 7 -2 (28,16)
3 14 (24,13) 8 14 (29,17)
4 10 (25,14) 9 10 (30,18)
Bresenham's Line Algorithm:
Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope
of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for
calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒.
We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the
decision parameter as
…Line-Drawing Algorithms(Cont’d)
99
k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1)
0 6 (21,11) 5 6 (26,15)
1 2 (22,12) 6 2 (27,16)
2 -2 (23,12) 7 -2 (28,16)
3 14 (24,13) 8 14 (29,17)
4 10 (25,14) 9 10 (30,18)
Bresenham's Line Algorithm:
Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope
of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for
calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒.
We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the
decision parameter as
…Line-Drawing Algorithms(Cont’d)
100
k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1)
0 6 (21,11) 5 6 (26,15)
1 2 (22,12) 6 2 (27,16)
2 -2 (23,12) 7 -2 (28,16)
3 14 (24,13) 8 14 (29,17)
4 10 (25,14) 9 10 (30,18)
Bresenham's Line Algorithm:
Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope
of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for
calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒.
We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the
decision parameter as
…Line-Drawing Algorithms(Cont’d)
101
k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1)
0 6 (21,11) 5 6 (26,15)
1 2 (22,12) 6 2 (27,16)
2 -2 (23,12) 7 -2 (28,16)
3 14 (24,13) 8 14 (29,17)
4 10 (25,14) 9 10 (30,18)
Bresenham's Line Algorithm:
Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope
of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for
calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒.
We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the
decision parameter as
…Line-Drawing Algorithms(Cont’d)
102
k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1)
0 6 (21,11) 5 6 (26,15)
1 2 (22,12) 6 2 (27,16)
2 -2 (23,12) 7 -2 (28,16)
3 14 (24,13) 8 14 (29,17)
4 10 (25,14) 9 10 (30,18)

More Related Content

What's hot

Raster Scan And Random Scan
Raster Scan And Random ScanRaster Scan And Random Scan
Raster Scan And Random ScanDevika Rangnekar
 
Video display devices
Video display devicesVideo display devices
Video display devicesMohd Arif
 
Hardware concept for graphics
Hardware concept  for graphics Hardware concept  for graphics
Hardware concept for graphics Partnered Health
 
ITFT-Video display devices
ITFT-Video display devicesITFT-Video display devices
ITFT-Video display devicesShifali Sharma
 
COLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSCOLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSnehrurevathy
 
Overview of the graphics system
Overview of the graphics systemOverview of the graphics system
Overview of the graphics systemKamal Acharya
 
Display Devices - by Sumithra
Display Devices - by SumithraDisplay Devices - by Sumithra
Display Devices - by SumithraSanthosh Sundar
 
Raster scan displays ppt
Raster scan displays pptRaster scan displays ppt
Raster scan displays pptABHISHEK KUMAR
 
Overview of Graphics System
Overview of Graphics SystemOverview of Graphics System
Overview of Graphics SystemPrathimaBaliga
 
Lecture+ +raster+&+random+scan+systems
Lecture+ +raster+&+random+scan+systemsLecture+ +raster+&+random+scan+systems
Lecture+ +raster+&+random+scan+systemsavelraj
 
CG - Display Devices
CG - Display DevicesCG - Display Devices
CG - Display Devicesvinay arora
 
Display techniques
Display techniquesDisplay techniques
Display techniquesMohd Arif
 
Raster scan system
Raster scan systemRaster scan system
Raster scan systemMohd Arif
 
Memory display devices
Memory display devicesMemory display devices
Memory display devicesdgoradia
 
Graphics display-devicesmod-1
Graphics display-devicesmod-1Graphics display-devicesmod-1
Graphics display-devicesmod-1Praveen Kumar
 
Introduction to computer graphics part 1
Introduction to computer graphics part 1Introduction to computer graphics part 1
Introduction to computer graphics part 1Ankit Garg
 

What's hot (20)

Raster Scan And Random Scan
Raster Scan And Random ScanRaster Scan And Random Scan
Raster Scan And Random Scan
 
Video display devices
Video display devicesVideo display devices
Video display devices
 
Cg Chap 02
Cg Chap 02Cg Chap 02
Cg Chap 02
 
Hardware concept for graphics
Hardware concept  for graphics Hardware concept  for graphics
Hardware concept for graphics
 
ITFT-Video display devices
ITFT-Video display devicesITFT-Video display devices
ITFT-Video display devices
 
COLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICSCOLOR CRT MONITORS IN COMPUTER GRAPHICS
COLOR CRT MONITORS IN COMPUTER GRAPHICS
 
Computer Graphics - Introduction and CRT Devices
Computer Graphics - Introduction and CRT DevicesComputer Graphics - Introduction and CRT Devices
Computer Graphics - Introduction and CRT Devices
 
Overview of the graphics system
Overview of the graphics systemOverview of the graphics system
Overview of the graphics system
 
Display Devices - by Sumithra
Display Devices - by SumithraDisplay Devices - by Sumithra
Display Devices - by Sumithra
 
Raster scan displays ppt
Raster scan displays pptRaster scan displays ppt
Raster scan displays ppt
 
Overview of Graphics System
Overview of Graphics SystemOverview of Graphics System
Overview of Graphics System
 
Lecture+ +raster+&+random+scan+systems
Lecture+ +raster+&+random+scan+systemsLecture+ +raster+&+random+scan+systems
Lecture+ +raster+&+random+scan+systems
 
CG - Display Devices
CG - Display DevicesCG - Display Devices
CG - Display Devices
 
lecture2 computer graphics graphics hardware(Computer graphics tutorials)
 lecture2  computer graphics graphics hardware(Computer graphics tutorials) lecture2  computer graphics graphics hardware(Computer graphics tutorials)
lecture2 computer graphics graphics hardware(Computer graphics tutorials)
 
Display techniques
Display techniquesDisplay techniques
Display techniques
 
Raster scan system
Raster scan systemRaster scan system
Raster scan system
 
Memory display devices
Memory display devicesMemory display devices
Memory display devices
 
Graphics display-devicesmod-1
Graphics display-devicesmod-1Graphics display-devicesmod-1
Graphics display-devicesmod-1
 
Display devices
Display devices Display devices
Display devices
 
Introduction to computer graphics part 1
Introduction to computer graphics part 1Introduction to computer graphics part 1
Introduction to computer graphics part 1
 

Similar to Lecture 2&amp;3

Overview-of-GraphicsSystem@2334444_5.ppt
Overview-of-GraphicsSystem@2334444_5.pptOverview-of-GraphicsSystem@2334444_5.ppt
Overview-of-GraphicsSystem@2334444_5.pptvijaybhasker26
 
CG03 Random Raster Scan displays and Color CRTs.ppsx
CG03 Random Raster Scan displays and Color CRTs.ppsxCG03 Random Raster Scan displays and Color CRTs.ppsx
CG03 Random Raster Scan displays and Color CRTs.ppsxjyoti_lakhani
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer GraphicsSanthiNivas
 
Introduction to computer graphics part 2
Introduction to computer graphics part 2Introduction to computer graphics part 2
Introduction to computer graphics part 2Ankit Garg
 
CG MODULE 1 (S6 CSE).pptx
CG MODULE 1 (S6 CSE).pptxCG MODULE 1 (S6 CSE).pptx
CG MODULE 1 (S6 CSE).pptxFahadSalim15
 
CG MODULE 1 (S6 CSE)-1.pptx
CG MODULE 1 (S6 CSE)-1.pptxCG MODULE 1 (S6 CSE)-1.pptx
CG MODULE 1 (S6 CSE)-1.pptxSayoojSukumaran1
 
display devices.pptx
display devices.pptxdisplay devices.pptx
display devices.pptxAseebKhan33
 
Displaydevices graphics
Displaydevices graphicsDisplaydevices graphics
Displaydevices graphicssuhail ahmad
 
Randomscandisplaysandrasterscandisplays 130930115124-phpapp01
Randomscandisplaysandrasterscandisplays 130930115124-phpapp01Randomscandisplaysandrasterscandisplays 130930115124-phpapp01
Randomscandisplaysandrasterscandisplays 130930115124-phpapp01mahammed rashid
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displaysSomya Bagai
 
Cgmm introduction
Cgmm introductionCgmm introduction
Cgmm introductionSIRT BHOPAL
 
Raster Scan Display
Raster Scan DisplayRaster Scan Display
Raster Scan DisplayAnkur Soni
 

Similar to Lecture 2&amp;3 (20)

Overview-of-GraphicsSystem@2334444_5.ppt
Overview-of-GraphicsSystem@2334444_5.pptOverview-of-GraphicsSystem@2334444_5.ppt
Overview-of-GraphicsSystem@2334444_5.ppt
 
CG03 Random Raster Scan displays and Color CRTs.ppsx
CG03 Random Raster Scan displays and Color CRTs.ppsxCG03 Random Raster Scan displays and Color CRTs.ppsx
CG03 Random Raster Scan displays and Color CRTs.ppsx
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
lect-2.ppt
lect-2.pptlect-2.ppt
lect-2.ppt
 
Unit 1
Unit 1Unit 1
Unit 1
 
5_6066813714177198739.pdf
5_6066813714177198739.pdf5_6066813714177198739.pdf
5_6066813714177198739.pdf
 
Introduction to computer graphics part 2
Introduction to computer graphics part 2Introduction to computer graphics part 2
Introduction to computer graphics part 2
 
New_title.pptx
New_title.pptxNew_title.pptx
New_title.pptx
 
Display device
Display deviceDisplay device
Display device
 
CG MODULE 1 (S6 CSE).pptx
CG MODULE 1 (S6 CSE).pptxCG MODULE 1 (S6 CSE).pptx
CG MODULE 1 (S6 CSE).pptx
 
CG MODULE 1 (S6 CSE)-1.pptx
CG MODULE 1 (S6 CSE)-1.pptxCG MODULE 1 (S6 CSE)-1.pptx
CG MODULE 1 (S6 CSE)-1.pptx
 
display devices.pptx
display devices.pptxdisplay devices.pptx
display devices.pptx
 
Displaydevices graphics
Displaydevices graphicsDisplaydevices graphics
Displaydevices graphics
 
8259731.ppt
8259731.ppt8259731.ppt
8259731.ppt
 
Randomscandisplaysandrasterscandisplays 130930115124-phpapp01
Randomscandisplaysandrasterscandisplays 130930115124-phpapp01Randomscandisplaysandrasterscandisplays 130930115124-phpapp01
Randomscandisplaysandrasterscandisplays 130930115124-phpapp01
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
 
Crt notes
Crt notesCrt notes
Crt notes
 
Crt notes
Crt notesCrt notes
Crt notes
 
Cgmm introduction
Cgmm introductionCgmm introduction
Cgmm introduction
 
Raster Scan Display
Raster Scan DisplayRaster Scan Display
Raster Scan Display
 

Recently uploaded

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 

Lecture 2&amp;3

  • 1. CG Chapter Two Video Display Devices Tips: Install MinGw on you Computer Integrate freeglut with CodeBlocks(Optional) Class on Tuesday 16, April @10:30AM-Venue VIII-1
  • 2. Note How computers store Image in memory? Look at the following figures: 2
  • 4. CHAPTER OUTLINE Raster Scan Displays Random Scan Displays Color CRT Monitors Direct View Storage Tube Flat panel Displays Three Dimensional Viewing Devices Stereoscopic and Virtual Reality System 4
  • 5. OVERVIEW The display systems are often referred to as Video Monitor or Video display Unit(VDU). The primary output device in a graphics system is a monitor. 5
  • 6. CRT (CATHODE RAY TUBES) 1. Electron Guns 2. Electron Beams 3. Focusing Coils 4. Deflection Coils 5. Anode Connection 6. Shadow Mask 7. Phosphor layer 8. Close-up of the phosphor coated inner side of the screen 6
  • 9. …REFRESH CRT Light emitted by the Phosphor fades very rapidly. Refresh CRT: One way to keep the phosphor glowing is to redraw the picture repeatedly by quickly directing the electron beam back over the same points. Electron Gun: Heat is supplied to the cathode by the filament. 9
  • 10. …ELECTRON GUN The free electrons are then accelerated toward the phosphor coating by a high positive voltage. High Positive Voltage: a positively charged metal coating on the inside of the CRT envelope near the phosphor screen. 1 0
  • 11. … HIGH POSITIVE VOLTAGE accelerating anode. Intensity of the electron beam is controlled by setting voltage level on the control grid. smaller negative voltage on the control grid simply decrease the number of electrons passing through. 1 1
  • 12. …FOCUSING SYSTEM The focusing system is needed to force the electron beam to converge into a small spot as it strikes the phosphor. Electrostatic focusing is commonly used in computer graphics monitor With electrostatic focusing, the electron beam passes through a positively charged metal cylinder that forms an electrostatic lens. 1 2
  • 13. …FOCUSING SYSTEM The distance that the electron beam must travel to different points on the screen varies because the radius of curvature for most CRTs is greater than the distance from the focusing system to the screen center. The electron beam will be focused properly only at the center of the screen. As the beam moves to the outer edges of the screen, displayed images become blurred. Dynamically focusing lens work based on beam position. 1 3
  • 14. …DEFLECTION SYSTEMS Deflection of the electron beam can be controlled either with electric fields or with magnetic fields. The magnetic deflection coils mounted on the outside of the CRT envelope. 1 4
  • 15. …DEFLECTION SYSTEMS Two pairs of coils are used, with the coils in each pair mounted on opposite sides of the neck 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. 1 5
  • 16. …DEFLECTION SYSTEMS Horizontal deflection is accomplished with one pair of coils, and vertical deflection by the other pairs. The proper deflection amounts are attained by adjusting the current through the coil. Electrostatic deflection: Two pairs of parallel plates are mounted inside the CRT envelope. One pair of plates is mounted horizontally to control the vertical deflection, and the other pair is mounted vertically to control horizontal deflection. 1 6
  • 17. …DEFLECTION SYSTEMS . Persistence: The time it takes the emitted light from the screen to decay to one tenth of its original intensity 1 7
  • 18. …RASTER SCAN DISPLAYS Raster: A rectangular array of points or dots Pixel: One dot or picture element of the raster Scan Line: A row of pixels In a raster scan system, the electron beam is swept across the screen, one row at a time from top to bottom 1 8
  • 20. …RASTER SCAN DISPLAYS As the electron 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. 2 0
  • 21. …RASTER SCAN DISPLAYS Refresh buffer or frame buffer: This memory area holds the set of intensity values for all the screen points. Stored intensity values then retrieved from refresh buffer and “painted” on the screen one row (scan line) at a time. 2 1
  • 22. …RASTER SCAN DISPLAYS Intensity range for pixel positions depends on the capability of the raster system. A black-and-white system: each screen point is either on or off, so only one bit per pixel is needed to control the intensity of screen positions. On a black-and-white system with one bit per pixel, the frame buffer is called bitmap For system with multiple bits per pixel, the frame buffer is called pixmap Sometimes, refresh rates are described in unit of cycles per second, or Hertz (HZ) Refreshing on raster scan displays is carried out at the rate 60 to 80 frame per second 2 2
  • 23. …RASTER SCAN DISPLAYS Horizontal retrace: The return to the left of the screen, after refreshing each scan line Vertical retrace: At the end of each frame (displayed in 1/80th to 1/60th of a second) the electron beam returns to the top left corner of the screen to begin the next frame 23
  • 24. …RASTER IMAGE The quality of a raster image is determined by the total number pixels (resolution), and the amount of information in each pixel (color depth). Raster graphics cannot be scaled to a higher resolution without loss of apparent quality. 24
  • 25. Random scan Display CRT has the electron beam directed only to the parts of the screen where a picture is to be drawn. are also referred to as vector displays (or stroke-writing or calligraphic displays) because Random scan monitors draw a picture one line at a time A pen plotter operates in a similar way and is an example of a random-scan, hard-copy device. Refresh rate depends on the number of lines to be displayed.  Picture definition is stored as a set of line drawing commands in an area of memory referred to as the refresh display file/display list. 25
  • 26. Random scan Display The refresh display file is called the display list, display program, or simply the refresh buffer. To display a specified picture, the system cycles through the set of commands in the display file, drawing each component line in turn. Random-scan systems are designed for line drawing applications and cannot display realistic shaded scenes. vector displays generally have higher resolution than raster systems. 26
  • 27. Random scan Display (Cont’d) A random-scan system draws the component lines of an object in any order specified 27
  • 28. Exercise(get a Reward) 1. Discuss the difference between Raster scan Random Scan? 2. What is the difference between Vertical and Horizontal retrace? 28
  • 29. Raster Scan Vs Random scan Display . 29 Base of Difference Raster Scan System Random Scan System Electron Beam The electron beam is swept across the screen, one row at a time, from top to bottom. The electron beam is directed only to the parts of screen where a picture is to be drawn. Resolution Its resolution is poor because raster system in contrast produces zigzag lines that are plotted as discrete point sets. Its resolution is good because this system produces smooth lines drawings because CRT beam directly follows the line path. Picture Definition Picture definition is stored as a set of intensity values for all screen points, called pixels in a refresh buffer area. Picture definition is stored as a set of line drawing instructions in a display file. Realistic Display The capability of this system to store intensity values for pixel makes it well suited for the realistic display of scenes contain shadow and color pattern. These systems are designed for line drawing and can’t display realistic shaded scenes. Draw an Image Screen points/pixels are used to draw an image Mathematical functions are used to draw an image
  • 30. Color CRT Monitors A CRT monitor displays color pictures by using a combination of phosphors that emit different-colored light. Two basic technique is applied to produce color display: Beam-penetration method: •used with random-scan monitors •usually red and green, are coated onto the inside of the CRT screen, and the displayed color depends on how far the electron beam penetrates into the phosphor layers. • A beam of slow electrons excites only the outer red layer. 30
  • 31. Color CRT Monitors Beam-penetration method: •A beam of very fast electrons penetrates through the red layer and excites the inner green layer. •At intermediate beam speeds, combinations of red and green light are emitted to show two additional colors, orange and yellow. •The speed of the electrons, and hence the screen color at any point, is controlled by the beam-acceleration voltage. •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. 31
  • 33. Color CRT Monitors(Cont’d) Shadow-Mask Method: Commonly used in raster-scan systems (including color TV) because they produce a much wider range of colors than the beam-penetration method. has three phosphor color dots at each pixel position. One phosphor dot emits a red light, another emits a green light, and the third emits a blue light. This type of CRT has three electron guns, one for each color dot, and a shadow- mask grid just behind the phosphor-coated screen. The three electron beams are deflected and focused as a group onto the shadow mask, which contains a series of holes aligned with the phosphor-dot patterns. 33
  • 34. Color CRT Monitors(Cont’d) …Shadow-Mask Method: When the three beams pass through a hole in the shadow mask, they activate a dot triangle, which appears as a small color spot on the screen. The phosphor dots in the triangles are arranged so that each electron beam can activate only its corresponding color dot when it passes through the shadow mask. Another configuration for the three electron guns is an in-line arrangement in which the three electron guns, and the corresponding red-green-blue color dots on the screen, are aligned along one scan line instead of in a triangular pattern. This in-line arrangement of electron guns is easier to keep in alignment and is commonly used in high-resolution color CRTs. 34
  • 36. Color CRT Monitors(Cont’d) . Three electron guns, aligned with the triangular color-dot patterns on the screen, are directed to each dot triangle by a shadow mask. 36
  • 38. Color CRT Monitors(Cont’d) Shadow-Mask Method: We obtain color variations in a shadow-mask CRT by varying the intensity levels of the three electron beams. By turning off the red and green guns, we get only the color coming from the blue phosphor. Other combinations of beam intensities produce a small light spot for each pixel position, since our eyes tend to merge the three colors into one composite. The color we see depends on the amount of excitation of the red, green, and blue phosphors. A white (or gray) area is the result of activating all three dots with equal intensity. 38
  • 39. Color CRT Monitors(Cont’d) Shadow-Mask Method: Yellow is produced with the green and red dots only, magenta is produced with the blue and red dots, and cyan shows up when blue and green are activated equally Color CRTs in graphics systems are designed as RGB monitors.  These monitors use shadow-mask methods and take the intensity level for each electron gun (red, green, and blue) directly from the computer system without any intermediate processing. High-quality raster-graphics systems have 24 bits per pixel in the frame buffer, allowing 256 voltage settings for each electron gun and nearly 17 million color choices for each pixel. 39
  • 40. Color CRT Monitors(Cont’d) An RGB color system with 24 bits of storage per pixel is generally referred to as a full-color system or a true-color system. Direct-View Storage Tubes : An alternative method for maintaining a screen image is to store the picture information inside the CRT instead of refreshing the screen. A direct-view storage tube (DVST) stores the picture information as a charge distribution just behind the phosphor-coated screen. Two electron guns are used in a DVST.  the primary gun, is used to store the picture pattern;  the flood gun, maintains the picture display. 40
  • 41. Color CRT Monitors(Cont’d) advantages compared to the refresh CRT: Because no refreshing is needed, very complex pictures can be displayed at very high resolutions without flicker. Disadvantages: they ordinarily do not display color and that selected parts of a picture cannot he erased. To eliminate a picture section, the entire screen must be erased and the modified picture is redrawn. The erasing and redrawing process can take several seconds for a complex picture.  For these reasons, storage displays have been largely replaced by raster systems 41
  • 42. Color Models R, G, and B represent the colors produced by red, green and blue phosphors, respectively. 42
  • 43. CMY Color Model CMY(short for Cyan, Magenta, Yellow, and key) is a subtractive color model. 43
  • 45. Color Depth, Bit Depth The number of discrete intensities that the video card is capable of generating for each color determines the maximum number of colors that can be displayed. The number of memory bits required to store color information (intensity values for all three primary color components) about a pixel is called color depth or bit depth. A minimum of one memory bit (color depth=1) is required to store intensity value either 0 or1 for every screen pixel. If there are n pixels in an image a total of n bits memory is used for storing intensity values (in a pure black & white image) 45
  • 46. Bit Plane The block of memory which stores (or is mapped with) intensity values for each pixel (B& W image) is called a bit plane or bitmap. 46
  • 47. 3Bit color display Color or gray levels can be achieved in the display using additional bit planes. 47
  • 48. True Color For true Color three bytes of information are used, one for each of the red, blue and green signals that make a pixel.  A byte can hold 256 different values and so 256 intensities setting are possible for each electron gun which mean each primary color can have 256 intensities (256*256* 256 color possible) . 48
  • 49. Flat-Panel Displays The term flat-panel display refers to a class of video devices that have reduced volume, weight, and power requirements compared to a CRT. A significant feature of flat-panel displays is that they are thinner than CRTs, and we can hang them on walls or wear them on our wrists. Since we can even write on some flat-panel displays, they will soon be available as pocket notepads.  Current uses for flat-panel displays include small TV monitors, calculators, pocket video games, laptop computers, armrest viewing of movies on airlines, as advertisement boards in elevators, and as graphics displays in applications requiring rugged, portable monitors. 49
  • 50. Flat-Panel Displays Two categories of flat-panel:  emissive displays : displays (or emitters) are devices that convert electrical energy into light. Plasma panels, thin-film electroluminescent displays, and Light- emitting diodes are examples of emissive displays. Non-emissive displays: use optical effects to convert sunlight or light from some other source into graphics patterns. The most important example of a non-emissive flat-panel display is a liquid- crystal device. 50
  • 51. Three-Dimensional Viewing Devices Graphics monitors for the display of three-dimensional scenes have been devised using a technique that reflects a CRT image from a vibrating, flexible mirror. 51
  • 52. Three-Dimensional Viewing Devices From figure above, as the varifocal mirror vibrates, it changes focal length. These vibrations are synchronized with the display of an object on a CRT so that each point on the object is reflected from the mirror into a spatial position corresponding to the distance of that point from a specified viewing position. This allows us to walk around an object or scene and view it from different sides.. 52
  • 53. Pixel Resolution and Aspect Ratio Resolution is technically the number of pixels per unit of area, rather than the total number of pixels. Pixel resolution refers to the total number of count of pixels in an digital image. For example, if an image has M rows and N columns, then its resolution can be defined as M X N. Pixel resolution can be defined with set of two numbers:- the first number the width of the picture, or the pixels across columns, and the second number is height of the picture, or the pixels across its width. We can say that the higher is the pixel resolution, the higher is the quality of the image Resolution can affected by: the type of phosphor, the intensity to be displayed, the focusing and deflection systems. 53
  • 54. Pixel Resolution and Aspect Ratio(Cont’d) Aspect ratio is the ratio between width of an image and the height of an image.  It is commonly explained as two numbers separated by a colon (8:9). This ratio differs in different images, and in different screens. Example: If you are given an image with aspect ratio of 6:2 of an image of pixel resolution of 480000 pixels given the image is a gray scale image. Then calculate two things. Resolve pixel resolution to calculate the dimensions of image Calculate the size of the image Aspect ratio: c:r = 6:2 Pixel resolution: c * r = 480000 Bits per pixel: grayscale image = 8 54
  • 55. Pixel Resolution and Aspect Ratio(Cont’d) Number of columns = ? 𝑐 𝑥 𝑟 = 480000 𝑐 𝑟 = 6 2 ⇒ 𝑐2 = 480,000𝑥 3 ⇒ 𝑐 = 1200 Number of cols = ? 1200 * 𝑟 = 480,000 ⇒ 𝑟 = 400 Size = rows * cols * bpp Size of image in bits = 400 * 1200 * 8 = 3840000 bits Size of image in bytes = 480000 bytes Size of image in kilo bytes = 48 kb (approximate). What if the image is colored image? 55
  • 56. Pixel Resolution and Aspect Ratio(Cont’d) Consider two raster systems with the resolutions of 640x480, 1280x1024, and 2560x2048. a) What size frame buffer (in bytes) is needed for each of these systems to store 12 bits/pixel? How much storage is required for each system if true color image is to be stored? 56
  • 57. Pixel Resolution and Aspect Ratio(Cont’d) P's, and I's about screen resolutions You may have seen the screen resolution described as something like 720p or 1080i. What does that mean? The letters tell you how the picture is "painted" on the monitor A "p" stands for progressive, and an "i" stands for interlaced. The interlaced scan is a holdover from television and early CRT monitors. The monitor or TV screen has lines of pixels arranged horizontally across it. The lines were relatively easy to see if you got up close to an older monitor or TV. 57
  • 58. Pixel Resolution and Aspect Ratio(Cont’d) P's, and I's about screen resolutions(Cont’d) but nowadays the pixels on the screen are so small that they are hard to see even with magnification.  The monitor's electronics "paint" each screen line by line, too quickly for the eye to see. An interlaced display paints all the odd lines first, then all the even lines. 58
  • 59. RASTER-SCAN SYSTEMS Interactive raster graphics systems typically employ several processing units. In addition to the central processing unit, or CPU, a special-purpose processor, called the video controller or display controller, is used to control the operation of the display device.  The frame buffer can be anywhere in the system memory, and the video controller accesses the frame buffer to refresh the screen. In addition to the video controller, more sophisticated raster systems employ other processors as co-processors and accelerators to implement various graphics operations. 59
  • 60. …RASTER-SCAN SYSTEMS Architecture of Raster system with a fixed portion of the system memory reserved for the frame buffer. 60
  • 61. …RASTER-SCAN SYSTEMS Video Controller: A fixed area of the system memory is reserved for the frame buffer, and the video controller is given direct access to the frame-buffer memory. Frame-buffer locations, and the corresponding screen positions, are referenced in Cartesian coordinates. For many graphics monitors, the coordinate origin is defined at the lower left screen comer (see fig on next page). The screen surface is then 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. 61
  • 62. On some personal computers, the coordinate origin is referenced at the upper left comer of the screen, so the y values are inverted.) Scan lines are then labeled from 𝒚 𝒎𝒂𝒙 , at the top of the screen to 0 at the bottom. Along each scan line, screen pixel positions are labeled from 0 to 𝑿 𝒎𝒂𝒙 . [The origin of the coordinate system for identifying screen positions is usually specified in the lower-left corner] …RASTER-SCAN SYSTEMS 62
  • 63. The basic refresh operations of the video controller are diagrammed on the next slide. Two registers are used to store the coordinates of the screen pixels. Initially, the x register is set to 0 and the y register is set to 𝒚 𝒎𝒂𝒙 . The value stored in the frame buffer for this pixel position is then retrieved and used to set the intensity of the CRT beam. Then the x register is incremented by 1, and the process repeated for the next pixel on the top scan line. This procedure is repeated for each pixel along the scan line. After the last pixel on the top scan line has been processed, the x register is reset to 0 and the y register is decremented by 1. Pixels along this scan line are then processed in turn, and the procedure is repeated for each successive scan line. After cycling through all pixels along the bottom scan line (y = 0), the video controller resets the registers to the first pixel position on the top scan line and the refresh process starts over. …RASTER-SCAN SYSTEMS 63
  • 64. Since the screen must be refreshed at the rate of 60 frames per second, the simple procedure depicted in the figure on the next page cannot be accommodated by typical RAM chips. The cycle time is too slow. To speed up pixel processing, video controllers can retrieve multiple pixel values from the refresh buffer on each pass. The multiple pixel intensities are then stored in a separate register and used to control the CRT beam intensity for a group of adjacent pixels. When that group of pixels has been processed, the next block of pixel values is retrieved from the frame buffer. …RASTER-SCAN SYSTEMS 64
  • 67. Raster-Scan Display Processor(Cont’d): The purpose of the display processor is to free the CPU from the graphics chores. In addition to the system memory, a separate display processor memory area can also be provided. A major task of the display processor is digitizing a picture definition given in an application program into a set of pixel-intensity values for storage in the frame buffer. This digitization process is called scan conversion. Graphics commands specifying straight lines and other geometric objects are scan converted into a set of discrete intensity points. Scan converting a straight-line segment, for example, 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.  Similar methods are used for scan converting curved lines and polygon outline. …RASTER-SCAN SYSTEMS 67
  • 68. Raster-Scan Display Processor(Cont’d): [A character defined as a [A character defined as a curve outline] rectangular grid of pixel positions] Additional functions of Display processor include generating various line styles (dashed, dotted, or solid), displaying color areas, and performing certain transformations and manipulations on displayed objects. Also, display processors are typically designed to interface with interactive input devices, such as a mouse. …RASTER-SCAN SYSTEMS 68
  • 69. An application program is input and stored in the system memory along with a graphics package Graphics commands in the application program are translated by the graphics package into a display file stored in the system memory. RANDOM-SCAN SYSTEMS 69
  • 70. A graphics package is an application that can be used to create and manipulate images on a computer. There are two main types of graphics package: painting packages A painting package produces images by changing the color of pixels on the screen. These are coded as a pattern of bits to create a bitmapped graphics file. Bitmapped graphics are used for images such as scanned photographs or pictures taken with a digital camera. drawing packages Graphics Packages 70
  • 71. This display file is then accessed by the display processor to refresh the screen. The display processor cycles through each command in the display file program once during every refresh cycle. Sometimes the display processor in a random-scan system is referred to as a display processing unit or a graphics controller. Graphics patterns are drawn on a random-scan system by directing the electron beam along the component lines of the picture. Lines are defined by the values for their coordinate endpoints, and these input coordinate values are converted to x and y deflection voltages. A scene is then drawn one line at a time by positioning the beam to fill in the line between specified endpoints. …Random-scan Systems 71
  • 73. Introduction Points and Lines Line Drawing Algorithms DDA algorithm Bresenham Line Drawing Algorithm Parallel Line Algorithms Loading The Frame Buffer Circle Generating Algorithms Ellipse Generating Algorithms Chapter Outlines 73
  • 74. In a raster display, a picture is completely specified by the set of intensities for the pixel positions in the display. Graphics programming packages provide functions to describe a scene in terms of these basic geometric structures, referred to as output primitives, and to group sets of output primitives into more complex structures. Each output primitive is specified with input coordinate data and other information about the way that object is to be displayed.  Points and straight line segments are the simplest geometric components of pictures. Additional output primitives that can be used to construct a picture include circles and other conic sections, quadric surfaces, spline curves and surfaces, polygon color areas, and character strings. Introduction 74
  • 75. Point plotting is accomplished by converting a single coordinate position furnished by an application program into appropriate operations for the output de-vice in use. With a CRT monitor, for example, the electron beam is turned on to illuminate the screen phosphor at the selected location.  How the electron beam is positioned depends on the display technology. A random-scan (vector) system stores point-plotting instructions in the display list, and coordinate values in these instructions are converted to deflection voltages that position the electron beam at the screen locations to be plotted during each refresh cycle.  For a black and white raster system, on the other hand, a point is plotted by setting the bit value corresponding to a specified screen position within the frame buffer to 1. Then, as the electron beam sweeps across each horizontal scan line, it emits a burst of electrons (plots a point) whenever a value of 1(one) is encountered in the frame buffer. With an RGB system, the frame buffer is loaded with the color codes for the intensities that are to be displayed at the screen pixel positions. Points and Lines 75
  • 76. Line drawing is accomplished by calculating intermediate positions along the line path between two specified endpoint positions. An output device is then directed to fill in these positions between the endpoints. For analog devices, such as a vector pen plotter or a random-scan display, a straight line can be drawn smoothly from one endpoint to the other.  Linearly varying horizontal and vertical deflection voltages are generated that are proportional to the required changes in the x and y directions to produce the smooth line. Digital devices display a straight line segment by plotting discrete points between the two endpoints. Discrete coordinate positions along the line path are calculated from the equation of the line. For a raster video display, the line color (intensity) is then loaded into the frame buffer at the corresponding pixel coordinates. Reading from the frame buffer, the video controller then "plots" the screen pixels. …Points and Lines(Cont’d) 76
  • 77. Screen locations are referenced with integer values, so plotted positions may only approximate actual Line positions between two specified endpoints. A computed line position of (10.48,20.51), for example, would be converted to pixel position (10,21). Thus rounding of coordinate values to integers causes lines to be displayed with a stair step appearance ("the jaggies"), as represented in the figure on the next page. The characteristic stair step shape of raster lines is particularly noticeable on systems with low resolution, and we can improve their appearance somewhat by displaying them on high-resolution systems. More effective techniques for smoothing raster lines are based on adjusting pixel intensities along the line paths. For the raster-graphics device-level algorithm, object positions are specified directly in integer device coordinates. Pixel positions are referenced according to scan-line number and column number (pixel position across a scan line). …Points and Lines(Cont’d) 77
  • 78. Scan lines are numbered consecutively from 0, starting at the bottom of the screen; and pixel columns are numbered from 0, left to right across each scan line.  fig 2.1 a fig 2.1 b [Pie1 positions referenced by scan- line number and column number.] …Points and Lines(Cont’d) 78
  • 79. The Cartesian slope-intercept equation for a straight line is: 𝑦 = 𝑚𝑥 + 𝑏 (2.1) with mrepresenting the slope of the line and b as they intercept. Given that the two endpoints of a he segment are specified at positions (x,, y,) and (x, y), as shown the following figure, we can determine values for the slope mand y intercept b with the following calculations. 𝑚 = 𝑦2 − 𝑦1 𝑥2 − 𝑥1 (2.2) 𝑏 = 𝑦1 − 𝑚𝑥 (2.3) [fig 2.2 Line path between endpoint positions (𝑥1, 𝑦1) and (𝑥2,𝑦2] Line-Drawing Algorithms 79
  • 80. For any given x interval 𝜟𝒙along a line, we can compute the corresponding y interval 𝜟𝒚from equation 2.2 and 2.3 above. Δ𝑦 = 𝑚Δ𝑥 (2.4) Δ𝑥 = Δ𝑦 𝑚 (2.5) These equations form the basis for determining deflection voltages in analog devices. For lines with slope magnitudes |m|< 1, Δ𝑥can be set proportional to a small horizontal deflection voltage and the corresponding vertical deflection is then set proportional to Δ𝑦 as calculated from Eq. 2-4. For lines whose slopes have magnitudes |m|< 1, 𝛥𝑦can be set proportional to a small vertical deflection voltage with the corresponding horizontal deflection voltage set proportional to Δ𝑥, calculated from Eq. 2-5. For lines with m = 1, 𝜟𝒙= 𝜟𝒚and the horizontal and vertical deflections voltages are equal. In each case, a smooth line with slope m is generated between the specified endpoints. …Line-Drawing Algorithms(Cont’d) 80
  • 81. On raster systems, lines are plotted with pixels, and step sizes in the horizontal and vertical directions are constrained by pixel separations. That is, we must "sample" a line at discrete positions and determine the nearest pixel to the line at each sampled position. This scan conversion process for straight lines is illustrated below. [Straight line segment with five sampling positions along the x axis between 𝑥1 and 𝑥2] Fig 2.3 …Line-Drawing Algorithms(Cont’d) 81
  • 82. DDA Algorithm: The digital differential analyzer (DDA) is a scan-conversion line algorithm based on calculating either 𝜟y or 𝜟𝒙, using Eq. 2-4 or Eq. 2-5. We sample the line at unit intervals in one coordinate and determine corresponding integer values nearest to the line path for the other coordinate. Consider first a line with positive slope, as shown below. If the slope is less than or equal to 1, we sample at unit x intervals (𝜟𝒙 = 1) and compute each successive y value as: 𝑦 𝑘+1 = 𝑦 𝑘 + 𝑚 2.6 fig 2.4 Subscript k takes integer values starting from 1, for the first point, and increases by 1 until the final endpoint is reached. Since mcan be any real number between 0 and 1, the calculated y values must be rounded to the nearest integer. …Line-Drawing Algorithms(Cont’d) 82
  • 83. …DDA Algorithm: For lines with a positive slope greater than 1, we reverse the roles of x and y. That is, we sample at unit y intervals (𝜟y = 1) and calculate each succeeding x value as: 𝑥 𝑘+1 = 𝑥 𝑘 + 1 𝑚 2.7 Equations 2.6 and 2.7 are based on the assumption that lines are to be processed from the left endpoint to the right endpoint. If this processing is reversed, so that the starting endpoint is at the right, then either we have 𝜟𝒙= -1 and 𝑦 𝑘+1 = 𝑦 𝑘 − 𝑚 2.8 or (when the slope is greater than I) we have 𝜟y = -1 with 𝑋 𝑘+1 = 𝑥 𝑘 − 1 𝑚 2.9 …Line-Drawing Algorithms(Cont’d) 83
  • 84. …DDA Algorithm: Equations 2.6 through 2.9 can also be used to calculate pixel positions along a line with negative slope. If the absolute value of the slope is less than 1 and the start endpoint is at the left, we set 𝜟𝒙 = 1 and calculate y values with Eq. 2.6. When the start endpoint is at the right (for the same slope), we set 𝜟𝒙= -1 and obtain y positions from Eq. 2.8. Similarly, when the absolute value of a negative slope is greater than 1, we use 𝜟y = -1and Eq. 2.9 or we use 𝜟𝒚 = 1 and Eq. 2.7. Advantages of DDA Algorithm over the equation: 𝑦 = 𝑚𝑥 + 𝑏 : faster method for calculating pixel positions than the direct use of 𝑦 = 𝑚𝑥 + 𝑏. Eliminates the multiplicationby making use of raster characteristics, so that appropriate increments are applied in the x or y direction to step to pixel positions along the line path. …Line-Drawing Algorithms(Cont’d) 84
  • 85. …Disadvantages of DDA Algorithm : The accumulation of roundoff error in successive additions of the floating-point increment, however, can cause the calculated pixel positions to drift away from the true line path for long line segments. Furthermore, the rounding operations and floating-point arithmetic in procedure lineDDA are still time- consuming. We can improve the performance of the DDA algorithm by separating the increments m and l/m into integer and fractional parts so that all calculation are reduced to integer operations. …Line-Drawing Algorithms(Cont’d) 85
  • 86. Bresenham's Line Algorithm: An accurate and efficient raster line-generating algorithm, developed by Bresenham, scan converts lines using only incrementa1 integer calculations that can be adapted to display circles and other curves. Fig 2.5 a fig 2.5 b [Section of a display screen where a straight line segment [Section of a display screen where a negative slope line 1s to be plotted, starting from the pixel at column 10 on scan segment 1s to be plotted starting from the pixel at Line 11 ] column 50 on scan line 50] …Line-Drawing Algorithms(Cont’d) 86
  • 87. Bresenham's Line Algorithm: …Figures 2.5(a) and 2.5(b) above illustrate sections of a display screen where straight line segments are to be drawn. The vertical axes show scan-line positions, and the horizontal axes identify pixel columns. Sampling at unit x intervals in these examples, we need to decide which of two possible pixel positions is closer to the line path at each sample step. Starting from the left endpoint shown in Fig. 2.5(a), we need to determine at the next sample position whether to plot the pixel at position (11, 11) or the one at (11, 12).  Similarly, Fig. 2.5(b) shows-a negative slope-line path starting from the left endpoint at pixel position (50, 50). In this one, do we select the next pixel position as (51,50) or as (51,49)? These questions are answered with Bresenham's line algorithm 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. …Line-Drawing Algorithms(Cont’d) 87
  • 88. Bresenham's Line Algorithm: …To illustrate Bresenham's approach, we first consider the scan-conversion process for lines with positive slope less than 1. Pixel positions along a line path are then determined by sampling at unit x intervals. Starting from the left endpoint (𝑥0, 𝑦0) of a given line, we step to each successive column (x position) and plot the pixel whose scan-line y value is closest to the line path. [Fig 2.6Section of the screen grid showing a pixel in column 𝒙 𝒌on scan line 𝒙 𝒌 that is to be plotted along the path of a line segment with slope O<m<l. ] …Line-Drawing Algorithms(Cont’d) 88
  • 89. Bresenham's Line Algorithm: …Figure 2.6 above demonstrates the 𝒌𝐭𝐡 step in this process. Assuming we have determined that the pixel at (𝒙 𝒌, 𝒚 𝒌) is to be displayed, we next need to decide which pixel to plot in column𝒙 𝒌+𝟏.  Our choices are the pixels at positions (𝒙 𝒌+𝟏, 𝒚 𝒌) and ((𝒙 𝒌+𝟏, 𝒚 𝒌+𝟏). At sampling position 𝒙 𝒌+𝟏, we label vertical pixel separations from the mathematical line path as 𝒅 𝟏and 𝒅 𝟐. See the following figure. fig 2.7 [Distances between pixel positions and the line y coordinate at sampling position xk+1] …Line-Drawing Algorithms(Cont’d) 89
  • 90. Bresenham's Line Algorithm: …They coordinate on the mathematical line at pixel column position 𝒙 𝒌+𝟏 is calculated as: 𝒚 = 𝒎 𝒙 𝒌 + 𝟏 + 𝒃2.10 Then 𝑑1 = 𝑦 − 𝑦 𝑘 = 𝑚 𝑥 𝑘 + 1 + 𝑏 − 𝑦 𝑘 And 𝑑2 = 𝑦 𝑘 + 1 − 𝑦 = 𝑦 𝑘 + 1 − 𝑚 𝑥 𝑘 + 1 − 𝑏 The difference between these two separations is 𝑑1 − 𝑑2 = 2𝑚 𝑥 𝑘 + 1 − 2𝑦 𝑘 + 2𝑏 − 1 2.11 …Line-Drawing Algorithms(Cont’d) 90
  • 91. Bresenham's Line Algorithm: …A decision parameter 𝒑 𝒌 for the kth step in the line algorithm can be obtained by rearranging Eq. 2.11 so that it involves only integer calculations. We accomplish this by substituting m = 𝜟𝒚 𝜟𝒙 , where 𝜟𝒚 and 𝜟𝒙are the vertical and horizontal separations of the endpoint positions, and defining: 𝑝 𝑘 = Δ𝑥 𝑑1 − 𝑑2 = 2Δ𝑦. 𝑥 𝑘 − 2Δ𝑥. 𝑦 𝑘 +𝑐 2.12 The sign of 𝒑 𝒌 , is the same as the sign of 𝒅 𝟏 − 𝒅 𝟐since 𝚫𝒙> 0 for our example. Parameter c is constant and has the value 2Δ𝑦 + 𝚫𝒙(2b - l), which is independent of pixel position and will be eliminated in the recursive calculations for 𝒑 𝒌. If the pixel at 𝒚 𝒌 is closer to the line path than the pixel at 𝑦 𝑘+ l (that is, 𝒅 𝟏<𝒅 𝟐), then decision parameter 𝒑 𝒌 is negative. In that case, we plot the lower pixel; otherwise, we plot the upper pixel. …Line-Drawing Algorithms(Cont’d) 91
  • 92. Bresenham's Line Algorithm: …Coordinate changes along the line occur in unit steps in either the x or y directions. Therefore, we can obtain the values of successive decision parameters using incremental integer calculations. At step k + 1, the decision parameter is evaluated from Eq. 2.12 as 𝑝 𝑘+1 = 2Δ𝑦. 𝑥 𝑘+1 −2Δ𝑥. 𝑦 𝑘+1 +𝑐 Subtracting Eq. 2.12 from the preceding equation, we have 𝑝 𝑘+1− 𝑝 𝑘 = 2Δ𝑦(𝑥 𝑘+1 − 𝑥 𝑘) −2Δ𝑥(𝑦 𝑘+1 − 𝑦 𝑘) but 𝑥 𝑘+1 = 𝑥 𝑘 +1, therefore, 𝑝 𝑘+1 = 𝑝 𝑘 + 2Δ𝑦 − 2Δ𝑥 (𝑦 𝑘+1 − 𝑦 𝑘) 2.13 where the term 𝒚 𝒌+𝟏 − 𝒚 𝒌 is either 0 or 1, depending on the sign of parameter 𝑝 𝑘. This recursive calculation of decision parameters is performed at each integer x position, starting at the left coordinate endpoint of the line. The first parameter, 𝑝0 is evaluated from Eq. 2.12 at the starting pixel position (𝒙 𝟎, 𝒚 𝟎) and with m evaluated as Δ𝑦/Δ𝑥: 𝑝0 = 2Δ𝑦 − Δ𝑥 2.14 …Line-Drawing Algorithms(Cont’d) 92
  • 93. Bresenham's Line Algorithm: …We can summarize Bresenham line drawing for a line with a positive slope less than 1 in the following listed steps. The constants 𝟐𝚫𝒚and 𝟐𝜟𝒚 - 𝟐𝜟𝒙 are calculated once for each line to be scan converted, so the arithmetic involves only integer addition and subtraction of these two constants. Algorithm: 1. Input the two line endpoints and store the left endpoint in (𝒙 𝟎, 𝒚 𝟎) 2. Load (𝒙 𝟎, 𝒚 𝟎) into the frame buffer; that is, plot the first point 3. Calculate constants 𝜟𝒙, 𝜟𝒚, 𝟐𝜟𝒚, and 𝟐𝜟𝒚 − 𝟐𝜟𝒙, and obtain the starting value for the decision parameter as: 𝑝0 = 2Δ𝑦 − Δ𝑥 4. At each 𝒙 𝒌 along the line, starting at k = 0, perform the following test: If 𝑝 𝑘< 0, the next point to plot is (𝒙 𝒌 +1, 𝒚 𝒌) and 𝑝 𝑘+1 = 𝑝 𝑘 + 2Δ𝑦 Otherwise, the next point to plot is (𝒙 𝒌 +1, 𝒚 𝒌+ 1) and 𝑝 𝑘+1 = 𝑝 𝑘 + 2Δ𝑦 − 𝟐𝜟𝒙 5. repeat step 4 𝜟𝒙 times …Line-Drawing Algorithms(Cont’d) 93
  • 94. Bresenham's Line Algorithm: Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒. We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the decision parameter as …Line-Drawing Algorithms(Cont’d) 94 k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) 0 6 (21,11) 5 6 (26,15) 1 2 (22,12) 6 2 (27,16) 2 -2 (23,12) 7 -2 (28,16) 3 14 (24,13) 8 14 (29,17) 4 10 (25,14) 9 10 (30,18)
  • 95. Since the circle is a frequently used component in pictures and graphs, a procedure for generating either full circles or circular arcs is included in most graphics packages. A circle is defined as the set of points that are all at a given distance r from a center position (𝒙 𝟎, 𝒚 𝟎). This distance relationship is expressed by the Pythagorean theorem in Cartesian coordinates as: 𝑥 − 𝑥c 2 + 𝑦 − 𝑦c 2 = 𝑟2 2.24 Fig 3.8 [circle with center coordinate (𝑥c,𝑦c) and radius r. …Circle-Generating Algorithms 95
  • 96. We could use this equation to calculate the position of points on a circle circumference by stepping along the x axis in unit steps from xc - r to xc+ r and calculating the corresponding y values at each position as 𝑦 = 𝑦𝑐 ± 𝑟2 − 𝑥 𝑐 − 𝑥 2 2.25 but this not the best method for generating a circle. it involves considerable computation at each step. spacing between plotted pixel positions is not uniform Fig 3.9 [Positive half of a circle plotted with Eq. 2.25 and with (𝑥 𝑐, 𝑦𝑐 = (0.0)] …Circle-Generating Algorithms (Cont’d) 96
  • 97. To eliminate the unequal spacing shown in Fig. 3.9 above is to calculate points along the circular boundary using polar coordinates r and 𝜃(Fig. 3.8). Expressing the circle equation in parametric polar form yields the pair of equations. 𝑥 = 𝑥 𝑐 + 𝑟 cos 𝜃 𝑦 = 𝑦𝑐 + 𝑟 sin 𝜃 3.26 … Circle-Generating Algorithms (Cont’d) 97
  • 98. Bresenham's Line Algorithm: Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒. We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the decision parameter as …Line-Drawing Algorithms(Cont’d) 98 k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) 0 6 (21,11) 5 6 (26,15) 1 2 (22,12) 6 2 (27,16) 2 -2 (23,12) 7 -2 (28,16) 3 14 (24,13) 8 14 (29,17) 4 10 (25,14) 9 10 (30,18)
  • 99. Bresenham's Line Algorithm: Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒. We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the decision parameter as …Line-Drawing Algorithms(Cont’d) 99 k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) 0 6 (21,11) 5 6 (26,15) 1 2 (22,12) 6 2 (27,16) 2 -2 (23,12) 7 -2 (28,16) 3 14 (24,13) 8 14 (29,17) 4 10 (25,14) 9 10 (30,18)
  • 100. Bresenham's Line Algorithm: Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒. We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the decision parameter as …Line-Drawing Algorithms(Cont’d) 100 k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) 0 6 (21,11) 5 6 (26,15) 1 2 (22,12) 6 2 (27,16) 2 -2 (23,12) 7 -2 (28,16) 3 14 (24,13) 8 14 (29,17) 4 10 (25,14) 9 10 (30,18)
  • 101. Bresenham's Line Algorithm: Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒. We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the decision parameter as …Line-Drawing Algorithms(Cont’d) 101 k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) 0 6 (21,11) 5 6 (26,15) 1 2 (22,12) 6 2 (27,16) 2 -2 (23,12) 7 -2 (28,16) 3 14 (24,13) 8 14 (29,17) 4 10 (25,14) 9 10 (30,18)
  • 102. Bresenham's Line Algorithm: Example: To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18). This line has a slope of 0.8, with 𝚫𝒙= 10, 𝚫𝐲 = 𝟖, The initial decision parameter has the value 𝑝0 = 2Δ𝑦 − Δ𝑥 = 6 and the increments for calculating successive decision parameters are 𝟐𝚫𝒚 = 16, 𝟐𝚫𝒚 − 𝟐𝜟𝒙 = −𝟒. We plot the initial point (𝒙 𝟎, 𝒚 𝟎) = (20, l0), and determine successive pixel positions along the line path from the decision parameter as …Line-Drawing Algorithms(Cont’d) 102 k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) k 𝑝 𝑘 (𝒙 𝒌 +1, 𝒚 𝒌+ 1) 0 6 (21,11) 5 6 (26,15) 1 2 (22,12) 6 2 (27,16) 2 -2 (23,12) 7 -2 (28,16) 3 14 (24,13) 8 14 (29,17) 4 10 (25,14) 9 10 (30,18)