54
Lab Manual: Computer Graphics & Multimedia Department of Information Technology ORIENTAL INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL ORIENTAL INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL DEPARTMENT OF INFORMATION TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY LAB MANUAL LAB MANUAL Course Code: IT-602 Course Code: IT-602 Course: Computer Graphics & Multimedia Course: Computer Graphics & Multimedia Session: Jan-Jun 2014 Session: Jan-Jun 2014 1 Mr. Imran Khan Mr. Imran Khan Associate Professor, Department of IT, OIST Associate Professor, Department of IT, OIST Email:[email protected] Email:[email protected]

Cgm Lab Manual

Embed Size (px)

Citation preview

Page 1: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

ORIENTAL INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPALORIENTAL INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL

DEPARTMENT OF INFORMATION TECHNOLOGYDEPARTMENT OF INFORMATION TECHNOLOGY

LAB MANUALLAB MANUAL

Course Code: IT-602Course Code: IT-602

Course: Computer Graphics & MultimediaCourse: Computer Graphics & Multimedia

Session: Jan-Jun 2014Session: Jan-Jun 2014

1Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 2: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Table of ContentsTable of Contents

Sr. No. Particulars Page No.

1 Time Table 2

2 University Scheme 3

3 Syllabus 4

4 List of Books 4

5 List of Programs 5

6 Important Viva Questions 43

2Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 3: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Time TableTime Table

3Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 4: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

University Scheme University Scheme

4Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 5: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

SyllabusSyllabus

IT-602– Computer Graphics & Multimedia Unit IIntroduction to Raster scan displays, Storage tube displays, refreshing, flickring, interlacing,colour monitors, display processors resolution, working principle of dot matirix, inkjet laserprinters, working principles of keyboard, mouse scanner, digitizing camera, track ball , tabletsand joysticks, graphical input techniques, positioning techniques, rubber band techniques,dragging etc.Unit IIScan conversion techniques, image representation, line drawing, simple DDA, Bresenham’sAlgorithm, Circle drawing, general method, symmetric DDA, Bresenham’s Algorithm, curves,parametric function, Beizier Method, B-spline Method.Unit III2D & 3D Co-ordinate system, Translation, Rotation, Scaling, Reflection Inverse transformation,Composite transformation, world coordinate system, screen coordinate system, parallel and perspective projection, Representation of 3D object on 2D screen. Point Clipping. Line Clipping Algorithms, Polygon Clipping algorithms, Introduction to Hidden Surface elimination, Basic illumination model, diffuse reflection, specular reflection, phong shading, Gourand shading ray tracing, color models like RGB, YIQ, CMY, HSV etc.Unit IVAn Introduction – Multimedia applications – Multimedia System Architecture – Evolvingtechnologies for Multimedia – Defining objects for Multimedia systems – Multimedia Datainterface standards – Multimedia Databases.Multimedia components, Multimedia Hardware, SCSI, IDE, MCI, Multimedia -Tools,presentation tools, Authoring tools .Unit VCompression & Decompression – Multimedia Data & File Format standards :-TIFF, MIDI,JPEG,DIB, MPEG,RTF, – Multimedia I/O technologies - Digital voice and audio – Video image andanimation–Full motion video – Storage and retrievaltechnologies .4. List of Books

SNo TITLE AUTHOR PUBLISHER / EDITION YEAR

1Computer Graphics C

VersionDonald Hearn and M.Pauline Baker

Pearson

Education2003

2Multimedia Systems and

DesignPrabat K Andleigh and Kiran Thakrar PHI Learning 2008

3 Multimedia making it work Tay Vaughan Tata McGraw Hill edition 2007

4 Computer Graphics Amarendra N Sinha & Arun D Udai McGraw Hill publication 2011

5Fundamental of Computer

Graphics and MultimediaMukherjee PHI Learning 2008

5Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 6: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

List of ProgramsList of Programs

Experiment No.

AimDate of

Submission

Signature &

Remarks

1. Write a program to implement DDA line drawing Algorithm.

2. Write a program to implement Bresenhams’ line drawing algorithm.

3. Write a program to implement Bresenhams’ circle drawing algorithm.

4. Write a program to draw an ellipse using Bresenhams’ algorithm.

5. Write a program to perform various transformations on line , square & rectangle.

6. Write a program to implement Cohen Sutherland line clipping algorithm.

7. Write a program to convert a color given in RGB space to it’s equivalent HSV color space

8. Write a program to implement JPEG compression scheme for still images.

9. Write a program to implement text compression algorithm.

10. To perform animation using any animation software.

11.To perform basic operations on image using any image editing software.

6Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 7: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-1

Required Software/ Software Tool

OS:Linux Operating System or Windows Operating System C/C++ TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:-To implement DDA Algorithm for drawing a Line.

Description: To DDA algorithm is an incremental scan conversion method. Here we perform calculations at each step using the results from the preceding step. The characteristic of the DDA algorithm is to take unit steps along one coordinate and compute the corresponding values along the other coordinate. The unit steps are always along the coordinate of greatest change, e.g. if dx = 10 and dy = 5, then we would take unit steps along x and compute the steps along y.

In DDA we need to consider two cases;One is slope of the line less than or equal to one (|m| ≤1) and slope of the line greater than one (m|> 1).

• When |m| ≤ 1 means y2-y1 = x2-x1 or y2-y1 <x2-x1.In both these cases we assume x to be themajor axis. Therefore we sample x axis at unit intervals and find the y values corresponding to each x value. We have the slope equation as

Δ y = m Δ x y2-y1 = m (x2-x1)

In general terms we can say that y i+1 - yi = m(x i+1 - xi ). But here Δ x = 1; therefore the equation reduces to y i+1= yi + m = yi + dy/dx.

• When | m| > 1 means y2-y1> x2-x1 and therefore we assume y to be the major axis. Here we sample y axis at unit intervals and find the x values corresponding to each y value. We have the slope equation as

Δ y = m Δ x y2-y1 = m (x2-x1)

Algorithm :

1. Start.2. Declare variables x,y,x1,y1,x2,y2,k,dx,dy,s,xi,yi and also declare gdriver=DETECT, mode.3. Initialize the graphic mode with the path location in TurboC3 folder.4. Input the two line end-points and store the left end-points in (x1,y1).5. Load (x1, y1) into the frame buffer; that is, plot the first point. put x=x1,y=y1.6. Calculate dx=x2-x1 and dy=y2-y1.7. If abs (dx) > abs (dy), do s=abs(dx).8. Otherwise s= abs(dy).9. Then xi=dx/s and yi=dy/s.10. Start from k=0 and continuing till k<s,the points will be

i. X=x+xi.ii. Y=y+yi.

7Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 8: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

11. Plot pixels using putpixel at points (X,Y) in specified color.12. Close Graph and stop.

Coding:

8Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 9: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Output:-

9Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 10: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-2 Required Software/ Software ToolOS:Linux Operating System or Windows Operating System C/C++TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:-To implement Bresenham ‘s Algorithm for drawing a Line.

Description: Basic Concept:Move across the x axis in unit intervals and at each step choose between two different y coordinates

For example, from position (2, 3) we have to choose between (3, 3) and (3, 4). Wewould like the point that is closer to the original lineSo we have to take decision to choose next point. So next pixels are selected basedon the value of decision parameter p. The equations are given in below algorithm.

Algorithm : 1. Input the two line end-points, storing the left end-point in (x0, y0)2. Plot the point (x0, y0)3. Calculate the constants Δx, Δy, 2Δy, and (2Δy - 2Δx) and get the first value for the decision parameter as:4. At each xk along the line, starting at k = 0, perform the following test. If pk < 0, the next point to plot is (xk+1, yk ) and: Otherwise, the next point to plot is (xk+1, yk+1) and:5.Repeat step 4 (Δx – 1) times

NOTE: The algorithm and derivation above assumes slopes are less than 1. For other slopes

10Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 11: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

we need to adjust the algorithm slightly

Coding:

11Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 12: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Output:-

12Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 13: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-3 Required Software/ Software ToolOS:Linux Operating System or Windows Operating System C/C++TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:-To implement Midpoint Circle drawing Algorithm for drawing a Circle.

Description: Basic Concept:Circles have the property of being highly symmetrical, which is handy when it comes to drawing them on a display screen.

• We know that there are 360 degrees in a circle. First we see that a circle is symmetrical about the axis, so only the first 180 degrees need to be calculated.

• Next we see that it's also symmetrical about the y axis, so now we only need to calculate the first 90 degrees.

• Finally we see that the circle is also symmetrical about the 45 degree diagonal axis, so we only need to calculate the first 45 degrees.

• We only need to calculate the values on the border of the circle in the first octant. The other values may be determined by symmetry.

Bresenham's circle algorithm calculates the locations of the pixels in the first 45 degrees. It assumes that the circle is centered on the origin. So for every pixel (x, y) it calculates, we draw a pixel in each of the eight octants of the circle. This is done till when the value of the y coordinate equals the x coordinate. The pixel positions for determining symmetry are given in the below algorithm.

Algorithm :1. Input radius r and circle centre (xc, yc), then set the coordinates for the first point on the circumference of a circle centred on the origin as:

2. Calculate the initial value of the decision parameter as:

13Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 14: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

3. Starting with k = 0 at each position xk, perform the following test. If pk < 0, the next point along the circle centred on (0, 0) is (xk+1, yk) and:

Otherwise the next point along the circle is (xk+1, yk-1) and:

4. Determine symmetry points in the other seven octants5. Move each calculated pixel position (x, y) onto the circular path centred at (xc, yc) to plot the coordinate values:

6. Repeat steps 3 to 5 until x >= ySymmetric pixel positions:

• putpixel(xc+x,yc-y,GREEN); //For pixel (x,y)• putpixel(xc+y,yc-x, GREEN); //For pixel (y,x)• putpixel(xc+y,yc+x, GREEN); //For pixel (y,-x)• putpixel(xc+x,yc+y, GREEN); //For pixel (x,-y)• putpixel(xc-x,yc+y, GREEN); //For pixel (-x,-y)• putpixel(xc-y,yc+x, GREEN); //For pixel (-y,-x)• putpixel(xc-y,yc-x, GREEN); //For pixel (-y,x)• putpixel(xc-x,yc-y, GREEN); //For pixel (-x,y)

Coding:

14Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 15: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

15Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 16: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Output:

16Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 17: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-4 Required Software/ Software ToolOS:Linux Operating System or Windows Operating System C/C++

TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:- To implement Mid-Point Ellipse drawing Algorithm for drawing an ellipse.

Description: Basic Concept:Midpoint ellipse algorithm is a method for drawing ellipses in computer graphics.This method is modified from Bresenham’s algorithm. The advantage of this modified method is that only addition operations are required in the program loops. This leads to simple and fast implementation in all processors.Let us consider one quarter of an ellipse. The curve is divided into two regions. In region I, the slope on the curve is greater than –1 while in region II less than –1.

Algorithm :1. Set RXSq = RX * RX2. Set RYSq = RY * RY3. Set X = 0 and Y = RY4. Set PX = 0 and PY = 2 * RXSq * Y5. Call Draw Elliplse(XC, YC, X, Y)6. Set P = RYSq – (RXSq * RY) + (0.25 * RXSq) [Region 1]7. Repeat While (PX < PY)8. Set X = X + 19. PX = PX + 2 * RYSq10. If (P < 0) Then11. Set P = P + RYSq + PX12. Else

17Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 18: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

13. Set Y = Y – 114. Set PY = PY – 2 * RXSq15. Set P = P + RYSq + PX – PY[End of If]16. Call Draw Elliplse(XC, YC, X, Y)[End of Step 7 While]17. Set P = RYSq*(X + 0.5)2+RXSq*(Y – 1)2–RXSq*RYSq [Region 2]18. Repeat While (Y > 0)19. Set Y = Y – 120. Set PY = PY – 2 * RXSq21. If (P > 0) Then22. Set P = P + RXSq – PY23. Else24. Set X = X + 125. Set PX + 2 * RYSq26. Set P = P + RXSq – PY + PX[End of If]27. Call Draw Ellipse(XC, YC, X, Y)[End of Step 18 While]28. Exit

Coding:

18Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 19: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

19Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 20: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Output:

20Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 21: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-5 Required Software/ Software ToolOS:Linux Operating System or Windows Operating System C/C++TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:-Write a C-program for performing the basic 2D transformations such as translation, Scaling, Rotation,shearing and reflection for a given 2D object.Description: Basic Concept:We have to perform 2D transformations on 2D objects. Here we perform transformations on a line segment.The 2D transformations are:

1. Translation2. Scaling3. Rotation4. Reflection5. Shear

1. Translation: Translation is defined as moving the object from one position to another position along straight line path.

We can move the objects based on translation distances along x and y axis. tx denotes translation distance along x-axis and ty denotes translation distance along y axis.Translation Distance: It is nothing but by how much units we should shift the object from one location to another along x, y-axis. Consider (x,y) are old coordinates of a point. Then the new coordinates of that same point (x’,y’) can be obtained as follows:

X’=x+txY’=y+ty

We denote translation transformation as P. we express above equations in matrix form as:

2. Scaling: scaling refers to changing the size of the object either by increasing or decreasing. We will increase or decrease the size of the object based on scaling factors along x and y-axis. If (x, y) are old coordinates of object, then new coordinates of object after applying scaling transformation are obtained as:

x’=x*sxy’=y*sy.

21Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 22: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

sx and sy are scaling factors along x-axis and y-axis.

3. Rotation: A rotation repositions all points in an object along a circular path in the plane centered at the pivot point. We rotate an object by an angle theta. New coordinates after rotation depend on both x and y

x’ = xcosθ -y sinθy’ = xsinθ+ ycosθ

or in matrix form:P' = R • P,

R-rotation matrix.

4. Reflection: Reflection is nothing but producing mirror image of an object. Reflection can be done just by rotating the object about given axis of reflection with an angle of 180 degrees

5. Shear:1. Shear is the translation along an axis by an amount that increases linearly with another axis (Y). Itproduces shape distortions as if objects were composed of layers that are caused to slide over each other.

22Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 23: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

2. Shear transformations are very useful in creating italic letters and slanted letters from regular letters.3. Shear transformation changes the shape of the object to a slant position.

4. Shear transformation is of 2 types:a. X-shear: changing x-coordinate value and keeping y constant

x’=x+shx*yy’=y

b. Y-shear: changing y coordinates value and keeping x constantx’=x

y’=y+shy*xshx and shy are shear factors along x and y-axis.

Coding:

23Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 24: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

24Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 25: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Output:

25Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 26: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-6 Required Software/ Software ToolOS:Linux Operating System or Windows Operating System C/C++TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:-Write a program to implement Cohen Sutherland line clipping algorithm.

Description: Basic Concept:This method speeds up the processing of line segments by performing initial tests that reduce the number of intersections that must be calculated. Every line endpoint is assigned to four digit, binary code called region code. Region code identifies the location of the pint relative to the boundaries of the clipping rectangle.

Bit 1: leftBit 2: rightBit 3: belowBit 4: above

Syntaxes & keywords:Drawpoly function is used to draw polygons i.e. triangle, rectangle, pentagon, hexagon etc.Declaration :- void drawpoly( int num, int *polypoints );outtextxy function display text or string at a specified point(x,y) on the screen.Declaration :- void outtextxy(int x, int y, char *string);

For a line segment with endpoints (x1,y1) and (x2,y2) and one or both endpoints outside theclipping rectangle, the parametric representation is,

X = x1+u(x2-x1)

Y= y1+u(y2-y1)

Algorithm:

Step 1: StartStep 2: Get the bottom-left coordinate of view port from the user.Step 3: Get the top-right coordinate of view port from the user.Step 4: Get the coordinates of 1st end point of line from the user.Step 5: Get the coordinates of 2nd endpoint of line from the user.Step 6: Print the region code of the first and second point.Step 7: If the points lie inside the view port, print The line is totally visible.‖Step 8: If the starting point lies outside the view port, print ―The line is invisible.Step 9: If the starting point lies inside the view port and the ending point lies outside the view port, print ―The line is partially visibleStep 10: Clip the line present outside the view port.Step 11: Draw the clipped line present inside the view port.Step 12: Stop

26Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 27: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Coding:

27Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 28: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Output:

28Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 29: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-7 Required Software/ Software ToolOS:Linux Operating System or Windows Operating System C/C++TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:-Write a program to convert a color given in RGB space to it’s equivalent HSV color space.

Description:

The Objective can be achieved by transformed the parameters of HSV to the RGB settings needed for the color monitor. Transformation from HSV parameters to RGB parameters by determining the inverse of the equations in rgbToHsv procedure.Syntaxes & keywords commands for achieving the objective

void hsvtorgb(float h,float s,float v,float *r,float *g,float *b)void rgbtohsv(float r,float g,float b,float *h,float *s,float *v)void hsvtorgb(float h,float s,float v,float *r,float *g,float *b)

Description about the parts of the program with description about the language constructsused for the same. Here passing pointers to (addresses of) r, g, and b - and the function is returning the r,g,b values.

• hue in degrees (360.0)• saturation in percent (0.0 - 1.0)• value/brightness in percent (0.0-1.0)

void rgbtohsv(float r,float g,float b,float *h,float *s,float *v)Here passing pointers to (addresses of) h, s, and v - and the function is returning the h,s,v values

Algorithm:HSV to RGB1. Read the H, S, V values in the range 0 to 1.2. If the value of s is 0 then it is gray scale and the R, G, B becomes the value of V.3. If the value of h is 1.0 then assign h=0 else h=h*6.0 and perform the following

i= floor(h); f=h-i;aa=v*(1-s); bb=v*(1-s*f); cc=v*(1-s*(1f)));

4. Based on the i value assign v, aa, bb ,cc to RGB and display the RGB values.RGB to HSV1. Read the R, G, B values.2. Find the min,max value among the RGB values3. Assign the maximum value to V.4. S value is calculated by (max-min)/max.5. H value is calculated by comparing R, G, and B values to max value.6. Display the H, S and V values.

29Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 30: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Coding:

30Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 31: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

OutPut:

31Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 32: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-8 Required Software/ Software ToolOS:Linux Operating System or Windows Operating System C/C++TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:-Write a program to implement JPEG compression scheme for still images.

Description:

The basic idea behind this method of compression is to treat a digital image as an array ofnumbers i.e., a matrix. Each image consists of a fairly large number of little squares calledpixels.Objective:The main Objective is to reduce irrelevance and redundancy of the image data in order to be able to store or transmit data in an efficient form.How it is being achieved?It can be achieved by using image compression techniques.Syntaxes & keywords commands for achieving the objectiv

• import java.util.zip.*;• FileInputStream()• DeflaterOutputStream

Description about the parts of the program with description about the language constructsused for the same.import java.util.zip.*; - Provides classes for reading and writing the standard ZIP and GZIP file formats.FileInputStream() - FileInputStream is meant for reading streams of raw bytes such as imagedata. For reading streams of characters, consider using FileReader. DeflaterOutputStream - This class implements an output stream filter for compressing data in the"deflate" compression format.

Algorithm1. File input stream class is used to access the input file2. Read the content of the image file and assign to a variable3. write the value to an object4. Repeat the step 3 until end of file.5. Print the size of the compressed image .

32Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 33: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Coding:

33Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 34: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Output:

34Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 35: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-9 Required Software/ Software ToolOS:Linux Operating System or Windows Operating System C/C++TOOLS/APPARATUS: Turbo C or gcc / gprof compiler in linux.

Objective:-Write a program to implement text compression algorithm.

Description:

Run Length Encoding (RLE) is a simple and popular data compression algorithm. It is based on the idea to replace a long sequence of the same symbol by a shorter sequence and is a goodintroduction into the data compression field. For instance, text files with large runs of spaces or tabs may compress well with this algorithm.

Objective:The main Objective is to compress the data without any loss using text compression algorithm.

How it is being achieved?It can be achieved by replace a long sequence of the same symbol by a shorter sequence of asymbol.

Syntaxes & keywords commands for achieving the objectiv• gets(str); used to get the string from the userFileInputStream()

Algorithm:1. Read the message.2. Check the first character with the next character.3. If it is same, then increment the count and check the next character.4. Repeat the step 2 & 3 till reads the null character.5. Display the encoded message

35Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 36: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Coding:

36Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 37: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Output:

37Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 38: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-10 Required Software/ Software ToolOS: Windows Operating System TOOLS/APPARATUS: Adobe Flash Player.

Objective: - To perform animation using any animation software.

Description:

Animation is anything that moves on your screen like a cartoon character. Time sequence of visual images on a scene. It can be achieved by using animation software like Swiss, flash

Algorithm:

Motion Tweening

Step 1: Create an object in the first layer of first key frame.Step 2: Create the last key frame and move the object to it.Step 3: Right click on the first key frame and select create motion tween.Step 4: Play the picture.

Shape Tweening

Step 1: Create an object in the first layer of first key frame.Step 2: Create the last key frame.Step 3: In first key frame’s properties and select shape tween.Step 4: Change the shape of the object at the last frame.Step 5: Play the picture.

Guide Layer

Step 1: Create an object in the first layer of first key frame.Step 2: Create the last key frame and move the object to it.Step 3: Right click on the first key frame and select create motion tween.Step 4: Right click on the object’s layer select add motion guide.Step 5: In motion guide draw your guide line.Step 6: Play the picture.

Masking

Step 1: Create an object in the first layer of first key frameStep 2: Add new layer and draw the shape of the view.Step 3: Add the motion guide to the view tool.

38Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 39: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Step 4: Right click on the second layer (view layer) and select mask.Step 5: Play the picture.

Output

Shape Tweening

Motion Tweening

39Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 40: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Guide Layer

Masking

40Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 41: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Experiment-11 Required Software/ Software ToolOS: Windows Operating System TOOLS/APPARATUS: Adobe Flash Player.

Objective: - To perform basic operations on image using any image editing software.

Description:

Adobe Photoshop is a graphics editing program developed and published by Adobe Systems.Photoshop is a tool that helps design sequences for videos and films by removing the guesswork for film and video professionals.

Procedure:

The Brush Popup PaletteAllow quick, convenient access to a range of standard, preset brushes.

The Brushes PaletteProvides access to a wide variety of options for controlling the appearance and characteristics of brush.

The Pencil ToolUsed to draw free form lines. These draws with the foreground color.

41Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 42: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

The Gradient ToolUsed to color pixels with the foreground color based on tolerance setting.

The Paint Bucket ToolUsed to color pixels with the foreground color on the tolerance setting.

Cropping An ImageDigital editors are used to crop images. Cropping creates a new image by selecting a desired rectangular portion from the image being cropped. The unwanted part of the image is discarded. Image cropping does not reduce the resolution of the area cropped. A primary\ reason for cropping is to improve the image composition in the new image.

Removal of Unwanted ElementsMost image editors can be used to remove unwanted branches, etc., using a "clone" tool.

Image OrientationImage orientation (from left to right): original, -30° CCW rotation, and flipped.

Sharpening And Softening ImagesGraphics programs can be used to both sharpen and blur images in a number of ways, such as unsharp masking or deconvolution.

Editing• Open your project file and create a duplicate.• Crop the image using crop tool.• Change the image size using canvas technique.

Back Ground Changing• Select the area to change the back ground using magic wand tool.• Select the back ground image for your image.• Move the shape of the back ground using marquee tool.• Using selection tool, move the back ground.

Changing Color• Select the area using Lasso tool .• Go to image tab and adjustments and select the Hue / saturation option.• Change the color using RGB mode.

Output

42Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 43: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Results

43Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 44: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Important Viva QuestionsImportant Viva Questions

1. What is scan conversion?A major task of the display processor is digitizing a picture definition given in an application program into a set of pixel-intensity values for storage in the frame buffer. This digitization process is called scan conversion.

2. Write the properties of video display devices?Properties of video display devices are persistence, resolution, and aspect ratio.

3. What is rasterization?The process of determining the appropriate pixels for representing picture or graphics object is known as rasterization.

4. Define Computer graphics.Computer graphics remains one of the most existing and rapidly growing computer fields. Computer graphics may be defined as a pictorial representation or graphical representation of objects in a computer.

5. Name any four input devices.Four input devices are keyboard, mouse, image scanners, and trackball.

44Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 45: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

6. Write the two techniques for producing color displays with a CRT?Beam penetration method, shadow mask method

7. What is vertical retrace of the electron beam?In raster scan display, at the end of one frame, the electron beam returns to the left top corner of the screen to start the next frame, is called vertical retrace of the electron beam.

8. Short notes on video controller?Video controller is used to control the operation of the display device. A fixed area of the system is reserved for the frame buffer, and the video controller is given direct access to the frame buffer memory.

9. What is bitmap?Some system has only one bit per pixel; the frame buffer is often referred to as bitmap.

10. Differentiate plasma panel display and thin film electro luminescent display?In plasma panel display, the region between two glass plates is filled with neon gas. In thin film electro luminescent display, the region between two glasses plates are filled with phosphor, such as zinc sulphide doped with manganese.

11. What is resolution?The maximum number of points that can be displayed without overlap on a CRT is referred to as the resolution.

12. What is horizontal retrace of the electron beam?In raster scan display, the electron beam return to the left of the screen after refreshing each scan line, is called horizontal retrace of the electron beam.

13. What is filament?In the CRT, heat is applied to the cathode by directing a current through a coil of wire, is called filament.

14. What is pixmap?Some system has multiple bits per pixel, the frame buffer is often referred to as pixmap.

15. Write the types of clipping?Point clipping, line clipping, area clipping, text clipping and curve clipping.

16. What is meant by scan code?When a key is pressed on the keyboard, the keyboard controller places a code carry to the key pressed into a part of the memory called as the keyboard buffer. This code is called as the scan code.

17. List out the merits and demerits of Penetration techniques?The merits and demerits of the Penetration techniques are as follows

• It is an inexpensive technique

45Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 46: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

• It has only four colors• The quality of the picture is not good when it is compared to other techniques• It can display color scans in monitors• Poor limitation etc.

18. List out the merits and demerits of DVST?The merits and demerits of direct view storage tubes [DVST] are as follows

• It has a flat screen• Refreshing of screen is not required• Selective or part erasing of screen is not possible• It has poor contrast Performance is inferior to the refresh CRT.

19. What do you mean by emissive and non-emissive displays?The emissive display converts electrical energy into light energy. The plasma panels, thin film electro-luminescent displays are the examples. The Non-emissive are optical effects to convert the sunlight or light from any other source to graphic form. Liquid crystal display is an example.

20. List out the merits and demerits of Plasma panel display?Merits

• Refreshing is not required• Produce a very steady image free of Flicker• Less bulky than a CRT.

Demerits• Poor resolution of up to 60 d.p.i• It requires complex addressing and wiring• It is costlier than CRT.

21. What is persistence?The time it takes the emitted light from the screen to decay one tenth of its original intensity is called as persistence.

22. What is Aspect ratio?The ratio of vertical points to the horizontal points necessary to produce length of lines in both directions of the screen is called the Aspect ratio. Usually the aspect ratio is ¾.

23. What is the difference between impact and non-impact printers?Impact printer press formed character faces against an inked ribbon on to the paper. A line printer and dot-matrix printer are examples.Non-impact printer and plotters use Laser techniques, inkjet sprays, Xerographic process, electrostatic methods and electro thermal methods to get images onto the papers. Examples are: Inkjet/Laser printers.

24. Define pixel?Pixel is shortened forms of picture element. Each screen point is referred to aspixel or pel.

25. What is frame buffer?

46Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 47: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Picture definition is stored in a memory area called frame buffer or refresh buffer.

26. Where the video controller is used?A special purpose processor, which is used to control the operation of the display device, is known as video controller or display controller.

27. What is run length encoding?Run length encoding is a compression technique used to store the intensity values in the frame buffer, which stores each scan line as a set of integer pairs.One number each pair indicates an intensity value, and second number specifies the number of adjacent pixels on the scan line that are to have that intensity value.

28. What is point in the computer graphics system?The point is a most basic graphical element & is completely defined by a pair of user coordinates (x, y).

29. Write short notes on lines?A line is of infinite extent can be defined by an angle of slope q and one point on the line P=P(x,y). This can also be defined as y=mx+C where C is the Yintercept.

30. Define Circle?Circle is defined by its center xc, yc and its radius in user coordinate units.The equation of the circle is (x-xc) + (y-yc) = r2.

31. What are the various attributes of a line?The line type, width and color are the attributes of the line. The line type include solid line, dashed lines, and dotted lines.

32. What is antialiasing?The process of adjusting intensities of the pixels along the line to minimize the effect of aliasing is called antialiasing.

33. What is Transformation?Transformation is the process of introducing changes in the shape size and orientation of the object using scaling rotation reflection shearing & translation etc.

34. What is translation?Translation is the process of changing the position of an object in a straight-line path from one coordinate location to another. Every point (x , y) in the object must undergo a displacement to (x|,y|). the transformation is: x| = x + tx ; y| = y+ty

35. What is rotation?A 2-D rotation is done by repositioning the coordinates along a circular path, in the x-y plane by making an angle with the axes. The transformation is given by: X| = r cos (q + f) and Y| = r sin (q + f).

47Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 48: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

36. What is scaling?A 2-D rotation is done by repositioning the coordinates along a circular path, in the x-y plane by making an angle with the axes. The transformation is given by: X| = r cos (q + f) and Y| = r sin (q + f).

37. What is shearing?The shearing transformation actually slants the object along the X direction or the Y direction as required. ie; this transformation slants the shape of an object along a required plane.

38. What is reflection?The reflection is actually the transformation that produces a mirror imageof an object. For this use some angles and lines of reflection.

39. What are the two classifications of shear transformation?X shear, y shear.

40. A point (4,3) is rotated counterclockwise by an angle of 45°. Find the rotationmatrix and the resultant point.

41. Name any three font editing tools.ResEdit, FONTographer,

42. Differentiate serif and sans serif fonts. Give one exampleSerif fonts has a little decoration at the end of the letter, but serif font has not. Times, new century schoolbook is the examples of serif fonts. Arial, potima are examples for sans serif fonts.

43. Distinguish between window port & view port?A portion of a picture that is to be displayed by a window is known as window port. The display area of the part selected or the form in which the selected part is viewed is known as view port.

44. Define clipping?Clipping is the method of cutting a graphics display to neatly fit a predefined graphics region or the view port

45. What is the need of homogeneous coordinates?To perform more than one transformation at a time, use homogeneous coordinates or matrixes. They reduce unwanted calculations intermediate steps saves time and memory and produce a sequence of transformations.

46. Distinguish between uniform scaling and differential scaling?When the scaling factors sx and sy are assigned to the same value, a uniform scaling is produced that maintains relative object proportions. Unequal values for sx and sy result in a differential scaling that is often used in design application.

47. What is fixed point scaling?

48Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 49: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

The location of a scaled object can be controlled by a position called the fixed point that is to remain unchanged after the scaling transformation.

48. What is Bezier Basis Function?Bezier Basis functions are a set of polynomials, which can be used instead of the primitive polynomial basis, and have some useful properties for interactive curve design.

49. What is surface patchA single surface element can be defined as the surface traced out as two parameters (u, v) take all possible values between 0 and 1 in a two-parameter representation. Such a single surface element is known as a surface patch.

50. Define B-Spline curve?A B-Spline curve is a set of piecewise(usually cubic) polynomial segments that pass close to a set of control points. However the curve does not pass through these control points, it only passes close to them.

51. What is a spline?To produce a smooth curve through a designed set of points, a flexible strip calledspline is used. Such a spline curve can be mathematically described with a piecewisecubic polynomial function whose first and second derivatives are continuous acrossvarious curve section.

52. What are the different ways of specifying spline curve?• Using a set of boundary conditions that are imposed on the spline.• Using the state matrix that characteristics the spline• Using a set of blending functions that calculate the positions along the curve path by specifying combination of geometric constraints on the curve

53. What are the important properties of Bezier Curve?• It needs only four control points• It always passes through the first and last control points• The curve lies entirely within the convex half formed by four control points.

54. Define Projection?The process of displaying 3D into a 2D display unit is known as projection. The projection transforms 3D objects into a 2D projection plane

55. What are the steps involved in 3D transformation?• Modeling Transformation• Viewing Transformation• Projection Transformation• Workstation Transformation

56. What do you mean by view plane?A view plane is nothing but the film plane in camera which is positioned and oriented for a particular shot of the scene.

49Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 50: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

57. Define projection?The process of converting the description of objects from world coordinates to viewing coordinates is known as projection

58. What you mean by parallel projection?Parallel projection is one in which z coordinates is discarded and parallel lines from each vertex on the object are extended until they intersect the view plane.

59. What do you mean by Perspective projection?Perspective projection is one in which the lines of projection are not parallel. Instead, they all converge at a single point called the center of projection.

60. What is Projection reference point?In Perspective projection, the lines of projection are not parallel. Instead, they all converge at a single point called Projection reference point.

61. Define computer graphics animation?Computer graphics animation is the use of computer graphics equipment where the graphics output presentation dynamically changes in real time. This is\ often also called real time animation.

62. What is tweening?It is the process, which is applicable to animation objects defined by a sequence of points, and that change shape from frame to frame.

63. Define frame?One of the shape photographs that a film or video is made of is known as frame.

64. What is key frame?One of the shape photographs that a film or video is made of the shape of an object is known initially and for a small no of other frames called key frame

65. Define MultimediaMultimedia is the use of the computer to present and combine text, graphics, audio and video with links and tools that lets the user to navigate, interact, create and communicate.

66. What is multimedia PC:A multimedia PC is a computer that has a CD-ROM or DVD drive and supports 8-bit and 16-bit waveform audio recording and playback, MIDI sound synthesis, and MPEG movie watching, with a central processor fast enough and a RAM large enough to enable the user to play and interact with these media in real time, and with a hard disk large enough to store multimedia works that the user can create.67. Where to use multimedia?Multimedia improves information relation. Multimedia applications include the following:

• Business• Schools• Home

50Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 51: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

• Public place

68. List out the benefits of multimediaBenefits of multimedia are

• Training• Sales• Communications• Medicines

69. What is hypermedia?A set of documents in which a given document can contain text, graphics video and audio clips as well as embedded references to other documents world wide web pages are hypermedia documents.

70. What is hypertext?Hyper text is an application of indexing text to provide a rapid search of specific text strings in one or more documents. Hypertext is an integral part of hypermedia documents. In multimedia applications, a hypermedia documents is the basic complex object of which text is a sub-object. Other sub-objects in the basic object include images, sound, and full-motion video.

71. List out the building blocks of multimedia.• Text• Image• Sound• Animation, Video

72. What are the main functions of a multimedia development system?Multimedia development system must perform main three functions as follows:

• Input data• Development• Data output

Data input from sources such as cameras or musical instruments, application development, and data output to some delivery medium such as a videodisk or CD-ROM.

73. Define TypefaceTypeface is measured in point sizes, where one point is approximately1/72 of an inch. It is a measure of the height of the metal blocks containing letters.

74. Define the following:(i) X-height (ii) Set (iii) Kerning

(i.)X-height: The X-height is the measurement of the height of the character X, in other words of the middle bit without any ascender or descender.(ii) Set: The width of the letters is called the set and is fixed relative to the point-size.

51Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 52: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

(iii) Kerning: The spaces between letters in one world (tracking) can be adjusted in a process called kerning.

75. Define the following respective to sound:(i) Waveform (ii) Frequency (iii) Amplitudei) WaveformSound is produced by the vibration of matter. During the vibration pressure variation are created in the air surrounding it. The pattern of the oscillation is called a waveform.(ii) FrequencyThe frequency of the sound is the reciprocal value of the period. It represents the number of period s in a second and it is measured in Hertz (Hz) or cycles per second.(iii) AmplitudeA sound also has amplitude. The amplitude of a sound is a measure of the displacement of the air pressure wave from its, or quiescent state.

76. Define quantization (or) resolution?The resolution (or) quantization of a sample value depends on the number of bits used in measuring the height of the waveform. An 8-bit quantization yields 256 possible values, 16-bit CD-qudra quantization results in over 65536 values.

77. What are the types of sound objects that can be used in multimedia production?There are four types of sound objects that can be used in multimedia production:

• Waveform audio• MIDI sound tracks• Compact disc (CD) audio• MP3 files

78. What is MIDI?Musical Instrument Digital Interface (MIDI) is the interface between electronic musical instruments and computers is a small piece of equipment that plugs directly into the computer’s serial port and allows the transmission of music signal. MIDI is considered to be the most compact interface that allows full-scale output.

79. List out the components of MIDI interface.A MIDI interface has two different components:

• Hardware• Data format

Hardware connects the equipment. It specifies the physical connection between musical instruments, stimulate that a port MIDI port is built into an instrument, specifies a MIDI cable and deals with electronic signals t that are sent over the cable.

Data format encodes the information traveling through the hardware MIDI data format includes an instrument –connected data format. The encoding includes, besides the instrument specification, the notion of the beginning and end of a note, basic frequency and sound volume; MIDI data allow an encoding of about 10 octaves, which corresponds to 128 notes.

80. Define the term flicker in video.

52Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]

Page 53: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

A periodic fluctuation of brightness perception is called flicker effect.81. Define Random scan/Raster scan displays?Random scan is a method in which the display is made by the electronic beam which is directed only to the points or part of the screen where the picture is to be drawn.

The Raster scan system is a scanning technique in which the electrons sweep from top to bottom and from left to right. The intensity is turned on or off to light and unlight the pixel.

82. What is an MPC?The MPC computer is not a hardware unit but rather a standard that includes minimum specifications to turn Intel microprocessor-based computers into multimedia computers.

83. List all the MPC standardsThere are currently three MPC standards as follows

• MPC Level 1• MPC Level 2• MPC Level 3

The standards apply not only to desktop computers but also to increasingly more powerful multimedia laptops.

84. What is configuration of MPC level 1 standards?The MPC level 1 minimum standard workstation consisted of a 16MHz 386SX microprocessor, atleast 2MB of RAM, a 30MB Hard disk, a CD-ROM drive, VGA video (16 colors), an 8-bit audio board, speakers and/or headphones, and Microsoft windows software with the Multimedia Extensions package.

85. Write the configuration of MPC level 2 standards.MPC level 2 minimum standard consisted of a 25MHz 486SX microprocessor with atleast 4MB of RAM, a 3.5-inch high density, a 160 MB or larger hard disk drive, and a CD-ROM drive capable of sustained 300k per second transfer rate with CD-DA outputs and volume control, 16-bit sound capability with microphone input, and a color monitor with display resolution of atleast 640X 480 with 65,536(64k) colors.

86. List out the input devices of multimedia.Input devices for a multimedia system are as follows:

• Keyboards• Mouse• Trackball• Touch screen• Magnetic card Encoders and Readers• Graphics Tablets• Scanners• Optical Character Recognition (OCR) devices• Voice Recognition Systems• Digital cameras

87. What is a Video disk?53

Mr. Imran KhanMr. Imran KhanAssociate Professor, Department of IT, OISTAssociate Professor, Department of IT, OIST

Email:[email protected]:[email protected]

Page 54: Cgm Lab Manual

Lab Manual: Computer Graphics & Multimedia Department of Information Technology

Video disk serves as the output of motion pictures and audio. The data are stored in an analog-coded format on the disk. The reproduced data meet the highest quality requirements. Video disk has a diameter of approximately 30cm and stores approximately 2.6 Giga bytes.88. What is synchronization?Integration of the different media is given through a close relation between information units. This is called synchronization.

89. What is meant by Multimedia User Interface?Multimedia user interface is a computer interface that communicates with users multiple media.

90. Define the following terms:(i) Compression Ratio (ii) Image Quality(i) Compression Ratio: The Compression Ratio represents the size of the original image divided by the size of the compressed image.

(ii) Image Quality: Compression ratio typically affects picture quality, the higher the compression ratio, the lower the quality of the decompressed image.

91. What are the higher levels of multimedia communication system (MCS)?The higher layers of the multimedia communication system are divided into two architectural subsystems:

• Application subsystem• Transport subsystem.

92. Define collaborative computing environment?The recent infrastructure of networked workstations and pcs, and the availability of audio and video at these end points, makes it easier to people to cooperate and bridge space and time. In this way, network connectivity and endpoint integration of multimedia provide users with a collaborative computing environment. It is generally known as computer supported cooperative work (CSCW).

93. List out the tools for collaborative computingThe tools used for collaborative computing are as follows:

• Electronic mail• Bulletin boards(e.g. Usenet news)• Screen sharing tools(e.g. show me from sunsoft)• Text-based conferencing systems (e.g. Internet relay chat, CompuServe, America online).• Telephone conference systems.• Conference rooms(e.g. video window from Bellcore)• Video conference systems(e.g.,Mbone tools)

54Mr. Imran KhanMr. Imran Khan

Associate Professor, Department of IT, OISTAssociate Professor, Department of IT, OISTEmail:[email protected]:[email protected]