Please download to get full document.

View again

of 5
39 views
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.

Download

Document Related
Document Description
use
Document Share
Document Tags
Document Transcript
  OUTPUT PRIMITIVESSet pixel(x,y intensity)Get pixel(x,y) LINE DRAWING ALGORITHMC!tesin sl pe inte!#ept e$%ti n & !  st!i't line *+x-.+*sl pe n/ - s te y0inte!#ept +*y10y23x10x2 0000002 -*y20+4x2 0000001 y *+ x 00000005 x * y3+ 000000067 ! lines 8it sl pe +'nit%/es 9 2, x is set p! p !ti nl t s+ll  !i: ntl /e&le#ti n ; lt'e n/ # !!esp n/in' y &! + 57 ! sl pes 8it +'nit%/e < 2 y is set p! p !ti nl t s+ll ;e!ti#l /e&le#ti n ; lt'e n/ # !!esp n/in'  !it nl /e&le#ti n ; lt'e set p! p !ti nl t x &! + 6DAA ALGORITHMDi'itl /i&&e!entil nly:e! is -se/ n #l#%ltin' x ! yWe s+ple te line ! %nit inte!;ls in ne # !/inte n/ /ete!+ine # !!esp n/in' inte!'e! ;l%es ne!est te line pt & ! te te! # !/inteP siti;e sl peI& sl pe 9*2 x*2 n/ # +p%te y = 2 *y = +>*2 is in#!ese/ -y I %ntil te &inl en/p int is !e#e/I& sl pe <2 , y*2 n/ # +p%te ? =2 *? = 23+ (le&t en/ p int t !i't en/ p int)  I& tis p! #essin' is !e;e!se/, st!tin' en/p int is t !i't ?*02  =2 *y = 0+ Sl pe <2, y*02 n/ ? =2 *? = 023+DAA is &ste! +et / , /is/;nt'e n/ ! %n/ && e!! ! #n #%se #l#%lte/ pixel p siti ns t /!i&t 8y &! + te t!%e line pt Procedure line DAA(x,y,x-,y-*inte!'e!)V! /x,/y,steps,=@*inte!'e!. xin#,yin#,x,y@*!ele'in /x*x-0x /y*y-0y I& -s(/x)<-s(/y) ten steps *-s(x) else steps*-s(/y) xin#*/x3steps yin#*/y3steps x*x y*y Setpixel(! %n/(x),! %n/(y),2). & ! =*2 t steps /  x*xxin#. y*yyin#. Setpixel(! %n/(x),! %n/(y),2) En/En/.(line DAA)  !esen+Bs line l' !it+De;el pe/ -y -!esen+ 4Use/ t /!8 line, /pte/ t /isply #i!#les n/ #%!;es4 Spe#i&ie/ line pt 25 21 22 2 2 22 21 25 Ve!ti#l xes s 8 s#n0line p siti n n/  !i: ntl xes i/enti&y pixel # l%+ns4S+plin' t %nit 22 inte!;l, /e#i/e 8i# & t8 p ssi-le pixel p siti n is #l se! t te line pt t e# s+ple step4Next p siti n (22,22) ! (22,21) Ans8e!e/ -y !esen+Bs line l' !it+ -y testin' te si'n & te inte'e! p!+ete! n/ /i&&e!en#e -et8een te sep!ti ns & te t8 pixel p siti ns &! + te #t%l line ptP siti;e sl pe 92 C%!!ent pixel p siti n(x = ,y = ),next pixel 8 %l/ -e t (x = 2,y = ) n/ (x = 2,y = 2)At x = 2  =2  /1  /2 y =     x =2 te y # !/inte n te +te+ti#l line t pixel # l%+n p siti n x =2 is y*+(x = 2)- 2ten /2*y0y =  * +(x = 2)-0y = 1 &! + 2An/ /1*(y = 2)0y *y = 20+(x = 2)0- /20/1*1+(x = 2)01y = 1-02A /e#isi n p!+ete! p =  is -tine/ -y &in/in' +* y3 x P = * x(/20/1) *1 y4x = 01 x4y = #Si'n & p = is si'n & (/20/1)   sin#e   x<P!+ete! # is  # nstnt C*1 y x(1-02)I& /29/1 , 8e pl t te l 8e! pixel p =  is ne'ti;e4 Ote!8ise 8e pl t te %ppe! pixel P =2 * 1 y4x =2 0 1 x y =2 #P =2 0p = *1 y(x =2 0x = )01 x(y =2 0y = )%t x =2 *x = 2 s ttP =2 * p=1 y01 x(y =2 0y = )Te &i!st p!+ete! p   is e;l%te/ st!tin' &! + pixel p siti n (x   y ) n/ +* x3 y
Previous Slide

3. ISK FIX

Similar documents
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x