1 /***************************************************************************/
5 /* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
6 /* bitmaps into 8bpp format (specification). */
8 /* Copyright 2004, 2005 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
17 /***************************************************************************/
20 #ifndef __FTBITMAP_H__
21 #define __FTBITMAP_H__
25 #include FT_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."
37 /*************************************************************************/
46 /* Handling FT_Bitmap objects. */
49 /* This section contains functions for converting FT_Bitmap objects. */
51 /*************************************************************************/
54 /*************************************************************************/
60 /* Initialize a pointer to an FT_Bitmap structure. */
63 /* abitmap :: A pointer to the bitmap structure. */
66 FT_Bitmap_New( FT_Bitmap *abitmap );
69 /*************************************************************************/
75 /* Copies an bitmap into another one. */
78 /* library :: A handle to a library object. */
80 /* source :: A handle to the source bitmap. */
83 /* target :: A handle to the target bitmap. */
86 /* FreeType error code. 0 means success. */
88 FT_EXPORT_DEF( FT_Error )
89 FT_Bitmap_Copy( FT_Library library,
90 const FT_Bitmap *source,
94 /*************************************************************************/
97 /* FT_Bitmap_Embolden */
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. */
105 /* library :: A handle to a library object. */
107 /* xStrength :: How strong the glyph is emboldened horizontally. */
108 /* Expressed in 26.6 pixel format. */
110 /* yStrength :: How strong the glyph is emboldened vertically. */
111 /* Expressed in 26.6 pixel format. */
114 /* bitmap :: A handle to the target bitmap. */
117 /* FreeType error code. 0 means success. */
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. */
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. */
126 FT_EXPORT_DEF( FT_Error )
127 FT_Bitmap_Embolden( FT_Library library,
133 /*************************************************************************/
136 /* FT_Bitmap_Convert */
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'. */
144 /* library :: A handle to a library object. */
146 /* source :: The source bitmap. */
148 /* alignment :: The pitch of the bitmap is a multiple of this */
149 /* parameter. Common values are 1, 2, or 4. */
152 /* target :: The target bitmap. */
155 /* FreeType error code. 0 means success. */
158 /* It is possible to call @FT_Bitmap_Convert multiple times without */
159 /* calling @FT_Bitmap_Done (the memory is simply reallocated). */
161 /* Use @FT_Bitmap_Done to finally remove the bitmap object. */
163 /* The `library' argument is taken to have access to FreeType's */
164 /* memory handling functions. */
166 FT_EXPORT( FT_Error )
167 FT_Bitmap_Convert( FT_Library library,
168 const FT_Bitmap *source,
173 /*************************************************************************/
179 /* Destroy a bitmap object created with @FT_Bitmap_New. */
182 /* library :: A handle to a library object. */
184 /* bitmap :: The bitmap object to be freed. */
187 /* FreeType error code. 0 means success. */
190 /* The `library' argument is taken to have access to FreeType's */
191 /* memory handling functions. */
193 FT_EXPORT( FT_Error )
194 FT_Bitmap_Done( FT_Library library,
203 #endif /* __FTBITMAP_H__ */