Exam Solution
Exam Solution
Exam Solution
1. Computer graphics
An area of computer science and engineering that plays an important role in almost every
application of computer software.
CG’s is the art and science of creating images by:
The status of each pixel on the screen was stored in a specific memory address in the
computer’s memory (memory mapped display).
4. Aspect Ratio
- is the ratio of vertical points to horizontal points necessary to produce equal-length lines in
both directions on the screen. (Sometimes aspect ratio is stated in terms of the ratio of
horizontal to vertical points.)
- An aspect ratio of 3/4 means that a vertical line plotted with three points has the same
length as a horizontal line plotted with four points.
5. Resolution
- Resolution: Is the maximum number of points that can be displayed without overlap on a
CRT monitors. Or it is the number of points per centimeter that can be plotted horizontally
and vertically, although it is often simply stated as the total number of points in each
direction.
6. 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), so only one bit per pixel is needed to store
the intensity of screen positions.
Vector Image:
The image is stored as a set of instructions for displaying the.
• Are often used for text, diagrams, mechanical drawings, and other applications where precision
are important and photographic images and complex shading aren’t needed.
- Jpeg format. This Lossy format compresses image blocks based on thresholds in the human
visual system. This format works well for natural images.
- Tiff format. This format is most commonly used to hold binary images or lossless
compressed 8- or 16-bit RGB although many other options exist.
- Ppm format. a lossless, uncompressed format is most often used for 8-bit RGB images
although many options exist.
- Png format. This is a set of lossless formats with a good set of open source management
tools.
8. List of common Computer Graphics Areas
9. 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.
10. 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.
• 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).
• A computer graphics system is a computer system; that have all the components of a
general-purpose computer system.
• There are six major elements in our system:
• Input devices
• Central Processing Unit
• Graphics Processing Unit
• Memory
• Frame buffer
• Output devices
16. 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.
17. 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?
18. 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
19. 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?
20. 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?
21. 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
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
Gaps start to appear in the line. Why has this happened? Looking at some
values for x and y soon reveals that when m>1, the values for y increase by an
amount greater than the increments of x that we are using (i.e. >1). And it can
be solved as the following
It requires floating point arithmetic which is slow when compared with using
integer only arithmetic. And it can be solved using Bresenhams algorithm
25. Write the algorithm of the line drawing algorithm using Bresenham’s
algorithm.
1. Input the two line endpoints and store the left endpoint in (x0 , y0 )
2. Load (x0 , y0 ) into the frame buffer; that is, plot the first point.
3. Calculate constants Δx, Δy, 2Δy, and 2Δy − 2Δx, and obtain the starting value for the
decision parameter as p0 = 2∆y − ∆x
4. At each xk along the line, starting at k = 0, perform the following test:
27. Write the algorithm of the line drawing algorithm using Digital Differential
Analyzer (DDA).
28. Using the DDA algorithm digitize a line with end points (10,15) and (15,30).
29. The process of drawing circle using Brute force method can be enhanced by
taking greater advantage of the symmetry in a circle.
3. Using the Brute orce algorithm to digitize a line with end points (20, 10) and
(26, 14).