Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 63

AMAL JYOTHI COLLEGE OF ENGINEERING

KANJIRAPPALLY

COMPUTER GRAPHICS

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Module 1

Basic concepts in Computer Graphics


Types of Graphic Devices – Interactive Graphic inputs
Raster Scan and Random Scan Displays

2
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
• Computer graphics are visual representations of data displayed on a monitor made
on a computer. Computer graphics can be a series of images (most often
called video) or a single image.
• Computer-generated imagery is used for 
Movie making, 
video game and computer program development
scientific modeling
design for catalogs and
 other commercial art

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Basic Definition
Computer Graphics is the use of computers to display and manipulate
information in graphical or pictorial form, either on a visual display unit or
via a printer or plotter.

Computer Graphics are pictures and movies created using computers -


usually referring to image data created by a computer specifically with help
from specialized graphical hardware and software's.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• The overall methodology depends heavily on the underlying
sciences of 
– Mathematics (Geometry, Numerical )
– Physics (optics, Mechanics)
– Psychology (color, perception)
– Art & Design

• Optics : (branch of physics which involves the behavior and


properties of light)

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
• The term computer graphics has been used in a broad sense to
describe "almost everything on computers that is not text or
sound". Typically, the term computer graphics refers to several
different things:
– the representation and manipulation of image data by a
computer
– the various technologies used to create and manipulate
images
– the sub-field of computer science which studies methods for
digitally synthesizing and manipulating visual content

8
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Motivation
• Pretty pictures ….

• Human respond better to pictures than text.

• Computer graphics is responsible for


– displaying art and image data effectively and beautifully to the
user, and
– processing image data received from the physical world.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Computer Graphics is about animation (films)

Major driving force now

Lecture 1
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Games are very important in Computer Graphics

Lecture 1
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Medical Imaging is another driving force

Lecture 1
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Applications of Computer Graphics

 Computer graphics is used in a lot of areas such as


1. Computer aided design
2. Presentation graphics
3. Computer art
4. Entertainment
5. Education and training
6. Visualization
7. Image processing
8. Graphical user interfaces

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


1. Computer Aided Design

 Computer graphics is used in the design of engineering and


architectural systems such as buildings, automobiles, aircraft,
watercraft, spacecraft, computers, textiles etc..
 Objects are first displayed in a wireframe outline form that shows
the overall shape & internal features of objects
 When object designs are complete, lighting and shading models are
applied to produce the final product.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


 Animations are used in CAD applications
 Animations using wireframe displays on a video monitor are
useful for testing performance of vehicles

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


 Software packages for CAD applications provide the designer
with a multi-window environment

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


 Architects use interactive graphics methods to lay out floor plans
such as positioning of rooms, doors, windows stairs shelves
counters etc

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


2. Presentation graphics

 It is an area of computer graphics in which slides are designed


to be used with projectors.
 It is used to summarize financial, statistical, mathematical,
scientific and economic data for reports.
 The data can be represented in the form of bar charts and
graphs, pie charts etc.
 PowerPoint is the best-known presentation graphics.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


 Presentation graphics is often called business graphics.

 A type of business software that enables users to create highly


stylized images for slide shows and reports.

 The software includes functions for creating various types of


charts and graphs and for inserting text in a variety of fonts.

 Most systems enable you to import data from a spreadsheet


application to create the charts and graphs.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


 Three-dimensional graphs are used, to provide more attractive
presentation of data relationships

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


3. Computer Art

 Computer graphics techniques are used in fine art and


commercial art applications.
 Artists use a variety of techniques such as paint packages,
special hardware, CAD packages and animation packages
for designing objects.
 Some examples software's
are Paint and Photoshop.

21
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
 The packages provide facility for designing object shapes
& specifying object motions
 Eg : cartoon drawings, paintings, logo design, product
advertisements

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


 Electronic painting
 Picture painted electronically on a graphics tablet (digitizer)
using a stylus

 Morphing
 A graphics method in which one object is transformed into
another

23
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
4. Entertainment

• Computer graphics methods are used in making motion pictures


and television shows.
• Music videos use graphics in several ways. Graphics objects
can be combined with live action

25
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
26
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
5 .Education and Training

• Computer generated models are used as financial aids.


• Simulators are used for training ship captains, aircraft pilots
and heavy equipment operators.
• Flight simulators are used for training aircraft pilots.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
6 .Visualization

• Scientists, engineers often need to analyze large amount of


information to analyze certain processes.
• Satellite cameras collect thousands and even millions of images
faster than they can be interpreted by human beings.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


 Numerical simulations carried out on super computers
frequently produce data files containing thousands & even
millions of data values

 Scanning these large set of numbers to determine trends &


relationships is a tedious & ineffective process

 But if these data are converted to visual form, trends can be


analyzed. This is referred to as visualization

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


 Data set includes scalar values, vectors, 2-dimensional or 3-
dimensional

 Color coding is one way to visualize a data set

 Contour plots, graphs & charts, surface renderings are the


additional techniques to visualize

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


7 .Image Processing

• Image processing apply techniques to modify or interpret


existing pictures.
• Two applications of image processing are
– improving picture quality and
– machine perception of visual information.
• Medical applications widely use image processing techniques
for surgery, tomography and for picture enhancements.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• Medical applications make extensive use of image processing

• CT, PET scanning techniques are used to monitor internal


functions and show cross sections during surgery

• Ultrasonics use high frequency sound waves to generate


digital data

34
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
35
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
8. Graphical User Interfaces

• Nowadays all operating systems provide graphical interfaces.


• They contain a number of windows.
• User can interact with the computer system by making some
clicks instead of typing commands

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


RASTER SCAN &
RANDOM SCAN SYSTEMS

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• Raster Scan methods have increasingly become the dominant technology since about 1975.
• These methods use the TV type raster scan.
• The growth in the use of such methods has been dependent on rapidly decreasing memory prices
and on the availability of cheap scan generating hardware from the TV industry.

• The screen is coated with discrete dots of phosphor, usually called pixels, laid out in a rectangular
array.
• The image is then determined by how each pixel is intensified. 
• The representation of the image used in servicing the refresh system is thus an area of memory holding
a value for each pixel.
• This memory area holding the image representation is called the frame buffer.
38
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
• The values in the frame buffer are held as a sequence of horizontal lines of pixel values from the top of
the screen down.
• The scan generator then moves the beam in a series of horizontal lines with fly-back (non-intensified)
between each line and between the end of the frame and the beginning of the next frame. This is
illustrated below.

39
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
• Unlike random-scan which is a line drawing device, refresh CRT is a point-plotting device.
• Raster displays store the display primitives (lines, characters, shaded and patterned areas) in a refresh
buffer.
• Refresh buffer (also called frame buffer) stores the drawing primitives in terms of points and pixels
components .
• This scan is synchronized with the access of the intensity values held in the frame buffer.

40
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
• The maximum number of points that can be displayed without overlap by a system is called the
resolution and is quoted as the number of points per horizontal line versus the number of
horizontal lines.

• Typical resolutions are 640*480, 1024*768, and 1280*1024.

• The maximum resolution is determined by the characteristics of the monitor and/or by the memory
capacity available for storing the frame buffer.

41
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
• Random scan displays, often termed vector Vector, Stroke, and Line drawing displays, came first
and are still used in some applications.
• Here the characters are also made of sequences of strokes (or short lines). The electron gun of a
CRT illuminates straight lines in any order.
• The display processor repeatedly reads a variable 'display file' defining a sequence of X,Y
coordinate pairs and brightness or color values, and converts these to voltages controlling the
electron gun

42
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
• In random scan display an electron beam is deflected from endpoint to end-point.
• The order of deflection is dictated by the arbitrary order of the display commands. The display
must be refreshed at regular intervals – minimum of 30 Hz (fps) for flicker-free display

43
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
44
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
45
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Raster scan systems

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• Interactive raster graphics systems employ several processing units.

• In addition to the CPU a special processor called video controller or


display controller is used to control the operation of the display
device.

• Frame buffer can be anywhere in the system memory, and the video
controller accesses the frame buffer to refresh the screen

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally
Video controller

• A fixed area of the system memory is reserved for the frame buffer.
• Video controller is given direct access to the frame buffer memory.
• Frame buffer locations and screen positions are referenced in Cartesian
coordinates (x , y)

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• Scan lines are labeled from ymax at the top of the screen to 0 at
the bottom.
• Along each scan line screen pixel positions are labeled from 0
to xmax

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Basic video controller refresh operations

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• Two registers are used to store the coordinates of screen pixels.
• Initially x register is set to 0 and y register is set to Ymax .
• The value stored in the frame buffer for this pixel position is retrieved
and used to set the intensity of the CRT beam.
• Then the x register is incremented by 1 and the process is repeated for
the next pixel on the top scan line.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• After the last pixels on the top scan line has been processed, the x
register is reset to 0 and y register is decremented by 1.

• Pixels along this scan line are then processed and the procedure is
repeated for each successive scan line.
• Process is repeated until x=xmax & y=0

• After cycling through all pixels along the bottom scan line the video
controller resets the registers to the first pixel position on the top scan
line and the refresh process starts over.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• Since screen must be refreshed at the rate of 60 frames per second,
the above procedure will not work with typical RAM.
• This is because the cycle time is too slow.
• To speed up pixel processing video controller can retrieve multiple
pixel values from the refresh buffer.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• These values are stored in a separate register
(pixel register)and can be 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.
• In high quality systems 2 frame buffers are used
– One for refreshing
– Second for filling intensity values
– Provides a fast mechanism for real time animations

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Raster scan display processor

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


For eg. Scan converting a straight-line segment means that we have to
locate the pixel positions closest to the line path and store the intensity for
each position in the frame buffer.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Scan conversions of curved lines

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


• Display processors can perform a number of other operations
such as
– generating various line styles,
– Displaying color areas, and
– performing certain transformations and manipulations on
displayed objects.

• In an effort to reduce memory requirements in raster system,


methods are taken for
– Organizing frame buffer as a linked list
– Encoding intensity information

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Random-scan systems

An application program is input and stored in the system memory along


with a graphics package.

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


1. Graphics commands in the program are translated by the
graphics package into a display file (frame buffer) stored in the
system memory.
2. This display file is then accessed by the display processor to
refresh the screen.
3. 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

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally


Refresh buffer (display file) in Random scan

Department of Computer Science, Amaljyothi College of Engineering, Kanjirapally

You might also like