Final - Sheet 2018 04 01 Part1
Final - Sheet 2018 04 01 Part1
Final - Sheet 2018 04 01 Part1
1|Page
4. List of computer graphics software packages:
- Allow a programmer to write computer graphics without dealing with system details.
- Perform a set of related operations such as drawing images and 3D surfaces into windows on
the screen.
2|Page
8. What does it mean by RGB?
- The RGB is a color model.
- Red, Green, and Blue light are added together to reproduce a different array of colors.
-
10. Define Pixel.
- Each screen point is referred to as a pixel or pel (Picture element).
11. Define bitmap.
- On a black and white system with one bit per pixel, the frame buffer is commonly known as a
bitmap.
3|Page
12. What is the role of a video controller?
- Used to control the operation
of the display device.
- Copy the content of the frame
buffer to refresh the screen.
-
4|Page
15. Give an example of memory mapping for 5 X 5 resolution color display device?
• A computer graphics system is a computer system; that have all the components of a general-
purpose computer system.
• Input devices
• Central Processing Unit
• Graphics Processing Unit
• Memory
• Frame buffer
• Output devices
17. What is the difference between raster storage image and vector storage image?
Raster Image:
- The images is considered as rectangular arrays of pixels.
- Each pixel have different colors stored as three numbers, for RGB.
- In a Monochrome system [black-and-white], each screen point is either on (a bit value of 1) or off
(a bit value of 0.
Random scan Image:
- The image is stored as a set of instructions for displaying the.
5|Page
• Used for text, diagrams, mechanical drawings, and other applications where precision are important
and photographic images and complex shading aren’t needed.
18. List the operating characteristics for the video display systems based on the CRT
technology?
- A beam of electrons emitted by an electron gun, passes through focusing System and
deflection systems that direct the beam toward specified positions on the phosphor-coated
screen.
- The phosphor-coated screen then emits a small spot of light at each position contacted by
the electron beam.
- The light emitted by the phosphor fades very rapidly, the picture is redrawn by quickly
directing the electron beam back over the same points. This type of display is called a refresh
CRT.
6|Page
21. What do you mean by an aspect ratio?
Aspect ratio is the ratio of vertical points to horizontal points necessary to produce equal
length lines in both directions on the screen. An aspect ratio of ¾ means that a vertical
line plotted with three points has same length as a horizontal line plotted with 4 points.
22. What are the different properties of phosphorus?
1. Color
2. Persistence
23. What do you mean by retracing? Define horizontal as well as vertical retracing.
- Retracing:
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.
- Horizontal retrace
The return to the left of the screen, after refreshing each scan line.
- Vertical retrace
At the end of each frame, the electron beam returns to the top left corner of the screen
to begin the next frame.
7|Page
26. Define shadow masking (Three Electron Gun).
This technique is used in raster scan display devices.
- Gives more colors than a beam penetration method.
- A shadow Mask CRT has 3 guns to generate 3 phosphor color dots at each pixel location (red,
green and blue).
- A shadow mask grid is installed just behind the phosphor coated screen.
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.
27. What are the different types of Flat-Screens, and what is the difference between them?
- light-emitting diodes (LEDs) - light-emitting diodes that can be turned on and off
- liquid-crystal displays (LCDs) - polarization of the liquid crystals in the middle panel
- plasma panels - voltages on the grids to energize gases
- Similarities:
- All use a two-dimensional grid to address individual light-emitting elements.
- The two outside plates each contain perpendicular parallel grids of wires.
- Sending electrical signals to a wire in each grid, generates electrical field at the
Intersection of two wires, can control the corresponding element in the middle plate.
8|Page
Exercises
29. Consider three different raster systems with resolutions of 640 x 480, 1280 x 1024, and
2560 x 2048.
a. What size is frame buffer (in bytes) for each of these systems to store 12 bits per pixel?
Because eight bits constitute a byte, frame-buffer sizes of the systems are as follows:
640 x 480 x 12 bits / 8 = 450KB;
1280 x 1024 x 12 bits / 8 = 1920KB;
2560 x 2048 x 12 bits / 8 = 7680KB;
b. How much storage (in bytes) is required for each system if 24 bits per pixel are to be
stored?
Similarly, each of the above results is just doubled for 24 (12×2) bits of storage per pixel.
30. Q33.Consider two raster systems with the resolutions of 640 x 480 and 1280 x 1024.
a. How many pixels could be accessed per second in each of these systems by a display
controller that refreshes the screen at a rate of 60 frames per second?
Since 60 frames are refreshed per second.
Each frame consists of 640 x 480 pixels,
- The access rate of such a system = (640 x 480) * 60 = 1.8432 x 107 pixels/second.
For the 1280 x 1024 system,
- The access rate is (1280 x 1024) * 60 = 7.86432 x 107 pixels/second.
b. What is the access time per pixel in each system?
The access time per pixel = 1/ access rate.
The access time is around 54 nanoseconds/pixel for the 640 x 480 system,
The access time is around 12.7 nanoseconds/pixel for the 1280×1024 system.
31. Consider a raster system with the resolution of 1024 x 768 pixels and the color palette
calls for 65,536 colors. What is the minimum amount of video RAM that the computer must
have to support the above-mentioned resolution and number of colors?
No of Colors = 65,536 colors
Number of bits per pixel = log 2 (65,536) =16-bit color.
The display’s resolution is 1024X768 pixels
Total Number of pixels = 786,432 (1024 × 768) pixels.
The total number of bits required
= 786,432 × 16 = 12,582,912 Bits = 1,572,864 bytes = 1,536 KB = 1.5 MB
32. How Many k bytes does a frame buffer needs in a 600 x 400 pixel?
9|Page
33. Q38. How much time is spent scanning across each row of pixels during screen refresh
on a raster system with resolution of 1280 X 1024 and a refresh rate of 60 frames per second?
Resolution = 1280 X 1024
That means system contains 1024 scan lines and each scan line contains 128 pixels
Refresh rate = 60 frame/sec.
1 frame takes = 1/60 sec = 0.01666 sec.
1 frame buffer consist of 1024 scan lines (It means then 1024 scan lines takes 0.01666 sec) 1 1
scan line takes = 0.01666 /1024 = 10.6 𝜇sec
34. Suppose RGB raster system is to be designed using on 8 inch X 10 inch screen with a
resolution of 100 pixels per inch in each direction. If we want to store 6 bits per pixel in the
frame buffer, how much storage (in bytes) do we need for frame buffer?
Resolution = 8 inch X 10 inch (100 pixels per inch)
Resolution = 8 X 100 by 10 X 100 pixel = 800 X 1000 pixel
1 pixel can be stored in 6 bits
Frame buffer size = 800 X 100 X 6 bits = 100 X 100 X 6 Byte
35. Find out the aspect ratio of the raster system using 8 x 10 inches screen and 100
pixel/inch.
36. Consider three different raster systems with resolutions of 640 by 480, 1280 by 1024,
and 2560 by 2048. What size frame buffer (in bytes) is needed for each of these systems to
store 12 bits per pixel? How much storage is required for each system if 24 bits per pixel are
to be stored?
37. How long does it take to load a 640-by-480 frame buffer with 12 bits per pixel, if 105 bits
can be transferred per second?
Let X the time that will be taken to load a 640-by-480 frame buffer with 12 bits per pixel.
Number of bits = 640 * 480 * 12 = 3686400 bits
1 sec X 105 bits
X sec(s) X 3686400 bits
Then X = 3686400/105 = 36.864 second
10 | P a g e
38. How much time is spent in scanning across each row of pixels during screen refresh on
a raster system with a resolution of 1280 by 1024 and refresh rate of 60 frames per second?
39. Suppose we have a video monitor with a display area with 12 inches width and 9.6 inches
high. If the resolution is 1280 X 1024 and the aspect ratio is 1, what are the width and the
height of each point on the screen?
40. How long would it take to load a 640-by-480 frame buffer with 12 bits per pixel, if 105
bits can be transferred per second? How long would it take to load a 24-bit-per-pixel frame
buffer with a resolution of 1280 by 1024 using this same transfer rate?
Total number of bits for the frame = 640 x 480 x 12 bits = 3686400 bits
The time needed to load the frame buffer = 3686400 / 105 sec = 36.864 sec
Total number of bits for the frame = 1280 x 1024 x 24 bits = 31457280 bits
The time needed to load the frame buffer = 31457280 / 105 sec = 314.5728 sec
41. Suppose an RGB raster system is to be designed using an 8-inch by 10-inch screen with
a resolution of 100 pixels per inch in each direction. If we want to store 6 bits per pixel in
the frame buffer, how much storage bytes do we need for the frame buffer?
11 | P a g e
Part 2: Graphics Primitives (Line)
1. How can an application program actually draw something on screen?
• Setpixel(x, y, color) - Sets the pixel at position (x, y) to the given color.
• Getpixel(x, y): Gets the color at the pixel at position (x, y).
Brute force Line Drawing Algorithm
3. For the brute force line drawing algorithm:
Analyze the Basic concept of drawing a line using the brute force algorithm?
y = mx + c
where m is the gradient of the line:
∆y yfrom − yto
m= =
∆x xfrom − xto
and c is its intercept of the y-axis
c = yfrom − m xfrom
12 | P a g e
5. Using the Brute force algorithm to digitize a line with end points (20, 10) and (26, 14).
6. Digitize a line with end points (20, 10) and (30, 18).
2. Using the DDA line drawing algorithm, find out the successive points that will be
plotted by drawing a line (7, 5) to (13, 9)?
3. Consider a line from (0,0) to (6,7), (0,0) to (6,6) and (0,0) to (6,7).Using simple DDA
algorithm, rasterize this line.
4. Consider a line from (0,0) to (6,7), (0,0) to (6,6) and (0,0) to (6,7).Using simple DDA
algorithm, rasterize this line.
13 | P a g e
5. Using the DDA algorithm digitize a line with end points (10, 15) and (15, 30).
6. Digitize a line with end points (20, 10) and (30, 18) using DDA line drawing Algorithm.
3. Digitize the line from (12, 16) to (1, 24) by using Bresenham's line drawing algorithm.
4. Derive the decision parameter to draw line using Bresenham’s algorithm?
5. Digitize a line from point (-1,-1) to point (4, 5) using Bresenham's line generation
algorithm?
6. Use the Bresenham's algorithm to find all points on a triangle in the first quadrant with
vertices at (0, 2), (6, 2) and (3, 6).
7. Applying Bresenham's algorithm to draw a line from (4, 4) and end point is (-3, 0).
8. Use the Bresenham's algorithm to find all points on a triangle in the first quadrant with
vertices at (0, 2), (6, 2) and (3, 6).
9. Applying Bresenham's algorithm to draw a line from (4, 4) and end point is (-3, 0).Plot
a circle at origin having center as (0, 0) and radius=8 using Bresenham's circle
algorithm.
17 | P a g e
10. Consider the Figure below where a line is to be placed on the grid from the circle in the
lower left-hand corner to the circle in the upper right-hand corner by Bresenham’s
algorithm. Graphically show how Bresenham’s algorithm will generate the line by
making appropriate grid-points. For the critical points, carry out simple calculations
for the decision what needs to be done. Explain how you arrived at your answer.
12
11
7
5 6 7 8 9 10 11 12 13 14 15 16
18 | P a g e
The basic idea of the Bresenham’s algorithm is that for a point P at (xp, yp) for a line of slope
between 0 and 1, the point at x = xp + 1 can be either E (y = yp) or NE (y = yp+1) depending on
which one the line is close to.
To determine which points to turn on, a line is first drawn between the two end-points.
12
11
7
5 6 7 8 9 10 11 12 13 14 15 16
5 5 25 52
y xb 7
The line has slope 11 and has equation 11 where b = 11 11 .
Then, scan from left to right along the x-axis to decide which points to turn on based on the idea
shown above.
For point at x = 6, y =7.45. Point (6, 7) will be turned on. The points at x = 7 to x = 14 are very
obvious. For point at x = 15, y 11.55 . Point (15, 12) will be turned on.
Therefore, the result is:
12
11
7
5 6 7 8 9 10 11 12 13 14 15 16
19 | P a g e
15. What are the advantages of Bresenham’s line drawing algorithm over
DDA and Brute force algorithm?
1. No rounding function
2. Only integer arithmetic
3. Calculation for the point (xi+1, yi+1) based on the point (xi, yi) only.
4. Applicable to the integer computation of circles
5. Line and integer circle algorithms provide the best-fit approximation
Points 1 – 3 imply that the Bresenham’s algorithm is faster than the DDA since rounding, floating
arithmetic and non-incremental technique take more computing time.
20 | P a g e
Part 2: Graphics Primitives (Circle)
1. The process of drawing circle using Brute force method can be enhanced by taking
greater advantage of the symmetry in a circle.
21 | P a g e
Bresenham's Circle Drawing Algorithm
1. Explain the basic concept of Midpoint ellipse algorithm.
Input radius r and circle center (𝑥𝑐 , 𝑦𝑐 ), and obtain the first point on the
circumference of a circle centered on the origin as
(𝑥0 , 𝑦0 ) = (0, 𝑟)
Calculate the initial value of the decision parameter as
5
𝑝0 = ( ) − 𝑟
4
At each x𝑘 position, starting at 𝑘 = 0, perform the following test: If 𝑝0 < 0 the
next point along the circle centered on (0,0) is (𝑥𝑘+1 , 𝑦𝑘 ) and
𝑝𝑘+1 = 𝑝𝑘 + 2(𝑥𝑘+1 ) + 1
o Otherwise, the next point along the circle is (𝑥𝑘+1 , 𝑦𝑘−1 ) and
𝑝𝑘+1 = 𝑝𝑘 + 2(𝑥𝑘 + 1) + 1-2(𝑦𝑘 + 1)
Determine symmetry points in the other seven octants.
Move each calculated pixel position (x, y) onto the circular path centered
on(𝑥𝑐 , 𝑦𝑐 ) and plot the coordinate values: 𝑥 = 𝑥 + 𝑥𝑐 , 𝑦 = 𝑦 + 𝑦𝑐
Repeat steps 3 through 5 until x ≥ y.
3. Derive the decision parameter to draw circle using Bresenham’s algorithm (Mid-
Point).
4. Plot a circle at origin having center as (0, 0) and radius=8 using Bresenham's circle
algorithm.
5. Plot a circle using mid-point algorithm whose radius=3 and center is at (0, 0). Find the
points lying on the circle centered at (5, 10) and having radius 8 using Bresenham’s
circle algorithm (Mid-Point).
22 | P a g e
6. Draw the circle or radius r=10 and center is at (3, 4) using midpoint algorithm
23 | P a g e
24 | P a g e
- Give three representations of circle, also give their equations.
- Fill in the blanks
In midpoint circle drawing algorithm if
f (x, y) < 0 means (x, y) is inside the circle
f ( x, y) = 0 means (x, y) is on the circle
f (x, y) > 0 means (x, y) is outside the circle
- Discuss scan conversion of circle with Bresenham’s and midpoint circle
algorithms.
25 | P a g e
Multiple choice questions
1. Smallest size object that can be displayed on a monitor is called.....................
a) Picture element b) Point c) Dot Pitch d) aspect ratio
7. The maximum number of points that can be displayed without overlap on a CRT
a) Aspect Ratio b) Resolution c)Brightness d)Pixel
8. ..................... is the number of points per centimeter that can be plotted horizontally and
vertically.
a) Aspect Ratio b) Pixel Depth c)Resolution d)Dot Pitch
9. ...................... is the ratio of horizontal points to vertical points necessary to produce equal
length lines in both direction.
a) Dot Pitch b) Resolution c) Aspect Ratio d) Height-Width Ratio
10. The shortest distance between any two dots of the same color is called...................
a)Resolution b)Dot Pitch c)Pixel Depth d) ppi
26 | P a g e
12. In CRT, the electron intensity is adjusted using.................
a) Accelerating anode b) Control grid c) Electron gun d) Focusing anode
21. The fly-back of electron beams from one scan line to next is known
as....................
a) Vertical Retrace b) Horizontal Retrace c) Raster scanning d) Refreshing
22. The return of electron beam to top left corner of the screen after one frame is
called............
a) Horizontal fly-back b) Vertical Fly-back c) Scanning d) None of the above
29. An RGB color system with 24 bits OS storage per pixel is known
as........................
a) Color CRT b) True-color system c) RGB monitor d) Color- Depth
30. Video devices with reduced volume, weight and power consumption are
collectively known as.........
28 | P a g e
a) Light weight monitors b) Flat-panel displays c) CRT d) Portable display
31. ................... is responsible for accessing the frame buffer to refresh the screen.
a) Graphics package b) Video controller c) CPU d) Monitor
32. Digitizing a picture definition into a set of intensity values is known as.............
a) Digitization b) Scan conversion c)Refreshing d) Scanning
34. The ................ simply reads each successive byte of data from the frame buffer.
a) Digital Controller b) Data Controller c) Display Controller d) All of above
36. The technique used to summarize the financial, statistical, mathematical, scientific
and economic data is?
a) Computer Art b) Image processing c) Presentation Graphics d) none of the above
37. Graphics and image processing technique used to produce a transformation of one
object into another is called
a) Animation b) Morphing c) Half toning d) None of the above
38. The amount of light emitted by the phosphor coating depends on the?
a) Number of electrons striking the screen
b) Speed of electrons striking the screen
c) Distance from the cathode to the screen
d) None of above
48. The basic geometric structures that describes a scene on display is called.................
a) Attributes b) Output primitive c) Lines d) Curves
30 | P a g e