BO GIAO DUC vA DAo TAO " TRUONG D~I HQC' DAN L~P' NGO~I NGU ~ TIN HQC TP.HCM KHOAC6NGNGHtTH6NGTm I r KHOA LuAN TOT NGHIEP • • NGHIEN CUU THU VIEN DO HOA NGUON MO AGG vA VIET UNG DUNG BIEN TAp THU VI~N QuAN LY MAu DliONG, MAu vA cAc BIEU TUONG TRONG BAN DO • TO k? I p GIANG VIEN HU'ONG DAN: SINH VIEN THVC HltN: TH.S NGUYEN MINH NAM PHAN THANH TUNG - 0311267 DUONG HOA PHONG - 0311204 Ml)C Ll)C G I 01 T HI~U • , • 0, CHU'ON G 1.1 Tang quan v~ cac thO' vi~n d6 hQa (Graphic Library) 1.2 Cac d~c di~m chinh cua AGG 1.3 MQt s8 u'ng dl}.ngClla AGG thl}.'ct~ 12 1.3.1 SVG Viewer 12 1.3.2 C rea tive Docs.N et 14 1.3.3 KSV G 15 1.3.4 Trang web ban d6 cua cong ty Dolsoft 15 1.3.5 RealWorld 16 1.3.6 Ung dl}.ng ch~y tren PDA cua cong ty Dolsoft Inc Graphics 17 j 1.4 Su'c m~nh clla template C++ 18 1.5 So sanh AGG vo'i GDI+ 19 1.6 Cac khai ni~m cO'ban 21 1.6.1 Anti-Aliasing va Subpixel Accuracy 1.6.2 Mau (Color), khong gian mau (Color Space) va dinh d~ng di~m anh (Pixel Formats) 21 26 1.6.3 Boon vi h~ tQa dQ (Coordinate 1.6.4 Scanline Container 1.7 Units) 28 28 Ki~n truc AGG 31 1.7.1 Pixel Format Renderers 31 1.7 Alpha-Mask 32 1.7.3 Basic Renderers 32 1.7.4 Scan line Renderer 32 1.7.5 Span Generator 33 1.7 Scanline Rasterizer 34 1.7 utli ne Re nd ere rs 34 1.7.8 Outline Rasterizer 34 1.7.9 Vertex Conversion Adaptor Pipeline 35 1.7.10 Vertex Source 35 1.7.11 Rendering 35 1.8 Buffer~ K~t lu~n 36 CHUON G 37 2.1 NQi suy mau doon gian (Simple Color Interpolation) 2.2 Phep bi~n d&i phBi canh vo'i anh (Image Parallelogram Transformations 2.3 Using Perspective Texts Rasterization Exposures Transformations) 37 37 39 2.4 SUOdl,mg API d~ render text 40 2.5 NQi suy vo'i dU'O'ngcong Bezier (Bezier curve) 41 2.6 Di~u chinh Gamma Anti-Aliasing 47 2.7 Gouraud Shading 47 2.8 Alpha-mask 48 2.9 T:,to chfi' dQc theo dU'o'ng cong va line pattern bftng anh 49 • 2.10 K~t lu~n 51 CHU ON G 52 3.1 Yeu c~u 52 3.2 K~t lu~n 52 3.3 Hu'6'ng phat tri~n 52 3.4 Cac man hinh 53 T AI LI~U THAM KHAo 57 PH1) L 1)C 58 5.1 BCGControlBar Library (v 9.51) Professional Edition 58 5.2 Unicode Visual C/C++ 58 5.3 Tern plates C++ 60 5.4 MQt sa thu~t ngfr lien quan 60 Gi&i thi~u Trang GIOI THItU £)6 h9a may tlnh la m9t nhung llnh V\fCly thu nh~t va phat tri~n nhanh nh~t cua tin h9C S\f dai cua d6 h9a may tlnh thl,l'CS\f la CU9Ccach m~mg giao tiSp giua nguai dung va may tinh V6i luqng thong tin tn,l'c quan, da dA Hinh 3.1 - Man hinh chinh cua chuang trinh AGGEditOf Chuang - U'ng dl:mg bien tap thu vi~n Mew CtrhN Qpen ctrl~O Background ~ Save /::.s Ctrl.P I L Print Pre~ew Print Setup line Options Cut line Gradient ~opy £rjnt Color Rounded Rectangle Options Ctrl~S ~ave Trang 54 E!it faste Fill Options Qelete Fill Gradient Select /::.11 Pattern Options ~ Increase I-Order Text Options ~ D~crease I-Order Text long Blend Mode Hinh 3.2 - Menu File, Edit It Fyll Screen I 10/ Ioolbars 2tatus Bar • va Options Notepad ~rrow :._ : ~election Rectangle Paint Brush "'- ]jne Windows D Rectangle ~ BCGSoft On-line fllipse ~ircle & Eolygon ) CgIVe A Text 0/ :J ~dd or Remove Buttons Explorer RQunded Rectangle • Standard Customize • !few CtrI •.N ; Qpen • Ctrl-O 0/ ~ave - ¥ 0/ i.!-';, ~ Ctrt-S Cut Ctrt-X ~opy Qrl~C 0/ Easte QrhV ; Erint • Ctrt-P 0/ I ~out AGGEditor Beset Toolbar Hinh 3.3 - Menu View, Shape, Tools, context menu va menu cAuhinh toolbar Chuang - 11ng dl,mgbien ~p thu vi~n Lolou "'-0 So•••••• 00 Trang 55 ~c.-._~ _ Cob< Olb RI ~ 00 ~ ~ ;>A ~ ~ I ~ ~ _ c.- , Ube llDu •••• ~ ~ Ry-~ fb:Top au ~ RyT -C &-t~ , fE, UpU'" 1b:1lrottrPr • ~ u.zo: l{eclong!e _ 2D "'- ~ _ I 0- • • T •••••••••••• 5_1 """" - Hinh 3.4 - Cac dialog Background Color, Rounded Rectangle, Pattern Blend Mode ~l "'- ""- """""" ••••• •• ••• - ;> .• ""Coo :RCU'ldC.ep ""• • w _ - -;;-] -3 "",., ''''' ' ã Ơ ,., ~""" ããããã ãã ••• ••• ""'= 0,0,0 50tid Dt'1aulllmaot """'- • "" C2.::J ~ • - - tIP • l' ., • '''' t- Hinh 3.5 - Cac dialog Line Options '- • va Fill Options va Chuang - lrng dl,mgbien ~p thu vi~n Trang 56 ~ ,0 I~U 00 O{l, ;>A - - =-:;: x @ IClCOpUDns Ơ I ããããããããã ;:;;; loo.2OO,,2SS 255 TmHeil;lk-el '•-••• •.• •-011 0"'" Hinh 3.6 - Cae dialog Gradient Options ~,:; ,0 00 O{l, ;>A 1ft COFnIIWniI ~ Toobm - -l~ - va Text Options ~-""-~ J , TIJOb.~.~ e:-.rd< •• -J~ -~ ~ ,,- • J Hinh 3.7 - Cae dialog Customize va About Tai li~u tham khao Trang 57 TAl LI~U THAM KHAo [1] Maxim Shemanarev - Trang web www.antigrain.com [2] Thao lu?n AGG tren forum http://sourceforge net/mailarchive/jorum.php? forum =vector-agg- general [3] Dinh d;;mgSVG - http://www.w3.org/Graphics/SVG [4] Vng dl,mg thiSt kS anh, icon dung AGG - http://www.rw-designer.com! [5] Vng d\mg AGG KDE - http://svgkde.org! [6] http://www.gnu.org/copylejt/gpl.html [7] V ng d\mg thiSt kS banner, poster dung AGG http://www.creativedocs.net [8] Dinh d:;mgPPM - http://netpbm.sourceforge.net/doc/ppm.html [9] M(>ts6 thu?t ngfr c16ha may tinh - www.directron.com [10] Hoang KiSm, Duong Anh Duc, Le Dinh Duy, VU Hai Quan - Co so' a6 h9a may tinh - NXB GD 2003 [11] H6 T~t Thanh - Gild philp toem di?n su dl;lng Tiing Visual C/C++ - DHQG Ha N(>i [12] Khoa CNTT HUFLIT - Lgp trinh tren Windows Vi?t Unicode vai Trang 58 Ph1,111,1C PHT) LT)C 5.1 BCGControlBar BCGControlBar Library (v 9.51) Professional (Business Professional Edition la mQt thu vi~n Components Edition Gallery ma rQng cho MFC Control Bar) giup t