Unit 1 Introduction of Computer Graphics: Main Task
Unit 1 Introduction of Computer Graphics: Main Task
Unit 1 Introduction of Computer Graphics: Main Task
CSIT
Unit 1
Introduction of Computer Graphics
Computer graphics is a field related to the generation of graphics using computer. It includes
the creation, storage and manipulation of images of object. These objects come from diverse
field such as medicine, physical, mathematical, engineering, architecture, entertainment,
advertisement.
- It is related to the generation and the representation of graphics by a computer using
specialized graphic hardware and software. The graphics can be photographs, drawings,
movies, or simulation etc.
- Computer graphics today is largely interactive; that is the user controls the contents
structure and appearance of images of the objects by using input devices such as
keyboard, mouse, or touch sensitive panel on the screen.
Main task
Imaging: Formation of an image.
- representation of 2D images.
Modelling: Representing 3D images.
Rendering: Constructing 2D images from 3D models.
Animation: Stimulating changes over time.
- describing how objects change in time.
Basic Concepts
Raster: A rectangular array of points and dots.
Pixel (picture element): One dot or picture element of the raster.
Scan line: A row of pixel.
Bit map: Ones and Zeros representation of rectangular array of point on the screen.
Black & white → bitmap
Color→ pixmap
n-1
Scan line
Pixel
0 m-1
m×n raster
Note: we don’t have any pixel like 1.2, 5.8.
Raster device co-ordinate can have only integer values.
System Graphics
CPU
modelling controller
I/O device
https://collegenote.pythonanywhere.com Prepared By: Jayanta Poudel
3 Computer Graphics (Reference Note) BSc.CSIT
Fluorescence / Phosphorescence
- When the beam of electron emitted by electron gun strikes phosphor coated screen on the
CRT, the phosphor emits a small spot of light at each position contacted by the electron
beam, such phenomenon is known as fluorescence / phosphorescence.
- It last just a fraction of millisecond.
Persistence
- How long a phosphor continues to emit light after the electron beam is removed?
- Persistence of phosphor is defined as time it takes for emitted light to decay to 1/10
(10%) of its original intensity. Range of persistence of different phosphors can react many
seconds.
- The phosphor used for graphics display device usually have persistence of 10 to 60
microsecond.
Resolution
- Resolution is defined as the maximum number of points that can be displayed
horizontally and vertically without overlap on display device.
Aspect Ratio
- It gives the ratio of vertical point to horizontal point necessary to produce equal length
lines in both directions on the screen.
- An aspect ratio of ¾ means that a vertical line plotted with 3 points has the same length as
a horizontal line plotted with 4 points.
Refresh Rate
- Light emitted by phosphor fades very rapidly, so to keep the drawn picture glowing
constantly; it is required to redraw the picture repeatedly and quickly directing the
electron beam back over the some point. The no of times/sec the image is redrawn to give
a feeling of non-flickering pictures is called refresh-rate.
- If Refresh rate decreases, flicker develops.
- Refresh rate above which flickering stops and steady it may be called as critical fusion
frequency (CFF).
Display Technologies:
- There is a special purpose processor called video controller or display controller, is used
to control the operation of the display device.
- When a particular command is called by the application program, the graphics subroutine
package sets the appropriate pixels in the frame buffer. The video controller then cycles
through the frame buffer, one scan line at a time. It will bring a value of each pixel
contained in the frame buffer and uses it to control the intensity of the CRT electron
beam.
- The display processor is a separate processor that performs graphics function such as scan
conversion and raster operation.
- System memory holds data and those program that execute on the CPU.
- The display processor memory holds data plus program that perform scan conversion and
raster operation.
- The frame buffer stores displayable image created by scan conversion & raster operation.
Advantages:
- It has an ability to fill the areas with solid colors or patterns
- The time required for refreshing is independent of the complexity of the image
- Low cost
Disadvantages:
- Its resolution is poor.
- For Real-Time dynamics not only the end points are required to move but all the pixels in
between the moved end points have to be scan converted with appropriate algorithms
which might slow down the dynamic process.
Video controller
- In random scan system, the electron beam is directed only to the part of screen where the
picture is to be drawn. It draws a picture one line at a time, so it is also called vector
display.
- Picture definition is stored as a set of line drawing commands in an area of memory called
refresh display file.
- To display a picture, the system cycles through the set of commands in the display file.
After all commands are processed, the system cycle backs to the first line command in the
list.
Architecture of Random Scan system:
Disadvantages:
- Cannot fill area with pattern and manipulate bits.
- Refreshing image depends upon its complexity.
Q. There is a system with 24 bits per pixel and resolution of 1024 by 1024. Calculate the
size of frame buffer.
Solution:
Resolution = 1024 × 1024
Total number of pixel = 1024*1024 = 1048576 pixels
Per pixel storage = 24 bits
Total storage required in frame buffer = 1048576*24 = 25165824 bits
= 25165824/8 byte
= 25165824/(8*1024) kb
= 25165824/(8*1024*1024)Mb
= 3 Mb
Q. Consider a raster scan system having 12 inch by 12 inch with a resolution of 100 pixels
per inch in each direction. If display controller of this system refresh the screen at the rate
of 50 frames per second, how many pixels could be accessed per second and what is the
access time per pixel of the system.
Solution:
Size of screen = 12 inch × 12 inch
Resolution = 100 pixels per inch
Total no. of pixels in one frame = (12*100)*(12*100)
Refresh rate = 50 frames per second
i.e. 50 frames can be accessed in 1 sec.
Total no. of pixel accessed in 1 sec = 50*(12*100)*(12*100) = 72000000 pixels
Again,
50 frames can be accessed in 1 sec.
1 frames can be accessed in 1/50 sec.
(12*100*12*100) frames can be accessed in 1/50 sec.
Then, 1 pixel can be accessed in 1/(50*12*100*12*100) sec.
= 109/(50*12*100*12*100) ns
= 13.88 ns.
Q. How many k bytes does a frame buffer needs in a 600 × 400 pixels?
Solution:
Suppose n bits are required to store 1 pixels.
Then, the size of frame buffer = resolution * bits per pixel
= (600*400)*n bits
= 240000 n/(8*1024) Kb
= 29.30 Kb
Q. Find the aspect ratio of raster system using 8 × 10 inches screen and having 100
pixels/inch.
Solution:
We know that,
𝑤𝑖𝑑𝑡ℎ 8∗100 4
Aspect ratio = ℎ𝑒𝑖𝑔ℎ𝑡 = 10∗100 = 5
Q. What is the time required to display a pixel on the monitor of size 1024 × 768 with
refresh rate of 60 Hz?
Solution:
Refresh rate = 60Hz i.e. 60 frames per second
Total no. of pixel in one frame = 1024*768 = 786432 pixels
60 frames need 1 sec.
1 frame need 1/60 sec.
786432 pixels need 1/60 sec.
1 pixel need 1/(60*786432) sec. = 109/(60*786432) ns = 21.19 ns
Q. How much time is spent scanning across each row of pixels during screen refresh on a
raster system with resolution 1280 ×1024 and refresh rate of 60 frames per second?
Solution:
Resolution = 1280 × 1024
i.e. one frame contains 1024 scan line and each scan line consists of 1280 pixels.
Refresh rate = 60 frames per second
i.e. 60 frames take 1 second.
1 frame takes 1/60 second.
i.e. 1024 scan line take 1/60 second i.e. 0.0166 sec.
1 scan line take 0.0166/1024 =0.016 sec.
Q. If a pixel is accessed from the frame buffer with an average access time of 300ns then
will this rate produce an un-flicking effect for the screen size of 640 × 480.
Solution:
Size of screen = 640 × 480
Total no. of pixels = 640*480=307200
Average access time of one pixel = 300 ns
Total time required to access entire pixels of image in the screen = 307200*300= 92160000ns
= 92160000/109 sec
= 0.09216 sec
i.e. one cycle take 0.09216 sec.
Now, no. of cycles per second i.e. refresh rate =?
0.09216 sec = 1 cycle
1 sec = 1/0.09216
=10.86
Refresh rate = 10.86 cycles per second.
Since the minimum refresh rate for unflicker image is 60 frames per second, hence we can
say the monitor produces flickering effect.
Q. Calculate the total memory required to store a 10 minute video in a SVGA system with
24 bit true color and 25 fps.
Solution:
The SVGA system allows resolution = 800 × 600
Refresh rate = 25 fps
i.e. 25 frames take 1 second
1 frame takes 1/25 second = 0.04 second
Size of video =10 minutes = 10*60 = 600 second
Total memory required = 800 × 600 × 600 × 0.04× 24 bit
= 276480000 /(8*1024*1024) Mb
= 32.959 Mb
Graphics Software
Software standards
Primary goal of standardized graphics software is portability. When packages are designed
with standard graphics functions, software can he moved easily from one hardware system to
another and used in different implementations and applications. International and national
standards planning organizations in many countries have cooperated in an effort to develop a
generally accepted standard for computer graphics. After considerable effort, this work led to
following standards:
GKS (Graphical Kernel System): This system was adopted as the first graphics software
standard by the International Standards Organization (ISO) and American National
Standards Institute (ANSI). Although GKS was originally designed as a two-dimensional
graphics package, a three dimensional GKS extension was subsequently developed.
Coordinate Representations
Normally, graphics package require coordinate specification to be given with respect to
Cartesian reference frames. Each object for a scene can be defined in a separate modeling
Cartesian coordinate system, which is then mapped to world coordinates to construct the
scene. From world coordinates, objects are transferred to normalized device coordinates, then
to the final display device coordinates. The transformations from modeling coordinates to
normalized device coordinate are independent of particular devices that might be used in an
application. Device drivers are then used to convert normalized coordinates to integer device
coordinates.
An initial modeling-coordinate position (𝑥𝑚𝑐 , 𝑦𝑚𝑐 ) in this illustration is transferred to a
device coordinate position (𝑥𝑑𝑐 , 𝑦𝑑𝑐 ) with the sequence:
(𝑥𝑚𝑐 , 𝑦𝑚𝑐 ) → (𝑥𝑤𝑐 , 𝑦𝑤𝑐 ) → (𝑥𝑛𝑐 , 𝑦𝑛𝑐 ) → (𝑥𝑑𝑐 , 𝑦𝑑𝑐 )
PHIGS Workstations
Generally, the term workstation refers to a computer system with a combination of input and
output devices that is designed for a single user. Some graphics system, such as PHIGS and
GKS, use the concept of a “workstation” to specify devices or software that are to be used for
input or output in a particular application. A workstation identifier in these system can refer
to a file; a single devices, such as a raster monitor; or a combination of devices, such as a
monitor, keyboard, and a mouse. Multiple workstation can be open to provide input or to
receive output in a graphics application.
Color Models
A color model is a method for explaining the properties or behavior of color within some
particular context. No single color model can explain all aspects of color, so we make use of
different models to help describe the different perceived characteristics of color.
Most light we see is not just a single wavelength, but a combination of many wavelengths
like below. This profile is often referred to as a spectrum, or spectral power distribution.
Frequency:
Red: 3.8 × 1014 ℎ𝑒𝑟𝑡𝑧
Violet: 7.9 × 1014 ℎ𝑒𝑟𝑡𝑧
Wavelength:
Red: 700 nm
Violet 400 nm
- Each color point within the bounds of the cube is represented as the triple (R, G, B),
where value for R, G, B are assigned in the range from 0 to 1.
- Here RGB color place together at 120 degree.
- All other colors are generated from these three primary colors.
c 1 r
m 1 g
y 1 b
References
- Donald Hearne and M.Pauline Baker, “Computer Graphics, C Versions.” Prentice
Hall