kolibrios/programs/develop/libraries/buf2d/trunk/about.htm
IgorA 0d1db9d12d 1) 'vox_editor' update
2) 'buf2d.obj' add new function 'buf2d_rotate'

git-svn-id: svn://kolibrios.org@2975 a494cfbc-eb01-0410-851d-a64ba20cac60
2012-10-01 10:45:57 +00:00

408 lines
21 KiB
HTML

<html>
<head>
<title>áčáëčîňĺęŕ äë˙ đŕáîňű ń 2d áóôĺđŕěč</title>
<meta http-equiv="content-type" content="text/html; charset=WINDOWS-1251">
<style>
body
{
font-size: 15px;
font-family: "Bookman Old Style";
color: black;
text-align: justify;
}
h1 { color: green; font-size: 23px; }
h2 { color: green; font-size: 21px; }
h3 { color: green; font-size: 19px; }
h4 { color: #803f00; font-size: 17px; }
i { color: #0099cc; }
b { color: #0099cc; }
p {
text-indent: 1em;
margin-top: 3px;
margin-bottom: 2px;
margin-left: 0px;
margin-right: 0px;
}
ol, ul, dl{
margin-top: 3px;
margin-bottom: 2px;
}
pre
{
padding: 2px;
padding-left: 20px;
margin-top: 5px;
margin-bottom: 5px;
margin-left: 0px;
margin-right: 0px;
font-family: "Courier New";
font-size: 15px;
color: #004000;
background-color: #ffd0ff;
}
table { font-size: 15px; }
</style>
</head>
<body>
<h1>Îăëŕâëĺíčĺ</h1>
<ul>
<li>Âńňóďëĺíčĺ</li>
<li><a href="#format_buf">Ôîđěŕňű áóôĺđîâ</a></li>
<li><a href="#fun">Ôóíęöčč</a><br>
<ul>
<li><a href="#f_init">lib_init</a></li>
<li><a href="#f_b_create">buf2d_create</a></li>
<li><a href="#f_b_create_f">buf2d_create_f_img</a></li>
<li><a href="#f_b_clear">buf2d_clear</a></li>
<li><a href="#f_b_draw">buf2d_draw</a></li>
<li><a href="#f_b_delete">buf2d_delete</a></li>
<li><a href="#f_b_rotate">buf2d_rotate</a></li>
<li><a href="#f_b_hdiv2">buf2d_img_hdiv2</a></li>
<li><a href="#f_b_wdiv2">buf2d_img_wdiv2</a></li>
<li><a href="#f_c_color">buf2d_crop_color</a></li>
<li><a href="#f_v_brush_c">buf2d_vox_brush_create</a></li>
</ul>
</li>
<li><a href="#const">Ęîíńňŕíňű</a></li>
<li><a href="#tabl_e">Ňŕáëčöŕ ýęńďîđňŕ</a></li>
<li><a href="#hist">Čńňîđč˙</a></li>
</ul>
<h1>Âńňóďëĺíčĺ</h1>
<p>Äîęóěĺíňŕöč˙ ę ńâîáîäíîé áčáëčîňĺęĺ <b>buf2d.asm</b>, äë˙ <b>ÎŃ Ęîëčáđč</b>.
Ýňŕ áčáëčîňĺęŕ ńîçäŕíŕ äë˙ đŕáîňű ń 2d čçîáđŕćĺíč˙ěč.
Ń ĺĺ ďîěîůüţ ěîćíî ńîçäŕâŕňü áóôĺđŕ ń čçîáđŕćĺíč˙ěč â ďŕě˙ňč, č ďđč íĺîáőîäčěîńňč âűâîäčňü čő íŕ ýęđŕí.
Čçîáđŕćĺíč˙ ěîćíî íŕęëŕäűâŕňü îäíî íŕ äđóăîĺ, ďîääĺđćčâŕĺňń˙ đŕáîňŕ ń ďđîçđŕ÷íűěč čçîáđŕćĺíč˙ěč.
Ĺńňü ôóíęöčč đčńîâŕíč˙ ëčíčé, ęđčâűő Áĺçüĺ, ďđ˙ěîóăîëüíčęîâ, îęđóćíîńňĺé.
Ňŕęćĺ ĺńňü ôóíęöčč äë˙ đčńîâŕíčé âîęńĺëüíîé ăđŕôčęč.</p>
<p>Ďîńëĺäíĺĺ îáíîâëĺíčĺ áčáëčîňĺęč 01.10.12.</p>
<h1><a name="format_buf">Ôîđěŕňű áóôĺđîâ</a></h1>
<p>Ďîääĺđćčâŕĺňń˙ 3 ôîđěŕňŕ áóôĺđîâ.
Ęŕćäŕ˙ ôóíęöč˙ ďđč đŕáîňĺ ń áóôĺđŕěč ěîćĺň áűňü đŕń÷čňŕíŕ íŕ đŕáîňó ń îďđĺäĺëĺííűěč ôîđěŕňŕěč čçîáđŕćĺíčé.</p>
<h4>8 áčň</h4>
<p>Ńîćĺđćčň ŕëüôŕ ęŕíŕë <b>a</b> (ďđîçđŕ÷íîńňü) čçîáđŕćĺíč˙. Íŕ ýęđŕí íĺ âűâîäčňń˙. Čńďîëüçóĺňń˙ äë˙ ńîçäŕí˙ 32-áčňíűő áóôĺđîâ.</p>
<h4>24 áčň</h4>
<p>Äŕííűé áóôĺđ ńîäĺđćčň čçîáđŕćĺíčĺ â ôîđěŕňĺ <b>rgb</b>. Ěîćĺň âűâîäčňń˙ íŕ ýęđŕí.</p>
<h4>32 áčň</h4>
<p>Ńîäĺđćčň ďđîçđŕ÷íîĺ čçîáđŕćĺíčĺ â ôîđěŕňĺ <b>rgba</b>. Íŕ ýęđŕí íĺ âűâîäčňń˙. Čńďîëüçóĺňń˙ äë˙ íŕëîćĺíč˙ čçîáđŕćĺíčé. Ĺńëč <b>a=255</b> ňî ďčęńĺëü ďđîçđŕ÷íűé, ĺńëč <b>0</b> íĺ ďđîçđŕ÷íűé.</p>
<h1><a name="fun">Ôóíęöčč</a></h1>
<p>Ďî÷ňč âńĺ ôóíęöčč 1-ě ďŕđŕěĺňđîě ďđčíčěŕţň óęŕçŕňĺëü íŕ ńňđóęňóđó áóôĺđŕ,
čç ęîňîđîé ěîăóň čńďîëüçîâŕňüń˙ ďŕđŕěĺňđű, íóćíűĺ äë˙ đŕáîňű ęîíęđĺňíîé ôóíęöčč.
Ďđčěĺđ ńňđóęňóđű áóôĺđŕ čçîáđŕćĺíč˙:</p>
<pre>align 4
buf_0:
dd 0 ;+ 0 óęŕçŕňĺëü íŕ áóôĺđ čçîáđŕćĺíč˙
dw 100 ;+ 4 îňńňóď ńëĺâŕ
dw 10 ;+ 6 îňńňóď ńďđŕâŕ
dd 150 ;+ 8 řčđčíŕ
dd 100 ;+12 âűńîňŕ
dd 0x80 ;+16 ôîíîâűé öâĺň
db 24 ;+20 áčň íŕ ďčęńĺëü</pre>
<h4><a name="f_init">lib_init</a></h4>
<p>Ýňŕ ôóíęöč˙ ďîëó÷ŕĺň óęŕçŕňĺëč íŕ ôóíęöčč đŕáîňű ń ďŕě˙ňüţ, âűçűâŕňń˙ äîëćíŕ ďđč çŕăđóçęĺ áčáëčîňĺęč. Ěîćĺňĺ čńďîëüçîâŕňü ěŕęđîń <b>@use_library_mem</b>, äë˙ ĺĺ ŕâňîěŕňč÷ĺńęîé íŕńňđîéęč.</p>
<h4><a name="f_b_create">buf2d_create</a></h4>
<p>Ńîçäŕĺň áóôĺđ č ÷čńňčň ĺăî ôîíîâűě öâĺňîě. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_create], buf_0</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ.</p>
<p>Ďŕđŕěĺňđű äë˙ ńîçäŕíč˙ áóôĺđŕ áĺđóňń˙ čç ńňđóęňóđű.</p>
<h4><a name="f_b_create_f">buf2d_create_f_img</a></h4>
<p>Ńîçäŕĺň áóôĺđ íŕ îńíîâĺ čçîáđŕćĺíč˙ â ôîđěŕňĺ <b>rgb</b>.</p>
<h4><a name="f_b_clear">buf2d_clear</a></h4>
<p>×čńňčň áóôĺđ óęŕçŕíűě öâĺňîě. Ďđčěĺđ:</p>
<pre>buf2d_color equ dword[edi+16] ;öâĺň ôîíŕ áóôĺđŕ
mov edi,buf_0
stdcall [buf2d_clear], edi, buf2d_color ;î÷čůŕĺě ýęđŕí ôîíîâűě öâĺňîě</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ.</p>
<h4><a name="f_b_draw">buf2d_draw</a></h4>
<p>Đčńóĺň áóôĺđ íŕ ýęđŕíĺ (đŕáîňŕĺň ÷ĺđĺç ńčńňĺěíóţ ô. 7). Đčńóţňń˙ ňîëüęî áóôĺđŕ ń ăëóáčíîé öâĺňŕ 24 áčňŕ.</p>
<h4><a name="f_b_delete">buf2d_delete</a></h4>
<p>Îńâîáîćäŕĺň ďŕě˙ňü çŕí˙ňóţ čçîáđŕćĺíčĺě áóôĺđŕ.</p>
<h4><a name="f_b_rotate">buf2d_rotate</a></h4>
<p>Ďîâîđŕ÷čâŕĺň áóôĺđ íŕ 90 čëč 180 ăđŕäóńîâ. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_rotate], buf_0, 90</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ (ěîćĺň áűňü 8, 24 čëč 32 áčňíűě); 90 - óăîë ďîâîđîňŕ.</p>
<h4>buf2d_resize</h4>
<p>Čçěĺí˙ĺň đŕçěĺđű áóôĺđŕ. Ďîęŕ ďîääĺđćčâŕţňń˙ áóôĺđŕ ń ăëóáčíîé öâĺňŕ 24 áčňŕ. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_resize], buf_0, 0,300 ;čçěĺí˙ĺě âűńîňó áóôĺđŕ</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ â ęîňîđîě áóäĺň đčńîâŕňüń˙ ëčíč˙; 0 - íîâŕ˙ řčđčíŕ áóôĺđŕ (0 îçíŕ÷ŕĺň íĺ čçěĺí˙ňü đŕçěĺđ); 300 - íîâŕ˙ âűńîňŕ áóôĺđŕ.</p>
<h4>buf2d_line</h4>
<p>Đčńóĺň â áóôĺđĺ ëčíčţ ń çŕäŕííűě öâĺňîě č ęîîđäčíŕňŕěč. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_line], buf_0, 30,10, 110,70, 0xffff00 ;đčńóĺě ëčíčţ</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ â ęîňîđîě áóäĺň đčńîâŕňüń˙ ëčíč˙; 30, 10, 110, 70 - ęîîđäčíŕňű ëčíčč; 0xffff00 - öâĺň ëčíčč.</p>
<p>Äë˙ đčńîâŕíč˙ ńăëŕćĺííîé ëčíčč čńďîëüçóéňĺ <b>buf2d_line_sm</b>.</p>
<h4>buf2d_line_sm</h4>
<p>Đčńóĺň â áóôĺđĺ ëčíčţ ďđčíčěŕĺň ňŕęčćĺ ďŕđŕěĺňđű ęŕę č ôóíęöč˙ <b>buf2d_line</b>. Äŕííŕ˙ ôóíęöč˙ đčńóĺň ńăëŕćĺííóţ ëčíčţ áîëĺĺ ęđŕńčâóţ ÷ĺě <b>buf2d_line</b>, íî đŕáîňŕĺň ěĺäëĺííĺĺ íĺ¸ çŕ ń÷ĺň âű÷čńëĺíč˙ ńěĺřŕííűő öâĺňîâ ôîíŕ č ńŕěîé ëčíčč.</p>
<h4>buf2d_rect_by_size</h4>
<p>Đčńóĺň ďđ˙ěîóăîëüíóţ đŕěęó, ďî äâóě ęîîđäčíŕňŕě, 2-˙ ęîîđäčíŕňŕ çŕäŕíŕ ďî đŕçěĺđó. Ĺńëč đŕçěĺđű îňđčöŕňĺëüíűĺ đŕěęŕ đčńóĺňń˙ â îáđŕňíîě íŕďđŕâëĺíčč.</p>
<pre>stdcall [buf2d_rect_by_size], buf_0, 10,10,150,100, 0x8080</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ â ęîňîđîě áóäĺň đčńîâŕňüń˙ ďđ˙ěîóăîëüíčę; 10, 10 - ęîîđäčíŕňű ëĺâîăî âĺđőíĺăî óăëŕ (ďđč îňđčöŕňĺëüíűő đŕçěĺđŕő ęîîđäčíŕňŕ ďđŕâîăî íčćíĺăî); 150, 100 - đŕçěĺđ ďđ˙ěîóăîëüíčęŕ; 0x8080 - öâĺň ëčíčč.</p>
<h4>buf2d_filled_rect_by_size</h4>
<p>Đčńóĺň çŕęđŕřĺííűé ďđ˙ěîóăîëüíčę, ďî äâóě ęîîđäčíŕňŕě, 2-˙ ęîîđäčíŕňŕ çŕäŕíŕ ďî đŕçěĺđó. Ĺńëč đŕçěĺđ çŕäŕňü 1*1, ňî áóäĺň íŕđčńîâŕíŕ ňî÷ęŕ đŕçěĺđîě â 1 ďčęńĺëü, ň.ĺ. đŕçěĺđ ďđ˙ěîóăîëüíčęŕ â ďčęńĺë˙ő áóäĺň đŕâĺí óęŕçŕííîěó. Ĺńëč đŕçěĺđű îňđčöŕňĺëüíűĺ ďđ˙ěîóăîëüíčę đčńóĺňń˙ â îáđŕňíîě íŕďđŕâëĺíčč.</p>
<pre>stdcall [buf2d_rect_by_size], buf_0, 10,10,150,100, 0x8080</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ â ęîňîđîě áóäĺň đčńîâŕňüń˙ ďđ˙ěîóăîëüíčę; 10, 10 - ęîîđäčíŕňű ëĺâîăî âĺđőíĺăî óăëŕ (ďđč îňđčöŕňĺëüíűő đŕçěĺđŕő ęîîđäčíŕňŕ ďđŕâîăî íčćíĺăî); 150, 100 - đŕçěĺđ ďđ˙ěîóăîëüíčęŕ; 0x8080 - öâĺň ďđ˙ěîóăîëčęŕ.</p>
<h4>buf2d_circle</h4>
<p>Đčńóĺň â áóôĺđĺ îęđóćíîńňü ń çŕäŕííűě öâĺňîě č đŕäčóńîě. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_circle], buf_0, 25, 70, 15, 0xff0000</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ â ęîňîđîě áóäĺň đčńîâŕňüń˙ îęđóćíîńňü; 25, 70 - ęîîđäčíŕňű öĺíňđŕ; 15 - đŕäčóń; 0xff0000 - öâĺň.</p>
<h4><a name="f_b_hdiv2">buf2d_img_hdiv2</a></h4>
<p>Ńćčěŕĺň čçîáđŕćĺíčĺ â áóôĺđĺ ďî âűńîňĺ â 2 đŕçŕ, ďđč ýňîě đŕçěĺđ ńŕěîăî áóôĺđŕ íĺ óěĺíüřŕĺňń˙.</p>
<h4><a name="f_b_wdiv2">buf2d_img_wdiv2</a></h4>
<p>Ńćčěŕĺň čçîáđŕćĺíčĺ â áóôĺđĺ ďî řčđčíĺ â 2 đŕçŕ, ďđč ýňîě đŕçěĺđ ńŕěîăî áóôĺđŕ íĺ óěĺíüřŕĺňń˙.</p>
<h4>buf2d_conv_24_to_8</h4>
<p>Ďđĺîáđŕçîâŕíčĺ áóôĺđŕ čç 24-áčňíîăî â 8-áčňíűé.
Ďđč ďđĺîáđŕçîâŕíčč óęŕçűâŕĺňń˙ ęŕęîé öâĺň áĺđŕňü: 0-ńčíčé, 1-çĺëĺíűé, 2-ęđŕńíűé.
Îńňŕëüíűĺ öâĺňŕ ďđč ďđĺîáđŕçîâŕíčč ňĺđ˙ţňń˙.</p>
<h4>buf2d_conv_24_to_32</h4>
<p>Ďđĺîáđŕçîâŕíčĺ áóôĺđŕ čç 24-áčňíîăî â 32-áčňíűé.
Ďđč ďđĺîáđŕçîâŕíčč óęŕçűâŕĺňń˙ ňŕęćĺ 8-áčňíűé áóôĺđ, ęîňîđűé áóäĺň čńďîëüçîâŕí äë˙ ńîçäŕíč˙ ŕëüôŕ ęŕíŕëŕ. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_conv_24_to_32],buf_a,buf_b ;äĺëŕĺě áóôĺđ rgba 32áčň</pre>
<p>Äî âűďîëíĺíč˙ ôóíęöčč áóôĺđ buf_a äîëćĺí áűňü 24 áčňíűě, ŕ áóôĺđ buf_b - 8 áčňíűě.
Ďîńëĺ âűďîëíĺíč˙ ôóíęöčč áóôĺđ buf_a ńňŕíĺň 32 áčňíűě, áóôĺđ buf_b íĺ čçěĺíčňń˙.</p>
<h4>buf2d_bit_blt</h4>
<p>Đčńóĺň â áóôĺđĺ čçîáđŕćĺíčĺ čç äđóăîăî áóôĺđŕ â óęŕçŕííűő ęîîđäčíŕňŕő. Áóôĺđ â ęîňîđîě đčńóň (ďđčĺěíčę) äîëćĺí áűňü 24 áčňíűě, ŕ ňîň ęîňîđűé đčńóĺňń˙ (čńňî÷íčę) 24 čëč 32 áčňíűě. Ĺńëč áóôĺđ čńňî÷íčę 32 áčňíűé, ňî ĺăî ďđîçđŕ÷íîńňü ďđč đčńîâŕíčč íĺ ó÷čňűâŕĺňń˙, äë˙ ó÷ĺňŕ ďđîçđŕ÷íîńňč čńďîëüçóĺňń˙ ôóíęöč˙ <i>buf2d_bit_blt_transp</i>. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_bit_blt], buf_0, 50,30, buf_1 ;ďđîđčńîâęŕ ńđĺäíĺăî ńęčíŕ</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ â ęîňîđîě áóäĺň đčńîâŕňüń˙ čçîáđŕćĺíčĺ (ďđčĺěíčę);
buf_1 - ńňđóęňóđŕ áóôĺđŕ ń đčńóĺěűě čçîáđŕćĺíčĺě (čńňî÷íčę);
50,30 - ęîîđäčíŕňű äë˙ âűâîäŕ čçîáđŕćĺíč˙, îďđĺäĺë˙ţň ďîëîćĺíčĺ đčńóĺěîé ęŕđňčíęč â buf_0.</p>
<h4>buf2d_bit_blt_transp</h4>
<p>Đčńóĺň â áóôĺđĺ čçîáđŕćĺíčĺ čç äđóăîăî áóôĺđŕ â óęŕçŕííűő ęîîđäčíŕňŕő, ďđč ýňîě ó÷čňűâŕĺňń˙ ďđîçđŕ÷íîńňü.
Áóôĺđ ęîňîđűé áóäĺň íŕđčńîâŕí äîëćĺí áűňü 32 áčňíűě, ŕ ňîň â ęîňîđîě đčńóţň 24 áčňíűě.</p>
<h4>buf2d_bit_blt_alpha</h4>
<p>Đčńóĺň â áóôĺđĺ čçîáđŕćĺíčĺ čç äđóăîăî áóôĺđŕ â óęŕçŕííűő ęîîđäčíŕňŕő, ďđč ýňîě ó÷čňűâŕĺňń˙ ďđîçđŕ÷íîńňü.
Áóôĺđ ęîňîđűé áóäĺň íŕđčńîâŕí äîëćĺí áűňü 8 áčňíűě, ŕ ňîň â ęîňîđîě đčńóţň 24 áčňíűě.</p>
<h4>buf2d_curve_bezier</h4>
<p>Đčńóĺň ďî ňđĺě ňî÷ęŕě îňđĺçîę ęđčâîé áĺçüĺ.</p>
<pre>stdcall [buf2d_curve_bezier], buf_0, (10 shl 16)+20,(110 shl 16)+10,(50 shl 16)+90, dword 0xff</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ â ęîňîđîě áóäĺň đčńîâŕňüń˙ ęđčâŕ˙;
(10 shl 16)+20,(110 shl 16)+10,(50 shl 16)+90 - ęîîđäčíŕňű ňî÷ĺę (10,20), (110,10), (50,90);
0xff - öâĺň ďđ˙ěîé.</p>
<h4>buf2d_convert_text_matrix</h4>
<p>Ďđĺîáđŕçóĺň ěŕňđčöó ń ňĺęńňîě đŕçěĺđîě 16*16 â đŕçěĺđ 1*256. Íĺîáőîäčěî äë˙ ńîçäŕíč˙ ěŕňđčöű äë˙ đčńîâŕíč˙ ňĺęńňŕ. Ďĺđĺä čńďîëüçîâŕíčĺě äŕííîé ôóíęöčč ďđĺäďîëŕăŕĺňń˙ ÷ňî ĺńňü čçîáđŕćĺíčĺ ń ďîëíűě íŕáîđîě ńčěâîëîâ đŕçěĺđîě 16 ńňîëáöîâ íŕ 16 ńňđîę, čç ęîňîđîăî ďđĺäâŕđčňĺëüíî áűë ńîçäŕí 8 áčňíűé áóôĺđ.</p>
<pre>stdcall [buf2d_create_f_img], buf_1,[image_data] ;ńîçäŕĺě áóôĺđ 24 áčň íŕ îńíîâĺ äŕííűő čçîáđŕćĺíč˙
stdcall [buf2d_conv_24_to_8], buf_1,1 ;äĺëŕĺě áóôĺđ ďđîçđŕ÷íîńňč 8 áčň
stdcall [buf2d_convert_text_matrix], buf_1</pre>
<p>ăäĺ buf_1 - ńňđóęňóđŕ áóôĺđŕ äë˙ ôîđěčđîâŕíč˙ ňĺęńňîâîé ěŕňđčöű;
image_data - äŕííűĺ čçîáđŕćĺíč˙ ňĺęńňîâîé ěŕňđčöű â ôîđěŕňĺ rgb, đŕçěĺđîě 16*16 ńčěâîëîâ.</p>
<h4>buf2d_draw_text</h4>
<p>Đčńóĺň ňĺęńň â áóôĺđĺ, čńďîëüçó˙ ěŕňđčöó ń ňĺęńňîě đŕçěĺđîě 1*256 ńčěâîëîâ. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_draw_text], buf_0, buf_1,some_text,20,10,0x4040ff ;đčńóĺě ńňđîęó ń ňĺęńňîě</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ â ęîňîđîě áóäĺň đčńîâŕňüń˙ ňĺęńň;</p>
<p>buf_1 - ńňđóęňóđŕ áóôĺđŕ ń ňĺęńňîâîé ěŕňđčöĺé â ôîđěŕňĺ 8 áčň, đŕçěĺđîě 1*256 ńčěâîëîâ;</p>
<p>some_text - ňĺęńň, ęîňîđűé áóäĺň âűâĺäĺí â áóôĺđ buf_0.</p>
<h4><a name="f_c_color">buf2d_crop_color</a></h4>
<p>Îáđĺçŕíčĺ áóôĺđŕ, ďî óęŕçŕííîěó öâĺňó. Ôóíęöč˙ čńďîëüçóĺňń˙ äë˙ óěĺíüřĺíč˙ ďŕě˙ňč, çŕíčěŕĺěîé áóôĺđîě. Îňđĺçŕţňń˙ ęđŕéíčĺ ÷ŕńňč áóôĺđŕ čěĺţůčĺ îäčíŕęîâűé öâĺň. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_crop_color], buf_0,0xffffff,BUF2D_OPT_CROP_TOP+BUF2D_OPT_CROP_BOTTOM</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ ęîňîđűé áóäĺň îáđĺçŕí;</p>
<p>0xffffff - öâĺň ďî ęîňîđîěó áóäĺň îáđĺçŕňüń˙ áóôĺđ;</p>
<p>BUF2D_OPT_CROP_TOP č BUF2D_OPT_CROP_BOTTOM - ęîíńňŕíňű, óęŕçűâŕţůčĺ ń ęŕęčő ńňîđîí îáđĺçŕňü áóôĺđ.</p>
<h4>buf2d_offset_h</h4>
<p>Ńäâčă čçîáđŕćĺíč˙ â áóôĺđĺ ďî âűńîňĺ ââĺđő čëč âíčç.</p>
<h4>buf2d_flood_fill</h4>
<p>Ôóíęöč˙ äë˙ đĺęóđńčâíîé çŕëčâęč âűáđŕííűě öâĺňîě. Čěĺĺňń˙ äâŕ âŕđčŕíňŕ çŕëčâęč. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_flood_fill], buf_0, 100,200, 0, 0xff,0xff0000</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ;</p>
<p>100,200 - ęîîđäčíŕňű ňî÷ęč, ń ęîňîđîé íŕ÷íĺňń˙ çŕëčâęŕ;</p>
<p>0 - ďŕđŕěĺňđ, îďđĺäĺë˙ĺň ŕëăîđčňě çŕëčâęč (ěîćĺň áűňü 0 čëč 1);</p>
<p>0xff - öâĺň çŕëčâęč;</p>
<p>0xff0000 - çŕâčńčň îň çíŕ÷ĺíč˙ 4-ăî ďŕđŕěĺňđŕ, 1) ĺńëč 0 - öâĺň äî ęîňîđîăî áóäĺň çŕëčâŕňüń˙ îáëŕńňü; 2) ĺńëč 1 - öâĺň îáëŕńňč ęîňîđŕ˙ áóäĺň çŕëčâŕňń˙;</p>
<h4>buf2d_set_pixel</h4>
<p>Ôóíęöč˙ ńňŕâčň ňî÷ęó, ďđčíčěŕĺň ęîîđäčíŕňű č öâĺň.</p>
<pre>stdcall [buf2d_set_pixel], buf_0, 100,150, 0xff0000</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ;</p>
<p>100,150 - ęîîđäčíŕňű ňî÷ęč;</p>
<p>0xff0000 - öâĺň ňî÷ęč.</p>
<h4>buf2d_get_pixel</h4>
<p>Ôóíęöč˙ çŕďčńűâŕĺň öâĺň ňî÷ęč â đĺăčńňđ eax, ďđčíčěŕĺň ęîîđäčíŕňű.</p>
<pre>stdcall [buf2d_get_pixel], buf_0, 100,150</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ;</p>
<p>100,150 - ęîîđäčíŕňű ňî÷ęč;</p>
<p>eax - öâĺň ňî÷ęč (äë˙ 8 č 24 áčňíűő áóôĺđîâ íĺ čńďîëüçóĺěűĺ ńňŕđřčĺ áčňű â eax đŕâíű 0) čëč çíŕ÷ĺíčĺ -1 â ńëó÷ŕĺ îřčáęč.</p>
<h4><a name="f_v_brush_c">buf2d_vox_brush_create</a></h4>
<p>Ńîçäŕíčĺ âîęńĺëüíîé ęčńňč.</p>
<h4>buf2d_vox_brush_delete</h4>
<p>Óäŕëĺíčĺ âîęńĺëüíîé ęčńňč.</p>
<h4>buf2d_vox_obj_draw_1g</h4>
<p>Đčńîâŕíčĺ âîęńĺëüíîăî îáúĺęňŕ ń 1-é ăđŕíüţ.</p>
<h4>buf2d_vox_obj_get_img_w_3g</h4>
<p>Âîçâđŕřŕĺň řčđčíó âîęńĺëüíîăî čçîáđŕćĺíč˙ ń 3-ě˙ ăđŕí˙ěč (ęîňîđîĺ đčńóĺňń˙ ôóíęöčĺé <b>buf2d_vox_obj_draw_3g</b>), ďđčíčěŕĺň óęŕçŕňĺëü íŕ ęčńňü č ěŕńřňŕá.</p>
<h4>buf2d_vox_obj_get_img_h_3g</h4>
<p>Âîçâđŕřŕĺň âűńîňó âîęńĺëüíîăî čçîáđŕćĺíč˙ ń 3-ě˙ ăđŕí˙ěč (ęîňîđîĺ đčńóĺňń˙ ôóíęöčĺé <b>buf2d_vox_obj_draw_3g</b>), ďđčíčěŕĺň óęŕçŕňĺëü íŕ ęčńňü č ěŕńřňŕá.</p>
<h4>buf2d_vox_obj_draw_3g</h4>
<p>Đčńîâŕíčĺ âîęńĺëüíîăî îáúĺęňŕ ń 3-ě˙ ăđŕí˙ěč.</p>
<h4>buf2d_vox_obj_draw_3g_scaled</h4>
<p>Đčńîâŕíčĺ ÷ŕńňč âîęńĺëüíîăî îáúĺęňŕ.</p>
<h4>buf2d_vox_obj_draw_3g_shadows</h4>
<p>Ôóíęöč˙ đčńóţůŕ˙ ňĺíč äë˙ čçîáđŕćĺíčé íŕđčńîâŕííűő ń ďîěîůüţ ôóíęöčč <b>buf2d_vox_obj_draw_3g</b> čëč <b>buf2d_vox_obj_draw_3g_scaled</b>.</p>
<h4>buf2d_vox_obj_draw_pl</h4>
<p>Ôóíęöč˙ đčńóţůŕ˙ ńđĺç âîęńĺëüíîăî îáüĺęňŕ.</p>
<h4>buf2d_vox_obj_draw_pl_scaled</h4>
<p>Ôóíęöč˙ đčńóţůŕ˙ ńđĺç ÷ŕńňč âîęńĺëüíîăî îáüĺęňŕ.</p>
<h1><a name="const">Ęîíńňŕíňű</a></h1>
<h4>BUF2D_OPT_CROP_TOP equ 1</h4>
<p>Ęîíńňŕíňŕ äë˙ ôóíęöčč <a href="#f_c_color">buf2d_crop_color</a>, îáîçíŕ÷ŕĺň îáđĺçęó áóôĺđŕ ńâĺđőó</p>
<h4>BUF2D_OPT_CROP_LEFT equ 2</h4>
<p>Ęîíńňŕíňŕ äë˙ ôóíęöčč <a href="#f_c_color">buf2d_crop_color</a>, îáîçíŕ÷ŕĺň îáđĺçęó áóôĺđŕ ńëĺâŕ</p>
<h4>BUF2D_OPT_CROP_BOTTOM equ 4</h4>
<p>Ęîíńňŕíňŕ äë˙ ôóíęöčč <a href="#f_c_color">buf2d_crop_color</a>, îáîçíŕ÷ŕĺň îáđĺçęó áóôĺđŕ ńíčçó</p>
<h4>BUF2D_OPT_CROP_RIGHT equ 8</h4>
<p>Ęîíńňŕíňŕ äë˙ ôóíęöčč <a href="#f_c_color">buf2d_crop_color</a>, îáîçíŕ÷ŕĺň îáđĺçęó áóôĺđŕ ńďđŕâŕ</p>
<h1><a name="tabl_e">Ňŕáëčöŕ ýęńďîđňŕ</a></h1>
<p>Ďđčěĺđ ňŕáëčöű ýęńďîđňŕ, đŕń÷čňŕííîé íŕ čńďîëüçîâŕíčĺ ěŕęđîńŕ <b>@use_library_mem</b>:</p>
<pre>align 4
import_buf2d_lib:
dd sz_lib_init
buf2d_create dd sz_buf2d_create
buf2d_create_f_img dd sz_buf2d_create_f_img
buf2d_clear dd sz_buf2d_clear
buf2d_draw dd sz_buf2d_draw
buf2d_delete dd sz_buf2d_delete
buf2d_rotate dd sz_buf2d_rotate
buf2d_resize dd sz_buf2d_resize
buf2d_line dd sz_buf2d_line
buf2d_line_sm dd sz_buf2d_line_sm
buf2d_rect_by_size dd sz_buf2d_rect_by_size
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
buf2d_circle dd sz_buf2d_circle
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
buf2d_bit_blt dd sz_buf2d_bit_blt
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
buf2d_curve_bezier dd sz_buf2d_curve_bezier
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
buf2d_draw_text dd sz_buf2d_draw_text
buf2d_crop_color dd sz_buf2d_crop_color
buf2d_offset_h dd sz_buf2d_offset_h
buf2d_flood_fill dd sz_buf2d_flood_fill
buf2d_set_pixel dd sz_buf2d_set_pixel
buf2d_get_pixel dd sz_buf2d_get_pixel
;âîęńĺëüíűĺ ôóíęöčč:
buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
dd 0,0
sz_lib_init db 'lib_init',0
sz_buf2d_create db 'buf2d_create',0
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
sz_buf2d_clear db 'buf2d_clear',0
sz_buf2d_draw db 'buf2d_draw',0
sz_buf2d_delete db 'buf2d_delete',0
sz_buf2d_rotate db 'buf2d_rotate',0
sz_buf2d_resize db 'buf2d_resize',0
sz_buf2d_line db 'buf2d_line',0
sz_buf2d_line_sm db 'buf2d_line_sm',0
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
sz_buf2d_circle db 'buf2d_circle',0
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
sz_buf2d_draw_text db 'buf2d_draw_text',0
sz_buf2d_crop_color db 'buf2d_crop_color',0
sz_buf2d_offset_h db 'buf2d_offset_h',0
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
sz_buf2d_get_pixel db 'buf2d_get_pixel',0
;âîęńĺëüíűĺ ôóíęöčč:
sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0</pre>
<h1><a name="hist">Čńňîđč˙</a></h1>
<p>02.07.10 - ńŕěŕ˙ ďĺđâŕ˙ âĺđńč˙ áčáëčîňĺęč, 2 ďđčěĺđŕ čńďîëüçîâŕíč˙.</p>
<p>06.07.10 - đŕńřčđĺíű âîçěîćíîńňč ôóíęöčč buf2d_bit_blt, ňĺďĺđü îíŕ ěîćĺň đčńîâŕňü 32 áčňíűĺ áóôĺđű. Äîáŕâëĺíű 2 íîâűĺ ôóíęöčč: buf2d_bit_blt_alpha č buf2d_cruve_bezier. Íĺáîëüřčĺ čçěĺíĺíč˙ â ôóíęöčč buf2d_line.</p>
<p>16.07.10 - čńďđŕâëĺíî ďî 2 îřčáęč â ôóíęöč˙ő buf2d_img_hdiv2 č buf2d_img_wdiv2, ęîňîđűĺ ěîăëč ďđî˙âë˙ňüń˙ ďđč îďđĺäĺëĺííűő óńëîâč˙ő (ĺńëč đŕçěĺđ čçîáđŕćĺíč˙ áűë ęđŕňĺí 4Ęá č äđ.). Äîáŕâëĺíű 2 ôóíęöčč äë˙ âűâîäŕ ňĺęńňŕ â áóôĺđ buf2d_convert_text_matrix č buf2d_draw_text.</p>
<p>19.07.10 - äîáŕâëĺíŕ ôóíęöč˙ đčńîâŕíč˙ îęđóćíîńňč buf2d_circle;
čçěĺíĺí ôîđěŕň áóôĺđŕ - äë˙ řčđčíű č âűńîňű čńďîëüçóţňń˙ 4-ő áŕéňíűĺ ÷čńëŕ âěĺńňî 2-ő áŕéňíűő.</p>
<p>29.07.10 - äîáŕâëĺíű ôóíęöčč buf2d_crop_color č buf2d_offset_h;
čńďđŕâëĺíč˙ â ôóíęöčč buf2d_delete.</p>
<p>30.09.10 - äîáŕâëĺíŕ ôóíęöč˙ buf2d_rect_by_size.</p>
<p>04.10.10 - äîáŕâëĺíŕ ôóíęöč˙ buf2d_filled_rect_by_size, äîđŕáîňŕíŕ ôóíęöč˙ buf_bit_blt_alpha.</p>
<p>07.10.10 - äîđŕáîňŕíŕ ôóíęöč˙ buf_bit_blt (ďđč ďîďűňęĺ íŕđčńîâŕňü čçîáđŕćĺíčĺ çŕ ďđĺäĺëŕěč ďđŕâîăî ęđŕ˙ áóôĺđŕ ďđčëîćĺíčĺ âűçâŕâřĺĺ ôóíęöčţ ďŕäŕëî).</p>
<p>11.10.10 - čńďđŕâëĺíî çŕäŕíčĺ öâĺňîâ â íĺęîňîđűő ôóíęöč˙ő, ęđŕńíűé č ńčíčé öâĺňŕ ďîěĺí˙ë ěĺńňŕěč. Ňĺďĺđü öâĺňŕ ńîâďŕäŕţň ń ńčńĺěíűěč ôóíęöč˙ěč.</p>
<p>02.11.10 - äîáŕâëĺíŕ ôóíęöč˙ buf2d_flood_fill.</p>
<p>22.12.10 - čçěĺíĺíî čě˙ ôóíęöčč buf2d_cruve_bezier íŕ buf2d_curve_bezier.</p>
<p>25.03.11 - äîáŕâëĺíŕ ôóíęöč˙ äë˙ đčńîâŕíč˙ ňî÷ęč buf2d_set_pixel.</p>
<p>30.08.11 - äîáŕâëĺíŕ ôóíęöč˙ čçěĺíĺíč˙ đŕçěĺđîâ áóôĺđŕ buf2d_resize.</p>
<p>13.09.11 - îďňčěčçčđîâŕíŕ đŕáîňŕ ôóíęöčé buf2d_filled_rect_by_size buf2d_rect_by_size, äîáŕâëĺíű ďđčěĺđű čńďîëüçîâŕíč˙ áčáëčîňĺęč.</p>
<p>22.09.11 - äîáŕâëĺíŕ ôóíęöč˙ buf2d_line_sm äë˙ đčńîâŕíč˙ ńăëŕćĺííîé ëčíčč.</p>
<p>20.02.12 - ôóíęöčč buf2d_filled_rect_by_size č buf2d_rect_by_size ěîăóň ďđčíčěŕňü îňđčöŕňĺëüíűĺ đŕçěĺđű äë˙ ďđ˙ěîóăîëüíčęîâ, â ôóíęöčč buf2d_line ăîđčçîíňŕëüíŕ˙ ëčíč˙ đčńóĺňń˙ íŕ 1 ďčęńĺëü äëčíĺĺ (đŕíüřĺ íĺ äîđčńîâűâŕëî), íĺęîňîđűĺ ôóíęöčč ěîăóň đčńîâŕňü â 8 áčňíűő áóôĺđŕő.</p>
<p>23.02.12 - ôóíęöč˙ buf2d_bit_blt_alpha ěîćĺň ďđčíčěŕňü îňđčöŕňĺëüíűĺ ęîîđäčíŕňű â ďîçčöčč ęîďčđóĺěîăî áóôĺđŕ, íĺáîëüřčĺ äîđŕáîňęč â buf2d_bit_blt_transp</p>
<p>11.05.12 - äîáŕâëĺíŕ ôóíęöč˙ äë˙ âç˙ňč˙ öâĺňŕ ňî÷ęč buf2d_get_pixel, äîđŕáîňęč â buf2d_set_pixel.</p>
<p>12.06.12 - äîáŕâëĺíű ôóíęöčč äë˙ đčńîâŕíč˙ âîęńĺëüíîé ăđŕôčęč.</p>
<p>11.08.12 - ôóíęöčč äë˙ ńćŕňč˙ čçîáđŕćĺíčé buf2d_img_hdiv2 č buf2d_img_wdiv2 đŕáîňŕţň ń 32 áčňíűěč áóôĺđŕěč.</p>
<p>01.10.12 - äîáŕâëĺíŕ ôóíęöč˙ ďîâîđîňŕ čçîáđŕćĺíčé íŕ 90 č 180 ăđŕäóńîâ buf2d_rotate.</p>
</body>
</html>