rev |
line source |
nuclear@0
|
1 /***************************************************************************/
|
nuclear@0
|
2 /* */
|
nuclear@0
|
3 /* ftbitmap.h */
|
nuclear@0
|
4 /* */
|
nuclear@0
|
5 /* FreeType utility functions for bitmaps (specification). */
|
nuclear@0
|
6 /* */
|
nuclear@0
|
7 /* Copyright 2004, 2005, 2006, 2008 by */
|
nuclear@0
|
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
nuclear@0
|
9 /* */
|
nuclear@0
|
10 /* This file is part of the FreeType project, and may only be used, */
|
nuclear@0
|
11 /* modified, and distributed under the terms of the FreeType project */
|
nuclear@0
|
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
nuclear@0
|
13 /* this file you indicate that you have read the license and */
|
nuclear@0
|
14 /* understand and accept it fully. */
|
nuclear@0
|
15 /* */
|
nuclear@0
|
16 /***************************************************************************/
|
nuclear@0
|
17
|
nuclear@0
|
18
|
nuclear@0
|
19 #ifndef __FTBITMAP_H__
|
nuclear@0
|
20 #define __FTBITMAP_H__
|
nuclear@0
|
21
|
nuclear@0
|
22
|
nuclear@0
|
23 #include <ft2build.h>
|
nuclear@0
|
24 #include FT_FREETYPE_H
|
nuclear@0
|
25
|
nuclear@0
|
26 #ifdef FREETYPE_H
|
nuclear@0
|
27 #error "freetype.h of FreeType 1 has been loaded!"
|
nuclear@0
|
28 #error "Please fix the directory search order for header files"
|
nuclear@0
|
29 #error "so that freetype.h of FreeType 2 is found first."
|
nuclear@0
|
30 #endif
|
nuclear@0
|
31
|
nuclear@0
|
32
|
nuclear@0
|
33 FT_BEGIN_HEADER
|
nuclear@0
|
34
|
nuclear@0
|
35
|
nuclear@0
|
36 /*************************************************************************/
|
nuclear@0
|
37 /* */
|
nuclear@0
|
38 /* <Section> */
|
nuclear@0
|
39 /* bitmap_handling */
|
nuclear@0
|
40 /* */
|
nuclear@0
|
41 /* <Title> */
|
nuclear@0
|
42 /* Bitmap Handling */
|
nuclear@0
|
43 /* */
|
nuclear@0
|
44 /* <Abstract> */
|
nuclear@0
|
45 /* Handling FT_Bitmap objects. */
|
nuclear@0
|
46 /* */
|
nuclear@0
|
47 /* <Description> */
|
nuclear@0
|
48 /* This section contains functions for converting FT_Bitmap objects. */
|
nuclear@0
|
49 /* */
|
nuclear@0
|
50 /*************************************************************************/
|
nuclear@0
|
51
|
nuclear@0
|
52
|
nuclear@0
|
53 /*************************************************************************/
|
nuclear@0
|
54 /* */
|
nuclear@0
|
55 /* <Function> */
|
nuclear@0
|
56 /* FT_Bitmap_New */
|
nuclear@0
|
57 /* */
|
nuclear@0
|
58 /* <Description> */
|
nuclear@0
|
59 /* Initialize a pointer to an @FT_Bitmap structure. */
|
nuclear@0
|
60 /* */
|
nuclear@0
|
61 /* <InOut> */
|
nuclear@0
|
62 /* abitmap :: A pointer to the bitmap structure. */
|
nuclear@0
|
63 /* */
|
nuclear@0
|
64 FT_EXPORT( void )
|
nuclear@0
|
65 FT_Bitmap_New( FT_Bitmap *abitmap );
|
nuclear@0
|
66
|
nuclear@0
|
67
|
nuclear@0
|
68 /*************************************************************************/
|
nuclear@0
|
69 /* */
|
nuclear@0
|
70 /* <Function> */
|
nuclear@0
|
71 /* FT_Bitmap_Copy */
|
nuclear@0
|
72 /* */
|
nuclear@0
|
73 /* <Description> */
|
nuclear@0
|
74 /* Copy a bitmap into another one. */
|
nuclear@0
|
75 /* */
|
nuclear@0
|
76 /* <Input> */
|
nuclear@0
|
77 /* library :: A handle to a library object. */
|
nuclear@0
|
78 /* */
|
nuclear@0
|
79 /* source :: A handle to the source bitmap. */
|
nuclear@0
|
80 /* */
|
nuclear@0
|
81 /* <Output> */
|
nuclear@0
|
82 /* target :: A handle to the target bitmap. */
|
nuclear@0
|
83 /* */
|
nuclear@0
|
84 /* <Return> */
|
nuclear@0
|
85 /* FreeType error code. 0~means success. */
|
nuclear@0
|
86 /* */
|
nuclear@0
|
87 FT_EXPORT( FT_Error )
|
nuclear@0
|
88 FT_Bitmap_Copy( FT_Library library,
|
nuclear@0
|
89 const FT_Bitmap *source,
|
nuclear@0
|
90 FT_Bitmap *target);
|
nuclear@0
|
91
|
nuclear@0
|
92
|
nuclear@0
|
93 /*************************************************************************/
|
nuclear@0
|
94 /* */
|
nuclear@0
|
95 /* <Function> */
|
nuclear@0
|
96 /* FT_Bitmap_Embolden */
|
nuclear@0
|
97 /* */
|
nuclear@0
|
98 /* <Description> */
|
nuclear@0
|
99 /* Embolden a bitmap. The new bitmap will be about `xStrength' */
|
nuclear@0
|
100 /* pixels wider and `yStrength' pixels higher. The left and bottom */
|
nuclear@0
|
101 /* borders are kept unchanged. */
|
nuclear@0
|
102 /* */
|
nuclear@0
|
103 /* <Input> */
|
nuclear@0
|
104 /* library :: A handle to a library object. */
|
nuclear@0
|
105 /* */
|
nuclear@0
|
106 /* xStrength :: How strong the glyph is emboldened horizontally. */
|
nuclear@0
|
107 /* Expressed in 26.6 pixel format. */
|
nuclear@0
|
108 /* */
|
nuclear@0
|
109 /* yStrength :: How strong the glyph is emboldened vertically. */
|
nuclear@0
|
110 /* Expressed in 26.6 pixel format. */
|
nuclear@0
|
111 /* */
|
nuclear@0
|
112 /* <InOut> */
|
nuclear@0
|
113 /* bitmap :: A handle to the target bitmap. */
|
nuclear@0
|
114 /* */
|
nuclear@0
|
115 /* <Return> */
|
nuclear@0
|
116 /* FreeType error code. 0~means success. */
|
nuclear@0
|
117 /* */
|
nuclear@0
|
118 /* <Note> */
|
nuclear@0
|
119 /* The current implementation restricts `xStrength' to be less than */
|
nuclear@0
|
120 /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
|
nuclear@0
|
121 /* */
|
nuclear@0
|
122 /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
|
nuclear@0
|
123 /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
|
nuclear@0
|
124 /* */
|
nuclear@0
|
125 FT_EXPORT( FT_Error )
|
nuclear@0
|
126 FT_Bitmap_Embolden( FT_Library library,
|
nuclear@0
|
127 FT_Bitmap* bitmap,
|
nuclear@0
|
128 FT_Pos xStrength,
|
nuclear@0
|
129 FT_Pos yStrength );
|
nuclear@0
|
130
|
nuclear@0
|
131
|
nuclear@0
|
132 /*************************************************************************/
|
nuclear@0
|
133 /* */
|
nuclear@0
|
134 /* <Function> */
|
nuclear@0
|
135 /* FT_Bitmap_Convert */
|
nuclear@0
|
136 /* */
|
nuclear@0
|
137 /* <Description> */
|
nuclear@0
|
138 /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
|
nuclear@0
|
139 /* bitmap object with depth 8bpp, making the number of used bytes per */
|
nuclear@0
|
140 /* line (a.k.a. the `pitch') a multiple of `alignment'. */
|
nuclear@0
|
141 /* */
|
nuclear@0
|
142 /* <Input> */
|
nuclear@0
|
143 /* library :: A handle to a library object. */
|
nuclear@0
|
144 /* */
|
nuclear@0
|
145 /* source :: The source bitmap. */
|
nuclear@0
|
146 /* */
|
nuclear@0
|
147 /* alignment :: The pitch of the bitmap is a multiple of this */
|
nuclear@0
|
148 /* parameter. Common values are 1, 2, or 4. */
|
nuclear@0
|
149 /* */
|
nuclear@0
|
150 /* <Output> */
|
nuclear@0
|
151 /* target :: The target bitmap. */
|
nuclear@0
|
152 /* */
|
nuclear@0
|
153 /* <Return> */
|
nuclear@0
|
154 /* FreeType error code. 0~means success. */
|
nuclear@0
|
155 /* */
|
nuclear@0
|
156 /* <Note> */
|
nuclear@0
|
157 /* It is possible to call @FT_Bitmap_Convert multiple times without */
|
nuclear@0
|
158 /* calling @FT_Bitmap_Done (the memory is simply reallocated). */
|
nuclear@0
|
159 /* */
|
nuclear@0
|
160 /* Use @FT_Bitmap_Done to finally remove the bitmap object. */
|
nuclear@0
|
161 /* */
|
nuclear@0
|
162 /* The `library' argument is taken to have access to FreeType's */
|
nuclear@0
|
163 /* memory handling functions. */
|
nuclear@0
|
164 /* */
|
nuclear@0
|
165 FT_EXPORT( FT_Error )
|
nuclear@0
|
166 FT_Bitmap_Convert( FT_Library library,
|
nuclear@0
|
167 const FT_Bitmap *source,
|
nuclear@0
|
168 FT_Bitmap *target,
|
nuclear@0
|
169 FT_Int alignment );
|
nuclear@0
|
170
|
nuclear@0
|
171
|
nuclear@0
|
172 /*************************************************************************/
|
nuclear@0
|
173 /* */
|
nuclear@0
|
174 /* <Function> */
|
nuclear@0
|
175 /* FT_GlyphSlot_Own_Bitmap */
|
nuclear@0
|
176 /* */
|
nuclear@0
|
177 /* <Description> */
|
nuclear@0
|
178 /* Make sure that a glyph slot owns `slot->bitmap'. */
|
nuclear@0
|
179 /* */
|
nuclear@0
|
180 /* <Input> */
|
nuclear@0
|
181 /* slot :: The glyph slot. */
|
nuclear@0
|
182 /* */
|
nuclear@0
|
183 /* <Return> */
|
nuclear@0
|
184 /* FreeType error code. 0~means success. */
|
nuclear@0
|
185 /* */
|
nuclear@0
|
186 /* <Note> */
|
nuclear@0
|
187 /* This function is to be used in combination with */
|
nuclear@0
|
188 /* @FT_Bitmap_Embolden. */
|
nuclear@0
|
189 /* */
|
nuclear@0
|
190 FT_EXPORT( FT_Error )
|
nuclear@0
|
191 FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
|
nuclear@0
|
192
|
nuclear@0
|
193
|
nuclear@0
|
194 /*************************************************************************/
|
nuclear@0
|
195 /* */
|
nuclear@0
|
196 /* <Function> */
|
nuclear@0
|
197 /* FT_Bitmap_Done */
|
nuclear@0
|
198 /* */
|
nuclear@0
|
199 /* <Description> */
|
nuclear@0
|
200 /* Destroy a bitmap object created with @FT_Bitmap_New. */
|
nuclear@0
|
201 /* */
|
nuclear@0
|
202 /* <Input> */
|
nuclear@0
|
203 /* library :: A handle to a library object. */
|
nuclear@0
|
204 /* */
|
nuclear@0
|
205 /* bitmap :: The bitmap object to be freed. */
|
nuclear@0
|
206 /* */
|
nuclear@0
|
207 /* <Return> */
|
nuclear@0
|
208 /* FreeType error code. 0~means success. */
|
nuclear@0
|
209 /* */
|
nuclear@0
|
210 /* <Note> */
|
nuclear@0
|
211 /* The `library' argument is taken to have access to FreeType's */
|
nuclear@0
|
212 /* memory handling functions. */
|
nuclear@0
|
213 /* */
|
nuclear@0
|
214 FT_EXPORT( FT_Error )
|
nuclear@0
|
215 FT_Bitmap_Done( FT_Library library,
|
nuclear@0
|
216 FT_Bitmap *bitmap );
|
nuclear@0
|
217
|
nuclear@0
|
218
|
nuclear@0
|
219 /* */
|
nuclear@0
|
220
|
nuclear@0
|
221
|
nuclear@0
|
222 FT_END_HEADER
|
nuclear@0
|
223
|
nuclear@0
|
224 #endif /* __FTBITMAP_H__ */
|
nuclear@0
|
225
|
nuclear@0
|
226
|
nuclear@0
|
227 /* END */
|