DEPARTMENT OF INFORMATION TECHNOLOGY DR.NAVALAR NEDUNCHEZHIAYN COLLEGE OF ENGINEERING, THOLUDUR , CUDDALORE DIST.

Size: px
Start display at page:

Download "DEPARTMENT OF INFORMATION TECHNOLOGY DR.NAVALAR NEDUNCHEZHIAYN COLLEGE OF ENGINEERING, THOLUDUR , CUDDALORE DIST."

Transcription

1 CS1357-GRAPHICS AND MULTIMEDIA LABORATORY LABORATORY MANUAL FOR VII SEMESTER B.TECH / IT ACADEMIC YEAR: (ODD) (FOR PRIVATE CIRCULATION ONLY) ANNA UNIVERSITY, CHENNAI. DEPARTMENT OF INFORMATION TECHNOLOGY DR.NAVALAR NEDUNCHEZHIAYN COLLEGE OF ENGINEERING, THOLUDUR , CUDDALORE DIST. 1

2 GENERAL INSTRUCTIONS FOR LABORATORY CLASSES DO S o o o o o o o Without Prior permission do not enter into the Laboratory. While entering into the LAB students should wear their ID cards. The Students should come with proper uniform. Students should sign in the LOGIN REGISTER before entering into the laboratory. Students should come with observation and record note book to the laboratory. Students should maintain silence inside the laboratory. After completing the laboratory exercise, make sure to shutdown the system properly. DONT S o Students bringing the bags inside the laboratory.. o Students wearing slippers/shoes insides the laboratory. o Students using the computers in an improper way. o Students scribbling on the desk and mishandling the chairs. o Students using mobile phones inside the laboratory. o Students making noise inside the laboratory. 2

3 HARDWARE REQUIREMENTS: INTEL PENTIUM 915 GV 80GB SATA II 512MB DDR SOFTWARE REQUIREMENTS: TURBO C3, Photo shop, Flash 5 UNIVERSITY PRACTICAL EXAMINATION Allotment of marks Internal assessment = 20 marks Practical assessment = 80 marks Total = 100 marks INTERNAL ASSESSMENT (20 marks) Staff should maintain the assessment Register and the Head of the Department should monitor it. SPLIT UP OF INTERNAL MARKS Observation = 3 marks Record Note = 7 marks Modal Exam = 5 marks Attendance = 5 marks Total = 20 marks UNIVERSITY EXAMINATION The exam will be conducted for 100 marks. Then the marks will be calculated to 80 marks. SPLIT UP OF PRACTICAL EXAMINATION MARKS Aim and Algorithm = 30 marks Program = 40 marks Output = 20 marks Viva-voce = 10 marks Total = 100 marks

4 LIST OF EXPERIMENTS 1. To implement Bresenham s algorithms for line, circle and ellipse drawing 2. To perform 2D Transformations such as translation, rotation, scaling, reflection and sharing. 3. To implement Cohen Sutherland 2D clipping and window viewport mapping 4. To perform 3D Transformations such as translation, rotation and scaling. 5. To visualize projections of 3D images and Hidden Surface Elimination. 6. To convert between color models. 7. To implement text compression algorithm 8. To implement image compression algorithm 9. To perform animation using any Animation software 10. To perform basic operations on image using any image editing software 4

5 CONTENTS S. No LIST OF EXPRIEMENTS Page Number 1 Bresenham s Line Drawing Algorithm 6 2 Bresenham s Circle Drawing Algorithm 8 3 Bresenhams Ellipse Generation Algorithm D Transformation 13 5 Cohen Sudherland - Line Clipping Algorithm D Transformation 29 7 Projection of 3D Image 34 8 Color Model 37 9 Text Compression and Decompression Image Compression Animation- Shape to Text Morphing Study of Tools in Photoshop 46 Beyond the Syllabus 13 Animation- Vehicle Moving Image Editing 51 5

6 Exercise Number: 1 Title of the Exercise : Bresenham s Line Drawing Algorithm Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT Write a program in C to draw a line using Bresenham s line drawing algorithm. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Name TURBOC3 b) Procedure for doing the experiment: Step Details of the step no. 1 Start the program. 2 Declare the variables and declare the DRAWLINE function. 3 Using input primitive function for detecting and initializing the graph. To give the parameter and using line drawing to draw the line in X-axis and Y 4 axis. 5 In DRAWLINE function, 6 Start the program. 7 Declare the variables and declare the DRAWLINE function. 8 Using input primitive function for detecting and initializing the graph. c) Program: #include<graphics.h> #include<iostream.h> #include<conio.h> #include<math.h> void main() int gd=detect,gm; initgraph(&gd,&gm,"c:\\turboc3\\big"); int x1,x2,y1,y2; int dx,dy,x,y,p,xend; cout<<"enter the value X1"<<endl; cin>>x1; cout<<"enter the value X2"<<endl; cin>>x2; cout<<"enter the value y1"<<endl; cin>>y1; cout<<"enter the value y2"<<endl; cin>>y2; dx=abs(x1-x2); dy=abs(y1-y2); p=2*dy-dx; if(x1>x2) x=x2;y=y2;xend=x1; else 6

7 x=x1;y=y1;xend=x2; putpixel(x,y,100); outtextxy(x1,y1,"(x1,y1)"); outtextxy(x2,y2,"(x2,y2)"); while(x<xend) x=x+1; if(p<0) p=p+2*dy; else y=y+1; p=p+2*(dy-dx); putpixel(x,y,100); getch(); closegraph(); d) Output: ENTER THE VALUE FOR X1 200 ENTER THE VALUE FOR Y1 300 ENTER THE VALUE FOR X2 300 ENTER THE VALUE FOR Y2 400 (x1,y1) (x2,y2) e) Result: Thus the program in c to draw a line using Bresenham s algorithm was executed successfully VIVA QUESTIONS & ANSWERS & ANSWERS 1. What is pixel? Each screen point in a monitor is called a pixel/pel. It is also called picture element. 2. Define aspect ratio. It is a property of video monitors. This number gives the ratio of vertical points to horizontal points necessary to produce equal-length lines in both directions on the screen. 3. What is Output Primitive? Basic geometric structures that describe a scene are referred to as Output Primitives. Points and straight lines segments are the simplest geometric components of pictures. Additional output primitives that can be used to construct a picture include circles and other conic sections, quadric surfaces, spline curves and surfaces, polygon color areas, and character strings. 7

8 Exercise Number: 2 Title of the Exercise : Bresenham s Circle Drawing Algorithm Date of the Exercise : AIM OF THE EXPERIMENT Write a program for drawing a circle in C using mid point circle algorithm. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Name TURBOC3 b) Procedure for doing the experiment: Step Details of the step no. 1 Start the program. 2 Declare the variables and initiate the graph. 3 To read the values of X-axis,Y-axis and radius co-ordinates. 4 Calculate the pixel position(x,y) onto the circular path(x1,y1) Give the condition for drawing a circle whether x is less than y by using WHILE 5 loop. In the loop we put the pixel position in the path by incrementing or decrementing 6 the position. 7 To calculate the value of the parameter by using if loop condition Check whether P is less than zero the X-axis pixel positions are incremented and 8 parameter value also incremented by twice Check whether P is not less than zero X-axis pixel positions are incremented and Y- 9 axis pixel positions are decremented. 10 Finally after finishing the loop condition the pixels are form a circle. 11 Stop the program. c) Program: #include<stdio.h> #include<stdlib.h> #include<math.h> #include<conio.h> #include<graphics.h> void main() int xc,yc,x,y,r,p; int gd=detect,gm; initgraph(&gd,&gm," "); cleardevice(); outtextxy(100,10,"bresenhams CIRCLE GENERATION ALGORITHM"); printf("\n\nenter THE VALUE OF CENTER(XC,YC) AND RADIUS:)"); 8

9 scanf("%d%d%d",&xc,&yc,&r); p=3-2*r;x=0;y=r; while(x<=y) putpixel(xc+x,yc-y,40); putpixel(xc-x,yc+y,40); putpixel(xc-y,yc-x,40); putpixel(xc+y,yc-x,40); if(p<0) p=p+4*x+6; else p=p+4*x-4*y+10;y=y-1; x=x+1; setcolor(12);outtextxy(300,275,"circle"); getch();closegraph(); putpixel(xc+x,yc+y,40); putpixel(xc-x,yc-y,40); putpixel(xc-y,yc+x,40); putpixel(xc+y,yc+x,40); d) Output: ENTER THE VALUE FOR (Xc,Yc)AND RADIUS 100,200,5 e) Result Thus the program in c to draw a circle using bresenham s algorithm was successfully executed VIVA QUESTIONS & ANSWERS 1. What is DDA? The Digital Differential Analyzer is a scan-conversion line algorithm based on calculating either difference in y-coordinate (dy) or difference in x-coordinate. We sample the line at unit intervals in one coordinate and determine corresponding integer values nearest the line path for the other coordinate. 2. What are the disadvantages of DDA algorithm? Round-off error in successive additions of the floating-point increment can cause the calculated pixel positions to drift away from the true line path for long line segments. Rounding operations and floating-point arithmetic in procedure are still time consuming. 9

10 Exercise Number: 3 Title of the Exercise : Bresenhams Ellipse Generation Algorithm Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT Write a program for drawing a ellipse in C using Mid point ellipse algorithm. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W TURBOC3 b) Procedure for doing the experiment: Step Details of the step no. 1 Start the program. 2 Declare the variables and initiate the graph. 3 To read the values of X-axis,Y-axis and radius co-ordinates. 4 Calculate the pixel position(x,y) onto the circular path(x1,y1) Give the condition for drawing a circle whether x is less than y by using WHILE 5 loop. In the loop we put the pixel position in the path by incrementing or decrementing 6 the position. 7 To calculate the value of the parameter by using if loop condition Check whether P is less than zero the X-axis pixel positions are incremented and 8 parameter value also incremented by twice Check whether P is not less than zero X-axis pixel positions are incremented and Y- 9 axis pixel positions are decremented. 10 Finally after finishing the loop condition the pixels are form a circle. 11 Stop the program. c) Program: #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> #include<dos.h> void main() long int d1,d2,rx,ry,rxsq,rysq,tworxsq,tworysq,dx,dy; 10

11 int i,gd=detect,gm,x,y; printf("\nenter THE RADIUS OF X AND Y OF THE ELLIPSE\n"); scanf("%ld%ld",&rx,&ry); initgraph(&gd,&gm," "); rxsq=rx*rx; rysq=ry*ry; tworxsq=2*rxsq; tworysq=2*rysq; x=0; y=ry; y-ry; d1=rysq-(rxsq*ry)+(0.25*rxsq); dx=tworysq*x; dy=tworxsq*y; do putpixel(200+x,200+y,15); putpixel(200-x,200-y,15); putpixel(200+x,200-y,15); putpixel(200-x,200+y,15); if(d1<0) x=x+1; y=y; dx=dx+tworysq; d1=d1+dx+rysq; else x=x+1; y=y-1; dx=dx+tworysq; dy=dy-tworxsq; d1=d1+dx-dy+rysq; delay(50); while(dx<dy); d2=rysq*(x+0.5)*(x+0.5)+rxsq*(y-1)*(y-1)-rxsq*rysq; do putpixel(200+x,200+y,15); putpixel(200-x,200-y,15); putpixel(200+x,200-y,15); putpixel(200-x,200+y,15); if(d2>0) x=x; 11

12 y=y-1; dy=dy-tworxsq; d2=d2-dy+rxsq; else x=x+1;y=y-1; dx=dx-tworysq; dy=dy-tworxsq; d2=d2+dx-dy+rxsq; delay(50); while(y>0); getch(); closegraph(); d) Output: Enter the values of x radius and y radius: e) Result Thus the program in c to draw a ellipse using bresenham s algorithm was successfully executed VIVA QUESTIONS & ANSWERS 1. What are the basic lines attributes? Basic attributes of a straight line segment are its type, its width, and its color. 2. What is meant by aliasing? The distortion of information due to low frequency sampling (Under sampling) is called aliasing. We can improve the appearance of displayed raster lines by applying antialiasing methods that compensate for the under sampling process. 12

13 Exercise Number: 4 Title of the Exercise : 2D Transformation Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT Write a program in C to draw and manipulate the polygon in two dimensions. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 b) Procedure for doing the experiment: Step no. 1 Start the program. 2 Operating System Windows XP 3 S/W TURBOC3 Details of the step 2 Declare the variables and detect the graph variables. 3 Draw the polygon and transform the image from the original image using the array. 4 Using the for loop get the polygon variables. 5 Whether the function of the menu() is less than and construct the polygon in different manner by using SWITCH statement. 6 In case 1,transform the polygon by given input length from the original image. 7 In case 2,rotate the polygon using the given angle and looping statement from the original image. 8 In case 3,to scale the polygon from the original image by given input. 9 Menu() function give the menu options. 10 Stop the program. c) Program: #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> #define PI void triangle(int,int,int,int,int,int) 13

14 main() int gd=detect,gm,tx,ty,angle,x1=100,y1=100,x2=150,y2=50,x3=200,y3=100,xr,yr,i,x,y,x0,y0; char ch='0',opt; double ang,a; initgraph(&gd,&gm," "); while(ch!='6') cleardevice(); x1=250;y1=250;x2=300;y2=200;x3=350;y3=250; outtextxy(290,170,"menu"); outtextxy(250,180,"translation"); outtextxy(250,190,"scaling"); outtextxy(250,200,"rotation"); outtextxy(250,210,"reflection"); outtextxy(250,220,"shearing"); outtextxy(250,230,"exit"); outtextxy(250,20,"enter THE OPTION:"); ch=getch(); x=getmaxx(); y=getmaxy(); x0=x/2;y0=y/2; switch(ch) case 1: cleardevice(); outtextxy(20,20,"enter TX AND TY VALUE:"); moveto(250,250); scanf("%d%d",&tx,&ty); triangle(x1,y1,x2,y2,x3,y3); triangle(x1+tx,y1+ty,x2+tx,y2+ty,x3+tx,y3+ty); getch(); break; case 2: cleardevice(); triangle(x1,y1,x2,y2,x3,y3); outtextxy(50,40,"enter SX AND SY:"); scanf("%d%d",&tx,&ty); outtextxy(50,60,"1.scaling W.R.T.ORGIN"); outtextxy(50,80,"2.scaling W.R.T.FIXED POINFT"); outtextxy(50,90,"enter YOUR OPTIon:"); opt=getch(); cleardevice(); triangle(x1,y1,x2,y2,x3,y3); if(opt=='1'); 14

15 if(tx<3&&ty<3) triangle((x1*tx)-x0+100,(y1*ty)-y0+100,(x2*tx)-x0+100,(y2*ty)-y0+100,(x3*tx)- x0+100,(y3*ty)-y0+100); else if(tx==3&&ty==1) triangle((x1*tx)-x0-100,(y1*ty)-y0+100,(x2*tx)-x0-100,(y2*ty)-y0+100,(x3*tx)-x0-100,(y3*ty)- y0+100); else if(tx<5&&ty<5) trianlge((x1*tx)-x0+100,(y1*ty)-y0-100,(x2*tx)-x0+100,(y2*ty)-y0-100,(x3*tx)- x0+100,(y3*ty)-y0-100); else xr=x1; yr=y1; triangle(xr+(x1*xr)*tx,yr+(y1-yr)*ty,xr+(x2-xr)*tx,yr+(y2-yr)*ty,xr+(x3-xr)*tx,yr+(y3-yr)*ty); getch(); break; case 3: clearedevice(); outtextxy(50,20,"\nenter THE ANGLE:"); scanf("%lf",&a); ang=pi*(a/180); opt=2; cleardevice(); triangle(x1,y1,x2,y2,x3,y3); xr=x1; yr=y1; triangle(xr+(x1-xr)*cos(ang)-(y1-yr)*sin(ang),yr+(x1-xr)*sin(ang)+(y1-yr)*cos(ang),xr+(x2- xr)*cos(ang)-(y2-yr)*sin(ang),yr+(x2-xr)*sin(ang)+(y2-yr)*cos(ang),xr+(x3-xr)*cos(ang)-(y3- yr)*sin(ang),yr+(x3-xr)*sin(ang)+(y3-yr)*cos(ang)); getch(); break; case 4: cleardevice(); x1=100;y1=100;x2=150;y2=50;x3=200;y3=100; outtextxy(20,20,"menu"); outtextxy(20,30,"1.w.r.t X AXIS"); outtextxy(20,40,"2. W.R.T Y AXIS"); outtextxy(20,60,"option"); opt=getch(); cleardevice(); line(x/2,0,x/2,y); line(0,y/2,x,y/2); if(opt='1' opt='2') 15

16 triangle(x0+x1,y0-y1,x0+x2,y0-y2,x0+x3,y0-y3); switch(opt) case 1: triangle(x0+x1,y0+y1,x0+x2,y0+y2,x0+x3,y0-y3);break; case 2: triangle(x0-x1,y0-y1,x0-x2,y0-y2,x0-x3,y0-y3); break; getch(); break; case 5: cleardevice(); outtextxy(50,60,"1. SHIFT X VALUES"); outtextxy(50,80,"2. SHIFT Y VALUES"); outtextxy(50,90,"enter YOUR OPTION"); opt=getch(); if(opt=='1') x1=50;y1=100;x2=100;y2=50;x3=150;y3=100; outtextxy(50,90,"enter THE X VALUE TO SHEAR:"); scanf("%d",&tx); cleardevice(); triangle(x1,y1,x2,y2,x3,y3); triangle(x1+tx*y1,y1,x2+tx*y2,y2,x3+tx*y3,y3); else x1=100;y1=50;x2=150;y2=20;x3=200;y3=50; outtextxy(50,90,"enter THE Y VALUE TO SHEAR:"); scanf("%d",&ty); cleardevice(); triangle(x1,y1,x2,y2,x3,y3); triangle(x1+tx*y1,y1,x2+tx*y2,y2,x3+tx*y3,y3); getch(); break; closegraph(); void triangle(int x1,int y1,int x2,int y2,int x3,int y3) outtextxy(x1,y1,"x1"); outtextxy(x2,y2,"x2"); outtextxy(x3,y3,"x3"); line(x1,y1,x2,y2); 16

17 line(x1,y1,x3,y3); line(x2,y2,x3,y3); d) Output: MENU 1. TRANSLATION 2. SCALING 3. ROTATION 4. REFLECTION 5. SHEARING 6. EXIT ENTER THE OPTION: 1 ENTER TX AND TY VALUE X1 X1 X1 X3 ENTER THE OPTION: 2 ENTER SX AND SY: SCALING W.R.T ORGIN 2. SCALING W.R.T FIXED POINT OPTION: 1 X2 X3 X2 X2 X1 X3 X3 17

18 ENTER THE OPTION: 2 ENTER SX AND SY: SCALING W.R.T ORGIN 2. SCALING W.R.T FIXED POINT X1 OPTION: 2 X2 X1 X3 X1 X3 ENTER THE OPTION: 3 ENTER THE ANGLE: 90 X1 X3 X2 X3 X2 X1 ENTER THE OPTION: 4 MENU 1. W.R.T X AXIS 2. W.R.T Y AXIS OPTION: 1 ENTER THE OPTION: 4 18

19 MENU 1. W.R.T X AXIS 2. W.R.T Y AXIS OPTION: 2 X1 X1 X3 X2 X3 X2 ENTER THE OPTION: 5 1. SHIFT X VALUES 2. SHIFT Y VALUES OPTION: 1 ENTER X VALUE TO SHEAR: 5 X1 X1 X3 X2 X3 X2 ENTER THE OPTION: 5 19

20 1. SHIFT X VALUES 2. SHIFT Y VALUES OPTION: 2 ENTER Y VALUE TO SHEAR: 3 X1 X1 X2 X2 X3 X3 e) Result Thus the program line clipping using c was successfully completed. VIVA QUESTIONS & ANSWERS 1. Define Translation. A translation is applied to an object by repositioning it along a straight line path from one coordinate location to another. We translate a two-dimensional point by adding translation distances, tx and ty, to original coordinate position (x, y) to move the point toa new position (x', y'). x' = x + tx, y' = y + ty. The translation distance pair (tx, ty ) is called a translation vector or shift vector. 2. Define Rotation. A 2-D rotation is applied to an object by repositioning it along a circular path in the xy plane. 3. Define Scaling. A scaling transformation alters the size of an object. This operation can be carried out for polygons by multiplying the coordinate values (x,y) of each vertex by scaling factors sx and sy to produce the transformed coordinates ( x', y' ). x' = x. sx, y' = y. sy. 4. Define Reflection. A Reflection is a transformation that produces a mirror image of an object. The mirror image for a 2D reflection is generated relative to an axis of reflection by rotatingthe object 180 degree about the reflection axis. 20

21 Exercise Number: 5 Title of the Exercise : Cohen Sudherland and Line Clipping Algorithm Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT Write a program in C to draw and line clipping and window -view port mapping.. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Turboc3 b) Procedure for doing the experiment: Step Details of the step no. 1 Start the program. 2 Declare the variables and detect the graph variables. 3 Draw the line clipping and window-viewport mapping.. 4 Using the for loop get the polygon variables. Whether the function of the menu() is less than and construct 5 the polygon in different manner by using SWITCH statement. In case 1,transform the polygon by given input length from 6 the original image. In case 2,rotate the polygon using the given angle and looping statement from the 7 original image. In case 3,to scale the polygon from the original image by given 8 input 9 Menu() function give the menu options. 10 Stop the program c) Program: #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> #include<stdlib.h> typedef struct coord 21

22 int x,y; char code[4]; PT; void drawwindow(); void drawline(pt p1,pt p2,int c1); PT setcode(pt p); int visibility(pt p1,pt p2); PT resetendpt(pt p1,pt p2); void main() int gd=detect,gm,v; PT p1,p2,ptemp; initgraph(&gd,&gm," "); cleardevice(); printf("\n\ncohen SUDHERLAND AND LINE CLIPPING ALGORITHM\n\n\n"); printf("\n\nenter THE TWO END POINTS P1(X,Y):\n\n"); scanf("%d%d",&p1.x,&p1.y); printf("\n\nenter THE TWO END POINTSp2(X,Y):\n\n"); scanf("%d%d",&p2.x,&p2.y); cleardevice(); printf("\n\nclipping WINDOW"); drawwindow(); getch(); printf("\n\ncohen SUTHERLAND LINE CLIPPING ALGORITHM\n\n"); printf("\n\t\t BEFORE CLIPPING"); drawline(p1,p2,4); getch(); p1=setcode(p1); p2=setcode(p2); v=visibility(p1,p2); switch(v) case 0: cleardevice(); drawwindow(); drawline(p1,p2,15); break; case 1: cleardevice(); drawwindow(); break; case 2: cleardevice(); p1=resetendpt(p1,p2); p2=resetendpt(p2,p1); drawwindow(); printf("\ncohen SUTHERLAND CLIPPING ALGORITHM"); 22

23 printf("\n \t\t AFTER CLIPPING\n\n"); drawline(p1,p2,15); break; getch(); closegraph(); void drawwindow() setcolor(red); setlinestyle(dotted_line,1,1); line(150,100,100,100); line(150,100,150,50); line(450,100,500,100); line(450,100,450,50); line(450,350,500,350); line(450,350,450,400); line(150,350,150,400); line(150,350,100,350); line(150,100,100,100); line(150,100,150,50); setlinestyle(solid_line,1,1); line(150,100,450,100); line(450,100,450,350); line(450,350,150,350); line(150,350,150,100); outtextxy(450,30,"1001"); outtextxy(470,200,"1000"); outtextxy(470,370,"1010"); outtextxy(300,370,"0010"); outtextxy(120,370,"0110"); outtextxy(120,200,"0100"); outtextxy(120,30,"0101"); outtextxy(300,30,"0001"); outtextxy(300,200,"0000"); void drawline(pt p1,pt p2,int c1) setcolor(c1); line(p1.x,p1.y,p2.x,p2.y); PT setcode(pt p) PT ptemp; if(p.y<100) ptemp.code[0]='1'; else ptemp.code[0]='0'; if(p.y>350) ptemp.code[1]='1'; else ptemp.code[1]='0'; if(p.x>200) ptemp.code[2]='1'; else ptemp.code[2]='0'; if(p.x<150) ptemp.code[3]='1'; 23

24 else ptemp.code[3]='0'; ptemp.x=p.x; ptemp.y=p.y; return(ptemp); int visibility(pt p1,pt p2) int i,flag=0; for(i=0;i<4;i++) if((p1.code[i]!='0') (p2.code[i]!='0')) flag=1; if(flag==0) return 0; for(i=0;i<4;i++) if((p1.code[i]==p2.code[i])&&(p1.code[i]=='1')) flag=0; if(flag==0) return(1); return(2); PT resetendpt(pt p1,pt p2) PT temp; int x,y,i; float m,k; if(p1.code[3]=='1') x=150; if(p1.code[2]=='1') x=450; if((p1.code[3]=='1') (p1.code[2]=='1')) m=(float)(p2.y-p1.y)/(p2.x-p1.x); k=(p1.y+(m*(x-p1.x))); temp.y=k; temp.x=x; for(i=0;i<4;i++) temp.code[i]=p1.code[i]; if(temp.y<=350&&temp.y>=100) return(temp); if(p1.code[0]=='1') 24

25 y=100; if(p1.code[1]=='1') y=350; if((p1.code[0]=='1') (p1.code[1]=='1')) m=(float)(p2.y-p1.y)/(p2.x-p1.x); k=(float)(p1.x+(float)(y-p1.y)/m); temp.y=y; temp.x=k; for(i=0;i<4;i++) temp.code[i]=p1.code[i]; return(temp); else return(p1); return(p2); WINDOW-TO-VIEWPORT TRANSFORMATION #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> void main() int xwmin,ywmax,ywmin,xwmax,xv1,yv1,xvmin,yvmin,xvmax,yvmax,xw, yw,xv,yv; int gd=detect,gm; initgraph(&gd,&gm," "); printf("\n ENTER THE WINDOW COORDINATES:\n\n\n"); printf("\n\nxwmin\n\n"); scanf("%d",&xwmin); printf("\n\nxwmax\n\n"); scanf("%d",&xwmax); printf("\n\nywmin\n\n"); scanf("%d",&ywmin); printf("\n\nywmax\n\n"); scanf("%d",&ywmax); line(xwmin-25,xwmin-25,xwmin-25,ywmax+50); line(xwmin-40,ywmax+25,xwmax+50,ywmax+25); outtextxy(xwmin+5,ywmax+5,"window");; line(xwmin,ywmin,xwmin,ywmax); line(xwmin,ywmax,xwmax,ywmax); line(xwmax,ywmax,xwmax,ywmin); line(xwmax,ywmin,xwmin,ywmin); 25

26 d) Output: xv=xwmax/2; xvmin=xwmin/2; yvmin=ywmin/2; yvmax=ywmax/2; line(xvmin+275,xvmin+275,xvmin+275,ywmax+325); line(xvmin+255,yvmax+315,xvmax+325,yvmax+315); outtextxy(xvmin+305,yvmax+305,"view PORT"); line(xvmin+300,yvmin+300,xvmin+300,yvmax+300); line(xvmin+300,yvmax+300,xvmax+300,yvmax+300); line(xvmax+300,yvmax+300,xvmax+300,yvmin+300); line(xvmax+300,yvmin+300,xvmin+300,yvmin+300); xw=xwmin+50; yw=ywmin+50; putpixel(xw,yw,13); xv1=(xvmax-xvmin)/(xwmax-xwmin)*(xw-xwmin); xv=xv1+xvmin; yv1=((yvmax-yvmin)/(ywmax-ywmin))*(yw-ywmin); yv=yv1+yvmin; putpixel(xv+325,yv+325,13); getch(); closegraph(); ENTER THE TWO END POINTS P1(X,Y): ENTER THE TWO END POINTS P1(X,Y): CLIPPING WINDOW

27 BEFORE CLIPPING AFTER CLIPPING WINDOW-VIEW PORT MAPPING OUTPUT ENTER THE COORDINATES XWMIN: 100 XWMAX: 200 YWMIN: 100 YWMAX: 200 WINDOW 27

28 VIEW PORT e) Result Thus the program window-viewport mapping using c was successfully completed. VIVA QUESTIONS & ANSWERS 1. Define Window. A world-coordinate area selected for display is called a window. 2. Define view port. An area on a display device to which a window is mapped is called a view port. 3. What is viewing transformation? The mapping of a part of a world-coordinate scene to device coordinates is referred to as viewing transformation. 4. Define Clipping. Any procedure that identifies those portions of a picture that are either inside or outside of a specified region of space is referred to as a clipping algorithm or simply clipping. The region against which an object is clipped is called a clip window. 5. What are the types of Clipping? Point clipping Line clipping Area clipping Curve clipping Text clipping 28

29 Exercise Number: 6 Title of the Exercise : 3D Transformation Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT To write a program in C to draw a 3D transformation. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Turboc3 b) Procedure for doing the experiment: Step no. 1 start the program. 2 Read the variables x1,y1,x2,y2,d,a,op. Details of the step 3 Get the choice of an action to be performed, whether translation,scaling,rotation using switch case structure. 4 Read the translation factor &scaling,factor for t&s. 5 Read the x,ycordinates 5.1.Read the angle value. 5.2.To calculate x1,y1,x2,y2 values using the formula x1=x+(x1-x)*cos(a)-(y1-y)*sin(a); y1=y+(x1-x)*sin(a)+(y1-y)*cos(a); x2=x+(x2-x)*cos(a)-(y2-y)*sin(a); y2=y+(x2-x)*sin(a)+(y2-y)+cos(a); 6 Stop the program. c) Program: #include<stdio.h> #include<conio.h> #include<dos.h> #include<graphics.h> #include<stdlib.h> 29

30 #include<math.h> void main() int gd=detect,gm,mx,my,cont=0,ch; int sx,sy,tx,ty,angle,a,b; int xa,xb,ya,yb,xa1,ya1,xb1,yb1,xa2,ya2,xb2,yb2,xa3,ya3,xb3,yb3; initgraph(&gd,&gm," "); cleardevice(); mx=100;my=200;xa=mx-50;xb=mx+50;ya=my-50;yb=my+50; setfillstyle(empty_fill,9); do cleardevice(); printf("\n WHAT DO U WANT TO PERFORM?\n 1.TRANSLATION\n 2.SCALING \n 3.ROTATION\n"); printf("enter your option\n"); scanf("%d",&ch); switch(ch) case 1: printf("\n Enter the translation value tx:\n"); scanf("%d",&tx); printf("\n Enter the translation value ty:\n"); scanf("%d",&ty); xa1=xa+tx; xb1=xb+tx; ya1=ya+ty; yb1=yb+ty; cleardevice(); setfillstyle(line_fill,3); bar3d(xa,ya,xb,yb,25,1); setfillstyle(line_fill,13); bar3d(xa1,ya1,xb1,yb1,25,1); getch(); break; case 2: printf("\n Enter the scaling value sx:\n"); scanf("%d",&sx); printf("\n Enter the scaling value sy:\n"); scanf("%d",&sy); xa2=xa*sx; xb2=xb*sx; ya2=ya*sy; yb2=yb*sy; cleardevice(); setfillstyle(line_fill,3); bar3d(xa,ya,xb,yb,10,1); 30

31 setfillstyle(line_fill,10); bar3d(xa2,ya2,xb2,yb2,10,1); getch();break; case 3: printf("enter the rotation angle\n"); scanf("%d",&angle); a=xb+50; b=yb+50; xa3=a+((xa-a)*cos(angle))-((ya-b)*sin(angle)); ya3=b+((xa-a)*sin(angle))+((ya-b)*cos(angle)); xb3=a+((xb-a)*cos(angle))-((yb-b)*sin(angle)); yb3=b+((xb-a)*sin(angle))-((yb-b)*cos(angle)); cleardevice(); setfillstyle(line_fill,1); bar3d(xa,ya,xb,yb,50,1); setfillstyle(line_fill,5); bar3d(xa3,ya3,xb3,yb3,50,1); getch();break; cleardevice(); printf("\n WANT TO CONTINUE YES(0)/NO(1):"); scanf("%d",&cont); while(cont==0); getch(); closegraph(); d) Output: WHAT DO U WANT TO PERFORM? 1.TRANSLATION 2.SCALING 3.ROTATION ENTER UR OPTION: 1 ENTER THE TRANSLATION VALUE TX: 200 ENTER THE TRANSLATION VALUE TY: 200 WANT TO CONTINUE YES (0)/NO (1):0 WHAT DOES U WANT TO PERFORM? 31

32 ENTER UR OPTION: 2 ENTER THE SCALING VALUE SX: 2 ENTER THE SCALING VALUE SY: 2 WANT TO CONTINUE YES (0)/NO (1):0 ENTER UR OPTION: 3 3D PROJECTION OUTPUT ENTER THE TOP-LEFT AND BOTTOM RIGHT CORNER: ENTER THE DEPTH ALONG Z AXIS: 20 MENU: 1. PARALLEL PROJECTION 2. PRESPECTIVE PROJECTION 3. EXIT ENTER UR OPTION: 1 TOP VIEW SIDE VIEW 32

33 FRONT VIEW MENU: 1. PARALLEL PROJECTION 2. PRESPECTIVE PROJECTION 3. EXIT ENTER UR OPTION: 2 PRESPECTIVE PROJECTION e) RESULT Thus the c program to perform 3D transformation was successfully completed. VIVA QUESTIONS & ANSWERS 1. What is projection? The process of displaying 3D objects on a 2D display is called as Projection 2. What are the types of projection? Perspective projection Parallel projection 3. What is parallel projection? In a parallel projection, coordinate positions are transformed to the view plane along parallel lines. 4. What is Perspective projection? For a perspective projection object positions are transformed to the view plane along lines that converge to a point called the projection reference point 33

34 Exercise Number: 7 Title of the Exercise : Projection of 3D Image Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT Write a c program to perform projection of 3D image. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W TURBOC3 b) Procedure for doing the experiment: Step Details of the step no. 1 Start the program. 2 Declare the variables using structure. 3 Create the function and get the function using create() function. 4 Get the coordinates and assign the values for the coordinates. 5 Define the drawcube() function. 6 Using rotate() function, rotation is performed. 7 End the program. c) Program: #include<stdio.h> #include<conio.h> #include<graphics.h> void fun(int xm,int ym,int xma,int yma,int x1,int y1,int x2,int y2) rectangle(xm,ym,xma,yma); rectangle(x1,y1,x2,y2); line(xm,ym,x1,y1); line(xm,yma,x1,x2); line(xma,yma,x1,y2); line(xma,ym,x2,y1); getch(); void main() int x1,y1,x2,y2,xm,ym,xma,yma,dep,ch,d; int gd=detect,gm; initgraph(&gd,&gm," "); printf("\n enter the TOP-LEFT and BOTTOM-RIGHT CORNER:"); scanf("%d%d%d%d",&xm,&ym,&xma,&yma); printf("\n Enter the depth along z axis:"); 34

35 scanf("%d",&dep); cleardevice(); d=dep/2;x1=xm+d;y1=ym-d;x2=xma+d;y2=yma-d; fun(xm,ym,xma,yma,x1,y1,x2,y2); do cleardevice(); outtextxy(20,20,"menu"); outtextxy(20,30,"..."); outtextxy(20,40,"1.parallel PROJECTION"); outtextxy(20,50,"2.prespective PROJECTION"); outtextxy(20,60,"3.exit"); outtextxy(20,70,"enter THE OPTION"); scanf("%d",&ch); switch(ch) case 1: rectangle(xma+100,ym+100,xma+100+dep,yma); outtextxy(xma+150,(ym+10+yma)/2,"slide SHOW"); rectangle(xm,ym+150,xma,yma+150); outtextxy(xm+20,(ym+yma)/2+250,"front VIEW"); outtextxy(xm+20,(ym+yma)/2+20,"to VIEW"); rectangle(xm,ym,xma,xm+dep); getch(); break; case 2: fun(xm/2,ym/2,xma/2,yma/2,x1/2,y1/2,x2/2,y2/2); break; cleardevice(); while(ch==1 ch==2);closegraph(); d) Output: ENTER THE TOP-LEFT AND BOTTOM RIGHT CORNER: ENTER THE DEPTH ALONG Z AXIS: 20 35

36 MENU: 1. PARALLEL PROJECTION 2. PRESPECTIVE PROJECTION 3. EXIT ENTER UR OPTION: 1 TOP VIEW SIDE VIEW FRONT VIEW ENTER UR OPTION: 2 PRESPECTIVE PROJECTION e) Result Thus the c program for visualizing projections of 3D images using graphics was successfully executed. VIVA QUESTIONS & ANSWERS 1. What Boundary representation? It describes a 3D object as a set of surfaces that separate the object interior from the environment. e.g. polygon facets and spine patches. 2. What space-partitioning representation? This is used to describe interior properties, by partitioning the spatial region containing an object in to a set of small, non-overlapping, contiguous solids. e.g.octree. 3. What is Perspective projection? For a perspective projection object positions are transformed to the view plane along lines that converge to a point called the projection reference point. 36

37 Title of the Exercise : Color Model Date of the Exercise : Exercise Number: 8 OBJECTIVE (AIM) OF THE EXPERIMENT Write a c program to convert between color models. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Turboc3 b) Procedure for doing the experiment: Step Details of the step no. 1 Start the program. 2 Declare the variables using structure. 3 Create the function and get the function using create() function. 4 Get the coordinates and assign the values for the coordinates. 5 Define the drawcube() function. 6 Using rotate() function, rotation is performed. 7 End the program. c) Program: #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> #include<math.h> void main() int i,j,a,b,c,d,p,q,r,s; int gd=detect,gm; initgraph(&gd,&gm," "); printf("\n enter the color coordinates in RGB:"); scanf("%d%d%d%d",&p,&q,&r,&s); a=1-p; b=1-q; c=1-r; 37

38 d=1-s; i=(8*p)+(4*q)+(2*r)+(1*s); if(i==0 i==1) i= (8*a)+(4*b)+(2*c)+(1*d); else i=(4*b)+(2*c)+(1*d); outtextxy(100,50,"rgb COLOR IS:"); setcolor(i); outtextxy(100,100,"(rgb)"); setcolor(6); delay(400); setcolor(j); printf("\ncmy COLOR is:"); outtextxy(150,150,"(cmy)"); getch(); closegraph(); d) Output: ENTER THE COLOR COORDINATES: RGB COLOR IS RED (RGB) THE CMY COLOR IS (CMY) e) Result Thus the c program to convert between color models was successfully completed. VIVA QUESTIONS & ANSWERS 1. What is chromaticity? The term chromaticity is used to refer collectively to the two properties describing color characteristics: Purity and dominant frequency. 2. Define Color model. A Color model is a method for explaining the properties or behavior of color within some particular context. 3. What are the uses of chromaticity diagram? The chromaticity diagram is useful for the following: Comparing color gamut s for different sets of primaries. Identifying complementary colors. Determining dominant wavelength and purity of a given color. 38

39 Exercise Number: 9 Title of the Exercise : Text Compression and Decompression Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT Write a program in Java for text compression and decompression. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Jdk1.5 b) Procedure for doing the experiment: Step Details of the step no. 1 Declare the header files and required variables. 2 Using the file input stream get the input datas. 3 Using GZIP print the output in another file. 4 Check the input data and write it in output file 5 The compression takes place after this condition 6 Close the file and else print error. 7 Halt the program 8 Likewise decompression also takes place. 9 the output file of compression is input for decompression 10 Halt the program c) Program: import java.io.*; import java.net.*; import java.util.zip.*; public class compress1 public static void main(string args[]); 39

40 try int n; File InputStream in=new FileInputStream ( input.txt ); CZIPOutputStream out=new CZIPOutputStream(new FileOutputStream( output1.txt )); Byte b -now byte 1024 ; While(n=in.read(b,0,100))!=1) out.write(b,0,n); out.close(); System.Out.Println( Compression successfully ); catch(exception e) System.Out.Println(e); TEXT DECOMPRESSION import java.io.*; import java.net.*; import java.util.zip.*; public class decompress1 public static void main(string args[]) try int n; FileOutputStream out=new FileOutputStream( output2.txt ); CZIPInputStream in=new CZIPInputStream(new FileInputStream( Output1.txt )); Bytee b -now byte 1024 ; While((n=in.read(b,0,100))!=1) out.write(b,0,n); out.close(); System.Out.Println( decompression successfully ); catch(exception e) 40

41 d) Output: System.Out.Println(e); ENTER THE STRING: GRAPHICS G 000 R 001 A 010 P 011 H 100 I 101 C 110 S 111 e) Result Thus the java program for text compression and decompression was compiled and executed successfully. VIVA QUESTIONS & ANSWERS 1. Define Cadence. Cadence is a term used to define the regular rise and fall in the intensity of sound. 2. Say some loss less compression standards? Pack bits encoding, CCITT Group3 1D, CCITT Group3 2D, CCITT Group4, Lembel-Ziv and Welch algorithm LZW. 3. Say some lossy compression standards? JPEG (Joint photographic Experts Group), MPEG (Moving Picture Experts Group), Intel DVI, CCITT H.261 video coding algorithm, Fractals. 4. Define Quantization. It is a process of reducing the precision of an integer, thereby reducing the number of bits required to store the integer. 5. What are the controls in VCR paradigm? Play, fast, forward, rewind, search forward, and rewind search. 41

42 Exercise Number: 10 Title of the Exercise : Image Compression Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT Write a program in JAVA for image compression FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Jdk1.5 b) Procedure for doing the experiment: Step Details of the step no. 1 Declare the required variables 2 Get input image file in Fin and print the output 3 The image file is stored in another folder 4 Check the condition for storage level 5 Print the memory of our folder before and after the addition of image 6 Halt the program. c) Program: import java.io.*; import java.net.*; import java.util.zip.*; class dzip Public static void main(string z[]) throws Exception FileInputStream Fin=new FileInputStream( sunset.jpg ); DeflaterOutputStream dout=new DeflaterOutputStream(new FileOutputStream( sunset.zip ); int b; while((b=fin.read())!=-1) 42

43 dout.write(b); Fin.close(); Dout.close(); File f1=new File( sunset.jpg ); File f2=new File( sunset.zip ); System.out.println( BEFORE: +f1.length()); System.out.println( AFTER: +f2.length()); d) Output: IMAGE COMPRESSION OUTPUT ORGINAL FILE SIZE: KB COMPRESSED FILE: KB NNCE IT e) Result Thus the java program for image compression compiled and executed successfully. VIVA QUESTIONS & ANSWERS 1. What are the advantages of CCITT Group 3 1D? It is simple to implement in both h/w and s/w. It is a world wide standard for facsimile, which is accepted for document imaging application. This allows document-imaging applications to incorporate fax documents easily. 2. What is the disadvantage of CCITT Group 3 2D Scheme? It is complex and relatively difficult to implement in software. 3. What is Luminance? Luminance refers to brightness. This is a measure of the brightness of the light emitted or reflected by an object. 4. What are the levels of definition in JPEG standards? Baseline system, extended system, special loss less function. 43

44 Exercise Number: 11 Title of the Exercise : Animation- Shape to Text Morphing Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT To Develop a program to perform animation using any animation software. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Any Flash version b) Procedure for doing the experiment: Step Details of the step no. 1 Open Flash5. Place object in the first frame of time line ie., key frame 2 Place another object in the last frame of time line 3 Select each object separately and break it in to pixels using Edit -> Break Apart Hold the mouse pointer between two key frame and right click it then select motion 4 tuning 5 Run the program by pressing CTRL+ Entr c) Output: 44

45 d) Result Thus the program to perform animation using flash software was performed and executed successfully. VIVA QUESTIONS & ANSWERS 1) What are the factors that affect video performance? Microprocessor speed, Play back window size, Frame rate. 2) What is fractal? A fractal is a multidimensional object with an irregular shape or body that has approximately the same shape or body irrespective of size. i.e irrespective of whether it gets smaller/ bigger in size. 3) What are multimedia file formats? Rich-Text Format(RTF), Tagged image file format(tiff), Resource image file format(riff), Musical instrument digital interface(midi), Joint Photographic Experts Group, Audio Video Interchanged Indeo file Format(AVI), TWAIN. 45

46 Exercise Number: 12 Title of the Exercise : Study of Tools in Photoshop Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT To perform basic operation on an image using Photoshop. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Photoshop b) Procedure for doing the experiment: Step no Details of the step Study of Photoshop tools and palette: - The toolbox contains essential tools for painting, selecting and editing graphics. Each tool is depicted by an icon. There are over 22 tools in the Photoshop toolbox each providing a specific utility to aid. When we are creating, editing and color connecting images. The Selection Tool: - At the top left toolbox location is the marquee tool, which allows you to create differently shaped selections. The Cropping Tool: - The cropping tool is used to cut out a portion of an image and then remove the rest. It can also be used to resize an image. We can activate a cropping tool by pressing c from the keyboard. 4 The Move Tool: - The move tool is used to move selections or layers. The Painting Tool: - The painting tools are paint bucket, gradient, lime, eye dropper, 5 eraser, pencil, airbrush in Photoshop the painting color is called the fragment color and the background color is the color that can be used to erase parts of an image or to delete an entire object. 6 The Pen Creating and Path Editing tools: - The pen tool allows you to create paths. Path is often used to create shapes for marks. 7 The Type Tools: - The type tool and type mask tool share a toolbox location. 46

47 8 9 The Color Control Icon: - The right-hand icon represents the quick mask mode, which allows you to easily create view and edit a mask. The Layer Palette: - A layer is like a plastic overlay that can be placed over the background electronic canvas. Object in layer can be easily moved independently of objects in another layer. c) Output 47

48 d) Result: Thus the c program to perform photo shop any photo shop software was compiled and executed successfully. VIVA QUESTIONS & ANSWERS 1) What is the primary n/w topologies used for multimedia? Traditional LANS extended LANS, High-speed LANS, WANS. 2) Give the primary goal of MAPI. Separate client applications from the underlying messaging services, Make basic mail-enabling a standard feature for all applications, Support messaging-reliant workgroup applications. 48

49 Exercise Number: 13 Title of the Exercise : Animation- Vehicle Moving Date of the Exercise : OBJECTIVE (AIM) OF THE EXPERIMENT To write a C program to perform animation using any animation software. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Turboc3 b) Procedure for doing the experiment: Step Details of the step no. 1 Include the necessary header files 2 Initialize the graphic detection and graphic mode to bgi folder that supports graphics 3 Use the line, circle and rectangle function to create a car. 4 Use the for loop up to the value 600 to move the car by setting the delay as 20 5 Display the results. Close the initialized graphic modes. c) Program #include<stdio.h>#include<conio.h> #include<dos.h> #include<graphics.h> void main() int i=0,gd=detect,gm=0; initgraph(&gd,&gm,"c:\\turboc3\\bgi"); for(i=0;i<600;i=i+2) line(50+i,300,100+i,300); line(100+i,300,150+i,250); line(150+i,250,300+i,250);//top line(300+i,250,350+i,300); line(350+i,300,400+i,320); line(400+i,320,450+i,320); line(50+i,350,50+i,300);//left-vertical line(450+i,350,450+i,320);//right-vertical 49

50 d) Output: line(50+i,350,450+i,350);//bottom-vertical circle(150+i,350,20); circle(300+i,350,20); line(165+i,335,135+i,365); line(135+i,335,165+i,365); line(285+i,335,315+i,365); line(315+i,335,285+i,365); rectangle(150+i,260,222+i,325); rectangle(225+i,260,300+i,325); cleardevice(); delay(50); getch(); closegraph(); e) Result Thus the program to perform animation using c was performed and executed successfully. VIVA QUESTIONS & ANSWERS 1) What is the use of line function? Line function is used to draw a line from the starting point (x1, y1) to ending point (x2, y2) Syntax: line(x1, y1, x2, y2); 2) What is the use of rectangle function? Rectangle function is used to draw a rectangle region from the starting point (top-left) (x1, y1) to ending point (bottom right) (x2, y2) Syntax: rectangle(x1, y1, x2, y2); 3) What is the use of circle function? Circle function is used to draw a circle on the point (x1, y1) with radius r. Syntax: circle(x1, y1, x2, r); 50

51 Title of the Exercise : Image Editing Date of the Exercise : Exercise Number: 14 OBJECTIVE (AIM) OF THE EXPERIMENT To perform image editing using various Photoshop tools. FACILITIES REQUIRED AND PROCEDURE a) Facilities required to do the experiment: Sl.No. Facilities required Quantity 1 System 1 2 Operating System Windows XP 3 S/W Photoshop b) Procedure for doing the experiment: Step Details of the step no. 1 Open the PhotoShop CS. 2 Create a frame which contain the jpeg image. 3 Create a interval to perform animation. Demonstrate Blur Tool. Demonstrate Sharpen Tool. Demonstrate Texture Tool. 4 Demonstrate Pixelate Tool. Demonstrate Stylize Tool. Demonstrate Photo Editing Tool. 5 Copy the new JPEG and create new layer. Now, paste the image in the new layer. c) Output Blur Tool 51

52 Sharpen Too Texture Tool [Pattern Tool] Pixelate Tool [Crystallize] Stylize Tool [Find Edges] 52

53 Photo Editing d) Result: Thus the editing of a photo using photo shop was done successfully. VIVA QUESTIONS & ANSWERS 1) What is use of selection tool? At the top left toolbox location is the marquee tool, which allows you to create differently shaped selections. 2) What is use of cropping tool? The cropping tool is used to cut out a portion of an image and then remove the rest. It can also be used to resize an image. We can activate a cropping tool by pressing c from the keyboard. 3) What is use of move tool? The move tool is used to move selections or layers. 4) What is use of painting tool? The painting tools are paint bucket, gradient, lime, eye dropper, eraser, pencil, airbrush in Photoshop the painting color is called the fragment color and the background color is the color that can be used to erase parts of an image or to delete an entire object. 53

54 CS GRAPHICS AND MULTIMEDIA LABORATORY LIST OF QUESTION SET 1. Write a program in C to perform bresenham s line drawing algorithm. 2. Write a program in C to implement bresenham s circle drawing algorithm. 3. Write a program in C to perform bresenham s ellipse drawing algorithm. 4. Write a program in C to implement 2D Transformation. 5. Write a program to implement Cohen Sutherland 2D line clipping. 6. Write a program to implement window-to-view port transformation 7. Write a program in C to implement 3D transformation such as translation, scaling, rotation. 8. Write a program to visualize projections of 3D. 9. Write a c program to convert between color model 10. Write a program in java to perform text compression. 11. Write a program in java to perform image compression. 12. Perform animations using any animation software Macromedia Flash. 13. Perform editing operation using an image editing software(adobe Photoshop) 54

Windowing And Clipping (14 Marks)

Windowing And Clipping (14 Marks) Window: 1. A world-coordinate area selected for display is called a window. 2. It consists of a visual area containing some of the graphical user interface of the program it belongs to and is framed by

More information

CS1354 GRAPHICS AND MULTIMEDIA DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK SUB CODE / SUBJECT: CS1354 GRAPHICS AND MULTIMEDIA.

CS1354 GRAPHICS AND MULTIMEDIA DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK SUB CODE / SUBJECT: CS1354 GRAPHICS AND MULTIMEDIA. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK SUB CODE / SUBJECT: CS1354 GRAPHICS AND MULTIMEDIA YEAR / SEM: II / III Unit 1 OUTPUT PRIMITIVES 1. Define 2D rotation. 2. Write the 2D transformation

More information

LAB MANUAL OF COMPUTER GRAPHICS BY: Mrs. Manisha Saini

LAB MANUAL OF COMPUTER GRAPHICS BY: Mrs. Manisha Saini LAB MANUAL OF COMPUTER GRAPHICS BY: Mrs. Manisha Saini INTRODUCTION TO COMPUTER GRAPHICS Computer Graphics is the pictorial representation of information using a computer program. In Computer Graphics,

More information

KINGS GRAPHICS AND MULTIMEDIA DEPARTMENT OF COMPUTER SCIENCE AND ENGG. OUTPUT PRIMITIVES Part-A (2-MARKS)

KINGS GRAPHICS AND MULTIMEDIA DEPARTMENT OF COMPUTER SCIENCE AND ENGG. OUTPUT PRIMITIVES Part-A (2-MARKS) KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGG QUESTION BANK YEAR/ SEM : III/ VI SUB. CODE : SUBJECT NAME: UNIT- I OUTPUT PRIMITIVES 1. What is the purpose of presentation graphics?

More information

BHARATHIDASAN ENGINEERING COLLEGE,NATTRAMPALLI

BHARATHIDASAN ENGINEERING COLLEGE,NATTRAMPALLI BHARATHIDASAN ENGINEERING COLLEGE,NATTRAMPALLI-635 854. 2017-2018 ODD SEMESTER -INFORMATION TECHNOLOGY IT6501 - GRAPHICS AND MULTIMEDIA- QUESTION BANK UNIT-I OUTPUT PRIMITIVES 1. What do you mean by output

More information

Part 3: 2D Transformation

Part 3: 2D Transformation Part 3: 2D Transformation 1. What do you understand by geometric transformation? Also define the following operation performed by ita. Translation. b. Rotation. c. Scaling. d. Reflection. 2. Explain two

More information

February 1. Lab Manual INSTITUTE OF INFORMATION TECHNOLOGY & MANAGEMENT GWALIOR COMPUTER GRAPHICS & MUTIMEDIA

February 1. Lab Manual INSTITUTE OF INFORMATION TECHNOLOGY & MANAGEMENT GWALIOR COMPUTER GRAPHICS & MUTIMEDIA Lab Manual February 1 2014 COMPUTER GRAPHICS & MUTIMEDIA INSTITUTE OF INFORMATION TECHNOLOGY & MANAGEMENT GWALIOR SOFTWARE REQUIREMENT : 1. Turbo C++ IDE (TurboC3) 2. Borland Turbo C++ (Version 4.5) LIST

More information

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS2401 COMPUTER GRAPHICS QUESTION BANK PART A UNIT I-2D PRIMITIVES 1. Define Computer graphics. 2. Define refresh

More information

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives. D Graphics Primitives Eye sees Displays - CRT/LCD Frame buffer - Addressable pixel array (D) Graphics processor s main function is to map application model (D) by projection on to D primitives: points,

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Computer Science and Engineering CS6504-COMPUTER GRAPHICS Anna University 2 & 16 Mark Questions & Answers Year / Semester: III / V Regulation:

More information

MET71 COMPUTER AIDED DESIGN

MET71 COMPUTER AIDED DESIGN UNIT - II BRESENHAM S ALGORITHM BRESENHAM S LINE ALGORITHM Bresenham s algorithm enables the selection of optimum raster locations to represent a straight line. In this algorithm either pixels along X

More information

Overview of Transformations (18 marks) In many applications, changes in orientations, size, and shape are accomplished with

Overview of Transformations (18 marks) In many applications, changes in orientations, size, and shape are accomplished with Two Dimensional Transformations In many applications, changes in orientations, size, and shape are accomplished with geometric transformations that alter the coordinate descriptions of objects. Basic geometric

More information

Chapter 8: Implementation- Clipping and Rasterization

Chapter 8: Implementation- Clipping and Rasterization Chapter 8: Implementation- Clipping and Rasterization Clipping Fundamentals Cohen-Sutherland Parametric Polygons Circles and Curves Text Basic Concepts: The purpose of clipping is to remove objects or

More information

1. DDA Algorithm(Digital Differential Analyzer)

1. DDA Algorithm(Digital Differential Analyzer) Basic concepts in line drawing: We say these computers have vector graphics capability (the line is a vector). The process is turning on pixels for a line segment is called vector generation and algorithm

More information

//2D TRANSFORMATION TRANSLATION, ROTATING AND SCALING. #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> #include<stdlib.

//2D TRANSFORMATION TRANSLATION, ROTATING AND SCALING. #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> #include<stdlib. //2D TRANSFORMATION TRANSLATION, ROTATING AND SCALING #include #include #include #include #include void main() int gd=detect,gm,i,x[10],y[10],a,b,c,d,n,tx,ty,sx,sy,ch;

More information

CS2401 COMPUTER GRAPHICS ANNA UNIV QUESTION BANK

CS2401 COMPUTER GRAPHICS ANNA UNIV QUESTION BANK CS2401 Computer Graphics CS2401 COMPUTER GRAPHICS ANNA UNIV QUESTION BANK CS2401- COMPUTER GRAPHICS UNIT 1-2D PRIMITIVES 1. Define Computer Graphics. 2. Explain any 3 uses of computer graphics applications.

More information

Output Primitives Lecture: 3. Lecture 3. Output Primitives. Assuming we have a raster display, a picture is completely specified by:

Output Primitives Lecture: 3. Lecture 3. Output Primitives. Assuming we have a raster display, a picture is completely specified by: Lecture 3 Output Primitives Assuming we have a raster display, a picture is completely specified by: - A set of intensities for the pixel positions in the display. - A set of complex objects, such as trees

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics r About the Tutorial To display a picture of any size on a computer screen is a difficult process. Computer graphics are used to simplify this process. Various algorithms and techniques are used to generate

More information

Unit 3 Transformations and Clipping

Unit 3 Transformations and Clipping Transformation Unit 3 Transformations and Clipping Changes in orientation, size and shape of an object by changing the coordinate description, is known as Geometric Transformation. Translation To reposition

More information

Course Title: Computer Graphics Course no: CSC209

Course Title: Computer Graphics Course no: CSC209 Course Title: Computer Graphics Course no: CSC209 Nature of the Course: Theory + Lab Semester: III Full Marks: 60+20+20 Pass Marks: 24 +8+8 Credit Hrs: 3 Course Description: The course coversconcepts of

More information

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur 603203. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : III Year, V Semester Section : CSE - 1 & 2 Subject Code : CS6504 Subject

More information

Roll No. : Invigilator's Signature :.. GRAPHICS AND MULTIMEDIA. Time Allotted : 3 Hours Full Marks : 70

Roll No. : Invigilator's Signature :.. GRAPHICS AND MULTIMEDIA. Time Allotted : 3 Hours Full Marks : 70 Name : Roll No. : Invigilator's Signature :.. CS/MCA/SEM-4/MCA-402/2012 2012 GRAPHICS AND MULTIMEDIA Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are

More information

OXFORD ENGINEERING COLLEGE (NAAC Accredited with B Grade) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS

OXFORD ENGINEERING COLLEGE (NAAC Accredited with B Grade) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS OXFORD ENGINEERING COLLEGE (NAAC Accredited with B Grade) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS YEAR/SEM.: III/V STAFF NAME: T.ELANGOVAN SUBJECT NAME: Computer Graphics SUB. CODE:

More information

Chapter - 2: Geometry and Line Generations

Chapter - 2: Geometry and Line Generations Chapter - 2: Geometry and Line Generations In Computer graphics, various application ranges in different areas like entertainment to scientific image processing. In defining this all application mathematics

More information

Cs602-computer graphics MCQS MIDTERM EXAMINATION SOLVED BY ~ LIBRIANSMINE ~

Cs602-computer graphics MCQS MIDTERM EXAMINATION SOLVED BY ~ LIBRIANSMINE ~ Cs602-computer graphics MCQS MIDTERM EXAMINATION SOLVED BY ~ LIBRIANSMINE ~ Question # 1 of 10 ( Start time: 08:04:29 PM ) Total Marks: 1 Sutherland-Hodgeman clipping algorithm clips any polygon against

More information

Chapter 1 Introduction to Photoshop CS3 1. Exploring the New Interface Opening an Existing File... 24

Chapter 1 Introduction to Photoshop CS3 1. Exploring the New Interface Opening an Existing File... 24 CONTENTS Chapter 1 Introduction to Photoshop CS3 1 Exploring the New Interface... 4 Title Bar...4 Menu Bar...5 Options Bar...5 Document Window...6 The Toolbox...7 All New Tabbed Palettes...18 Opening an

More information

Manipal Institute of Technology Manipal University Manipal

Manipal Institute of Technology Manipal University Manipal MIT/CSE/LM/13/R0 COMPUTER GRAPHICS LAB MANUAL FIFTH SEMESTER Department of Computer Science & Engineering 10pt. CREDIT SYSTEM (2014) Prepared by Approved by (Dr. P. C. Siddalingaswamy) (Head of the Department)

More information

CS602 MCQ,s for midterm paper with reference solved by Shahid

CS602 MCQ,s for midterm paper with reference solved by Shahid #1 Rotating a point requires The coordinates for the point The rotation angles Both of above Page No 175 None of above #2 In Trimetric the direction of projection makes unequal angle with the three principal

More information

CS6504 & Computer Graphics Unit I Page 1

CS6504 & Computer Graphics Unit I Page 1 Introduction Computer contains two components. Computer hardware Computer hardware contains the graphics workstations, graphic input devices and graphic output devices. Computer Software Computer software

More information

Write C++/Java program to draw line using DDA and Bresenham s algorithm. Inherit pixel class and Use function overloading.

Write C++/Java program to draw line using DDA and Bresenham s algorithm. Inherit pixel class and Use function overloading. Group A Assignment No A1. Write C++/Java program to draw line using DDA and Bresenham s algorithm. Inherit pixel class and Use function overloading. Aim: To draw line using DDA and Bresenham s algorithm

More information

UNIT 2 2D TRANSFORMATIONS

UNIT 2 2D TRANSFORMATIONS UNIT 2 2D TRANSFORMATIONS Introduction With the procedures for displaying output primitives and their attributes, we can create variety of pictures and graphs. In many applications, there is also a need

More information

End-Term Examination

End-Term Examination Paper Code: MCA-108 Paper ID : 44108 Second Semester [MCA] MAY-JUNE 2006 Q. 1 Describe the following in brief :- (3 x 5 = 15) (a) QUADRATIC SURFACES (b) RGB Color Models. (c) BSP Tree (d) Solid Modeling

More information

CS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo)

CS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo) CS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo) www.vucybarien.com Question No: 1 What are the two focusing methods in CRT? Explain briefly. Page no : 26 1. Electrostatic focusing

More information

SAZ4C COMPUTER GRAPHICS. Unit : 1-5. SAZ4C Computer Graphics

SAZ4C COMPUTER GRAPHICS. Unit : 1-5. SAZ4C Computer Graphics SAZ4C COMPUTER GRAPHICS Unit : 1-5 1 UNIT :1 SYLLABUS Introduction to computer Graphics Video display devices Raster scan Systems Random Scan Systems Interactive input devices Hard copy devices Graphics

More information

COMP371 COMPUTER GRAPHICS

COMP371 COMPUTER GRAPHICS COMP371 COMPUTER GRAPHICS LECTURE 14 RASTERIZATION 1 Lecture Overview Review of last class Line Scan conversion Polygon Scan conversion Antialiasing 2 Rasterization The raster display is a matrix of picture

More information

Einführung in Visual Computing

Einführung in Visual Computing Einführung in Visual Computing 186.822 Rasterization Werner Purgathofer Rasterization in the Rendering Pipeline scene objects in object space transformed vertices in clip space scene in normalized device

More information

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored. From Vertices to Fragments: Rasterization Reading Assignment: Chapter 7 Frame Buffer Special memory where pixel colors are stored. System Bus CPU Main Memory Graphics Card -- Graphics Processing Unit (GPU)

More information

USING THE PHOTOSHOP TOOLBOX

USING THE PHOTOSHOP TOOLBOX IN THIS CHAPTER USING THE PHOTOSHOP TOOLBOX Using the Options Bar 44 Using the Selection Tools 45 Using the Crop and Slice Tools 46 Using the Retouching Tools 46 Using the Painting Tools 49 Using the Drawing

More information

Graphics (Output) Primitives. Chapters 3 & 4

Graphics (Output) Primitives. Chapters 3 & 4 Graphics (Output) Primitives Chapters 3 & 4 Graphic Output and Input Pipeline Scan conversion converts primitives such as lines, circles, etc. into pixel values geometric description a finite scene area

More information

Rendering. A simple X program to illustrate rendering

Rendering. A simple X program to illustrate rendering Rendering A simple X program to illustrate rendering The programs in this directory provide a simple x based application for us to develop some graphics routines. Please notice the following: All points

More information

INFORMATION TECHNOLOGY HANDLED & PREPARED BY Dr. N.KRISHNARAJ,A.P(Sel.G) MS. R. THENMOZHI, AP (Sel.G)

INFORMATION TECHNOLOGY HANDLED & PREPARED BY Dr. N.KRISHNARAJ,A.P(Sel.G) MS. R. THENMOZHI, AP (Sel.G) VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur-603203 DEPARTMENT OF INFORMATION TECHNOLOGY Academic Year: 2016-17 QUESTION BANK ODD SEMESTER NAME OF THE SUBJECT GRAPHICS AND MULTIMEDIA SUBJECT

More information

Lab Manual. Computer Graphics. T.E. Computer. (Sem VI)

Lab Manual. Computer Graphics. T.E. Computer. (Sem VI) Lab Manual Computer Graphics T.E. Computer (Sem VI) Index Sr. No. Title of Programming Assignments Page No. 1. Line Drawing Algorithms 3 2. Circle Drawing Algorithms 6 3. Ellipse Drawing Algorithms 8 4.

More information

How to draw and create shapes

How to draw and create shapes Adobe Flash Professional Guide How to draw and create shapes You can add artwork to your Adobe Flash Professional documents in two ways: You can import images or draw original artwork in Flash by using

More information

ADOBE PHOTOSHOP BOOK SAHALSOFTWARE. Frist Editing. Contents

ADOBE PHOTOSHOP BOOK SAHALSOFTWARE. Frist Editing. Contents ADOBE PHOTOSHOP BOOK SAHALSOFTWARE Frist Editing Contents Lesson 01: Introduction of Adobe Photoshop Lesson 02: How to Open Photoshop Lesson 03: Environment Lesson 04: Tools in Adobe Photoshop Lesson 05:

More information

CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines. Emmanuel Agu

CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines. Emmanuel Agu CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines Emmanuel Agu 2D Graphics Pipeline Clipping Object World Coordinates Applying world window Object subset window to viewport mapping

More information

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR 603203 DEPARTMENT OF COMPUTER SCIENCE & APPLICATIONS QUESTION BANK (2017-2018) Course / Branch : BCA Semester / Year : IV / II Subject Name : Computer

More information

From Ver(ces to Fragments: Rasteriza(on

From Ver(ces to Fragments: Rasteriza(on From Ver(ces to Fragments: Rasteriza(on From Ver(ces to Fragments 3D vertices vertex shader rasterizer fragment shader final pixels 2D screen fragments l determine fragments to be covered l interpolate

More information

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into 2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel

More information

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4620/8626 Computer Graphics Spring 2014 Homework Set 1 Suggested Answers

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4620/8626 Computer Graphics Spring 2014 Homework Set 1 Suggested Answers UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4620/8626 Computer Graphics Spring 2014 Homework Set 1 Suggested Answers 1. How long would it take to load an 800 by 600 frame buffer with 16 bits per pixel

More information

DDA ALGORITHM. To write a C program to draw a line using DDA Algorithm.

DDA ALGORITHM. To write a C program to draw a line using DDA Algorithm. DDA ALGORITHM EX NO: 1 Aim : To write a C program to draw a line using DDA Algorithm. Algorithm: Step 1: Start the program. Step 1: Step 2: Input the line endpoints and store the left endpoint in (x1,

More information

COURSE DELIVERY PLAN - THEORY Page 1 of 6

COURSE DELIVERY PLAN - THEORY Page 1 of 6 COURSE DELIVERY PLAN - THEORY Page 1 of 6 Department of Information Technology B.E/B.Tech/M.E/M.Tech : Information Technology Regulation: 2013 PG Specialisation : LP: IT6501 Rev. No: 01 Date: 30/06/2016

More information

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY SRM INSTITUTE OF SCIENCE AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK SUB.NAME: COMPUTER GRAPHICS SUB.CODE: IT307 CLASS : III/IT UNIT-1 2-marks 1. What is the various applications

More information

How to create shapes. Drawing basic shapes. Adobe Photoshop Elements 8 guide

How to create shapes. Drawing basic shapes. Adobe Photoshop Elements 8 guide How to create shapes With the shape tools in Adobe Photoshop Elements, you can draw perfect geometric shapes, regardless of your artistic ability or illustration experience. The first step to drawing shapes

More information

Paint Tutorial (Project #14a)

Paint Tutorial (Project #14a) Paint Tutorial (Project #14a) In order to learn all there is to know about this drawing program, go through the Microsoft Tutorial (below). (Do not save this to your folder.) Practice using the different

More information

CHAPTER 1 Graphics Systems and Models 3

CHAPTER 1 Graphics Systems and Models 3 ?????? 1 CHAPTER 1 Graphics Systems and Models 3 1.1 Applications of Computer Graphics 4 1.1.1 Display of Information............. 4 1.1.2 Design.................... 5 1.1.3 Simulation and Animation...........

More information

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning 3 Data Storage 3.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List five different data types used in a computer. Describe how

More information

Aptitude Test Question

Aptitude Test Question Aptitude Test Question Q.1) Which software is not used for Image processing? a) MatLab b) Visual Basic c) Java d) Fortran Q.2) Which software is not used for Computer graphics? a) C b) Java c) Fortran

More information

EUROPEAN COMPUTER DRIVING LICENCE / INTERNATIONAL COMPUTER DRIVING LICENCE IMAGE EDITING

EUROPEAN COMPUTER DRIVING LICENCE / INTERNATIONAL COMPUTER DRIVING LICENCE IMAGE EDITING EUROPEAN COMPUTER DRIVING LICENCE / INTERNATIONAL COMPUTER DRIVING LICENCE IMAGE EDITING The European Computer Driving Licence Foundation Ltd. Portview House Thorncastle Street Dublin 4 Ireland Tel: +

More information

Scan Conversion. Drawing Lines Drawing Circles

Scan Conversion. Drawing Lines Drawing Circles Scan Conversion Drawing Lines Drawing Circles 1 How to Draw This? 2 Start From Simple How to draw a line: y(x) = mx + b? 3 Scan Conversion, a.k.a. Rasterization Ideal Picture Raster Representation Scan

More information

(a) rotating 45 0 about the origin and then translating in the direction of vector I by 4 units and (b) translating and then rotation.

(a) rotating 45 0 about the origin and then translating in the direction of vector I by 4 units and (b) translating and then rotation. Code No: R05221201 Set No. 1 1. (a) List and explain the applications of Computer Graphics. (b) With a neat cross- sectional view explain the functioning of CRT devices. 2. (a) Write the modified version

More information

Efficient Plotting Algorithm

Efficient Plotting Algorithm Efficient Plotting Algorithm Sushant Ipte 1, Riddhi Agarwal 1, Murtuza Barodawala 1, Ravindra Gupta 1, Prof. Shiburaj Pappu 1 Computer Department, Rizvi College of Engineering, Mumbai, Maharashtra, India

More information

Overview of Computer Graphics

Overview of Computer Graphics Application of Computer Graphics UNIT- 1 Overview of Computer Graphics Computer-Aided Design for engineering and architectural systems etc. Objects maybe displayed in a wireframe outline form. Multi-window

More information

EF432. Introduction to spagetti and meatballs

EF432. Introduction to spagetti and meatballs EF432 Introduction to spagetti and meatballs CSC 418/2504: Computer Graphics Course web site (includes course information sheet): http://www.dgp.toronto.edu/~karan/courses/418/fall2015 Instructor: Karan

More information

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION INTRODUCTION OBJECTIVE: This chapter deals the applications of computer graphics and overview of graphics systems and imaging. UNIT I 1 With clear

More information

Adobe Photoshop Sh S.K. Sublania and Sh. Naresh Chand

Adobe Photoshop Sh S.K. Sublania and Sh. Naresh Chand Adobe Photoshop Sh S.K. Sublania and Sh. Naresh Chand Photoshop is the software for image processing. With this you can manipulate your pictures, either scanned or otherwise inserted to a great extant.

More information

Topic #1: Rasterization (Scan Conversion)

Topic #1: Rasterization (Scan Conversion) Topic #1: Rasterization (Scan Conversion) We will generally model objects with geometric primitives points, lines, and polygons For display, we need to convert them to pixels for points it s obvious but

More information

CS 543: Computer Graphics. Rasterization

CS 543: Computer Graphics. Rasterization CS 543: Computer Graphics Rasterization Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Polytechnic Institute gogo@wpi.edu (with lots

More information

CS Rasterization. Junqiao Zhao 赵君峤

CS Rasterization. Junqiao Zhao 赵君峤 CS10101001 Rasterization Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Vector Graphics Algebraic equations describe

More information

LINE,CIRCLE AND ELLIPSE DRAWING USING BRESENHAM S ALGORITHM

LINE,CIRCLE AND ELLIPSE DRAWING USING BRESENHAM S ALGORITHM Ex.no :1 Date: LINE,CIRCLE AND ELLIPSE DRAWING USING BRESENHAM S ALGORITHM AIM: To write a program to implement Bresenham s algorithms for line, circle and ellipse drawing. ALGORITHM: Step1: Create a function

More information

Output Primitives. Dr. S.M. Malaek. Assistant: M. Younesi

Output Primitives. Dr. S.M. Malaek. Assistant: M. Younesi Output Primitives Dr. S.M. Malaek Assistant: M. Younesi Output Primitives Output Primitives: Basic geometric structures (points, straight line segment, circles and other conic sections, quadric surfaces,

More information

Scan Converting Circles

Scan Converting Circles Scan Conversion Algorithms CS 460 Computer Graphics Professor Richard Eckert Circles Ellipses and Other 2-D Curves Text February 16, 2004 Scan Converting Circles Given: Center: (h,k) Radius: r Equation:

More information

Overview: The Map Window

Overview: The Map Window Overview: The Map Window The Map Menu Map Window Tools and Controls Map Drawing Tools Clipboard Commands Undoing Edits Overview: The Map Window The MFworks Map window is a powerful facility for the visualization

More information

Education and Training CUFMEM14A. Exercise 2. Create, Manipulate and Incorporate 2D Graphics

Education and Training CUFMEM14A. Exercise 2. Create, Manipulate and Incorporate 2D Graphics Education and Training CUFMEM14A Exercise 2 Create, Manipulate and Incorporate 2D Graphics Menu Exercise 2 Exercise 2a: Scarecrow Exercise - Painting and Drawing Tools... 3 Exercise 2b: Scarecrow Exercise

More information

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization.

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization. Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática Chap. 2 Rasterization Rasterization Outline : Raster display technology. Basic concepts: pixel, resolution,

More information

Corel Draw 11. What is Vector Graphics?

Corel Draw 11. What is Vector Graphics? Corel Draw 11 Corel Draw is a vector based drawing that program that makes it easy to create professional artwork from logos to intricate technical illustrations. Corel Draw 11's enhanced text handling

More information

Computer Graphics Lecture Notes

Computer Graphics Lecture Notes Computer Graphics Lecture Notes UNIT- Overview of Computer Graphics. Application of Computer Graphics Computer-Aided Design for engineering and architectural systems etc. Objects maybe displayed in a wireframe

More information

Objective Utilize appropriate tools and methods to produce digital graphics.

Objective Utilize appropriate tools and methods to produce digital graphics. INSTRUCTIONAL NOTES There are many similarities between Photoshop and Illustrator. We have attempted to place tools and commands in the context of where they are most effective or used most often. This

More information

Photoshop / Editing paths

Photoshop / Editing paths Photoshop / Editing paths Path segments, components, and points Select a path Adjust path segments Add or delete anchor points Convert between smooth points and corner points Adjust path components Path

More information

Computer Graphics. - Rasterization - Philipp Slusallek

Computer Graphics. - Rasterization - Philipp Slusallek Computer Graphics - Rasterization - Philipp Slusallek Rasterization Definition Given some geometry (point, 2D line, circle, triangle, polygon, ), specify which pixels of a raster display each primitive

More information

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete Scan Conversion CMP 477 Computer Graphics S. A. Areete What is Scan-Conversion? 2D or 3D objects in real world space are made up of graphic primitives such as points, lines, circles and filled polygons.

More information

CS 130 Final. Fall 2015

CS 130 Final. Fall 2015 CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying

More information

Paint/Draw Tools. Foreground color. Free-form select. Select. Eraser/Color Eraser. Fill Color. Color Picker. Magnify. Pencil. Brush.

Paint/Draw Tools. Foreground color. Free-form select. Select. Eraser/Color Eraser. Fill Color. Color Picker. Magnify. Pencil. Brush. Paint/Draw Tools There are two types of draw programs. Bitmap (Paint) Uses pixels mapped to a grid More suitable for photo-realistic images Not easily scalable loses sharpness if resized File sizes are

More information

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling Downloaded from :www.comp.dit.ie/bmacnamee/materials/graphics/006- Contents In today s lecture we ll have a loo at:

More information

NAME: PD DATE / / 2. The Name of this Tool is: A: The Text Tool B: The Type on a Path Tool C: The Selection Tool D: The Gradient Mesh Tool

NAME: PD DATE / / 2. The Name of this Tool is: A: The Text Tool B: The Type on a Path Tool C: The Selection Tool D: The Gradient Mesh Tool NAME: PD DATE / / GD I END OF COURSE / YEAR REVIEW ILLUSTRATOR TOOLS & FUNCTIONS 1: The Name of this Tool is: A: The Group Selection Tool B: The Add Anchor Point Tool C: The Selection Tool D: The Gradient

More information

03 Vector Graphics. Multimedia Systems. 2D and 3D Graphics, Transformations

03 Vector Graphics. Multimedia Systems. 2D and 3D Graphics, Transformations Multimedia Systems 03 Vector Graphics 2D and 3D Graphics, Transformations Imran Ihsan Assistant Professor, Department of Computer Science Air University, Islamabad, Pakistan www.imranihsan.com Lectures

More information

UNIT -8 IMPLEMENTATION

UNIT -8 IMPLEMENTATION UNIT -8 IMPLEMENTATION 1. Discuss the Bresenham s rasterization algorithm. How is it advantageous when compared to other existing methods? Describe. (Jun2012) 10M Ans: Consider drawing a line on a raster

More information

L E S S O N 2 Background

L E S S O N 2 Background Flight, Naperville Central High School, Naperville, Ill. No hard hat needed in the InDesign work area Once you learn the concepts of good page design, and you learn how to use InDesign, you are limited

More information

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines COMP30019 Graphics and Interaction Scan Converting Polygons and Lines Department of Computer Science and Software Engineering The Lecture outline Introduction Scan conversion Scan-line algorithm Edge coherence

More information

Creating Digital Illustrations for Your Research Workshop III Basic Illustration Demo

Creating Digital Illustrations for Your Research Workshop III Basic Illustration Demo Creating Digital Illustrations for Your Research Workshop III Basic Illustration Demo Final Figure Size exclusion chromatography (SEC) is used primarily for the analysis of large molecules such as proteins

More information

COMPUTER GRAPHICS, MULTIMEDIA AND ANIMATION, Second Edition (with CD-ROM) Malay K. Pakhira

COMPUTER GRAPHICS, MULTIMEDIA AND ANIMATION, Second Edition (with CD-ROM) Malay K. Pakhira Computer Graphics, Multimedia and Animation SECOND EDITION Malay K. Pakhira Assistant Professor Department of Computer Science and Engineering Kalyani Government Engineering College Kalyani New Delhi-110001

More information

KRISTU JYOTI COLLEGE OF MANAGEMENT & TECHNOLOGY QUESTION BANK BCA SEMESTER III Computer graphics Part A (2 marks questions)

KRISTU JYOTI COLLEGE OF MANAGEMENT & TECHNOLOGY QUESTION BANK BCA SEMESTER III Computer graphics Part A (2 marks questions) KRISTU JYOTI COLLEGE OF MANAGEMENT & TECHNOLOGY QUESTION BANK 2018 BCA SEMESTER III Computer graphics Part A (2 marks questions) 1. What do mean by refreshing of a screen? 2. Define computer graphics 3.

More information

Chapter 3. Sukhwinder Singh

Chapter 3. Sukhwinder Singh Chapter 3 Sukhwinder Singh PIXEL ADDRESSING AND OBJECT GEOMETRY Object descriptions are given in a world reference frame, chosen to suit a particular application, and input world coordinates are ultimately

More information

Geneva CUSD 304 Content-Area Curriculum Frameworks Grades 6-12 Business

Geneva CUSD 304 Content-Area Curriculum Frameworks Grades 6-12 Business Geneva CUSD 304 Content-Area Curriculum Frameworks Grades 6-12 Business Mission Statement In the Business Department, our mission is to: Provide a variety of subject areas. Introduce students to current

More information

Introduction to Computer Science (I1100) Data Storage

Introduction to Computer Science (I1100) Data Storage Data Storage 145 Data types Data comes in different forms Data Numbers Text Audio Images Video 146 Data inside the computer All data types are transformed into a uniform representation when they are stored

More information

Adobe Illustrator CS5 Part 2: Vector Graphic Effects

Adobe Illustrator CS5 Part 2: Vector Graphic Effects CALIFORNIA STATE UNIVERSITY, LOS ANGELES INFORMATION TECHNOLOGY SERVICES Adobe Illustrator CS5 Part 2: Vector Graphic Effects Summer 2011, Version 1.0 Table of Contents Introduction...2 Downloading the

More information

The Photoshop Workspace

The Photoshop Workspace Adobe Photoshop: Chapter 2: The Photoshop Workspace When you first open or start Photoshop the work area is made up of a set of default or standard Tools, Palettes and menus. Photoshop s Tools are contained

More information

Computer Graphics. Apurva A. Desai

Computer Graphics. Apurva A. Desai Computer Graphics Apurva A. Desai COMPUTER GRAPHICS Apurva A. Desai Professor and Head Department of Computer Science Veer Narmad South Gujarat University Surat New Delhi-110001 2008 COMPUTER GRAPHICS

More information

Computer Graphics. Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D)

Computer Graphics. Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D) Computer Graphics Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D) Introduction Applications of Computer Graphics: 1) Display of Information 2) Design 3) Simulation 4) User

More information

Multimedia on the Web

Multimedia on the Web Multimedia on the Web Graphics in web pages Downloading software & media Digital photography JPEG & GIF Streaming media Macromedia Flash Graphics in web pages Graphics are very popular in web pages Graphics

More information

SHORTCUTS DRAW PERSONA

SHORTCUTS DRAW PERSONA SHORTCUTS DRAW PERSONA esc CANCEL OPERATION ± SHOW/HIDE TABS F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 1 2 3 4 5 6 7 8 9 0 200% 400% 800% ACTUAL PIXEL 10% 20% QUIT CLOSE RULERS CHAR- OUTLINE Q W E R T ACTER

More information