Upload tizen 2.0 beta source
[framework/graphics/freetype.git] / docs / reference / ft2-bitmap_handling.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>FreeType-2.4.9 API Reference</title>
7 <style type="text/css">
8   body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
9          color: #000000;
10          background: #FFFFFF; }
11
12   p { text-align: justify; }
13   h1 { text-align: center; }
14   li { text-align: justify; }
15   td { padding: 0 0.5em 0 0.5em; }
16   td.left { padding: 0 0.5em 0 0.5em;
17             text-align: left; }
18
19   a:link { color: #0000EF; }
20   a:visited { color: #51188E; }
21   a:hover { color: #FF0000; }
22
23   span.keyword { font-family: monospace;
24                  text-align: left;
25                  white-space: pre;
26                  color: darkblue; }
27
28   pre.colored { color: blue; }
29
30   ul.empty { list-style-type: none; }
31 </style>
32 </head>
33 <body>
34
35 <table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
36 <td width="100%"></td>
37 <td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
38 <center><h1>FreeType-2.4.9 API Reference</h1></center>
39
40 <center><h1>
41 Bitmap Handling
42 </h1></center>
43 <h2>Synopsis</h2>
44 <table align=center cellspacing=5 cellpadding=0 border=0>
45 <tr><td></td><td><a href="#FT_Bitmap_New">FT_Bitmap_New</a></td><td></td><td><a href="#FT_Bitmap_Embolden">FT_Bitmap_Embolden</a></td><td></td><td><a href="#FT_GlyphSlot_Own_Bitmap">FT_GlyphSlot_Own_Bitmap</a></td></tr>
46 <tr><td></td><td><a href="#FT_Bitmap_Copy">FT_Bitmap_Copy</a></td><td></td><td><a href="#FT_Bitmap_Convert">FT_Bitmap_Convert</a></td><td></td><td><a href="#FT_Bitmap_Done">FT_Bitmap_Done</a></td></tr>
47 </table><br><br>
48
49 <table align=center width="87%"><tr><td>
50 <p>This section contains functions for converting FT_Bitmap objects.</p>
51 </td></tr></table><br>
52 <table align=center width="75%"><tr><td>
53 <h4><a name="FT_Bitmap_New">FT_Bitmap_New</a></h4>
54 <table align=center width="87%"><tr><td>
55 Defined in FT_BITMAP_H (freetype/ftbitmap.h).
56 </td></tr></table><br>
57 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
58
59   FT_EXPORT( <span class="keyword">void</span> )
60   <b>FT_Bitmap_New</b>( <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *abitmap );
61
62 </pre></table><br>
63 <table align=center width="87%"><tr><td>
64 <p>Initialize a pointer to an <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a> structure.</p>
65 </td></tr></table><br>
66 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
67 <p></p>
68 <table cellpadding=3 border=0>
69 <tr valign=top><td><b>abitmap</b></td><td>
70 <p>A pointer to the bitmap structure.</p>
71 </td></tr>
72 </table>
73 </td></tr></table>
74 </td></tr></table>
75 <hr width="75%">
76 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
77 <td width="100%"></td>
78 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
79
80 <table align=center width="75%"><tr><td>
81 <h4><a name="FT_Bitmap_Copy">FT_Bitmap_Copy</a></h4>
82 <table align=center width="87%"><tr><td>
83 Defined in FT_BITMAP_H (freetype/ftbitmap.h).
84 </td></tr></table><br>
85 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
86
87   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
88   <b>FT_Bitmap_Copy</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>        library,
89                   <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *source,
90                   <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>        *target);
91
92 </pre></table><br>
93 <table align=center width="87%"><tr><td>
94 <p>Copy a bitmap into another one.</p>
95 </td></tr></table><br>
96 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
97 <p></p>
98 <table cellpadding=3 border=0>
99 <tr valign=top><td><b>library</b></td><td>
100 <p>A handle to a library object.</p>
101 </td></tr>
102 <tr valign=top><td><b>source</b></td><td>
103 <p>A handle to the source bitmap.</p>
104 </td></tr>
105 </table>
106 </td></tr></table>
107 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
108 <p></p>
109 <table cellpadding=3 border=0>
110 <tr valign=top><td><b>target</b></td><td>
111 <p>A handle to the target bitmap.</p>
112 </td></tr>
113 </table>
114 </td></tr></table>
115 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
116 <p>FreeType error code. 0&nbsp;means success.</p>
117 </td></tr></table>
118 </td></tr></table>
119 <hr width="75%">
120 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
121 <td width="100%"></td>
122 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
123
124 <table align=center width="75%"><tr><td>
125 <h4><a name="FT_Bitmap_Embolden">FT_Bitmap_Embolden</a></h4>
126 <table align=center width="87%"><tr><td>
127 Defined in FT_BITMAP_H (freetype/ftbitmap.h).
128 </td></tr></table><br>
129 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
130
131   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
132   <b>FT_Bitmap_Embolden</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library,
133                       <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>*  bitmap,
134                       <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>      xStrength,
135                       <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>      yStrength );
136
137 </pre></table><br>
138 <table align=center width="87%"><tr><td>
139 <p>Embolden a bitmap. The new bitmap will be about &lsquo;xStrength&rsquo; pixels wider and &lsquo;yStrength&rsquo; pixels higher. The left and bottom borders are kept unchanged.</p>
140 </td></tr></table><br>
141 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
142 <p></p>
143 <table cellpadding=3 border=0>
144 <tr valign=top><td><b>library</b></td><td>
145 <p>A handle to a library object.</p>
146 </td></tr>
147 <tr valign=top><td><b>xStrength</b></td><td>
148 <p>How strong the glyph is emboldened horizontally. Expressed in 26.6 pixel format.</p>
149 </td></tr>
150 <tr valign=top><td><b>yStrength</b></td><td>
151 <p>How strong the glyph is emboldened vertically. Expressed in 26.6 pixel format.</p>
152 </td></tr>
153 </table>
154 </td></tr></table>
155 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
156 <p></p>
157 <table cellpadding=3 border=0>
158 <tr valign=top><td><b>bitmap</b></td><td>
159 <p>A handle to the target bitmap.</p>
160 </td></tr>
161 </table>
162 </td></tr></table>
163 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
164 <p>FreeType error code. 0&nbsp;means success.</p>
165 </td></tr></table>
166 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
167 <p>The current implementation restricts &lsquo;xStrength&rsquo; to be less than or equal to&nbsp;8 if bitmap is of pixel_mode <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_MONO</a>.</p>
168 <p>If you want to embolden the bitmap owned by a <a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a>, you should call <a href="ft2-bitmap_handling.html#FT_GlyphSlot_Own_Bitmap">FT_GlyphSlot_Own_Bitmap</a> on the slot first.</p>
169 </td></tr></table>
170 </td></tr></table>
171 <hr width="75%">
172 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
173 <td width="100%"></td>
174 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
175
176 <table align=center width="75%"><tr><td>
177 <h4><a name="FT_Bitmap_Convert">FT_Bitmap_Convert</a></h4>
178 <table align=center width="87%"><tr><td>
179 Defined in FT_BITMAP_H (freetype/ftbitmap.h).
180 </td></tr></table><br>
181 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
182
183   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
184   <b>FT_Bitmap_Convert</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>        library,
185                      <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *source,
186                      <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>        *target,
187                      <a href="ft2-basic_types.html#FT_Int">FT_Int</a>            alignment );
188
189 </pre></table><br>
190 <table align=center width="87%"><tr><td>
191 <p>Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a bitmap object with depth 8bpp, making the number of used bytes per line (a.k.a. the &lsquo;pitch&rsquo;) a multiple of &lsquo;alignment&rsquo;.</p>
192 </td></tr></table><br>
193 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
194 <p></p>
195 <table cellpadding=3 border=0>
196 <tr valign=top><td><b>library</b></td><td>
197 <p>A handle to a library object.</p>
198 </td></tr>
199 <tr valign=top><td><b>source</b></td><td>
200 <p>The source bitmap.</p>
201 </td></tr>
202 <tr valign=top><td><b>alignment</b></td><td>
203 <p>The pitch of the bitmap is a multiple of this parameter. Common values are 1, 2, or 4.</p>
204 </td></tr>
205 </table>
206 </td></tr></table>
207 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
208 <p></p>
209 <table cellpadding=3 border=0>
210 <tr valign=top><td><b>target</b></td><td>
211 <p>The target bitmap.</p>
212 </td></tr>
213 </table>
214 </td></tr></table>
215 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
216 <p>FreeType error code. 0&nbsp;means success.</p>
217 </td></tr></table>
218 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
219 <p>It is possible to call <a href="ft2-bitmap_handling.html#FT_Bitmap_Convert">FT_Bitmap_Convert</a> multiple times without calling <a href="ft2-bitmap_handling.html#FT_Bitmap_Done">FT_Bitmap_Done</a> (the memory is simply reallocated).</p>
220 <p>Use <a href="ft2-bitmap_handling.html#FT_Bitmap_Done">FT_Bitmap_Done</a> to finally remove the bitmap object.</p>
221 <p>The &lsquo;library&rsquo; argument is taken to have access to FreeType's memory handling functions.</p>
222 </td></tr></table>
223 </td></tr></table>
224 <hr width="75%">
225 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
226 <td width="100%"></td>
227 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
228
229 <table align=center width="75%"><tr><td>
230 <h4><a name="FT_GlyphSlot_Own_Bitmap">FT_GlyphSlot_Own_Bitmap</a></h4>
231 <table align=center width="87%"><tr><td>
232 Defined in FT_BITMAP_H (freetype/ftbitmap.h).
233 </td></tr></table><br>
234 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
235
236   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
237   <b>FT_GlyphSlot_Own_Bitmap</b>( <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>  slot );
238
239 </pre></table><br>
240 <table align=center width="87%"><tr><td>
241 <p>Make sure that a glyph slot owns &lsquo;slot-&gt;bitmap&rsquo;.</p>
242 </td></tr></table><br>
243 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
244 <p></p>
245 <table cellpadding=3 border=0>
246 <tr valign=top><td><b>slot</b></td><td>
247 <p>The glyph slot.</p>
248 </td></tr>
249 </table>
250 </td></tr></table>
251 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
252 <p>FreeType error code. 0&nbsp;means success.</p>
253 </td></tr></table>
254 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
255 <p>This function is to be used in combination with <a href="ft2-bitmap_handling.html#FT_Bitmap_Embolden">FT_Bitmap_Embolden</a>.</p>
256 </td></tr></table>
257 </td></tr></table>
258 <hr width="75%">
259 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
260 <td width="100%"></td>
261 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
262
263 <table align=center width="75%"><tr><td>
264 <h4><a name="FT_Bitmap_Done">FT_Bitmap_Done</a></h4>
265 <table align=center width="87%"><tr><td>
266 Defined in FT_BITMAP_H (freetype/ftbitmap.h).
267 </td></tr></table><br>
268 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
269
270   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
271   <b>FT_Bitmap_Done</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library,
272                   <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *bitmap );
273
274 </pre></table><br>
275 <table align=center width="87%"><tr><td>
276 <p>Destroy a bitmap object created with <a href="ft2-bitmap_handling.html#FT_Bitmap_New">FT_Bitmap_New</a>.</p>
277 </td></tr></table><br>
278 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
279 <p></p>
280 <table cellpadding=3 border=0>
281 <tr valign=top><td><b>library</b></td><td>
282 <p>A handle to a library object.</p>
283 </td></tr>
284 <tr valign=top><td><b>bitmap</b></td><td>
285 <p>The bitmap object to be freed.</p>
286 </td></tr>
287 </table>
288 </td></tr></table>
289 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
290 <p>FreeType error code. 0&nbsp;means success.</p>
291 </td></tr></table>
292 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
293 <p>The &lsquo;library&rsquo; argument is taken to have access to FreeType's memory handling functions.</p>
294 </td></tr></table>
295 </td></tr></table>
296 <hr width="75%">
297 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
298 <td width="100%"></td>
299 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
300
301 </body>
302 </html>