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