Computer Graphics: Unit-I A Survey of Computer Graphics: Overview of Graphics Systems: Video

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 48

Computer Graphics

UNIT-I
A Survey of Computer Graphics: Overview of graphics systems: Video-
Display Devices, Raster-scan Systems, Random-scan Systems, Graphics
Monitors and Work stations, Input devices, Hardcopy Devices and Graphics
Software.
UNIT-II
Output Primitives: Points and lines, Line drawing algorithms- DDA,
Bresenhams line algorithm, Circle generation algorithm and Ellipse
Generating algorithms.
UNIT-III
2-DGeometrical transforms: Basic Transformations, Matrix
representations and Homogeneous coordinates, Composite transforms,
Other Transformations, Transformations between coordinate systems.
UNIT-IV
2-D Viewing: Definition of view port, clipping and window. The Viewing Pipeline,
Viewing coordinate reference frame, Window to View-port coordinate
transformation, 2D Viewing functions, Clipping Operation, Point Clipping, Line
Clipping: Cohen-Sutherland and Liang -Barsky line clipping algorithms, Polygon
Clipping: Sutherland– Hodgeman polygon clipping algorithm.
UNIT-V
3-D Geometric and Modeling Transformations: Translation, Rotation, Scaling,
other Transformations, Composite Transformations.
UNIT-VI
3-D viewing: Viewing Pipeline, Viewing coordinates, Projections. Computer
Animation: Design of Animation Sequence, General Computer Animation
functions, Raster Animation, Computer Animation Languages, Key-Frame
systems, Motion Specifications.

TEXT BOOKS:
Computer Graphics C version‖, Donald Hearn and M. Pauline Baker, Pearson
education.
Introduction to Computer Graphics
 Computer is a information processing machine. It is a tool for storing and
manipulating the data.
 There are many ways to communicate the processed information to the user
 The computer graphics is one of the most effective and commonly used way
to communicate the processed information to the user.
 Computer graphics displays the information in the form of graphics objects
such as pictures, charts, graphs and diagrams instead of simple text.
 Thus we can say that computer graphics makes it possible to express data in
pictorial form .
 Now a days almost every computer can do some graphics and people also
expect to control their computer through icons and pictures rather than
typing commands.
 Drawing pictures on computer is called rendering.
 Pictures or graphics objects are presented as a collection of picture
elements called pixels.
 Pixel is the smallest graphical unit represented on the computer screen.
 Each pixel on the graphics display does not represent mathematical point.
Rather, it represents a region which theoretically can contain an infinite
number of points.
 For Example, if we want to display point p1 whose coordinates are (4.2,3.8)
and point p2 whose coordinates are (4.8,3.1) then p1 and p2 are
represented by only one pixel(4,3)
Note: In general , a point is represented by the integer part of x and integer part of y,
i,.e. pixel(int(x),int(y)).
 The process of determining the appropriate pixels for representing picture or
graphics object known as rasterization.

 The process of representing continuous graphics object as a collection of pixels is


called scan conversion.

 The computer graphics allows rotation, translation, scaling and performing


various projections on the picture before displaying it. It provides user the control
to modify contents, structure, and appearance of pictures or graphic objects using
input devices such as keyboard, mouse on the screen.

 Therefore ,graphics devices includes both input and display devices.


Definition:

 Computer graphics is an art of drawing pictures, lines, charts,.etc using


computer
Or
 Computer Graphics is the creation of pictures with the help of a computer.
The end product of the computer graphics is a picture it may be a business
graph, drawing, and engineering.
Or
 Computer graphics is concerned with all aspects of producing pictures or
images using a computer.
Types of Computer Graphics

1. Interactive computer graphics(Active graphics)


2. Non-Interactive computer graphics(passive
graphics)
Interactive computer graphics
 In this case user have some control over the picture i.e. user can

make changes on image. Interactive computer graphics involves two-

way communication between computer and user.


 Here the user is given some control over the image by providing him

with an input device.

Example: The video game controller of the ping pong game. This helps to

signal his request to the computer, on receiving signals from the input

device can modify the displayed picture appropriately. To the user it

appears that the picture is changing instantaneously in response to his

commands.
Non Interactive Computer Graphics

 It is also known as passive computer graphics.

 In this the user does not have any kind of control over the image.
Image is merely the product of static stored program and will work
according to the instructions given in the program linearly.

 The image is totally under the control of program instructions not


under the user. Example: screen savers.
Video-Display Devices
 The output devices can be classified as display devices and hardcopy
devices.

 The most commonly used output device in a graphics system is a video


monitor. The operation of most video monitors is based on the standard
cathode-ray tube(CRT) design.
Cathode Ray Tube(CRT)
 The primary output device in graphical system is the video monitor and the
main element of video monitor is CRT.
 CRT is a technology used in traditional computer monitors and televisions
 A beam of electrons is emitted by the electron gun, it passes through
focusing &deflection systems that directs the beam towards specified
position on the phosphor screen.

 When the beam hits the screen, the phosphor emits a small spot of light at
each position contacted by the electron beam

 Since light is emitted by the phosphor fades very quickly some method is
needed for maintaining the screen picture

 One of the simplest way to maintain pictures on the screen is to redraw the
image rapidly. This type of display is called CRT.

 Apart from CRT there are two more ways to display an object on the screen
1. raster scan
2. Random scan
Raster scan

 In raster scan system the electron beam is swept across the screen one row
at a time from top to bottom.

 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 memory area called refresh buffer or Frame


buffer. This memory area holds the set of intensity values for all the screen
points.
 Stored intensity values are then retrieved from the refresh buffer and painted on the
screen one row at a time.

 Each screen point is referred as a pixel.

 At the end of each scan line, the electron beam returns to the left side of the screen
to begin displaying the next scan line.

 The return to the left of screen after refresh of each scan line is known as horizontal
retrace of electron beam.

 At the end of each frame electron beam returns to top left corner and begins the next
frame is called vertical retrace.

 Intensity range for pixel positions depends on the capability of raster scan system. It
can be a simple black and white system or color system.

 In a simple black and white system, each pixel position is either ON or OFF, so only a
bit for pixel is needed to control the intensity of the pixel positions. This frame buffer
is called bitmap.
 In a color system , each pixel requires multiple bits to control the intensity of
pixel positions. This frame buffer is called Pixmap.

 In raster scan systems refreshing is done at done at a rate of 60-80 frames


per second. Refresh rates are also sometimes described in units of cycles
per second / Hertz (Hz)

Advantages:
1. Real life images with different shades can be displayed.
2. Millions of different colors are generated.

Dis advantages:
3. Low Resolution
4. More memory is required.
5. Expensive
6. Electron beam directed to the entire screen not only to the part of the
screen where the picture is to be drawn
Random scan(Vector scan)
 In this technique, the electron beam is directed only to the part of the screen
where the picture is to be drawn rather than scanning from left to right and
top to bottom as in raster scan. It is also called vector display, stroke-writing
display, or calligraphic display.
 Picture definition is stored as a set of line-drawing commands in an area of
memory referred to as the refresh display file. To display a specified picture,
the system cycles through the set of commands in the display file, drawing
each component line in turn. After all the line-drawing commands are
processed, the system cycles back to the first line command in the list.

 Random-scan displays are designed to draw all the component lines of a


picture 30 to 60 times each second.

 Since picture definition is stored as a set of line drawing instructions; it has


higher resolution than raster scan systems and It has smooth line drawing
because the CRT beam directly follows the line path.
Advantages:
1. Electron beam directed only to the parts of the screen where a picture is to
be drawn.
2. It produces smooth line drawings
3. High resolution

Dis Advantages:
1. I can’t display realistic shaded image.
Color CRT Monitors

 A color CRT monitor displays color picture by using a combination of


phosphors that emit different colored light.

 It produces range of colors by combining the light emitted by different


phosphors.

 There are two basic techniques used for producing color displays.
1. Beam-penetration technique
2. Shadow-mask technique
Beam-penetration method
 The Beam-Penetration method has been used with random-scan monitors.
 In this method, the CRT screen is coated with two layers of phosphor, red and
green, The outer layer is of red phosphor and inner layer is of green
phosphor.
 The displayed color depends on how far the electron beam penetrates the
phosphor layers
 A beam of slow electrons excites the outer red layer only; hence screen
shows red color only. A beam of high-speed electrons excites the inner green
layer. Thus screen shows a green color.

 At intermediate beam speeds, combinations of red and green light are


emitted to show two additional colors- orange and yellow.

Advantages
 Less expensive

Disadvantages
 Quality of images are not good as comparable with other methods
 Four colors are allowed only
Shadow-mask Technique
 Shadow-mask methods are commonly used in rasterscan systems (including
color TV) because they produce a much wider range of colors than the beam-
penetration method.

 A shadow-mask CRT 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

 Figure illustrates the delta-delta shadow-mask method, commonly used in


color CRT systems
 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
 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.

 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 h m the blue phosphor.

 A white (or gray) area is the result of activating all three dots with equal
intensity. 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.
 In some low-cost systems, the electron beam can only be set to on or off,
limiting displays to eight colors. More sophisticated systems can set
intermediate intensity levels for the electron beams, allowing several million
different colors to be generated.

 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
directly from the computer system without any intennediate 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.

 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 (DVST)
 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. One, the primary gun, is used to store
the picture pattern; the second, the flood gun, maintains the picture display.
Advantage of DVST:
 Refreshing of CRT is not required.
 Because no refreshing is needed, very complex pictures can be displayed at
very high resolutions without flicker.

Disadvantage of DVST
 They do not display color and are available with single level of line intensity.
 selected parts of a picture cannot he erased. To eliminate a picture section,
the entire screen must be erased and the modified picture redrawn. The
erasing and redrawing process can take several seconds for a complex
picture..
 The performance of DVST is somewhat inferior to the refresh CRT.
Flat-Panel Displays
 The term flat panel display refers to a class of video device that have reduced
volume, weight & power requirement compared to a CRT.

 As flat panel display is thinner than CRTs, we can hang them on walls or wear
on our wrists.

 We can separate flat panel display in two categories:


1. Emissive displays: convert electrical energy into light.
Example: Plasma panel, Thin Film Electroluminescent Displays and light emitting diodes.
2. Non emissive displays: - non emissive display use optical effects to convert sunlight or light
from some other source into graphics patterns.
Example: LCD (Liquid Crystal Display).
Plasma panels
 Plasma panels, also called gas-discharge displays, are constructed by filling
the region between two glass plates with a mixture of gases that usually
includes neon.

 A series of vertical conducting ribbons is placed on one glass panel and a set
of horizontal ribbon is built into the other glass panel.
 Firing voltage is applied to a pair of horizontal and vertical conductors cause
the gas at the intersection of the two conductors to break down into glowing
plasma of electrons and ions.

 Picture definition is stored in a refresh buffer and the firing voltages are
applied to refresh the pixel positions, 60 times per second.

 Alternating current methods are used to provide faster application of firing


voltages and thus brighter displays.

Disadvantage:
 One disadvantage of plasma panels is they were strictly monochromatic
device that means shows only one color other than black like black and white
Thin Film Electroluminescent Displays

 It is similar to plasma panel display but region between the glass plates is filled
with phosphors such as zinc sulfide doped with magnesium instead of gas.
 When sufficient voltage is applied the phosphors becomes a conductor in area of
intersection of the two electrodes.
 Electrical energy is then absorbed by the manganese atoms which then release the
energy as a spot of light similar to the glowing plasma effect in plasma panel.
 It requires more power than plasma panel.
 In this good color and gray scale difficult to achieve.
Light Emitting Diode (LED)
 In this display a matrix of multi-color light emitting diode is arranged to form
the pixel position in the display. And the picture definition is stored in refresh
buffer.

 Information is read from the refresh buffer and converted to voltage levels
that are applied to the diodes to produce the light pattern on the display
Liquid Crystal Display (LCD)
 It is generally used in small system such as calculator and portable laptop.
 These devices produce a picture by passing polarized light from the
surroundings or from an internal light s o w through a liquid-crystal material
that can transmit the light.
 LCD uses liquid crystal material between two glass plates each with light
polarizer at right angles to each other.
 Rows of horizontal transparent conductors are built into one glass plate, and
column of vertical conductors are put into the other plates.

 The intersection of two conductors defines a pixel position

 In the ON state polarized light passing through material is twisted so that it


will pass through the opposite polarizer.

 In the OFF state it will reflect back towards source.

 To turn OFF, We applied a voltage to the two intersecting conductor to align


the molecules so that the light is not twisted.

 This type of flat panel device is referred to as a passive matrix LCD.


Advantages of LCD display
 Low cost.
 Low weight.
 Small size
 Low power consumption.
Raster graphics systems
 Interactive raster graphics systems typically employ several processing units.
In addition to the central processing unit,a special-purpose processor, called
the video controller or display controller, is used to control the operation of
the display device
Simple raster graphics system

C P U S y s te m Video Monitor
M e m o ry C o n tr o lle r

S y s te m B u s

I/O Devices

Fig. 1.14: - Architecture of a simple raster graphics system.


 Here, 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 coprocessors and accelerators to implement various graphics
operations.
 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
R a s te r g r a p h ic s s y s te m w ith a fix e d p o r tio n o f th e s y s te m m e m o r y r e s e r v e d fo r
the frame buffer

CPU S y s te m F ra m e Video Monitor


M e m o ry B u ffe r C o n tr o lle r

System bus

I/O Devices

 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 corner
 Screen surface is then represented as the first quadrant of the two
dimensional systems with positive X- value increases as left to right and
positive Y-value increases bottom to top.
 Basic refresh operation of video controller
R a s te r S c a n Horizontal and Vertical
G e n e ra to r Deflection Voltages

X Y
register register

Memory Address Pixel


Intensity
r e g is te r

Frame Buffer
 Two registers are used to store the coordinates of the screen pixels which are
X and Y. Initially the X is set to 0 and Y is set to Ymax.
 The value stored in frame buffer for this pixel is retrieved and used to set the
intensity of the CRT beam.
 After this X register is incremented by one.This procedure is repeated till X
becomes equals to Xmax.
 • Then X is set to 0 and Y is decremented by one pixel and repeat above
procedure.
 • This whole procedure is repeated till Y is become equals to 0 and
complete the one refresh cycle. Then controller reset the register as top –left
corner i.e. X=0 and Y=Ymax and refresh process start for next refresh cycle.
 • Since screen must be refreshed at the rate of 60 frames per second the
simple procedure illustrated in figure cannot be accommodated by typical
RAM chips.
Interlacing
A TV video signal is graphically interlaced, which means every full screen
of information is made up of two separate fields which include the odd
field and even field. First, the odd lines are printed on the graphics screen.
Then, the even lines are printed in between the odd lines before the odd
lines fade away. This all happens faster than any human eye can perceive.
In an interlaced monitor, the electron beam takes two passes
to form a complete image: it skips every other row on the first
pass, and then goes back and fills in the missing rows. A non-
interlaced monitor does the whole job in one pass, tracing
each row consecutively. Interlaced monitors are easier to build
and therefore cheaper, but as you can guess-they aren't as
good as non-interlaced monitors. The problem is that all
things being equal, it takes twice as long to create the
complete screen image on an interlaced monitor. That's long
enough to spoil the illusion that you're looking at a steady
picture, and the image on the screen flickers annoyingly. 

You might also like