CS489 - Tutorial Questions
CS489 - Tutorial Questions
2. Write are the factors that determine the size of an image file.
3. What is the impact of a color depth on the properties of an image file format?
4. Specify the no of bits per pixel and per color (R, G, B) for the following color modes
5. Consider three different raster systems with resolutions of 640 by 480, 1280 by 1024, and
2560 by 2048. What should be the frame buffer (in bytes) size that is required for each of
these systems to store 12 bits per pixel? How much storage is required for each system if
each requires 24-bits per pixel?
6. Suppose an RGB raster system is to be designed using an 8-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 (in bytes) do we need for the frame buffer?
7. A video display device has 480-scan lines with 640 pixels in each and the frame buffer size
of 640KB. How many bits are required for storing a pixel information?
8. In viewing transformation, find the new coordinate of a point P(6,8) before rounding
assuming that (2,2) and (8,12) are coordinates of a window, and (0,0) and (2,2) are
coordinates of the viewport. Show your work.
9. A polygon has 4 vertices, A (20, 30) B(20,10) C(60,10) D(60, 30). Find a transformation
matrix to double the size of the polygon with point B remained at the same position.
10. Triangle ABC where A (2,2), B (8,8), C (4,32) is translated with T (4,2) and then scaled
with S (2,1/2) with respect to the origin. Find out the coordinates of triangle A’B’C’ after
the composite transformation.
11. A polygon with vertices A(2,2), B(6,6), and C(2,6) is rotated by 90o degree in clockwise
direction with respect to the origin. Find the new coordinates A’, B’ and C’ after rotation.
Show your work.
12. Find the composite transformation matrix for a reflection about a line y = x; Show your
work.
13. In Cohen-Sutherland line clipping algorithm, the 4bit binary code representation of a point
(10, 145) with window coordinates (15, 50) and (75,125) is ____________________.
14. In the figure below, a polygon (p1 p2 p3 p4 p5 p6) and a clipping window with intersection
points (a, b, c, d, e and f) are given. Write the output list of the clipping process against each
side (in the order Left, Bottom, Right and Top) in the space provided below.
a. Left: ________________________
b. Bottom:______________________
c. Right:_______________________
d. Top: ________________________
Solution for the Selected Questions
Suppose an RGB raster system is to be designed using an 8-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 (in bytes) do we need for the frame buffer?
Given:
1) Screen Size = 8 by 10 inch
2) Resolution Unit = 100 pixels/inch
3) Bit Depth = 6 bits/pixel
Required:
Size (FrameBuffer)?
Solution:
Size(FrameBuffer) = #of Pixels x Bit Depth
= ((10 x 100) x (8 x 100)) x 6 bits/pixel
= 4,800,000 bits
= 600,000 Bytes
= 586KB
In viewing transformation, find the new coordinate of a point P(6,8) before rounding assuming
that (2,2) and (8,12) are coordinates of a window, and (0,0) and (2,2) are coordinates of the
viewport. Show your work.
Given:
1) P(6,8)
2) Window ((2,2), (8,12))
3) Viewport ((0,0), (2,2))
Required:
P’(x’,y’)
Solution:
P’ = Tmv . P
A polygon has 4 vertices, A (20, 30) B(20,10) C(60,10) D(60, 30). Find a transformation matrix
to double the size of the polygon with point B remained at the same position.
Given:
1) Polygon (A(20,30), B(20,10), C(60,10), D(60,30))
2) Scaling Factors: (Sx, Sy) = (2, 2)
3) With respect to: B(20,10)
Required:
Transformed Polygon (A’(Ax,Ay), B’(Bx,By), C’(Cx,Cy), D’(Dx,Dy))
Solution:
A’B’C’D’ = Tm . ABCD
In the figure below, a polygon (p1 p2 p3 p4 p5 p6) and a clipping window with intersection points (a,
b, c, d, e and f) are given. Write the output list of the clipping process against each side (in the order
Left, Bottom, Right and Top) in the space provided below.