Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 95

EX.NO:1.

a DATE:

BRESENHAMS LINE DRAWING ALGORITHM

#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<graphics.h> void linebress(int xa,int ya,int xn,int yn); int main(void) { int gdriver= !"!#",gmode; initgraph($gdriver,$gmode,% %); outtextxy(&',&',%(resnham)s line dra*ing algorithm%); linebress(+'',+'',,',,'); getch(); closegraph(); return '; void linebress(int xa,int ya,int xb,int yb) { int dx=abs(xa.xb),dy=abs(ya.yb); int p=+/dy.dx; int tdy=+/dy; int tdx=+/(dy.dx); int x,y,xend; i0(xa>xb) { x=xb;y=yb; xend=xa; else { x=xa;y=yb; xend=xb; putpixel(x,y,getmaxcolor()); *hile(x<xend) { x11; i0(p<') p1=tdy; else y11; p1=tdx; putpixel(x,y,getmaxcolor()); -

OUTPUT: (resenham2s line dra*ing algorithm

EX.NO:1.b DATE:

BRESENHAMS CIRCLE DRAWING ALGORITHM

#include<graphics.h> #include<stdio.h> #include<conio.h> #include<stdlib.h> void cirmidpt(int xcen,int ycen,int r); void plotpt(int xcen,int ycen,int x,int y); int main() { int xc,yc,radius; int gdriver= !"!#",gmode; initgraph($gdriver,$gmode,%%); print0(%3n (resenham)s circle dra*ing algorithm%); print0(%3n3n3n%); print0(%!nter the center co.ordinates%); scan0(%4d4d%,$xc,$yc); print0(%3n !nter the radius%); scan0(%4d%,$radius); cirmidpt(xc,yc,radius); getch(); closegraph(); return '; void cirmidpt(int xcen,int ycen,int r) { int x=',y=r,p=&.r; plotpt(xcen,ycen,x,y); *hile(x<y){ x11; i0(p<') p1=+/x1&; else { y..; p1=+/(x.y)1&; plotpt(xcen,ycen,x,y); -void plotpt(int xcen,int ycen,int x,int y) { putpixel(xcen1x,ycen1y,+5); putpixel(xcen.x,ycen1y,+5); putpixel(xcen1x,ycen.y,+5); putpixel(xcen.x,ycen.y,+5); putpixel(xcen1y,ycen1x,+5); putpixel(xcen.y,ycen1x,+5); putpixel(xcen1y,ycen.x,+5); putpixel(xcen.y,ycen.x,+5); -

OUTPUT: (resenham2s line dra*ing algorithm !nter center co.ordinates +'' +'' !nter the radius &''

EX:NO:1c DATE:

BRESENHAMS ELLIPSE DRAWING ALGORITHM

#include<stdio.h> #include<conio.h> #include<math.h> #include<graphics.h> #de0ine 6789 (a) (int) (a1'.5) void ellipmidpt(int xcen,int ycen,int rx,int ry); void plotpt(int xcen,int ycen,int x,int y); int main(void) { int xc,yc,radius; int ma:oraxis,minoraxis; int gdriver= !"!#",gmode; initgraph($gdriver,$gmode,%%); print0(%3n (resenham)s ellipse dra*ing algorithm%); print0(%3n =====================================%); print0(%3n !nter semima:or axis and minoraxis%); scan0(%4d4d%,$ma:oraxis,$minoraxis); print0(%3n !nter the center(xc,yc) co.ordinates%); scan0(%4d4d%,$xc,$yc); ellipmidpt(xc,yc,ma:oraxis,minoraxis); getch(); closegraph(); return '; void ellipmidpt(int xcen,int ycen,int rx,int ry) { int rx+=rx/rx,ry+=ry/ry,trx+=+/rx+,try+=+/ry+,p; int x=',y=ry,px=',py=trx+/y; plotpt(xcen,ycen,x,y); p=6789 (ry+.(rx+/y)1('.+5/rx+)); *hile(px<py) { x11; px1=try+; i0(p<') p1=try+1px; else { y..; py.=trx+; p1=ry+/px.py; plotpt(xcen,ycen,x,y); p=6789 (ry+/(x1'.5)/(x1'.5)1(rx+/((y.&)/(y.&))).(rx+/ry+)); *hile(y>') {

y..; py=trx+; i0(p>') p1=rx+.py; else { x11; px1=try+; p1=rx+.p; plotpt(xcen,ycen,x,y); void plotpt(int xcen,int ycen,int x,int y) { putpixel(xcen1x,ycen1y,+5); putpixel(xcen.x,ycen1y,+5); putpixel(xcen1x,ycen.y,+5); putpixel(xcen.x,ycen.y,+5); -

OUTPUT: (resenham2s !llipse dra*ing algorithm !nter semima:or axis and minoraxis +5 &+ !nter the center (xc,yc) coordinates +'' &;5

EX.NO:2 DATE:

TWO DIMENSIONAL TRANSFORMATION

#include<stdio.h> #include<conio.h> #include<math.h> #include<graphics.h> void main() { int i,a,poly,<&'=,poly&<&'=,poly+<&'=,poly;<&'=,tx,ty,sx,n,xr,yr; int poly<&'=,poly5<&'=,sy,op,ch; int gd= !"!#",gm; clrscr(); initgraph($gd,$gm,%%); print0(%"*o dimensional trans0ormation>%); print0(%???????????????????????3n%); print0(%!nter the number o0 vertices o0 the polygon%); scan0(%4d%,$n); print0(%!nter the coordinates o0 the vertices>%); 0or(i=';i<+/n;i11) scan0(%4d%,$poly<i=); poly<+/n==poly<'=; poly<+/n1&==poly<&=; outtextxy(@',@',%7riginal image%); dra*poly(n1&,poly); getch(); cleardevice(); start> print0(%Aenus>3n &."ranslation3n +.Bcaling3n ;.6otation3n ,.6e0lection3n 5.Bhearing 3n%); print0(%!nter your choice>%); scan0(%4d%,$ch); s*itch(ch) { case &> outtextxy(;',;',%7riginal image%); dra*poly(n1&,poly); outtextxy(&',&',%!nter the translation 0actor%); gotoxy(;',;); scan0(%4d4d%,$tx,$ty); 0or(i=';i<+/n;i1=+) { poly&<i==poly<i=1tx; poly&<i1&==poly<i1&=1ty; poly&<+/n==poly&<'=; poly&<+/n1&==poly&<&=; dra*poly(n1&,poly&); outtextxy(5',5',%C0ter translation%); getch(); cleardevice();

breaD; case +> outtextxy(;',;',%7riginal image%); dra*poly(n1&,poly); outtextxy(&',&',%!nter the scaling 0actor%); gotoxy(;',;); scan0(%4d%,$sx); 0or(i=';i<+/n;i1=+) { poly+<i==poly<i=/sx; poly+<i1&==poly<i1&=/sx; poly+<+/n==poly+<'=; poly+<+/n1&==poly+<&=; dra*poly(n1&,poly+); outtextxy(5',5',%C0ter scaling%); getch(); cleardevice(); breaD; case ;> outtextxy(;',;',%7riginal image%); dra*poly(n1&,poly); outtextxy(&',&',%!nter the rotation 0actor%); gotoxy(;',;); scan0(%4d4d%,$xr,$yr,$a); 0or(i=';i<+/n;i1=+) { poly;<i==xr1((poly<i=.xr)/cos(a)).((poly<i1&=.yr)/sin(a)); poly;<i1&==yr1((poly<i1&=.yr)/cos(a)).((poly<i=.xr)/sin(a)); poly;<+/n==poly;<'=; poly;<+/n1&==poly;<&=; dra*poly(n1&,poly;); outtextxy(5',5',%C0ter rotation%); getch(); cleardevice(); breaD; case ,> outtextxy(;',;',%7riginal image%); dra*poly(n1&,poly); outtextxy(&',&',%6e0lected image%); 0or(i=';i<+/n;i1=+) { poly,<i==E,'.poly<i=; poly,<i1&==poly<i1&=; poly,<+/n==poly,<'=; poly,<+/n1&==poly,<&=; dra*poly(n1&,poly,); getch(); cleardevice();

breaD; case 5> outtextxy(;',;',%7riginal image%); dra*poly(n1&,poly); outtextxy(&',&',%!nter the shear 0actor%); gotoxy(;',;); scan0(%4d%,$sy); 0or(i=';i<+/n;i1=+) { poly5<i==poly<i=1sy/poly<i1&=; poly5<i1&==poly<i=; poly5<+/n==poly5<'=; poly5<+/n1&==poly5<&=; dra*poly(n1&,poly5); outtextxy(5',5',%C0ter shearing%); getch(); cleardevice(); breaD; de0ault> print0(%3n invalid option try again3n%); breaD; print0(%do u *ant to continue(&F')>%); scan0(%4d%,$op); i0(op==&) goto start; else exit('); -

OUTPUT: "*o imensional "rans0ormation .......................................... !nter the no o0 vertices o0 polygon>; !nter the coordinate o0 the vertices> &'' &'' &'' +'' &5' &5' 7riginal image

Aenus &."ranslation +.Bcaling ;.6otation ,.6e0lection 5.Bhearing !nter your choice>& !nter the translation 0actor &'' &'' 7riginal image

C0ter translation

Aenus &."ranslation +.Bcaling ;.6otation ,.6e0lection 5.Bhearing !nter your choice>+ !nter the scaling 0actor > +

7riginal image

C0ter scaling

Aenus &."ranslation +.Bcaling ;.6otation ,.6e0lection 5.Bhearing !nter your choice > ; !nter the rotation 0actor > +5' G' 7riginal image

C0ter rotation

Aenus &."ranslation +.Bcaling ;.6otation ,.6e0lection 5.Bhearing !nter your choice > , !nter the re0lected 0actor > 7riginal image

C0ter re0lection

Aenus &."ranslation +.Bcaling ;.6otation ,.6e0lection 5.Bhearing !nter your choice > 5 !nter the shear 0actor > & 7riginal image

C0ter shearing

EX.NO:3 DATE:

COHEN SUTHERLAND LINE CLIPPINALGORITHM

#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<dos.h> #include<math.h> #include<graphics.h> typede0 struct coordinate { int x,y; char code<,=; -pt; void dra**indo*(); void dra*line(pt p&,pt p+,int c&); pt setcode(pt p); int visibility(pt p&,pt p+); pt resetendpt(pt p&,pt p+); main() { int gd= !"!#",gm,v; pt p&,p+,ptemp; clrscr(); initgraph($gd,$gm,% %); cleardevice(); print0(%3n cohen)s sutherland line clipping algorithm%); print0(%3n....................3n%); print0(%!nter the point&(x,y)>%); scan0(%4d4d%, $p&.x,$p&.y); print0(%3n enter the point+(x,y)>%); scan0(%4d4d%,$p+.x,p+.y); cleardevice(); dra**indo*(); getch(); dra*line(p&,p+,&5); getch(); p&=setcode(p&); p+=setcode(p+); v=visibility(p&,p+); s*itch(v) { case '> cleardevice(); dra**indo*(); dra*line(p&,p+,&5); breaD; case &> cleardevice(); dra**indo*();

breaD; case +> cleardevice(); p&=resetendpt(p&,p+); p+=resetendpt(p+,p&); dra**indo*(); dra*line(p&,p+,&5); breaD; getch(); closegraph(); return('); void dra**indo*() { setcolor(6! ); line(&5',&'',,5',&''); line(,5',&'',,5',;5'); line(,5',;5',&5',;5'); line(&5',;5',&5',&''); void dra*line(pt p&,pt p+,int c&) { setcolor(c&); line(p&.x,p&.y,p+.x,p+.y); pt setcode(pt p) { pt ptemp; i0(p.y<&'') ptemp.code<'==)&); else ptemp.code<'==)'); i0(p.y>;5') ptemp.code<&==)&); else ptemp.code<&==)'); i0(p.x>,5') ptemp.code<+==)&); else ptemp.code<+==)'); i0(p.x<&5') ptemp.code<;==)&); else ptemp.code<;==)'); ptemp.x=p.x; ptemp.y=p.y; return(ptemp); int visibility(pt p&,pt p+) { int i,0lag='; 0or(i=';i<,;i11)

{ i0((p&.code<i=H=)'))II(p+.code<i=H=)'))) 0lag=&; i0(0lag==') return('); 0or(i=';i<,;i11) { i0((p&.code<i===p+.code<i=)$$(p&.code<i===)&))) 0lag='; i0(0lag==') return(&); return(+); pt resetendpt(pt p&,pt p+) { pt temp; int x,y,i; 0loat m,D; i0(p&.code<;===)&)) x=&5'; i0(p&.code<+===)&)) x=,5'; i0((p&.code<;===)&))II(p&.code<+===)&))) { m=(0loat)(p+.y.p&.y)F(p+.x.p&.x); D=(p&.y1(m/(x.p&.x))); temp.y=D; temp.x=x; 0or(i=';i<,;i11) temp.code<i==p&.code<i=; i0(temp.y<=;5' $$ temp.y>=&'') return(temp); i0(p&.code<'===)&)) y=&''; i0(p&.code<&===)&)) y=;5'; i0((p&.code<'===)&))II(p&.code<&===)&))) { m=(0loat)(p+.y.p&.y)F(p+.x.p&.x); D=(0loat)p&.x1(0loat)(y.p&.y)Fm; temp.x=D; temp.y=y; 0or(i=';i<,;i11) temp.code<i==p&.code<i=; return(temp); else return(p&); -

OUTPUT:
cohen)s sutherland line clipping algorithm ..........................................

!nter the point&(x,y)>&'' &'' !nter the point+(x,y)>;'' ;''

EX:NO:4 DATE:

THREE DIMENSIONAL TRANSFORMATION

#include<stdio.h> #include<conio.h> #include<math.h> #include<dos.h> #include<graphics.h> #include<stdlib.h> void apoly(); void tra(); void scale(); void rot(); int side,i,a<&'=,b<&'=,c<&'=,d<&'=,e<&'=,0<&'=,rx<&'=,ry<&'=; void main() { int gd= !"!#",gm,ch; initgraph($gd,$gm,% %); clrscr(); do { print0(%3n A!983n &."ranslation3n +.6otate3n ;.Bcale3n ,.!xit3n%); print0(%!nter your choice>%); scan0(%4d%,$ch); s*itch(ch) { case &> cleardevice(); apoly(); tra(); breaD; case +> cleardevice(); apoly(); rot(); breaD; case ;> cleardevice(); apoly(); scale(); breaD; case ,> exit('); *hile(chH=,'); getch(); closegraph(); void apoly() { int tx; print0(%3n !nter the *idth>%); scan0(%4d%,$tx);

print0(%!nter the number o0 sides>%); scan0(%4d%,$side); 0or(i=';i<+/side;i11) { scan0(%4d%,$a<i=); a<+/side==a<'=; a<+/side1&==a<&=; dra*poly(side1&,a); 0or(i=';i<+/(side1&);i=i1+) { b<i==a<i=1tx; b<i1&==a<i1&=1tx; line(a<i=,a<i1&=,b<i=,b<i1&=); dra*poly(side,b); dra*poly(side1&,b); void tra() { int tx,ty; print0(%3n !nter the translation coordinate>%); scan0(%4d4d%,$tx,$ty); 0or(i=';i<+/(side1&);i=i1+) { c<i==a<i=1tx; c<i1&==a<i1&=1ty; d<i==b<i=1tx; d<i1&==b<i1&=1ty; line(c<i=,c<i1&=,d<i=,d<i1&=); dra*poly(side,c); dra*poly(side1&,c); dra*poly(side,d); dra*poly(side1&,d); getch(); void rot() { int xr,yr; 0loat ang,ang&; print0(%3n!nter center point%); scan0(%4d4d%,$xr,$yr); print0(%3n!nter the angle o0 rotation%); scan0(%40%,$ang); ang&=ang/(;.&,F&J'); 0or(i=';i<+/(side1&);i=i1+) { rx<i==xr1(a<i=.xr)/cos(ang&).(a<i1&=.yr)/sin(ang&); rx<i1&==yr1(a<i=.xr)/sin(ang&)1(a<i1&=.yr)/cos(ang&); ry<i1&==xr1(b<i=.xr)/cos(ang&).(b<i1&=.yr)/sin(ang&); ry<i1&==yr1(b<i=.xr)/sin(ang&)1(b<i1&=.yr)/cos(ang&); line(rx<i=,rx<i1&=,ry<i=,ry<i1&=); dra*poly(side,rx); dra*poly(side1&,rx);

dra*poly(side,ry); dra*poly(side1&,ry); getch(); void scale() { 0loat sx,sy; print0(%3n!nter scaling value%); scan0(%4040%,$sx,$sy); 0or(i=';i<+/(side1&);i=i1+) { e<i==a<i=/sx; e<i1&==a<i1&=/sy; 0<i==b<i=/sx; 0<i1&==b<i1&=/sy; line(e<i=,e<i1&=,0<i=,0<i1&=); dra*poly(side,e); dra*poly(side1&,e); dra*poly(side,0); dra*poly(side1&,0); getch(); -

OUTPUT: "hree imensional Kro:ection Aenu &."ranslation +.6otation ;.Bcaling ,.!xit !nter the choice>& !nter the *idth>5' !nter "he no o0 sides>; !nter the sides>+5 &'' +'' 5' &'' ;''

!nter the "ranslation coordinates>5' &''

!nter the choice>+ !nter the *idth>5' !nter "he no o0 sides>; !nter the sides>+5 &'' +'' 5' &'' ;''

!nter the center point &'' +'' !nter the angle o0 rotation ,5

!nter the choice>; !nter the *idth>5' !nter "he no o0 sides>; !nter the sides>+5 &'' +'' 5' &'' ;''

!nter the scaling value>5 5

!nter the choice>,

EX.NO: DATE:

3D PRO!ECTION

#include<stdio.h> #include<conio.h> #include<math.h> #include<graphics.h> int pts<=={&'',&'',&'',&5',&5',&5',&5',&'',&'',&''-; int pts&<&'=,pts+<&'=,pts;<&'=; int d=,',e=5'; void main() { int i,gd= !"!#",gm; clrscr(); initgraph($gd,$gm,%%); 0or(i=';i<G;i=i1+) { pts&<i==pts<i=1d; pts&<i1&==pts<i1&=1e; dra*poly(5,pts); dra*poly(5,pts&); 0or(i=';i<@;i1=+) line(pts<i=,pts<i1&=,pts&<i=,pts&<i1&=); gotoxy(,,&5); print0(%0ront vie*3n%); 0or(i=';i<G;i1=+) { pts+<i==pts<i=.@5; pts+<i1&==pts<i1&=1&5'; dra*poly(5,pts+); gotoxy(;',&5); print0(%sidevie*3n%); 0or(i=';i<=G;i11) { i0(i==,IIi==E) pts;<i==pts<i=1d1e; else pts;<i==pts<i=1(d1e)F+; 0or(i=';i<=G;i=i1+) { pts;<i==pts;<i=1@'; pts;<i1&==pts;<i1&=1&''; dra*poly(5,pts;); getch(); closegraph(); -

OUTPUT:

&.

L679" MN!O

+.

BN ! MN!O

EX.NO:" DATE:

COLOR MODELS

#include<stdio.h> #include<conio.h> void rgbtocmy(0loat,0loat,0loat); void cmytorgb(0loat,0loat,0loat); void main() { 0loat x&,y&,P&; int c, a; clrscr(); do { print0(%color models3n%); print0(%&.6Q( to#AR3n +.#AR to 6Q(3n !SN"%); print0(%!nter the choice%); scan0(%4d%,$a); s*itch(a) { case &> print0(%enter the 6Q( value%); scan0(%404040%,$x&,$y&,$P&); rgbtocmy(x&,y&,P&); breaD; case +> print0(%!nter the #AR value%); scan0(%404040%,$x&,$y&,$P&); cmytorgb(x&,y&,P&); breaD; case ;> exit('); print0(% o you *ant to continue press&>%); scan0(%4d%,$c); *hile(c==&); getch(); void rgbtocmy(0loat x&,0loat y&,0loat P&) { 0loat r,g,b; r=x&; g=y&; b=P&; x&=&.x&; y&=&.y&; P&=&.P&; print0(%6Q( value3n%); print0(%6=403t Q=403t (=403t%,r,g,b); print0(%converted #AR value3n%); print0(%#=403t A=403t R=403n%,x&,y&,P&); void cmytorgb(0loat x&,0loat y&,0loat P&)

{ 0loat c,m,y; c=x&; m=y&; y=P&; x&=&.x&; y&=&.y&; P&=&.P&; print0(%#AR value%); print0(%#=403t A=403t R=403t%,c,m,y); print0(%converted 6Q( value>3n%); print0(%6=403t Q=403t (=403t%,x&,y&,P&); -

OUTPUT:
#olor models &.6Q( to #AR +.#AR to 6Q( ;.!SN" !nter the choice & !nter the 6Q( value .+; .;5 .++ 6Q( value 6='.+;'''' Q='.;5'''' (='.++'''' #onverted #AR value #='.@@'''' A='.E5'''' R='.@J'''' o you *ant to continue press &> & #olor models &.6Q( to #AR +.#AR to 6Q( ;.!SN" !nter the choice + !nter the #AR value.@@ .E5 .@J #AR value #='.+;'''' A='.;5'''' R='.++'''' #onverted 6Q( value 6='.@@'''' Q='.E5'''' (='.@J''''

EX.NO:# DATE:

TEXT COMPRESSION

#include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> #include<stdlib.h> void main() { LNT! /0&,/0+; int i=',:=',a=',b=',D,count=&; char s<;'=,s+<;'=,s&<;'=,c<;'=; clrscr(); print0(%3n !nter the message%); scan0(%4s%,$s); 0&=0open(%U>3N9K8"."S"%,%*%); *hile(s<i=H=)3')) { i0(s<i=H=s<i1&=) { i0(count>=+) { s&<:1&==s<i=; itoa(count,c,&'); s&<:11==)#); s&<:11==c<'=; i0(count>G) s&<:11==c<i=; else 0or(D=';D<count;D11) s&<:11==s<i=; i11; count=&; else { count11; i11; s&<:11==)3'); 0print0(0&,%4s%,s&); print0(%3n the encoded message 4s%,s&); 0close(0&); 0+=0open(%V>pN9K8"."S"%,%r%); 0scan0(0+,%4s%,s&); *hile(s&<a=H=)3')) { i0(s&<a1&===)#)) { c<'==s&<a1+=;

c<&==)3'); count=atoi(c); 0or(D=';D<count;D11) s+<b11==s&<a=; a1=;; else { s+<b11==s&<a=; a11; s+<b11==)3'); i0(strcmp(s+,s)==') print0(%3n "he encode message3n4s%,s+); else print0(%"he encoded message3n4s%,s); 0close(0+); getch(); -

OUTPUT: !nter the message>(77" "he encoded message (#+" "he decoded message (77"

EX.NO: DATE: AIM:

IMAGE EDITING USING FLASH

"o edit di00erent image using 0lash. ALGORITHM: STEP1: 7pen a ne* 0lash document using Lile.>9e* option STEP 2: 8sing the reWuired tools per0orm the various programs as 0ollo*s..

EX.NO:

MOTION TWEENING

DATE: 1.Draw the circle and set the Create motion tween.

2. Set Insert keyframe and move the circle in particular position using selection tool.

3. To show it in full screen !ress "ctrl#enter$ or select "test movie$ from "control$ menu.

OUTPUT:

EX.NO: DATE:

SHAPE TWEENING

1. Draw the circle.

2. Set the "Insert key frame$.

3. i.

Draw the S%uare over the circle.

ii. Select the "!roperties$ from "&indow$ menu or !ress "ctrl#'3$. iii. Set "tween$ property as "Shape$.

(. To show it in full screen !ress "ctrl#enter$ or select "test movie$ from "control$ menu.

OUTPUT:

EX.NO: DATE:

MASKING

1. Type the te)t using "te)t tool$ and set the "Insert *ey frame$.

2. Create another layer as layer2 from "Insert +, Timeline +, -ayer$ or right click the layer1 and select the "Insert layer$.

3. Draw the Circle in front of the te)t and set the "Create .otion tween$.

(. .ove the circle at the end of the te)t. /. 0ight click the layer2 and select the mask.

1. To show it in full screen !ress "ctrl#enter$ or select "test movie$ from "control$ menu. OUTPUT:

EX.NO: DATE:

WORD BREA$ING

&.Belect the reWuired text using the text tool.

+.Belect the text and press Xctrl1(Y

;.6ight clicD the text and select distribute to layers. ,. elete the 0irst layer in the 0rame box.

5.Bet the 0rame at 5'. E.Aove the 0rame to the starting 0rame siPe. @.Aove the letters to the reWuired place .

J.Belect the motion t*een 0or each letter. G."o sho* it in 0ull screen,Kress Xctrl1enterY or select Xtest movieY 0rom XcontrolY menu.

OUTPUT:

EX.NO: DATE:

%OOM IN EFFECT

&.Belect the image using the image edit tool in the 0ile.

+.Bet Dey 0rame to various places by moving the image . ;."urn the image at a speci0ied place to sho* the e00ect o0 Pooming the picture. ,."o sho* it in 0ull screen,Kress Xctrl1enterY or select Xtest movieY 0rom XcontrolY menu.

OUTPUT:

RESULT: "hus the image is edited using 0lash success0ully .

EX.NO: DATE: AIM:

IMAGE EDITING USING PHOTOSHOP

"o edit di00erent image using photoshop. ALGORITHM: STEP1: 7pena ne* document using Lile.>9e* option STEP2:!nter the name ,change the resolution ,siPe(*idth $ height)and mode. STEP3:"he 0ollo*ing exercises represents the action o0 the each tool.

EX.NO:

IMAGE EDITING USING

RECTANGULAR OR
DATE:

ELLIPTICALMARQUEE TOOL

1. 2pen a new document using file +, new option. 2. 3nter the name change the resolution si4e5width 6 height7 and mode.

3. 2pen an Image. (. Select "0ectangular mar%uee tool 8 3lliptical mar%uee tool$ from the tool9o). /. Select an area from the image.

1. Copy the Selected Image using "3dit +, Copy$ or press "ctrl#c$.

:. Create another Document.

;. !aste the copied image in newly created document.

OUTPUT:

EX.NO: DATE:

IMAGE EDITING USING LASSO TOOLS

1. 2pen a new document using file +, new option. 2. 3nter the name change the resolution si4e5width 6 height7 and mode.

3. 2pen an image and select the

"magnetic lasso tool$.

(. Select an area using the magnetic lasso tool.

/. Copy the Selected area using "3dit +, copy$ or press "ctrl#c$.

1. Create an another document and paste the copied image in it.

OUTPUT:

EX.NO:

IMAGE EDITING BY CHANGING THE

CURVE
DATE:

1. 2pen a new document using file +, new option. 2. 3nter the name change the resolution si4e5width 6 height7 and mode.

3. 2pen and select an image and go to "Image +,

<d=ustments +, Curves$ or press "Ctrl#.$.

(. Change the Curves Input.

OUTPUT:

EX.NO: DATE:

IMAGE EDITING USING CLONE STAMP

1. 2pen a new document using file +, new option. 2. 3nter the name change the resolution si4e5width 6 height7 and mode.

3. 2 p e n

two different images. (. Select "Clone Stamp tool$ from tool 9o). /. !ress "<lt$ and "Click$ on the image which we want to clone.

1. .ove the cursor over the second image where we want to place the cloned image.

OUTPUT:

EX.NO: DATE:

IMAGE EDITING USING HORI%ANTAL IMAGE TOOL

&.7pen a ne* document using 0ile.> ne* option. +.!nter the name ,change the resolution ,siPe(*idth $ 1height),and mode.

;.7pen the image.

,.Belect the over all image and copy the image. 5.open a ne* *indo* and paste the t*o copies. E.select one o0 the image and right clicD. @.select the horiPantal vie* and clicD it. J.it displays the 0ollo*ing image. OUTPUT:

EX.NO: IMAGE EDITING USING ART & HISTOR' TOOL DATE &.7pen a ne* document using 0ile.> ne* option. +.!nter the name ,change the resolution ,siPe(*idth $ 1height),and mode.

;.7pen the image.

,.Belect the art tool. 5.Crt the image using the selected tool.

E.8se the history tool to display the reWuired image.

OUTPUT:

RESULT: "hus the image is edited using photoshop success0ully .

EX.NO:1 DATE:

LIANG BARS$' LINE CLIPPING ALGORITHM

#include<stdio.h> #include<conio.h> #include<math.h> #include<graphics.h> void main() { int gdriver= !"!#",gmode,x&,x+,y&,y+,l&,l+,l;,l,,op,t&,t+,t;,t,; x&=+'';x+=x&1+5';y&=+'';y+=y&1+5'; clrscr(); print0(%3nTiang (arsDy Tine #lipping Clgorithm%); print0(%3n3n!nter the coordinates o0 the line>%); scan0(%4d4d4d4d%,$l&,$l+,$l;,$l,); print0(%3n#lipping *indo* and the Tine to be clipped%); initgraph($gdriver,$gmode,%%); line(l&,l+,l;,l,); rectangle(x&,y&,x+,y+); getch(); closegraph(); print0(%3n&. o u *anna to clip the lineZ...763n+.8 *anna exit>%);

print0(%3n!nter the option>%); scan0(%4d%,$op); i0(op==&) { i0(l&<x&) { l&=x&;t&=&; i0(l;>x+) { l;=x+;t+=&; i0(l+<y&) { l+=y&;t;=&; i0(l,>y+) { l,=y+;t,=&; i0((t&==&$$t+==&$$t;==&)II(t+==&$$t;==&$$t,==&)II(t;==&$$t,==&$$t&==&)II (t,==&$$t&==&$$t+==&)) { print0(%3n#lipped Tine%); initgraph($gdriver,$gmode,%%); rectangle(x&,y&,x+,y+); getch(); closegraph(); else { clrscr(); print0(%3n#lipped Tine%); initgraph($gdriver,$gmode,%%); rectangle(x&,y&,x+,y+); line(l&,l+,l;,l,); getch(); closegraph(); exit(&); -

OUTPUT:
Tiang (arsDy Tine clipping Clgorithm ............................................... !nter the coordinate o0 the line>&'' +'' ;'' ,'' #lipping *indo* and the line to be clipped

&. o you *ant to clip the line

+. o you *ant to exit !nter your option>& #lipped Tine

EX.NO:2 DATE:

ANIMATION USING (C

#include<stdio.h> #include<conio.h> #include<graphics.h> void main() { int x=',y=',i,max?x,max?y; int gdriver= !"!#",gmode; initgraph($gdriver,$gmode,% %); 0or(i=';i<&5'';i11) { cleardevice(); x=x1&; i0(x>+'') y=y1&; setcolor(6! ); line(',,'',E;G,,''); setcolor(Q6!!9); moveto(E''1x,,''); rectangle(5'1x,;'',+''1x,;5');

rectangle(+''1x,+E',+5'1x,;5'); circle(&''1x,;@5,+5); circle(+''1x,;@5,+5); sound(5+5'); delay(&'); sound(&1;''); nosound(); getch(); -

OUTPUT:

VIVA QUESTIONS
1. &hat is pi)el> 3ach screen point in a monitor is called a pi)el8pel. It is also called picture element. 2.&hat is 2utput !rimitive> ?asic geometric structures that descri9e a scene are referred to as geometric components of pictures. <dditional output primitives that can 9e used to construct a picture include circles and other conic sections %uadric surfaces spline curves and surfaces polygon color areas and character strings. 3. &hat is DD<> The Digital Differential <naly4er is a scan+conversion line algorithm 9ased on calculating either difference in y+coordinate 5dy7 or difference in )+coordinate. &e sample the line at unit intervals in one coordinate and determine corresponding integer values nearest the line path for the other coordinate.

(. &hat are the disadvantages of DD< algorithm> 0ound+off error in successive additions of the floating+point increment can cause the calculated pi)el positions to drift away from the true line path for long line segments. 0ounding operations and floating+point arithmetic in procedure are still time+consuming. /. &hat are the 9asic lines attri9utes> ?asic attri9utes of a straight line segment are its type its width and its color. 1. 3)plain 2D Transformations. Translation 0otation Scaling Shearing 0eflection

:. Define Translation. < translation is applied to an o9=ect 9y repositioning it along a straight line path from one coordinate location to another. &e translate a original coordinate position 5) y7 to move the point to a new position 5)@ y@7. )@ A ) # t) y@ A y # ty. The translation distance pair 5t) ty7 is called a translation vector or shift vector. ;. Define 0otation. < 2+D rotation is applied to an o9=ect 9y repositioning it along a circular path in the )y plane. B. Define Scaling. < scaling transformation alters the si4e of an o9=ect. This operation can 9e carried out for polygons 9y multiplying the coordinate values 5) y7 of each verte) 9y

scaling factors s) and sy to produce the transformed coordinates 5 )@ y@ 7. )@ A ). s) y@ A y. sy. 1C. Define 0eflection. < 0eflection is a transformation that produces a mirror image of an o9=ect. The mirror image for a 2D reflection is generated relative to an a)is of reflection 9y rotating the o9=ect 1;C degree a9out the reflection a)is. 11. Define Shear. < transformation that distorts the shape of an o9=ect such that the transformed shape appears as if the o9=ect were composed of internal layers that had 9een caused to slide over each other is called a shear. 12. &hat is viewing transformation> The mapping of a part of a world+coordinate scene to device coordinates is referred to as viewing transformation. 13. Define Clipping. < !rocedure that identifies the portions of a picture which is inside the clip window is clipping algorithm or simply clipping. The region against which an o9=ect is clipped is called a clip window. 1(. &hat are the types of Clipping> !oint clipping -ine clipping <rea clipping Curve clipping Te)t clipping

1/. Categori4e the 3D representations> ?oundary representation 5?+reps7 and space+partitioning representation. 11. &hat is pro=ection>

The process of displaying 3D o9=ects on a 2D display is called as !ro=ection 1:. &hat are the types of pro=ection> !erspective pro=ection. !arallel pro=ection

1;. &hat for C.D color model used> < color model defined with the primary colors cyan magenta and yellow is useful for descri9ing color output to hard+copy devices. 1B. Define Computer animation. Computer animation refers to any time se%uence of visual changes in a scene. In addition to changing o9=ect position with translations or rotations a computer generated animation could display time variations in o9=ect si4e color transparency or surface te)ture. 2C. &hat is morphing> Transformation of o9=ect shapes from one form to another is called morphing. 21. &hat is Eolography> It is defined as the means of creating a uni%ue photographic image without the use of a lens.

22. &hat are the important processes in image processing> Image recognition reconstruction. 23. Define .ultimedia> .ultimedia is defined as a Computer 9ased Interactive Communication process that incorporates te)t numeric data record 9ased data graphic art video and audio elements animation etc. It is used for descri9ing sophisticated systems that support moving images and audio. 3g.!ersonal Computer. image enhancement image synthesis and image

2(. &hat are the o9=ects of .ultimedia> Te)t Images <udio and Foice 'ull+motion and -ive video

2/. &hat are the multimedia elements> 'acsimile Document images !hotographic images Geographical information system maps Foice commands and voice synthesis <udio messages Fideo 21. 3)plain a9out .ultimedia data9ases. .ultimedia storage and retrieval d9 management systems for multimedia system d9 organi4ation for multimedia applications transaction management for multimedia systems. 2:. Say some lossy compression standards> H!3G5Hoint photographic 3)perts Group7 .!3G5.oving !icture 3)perts

Group7 Intel DFI CCITT E.211 video coding algorithm 'ractals. 2;. &hat are multimedia file formats> 0ich+Te)t 'ormat50T'7 Tagged image file format5TI''7 0esource image file format50I''7 .usical instrument digital interface5.IDI7 Hoint !hotographic 3)perts Group <udio Fideo Interchanged Indeo file 'ormat5<FI7 T&<II. 2B. &hat is DFI> The Digital Fideo Interface 5DFI7 standard was defined to provide a processor+ independent specification for a video interface that could accommodate most compression algorithms for fast multimedia displays. 3C. &hat is .IDI> This is the interface standard for file transfer 9etween a computer and a musical instrument such as a digital piano.

31. &hat is <pple@s Juick time> The JuickTime standard developed 9y <pple Computer is designed to

support .ultimedia applications. <pple@s JuickTime is viewed as a multimedia interface that is evolving to 9ecome a standard part of the <pple as well as .S+ &indows+ 9ased systems. 32. &hat is H!3G> The Hoint !hotographic 3)perts Group formed as a =oint IS2 and CCITT working committee is focused e)clusively on still+ image compression. 33. Say some loss less compression standards> !ack 9its encoding CCITT Group3 1D CCITT Group3 2D CCITT Group( -em9el+ Kiv and &elch algorithm -K&. 3(. Iame some multimedia tools. 'lash Swiss &e9 designing tools .aya .ovie .aker <do9e Dream&eaver

3/. &hat is digital pen> < digital pen is a powerful input device that allows the user to write draw point and gesture. 31. &hat are the components of !3I> 3lectronic pen and digiti4er 0ecogni4er Dictionary Display driver. 3:. 3)plain data and file format standards. TI'' 0I'' !en driver 0ecognition conte)t manager

.IDI H!3G .!3G T&<II

3;. &hat is the purpose of .I.3> .ultipurpose Internet .ail 3)tension specification defines mechanisms for generali4ing the message content to include multiple 9ody parts and multiple data types. 3B. 3)plain hypermedia messaging. .o9ile messaging Te)t messages 0ich+te)t messages Foice messages 'ull motion video management (C. &hat is the purpose of 4ooming> Kooming allows the user to see more detail for a specific area of the image. (1. Iame some image editing softwares. 1. 2. 3. (. <do9e !hotoshop !hoto!lus !aint.I3T Dream-ight !hoto 3dito

You might also like