1 /***************************************************************************/
5 /* FreeType utility functions for bitmaps (specification). */
7 /* Copyright 2004, 2005, 2006, 2008 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
19 #ifndef __FTBITMAP_H__
20 #define __FTBITMAP_H__
24 #include FT_FREETYPE_H
27 #error "freetype.h of FreeType 1 has been loaded!"
28 #error "Please fix the directory search order for header files"
29 #error "so that freetype.h of FreeType 2 is found first."
36 /*************************************************************************/
45 /* Handling FT_Bitmap objects. */
48 /* This section contains functions for converting FT_Bitmap objects. */
50 /*************************************************************************/
53 /*************************************************************************/
59 /* Initialize a pointer to an @FT_Bitmap structure. */
62 /* abitmap :: A pointer to the bitmap structure. */
65 FT_Bitmap_New( FT_Bitmap
*abitmap
);
68 /*************************************************************************/
74 /* Copy a bitmap into another one. */
77 /* library :: A handle to a library object. */
79 /* source :: A handle to the source bitmap. */
82 /* target :: A handle to the target bitmap. */
85 /* FreeType error code. 0~means success. */
88 FT_Bitmap_Copy( FT_Library library
,
89 const FT_Bitmap
*source
,
93 /*************************************************************************/
96 /* FT_Bitmap_Embolden */
99 /* Embolden a bitmap. The new bitmap will be about `xStrength' */
100 /* pixels wider and `yStrength' pixels higher. The left and bottom */
101 /* borders are kept unchanged. */
104 /* library :: A handle to a library object. */
106 /* xStrength :: How strong the glyph is emboldened horizontally. */
107 /* Expressed in 26.6 pixel format. */
109 /* yStrength :: How strong the glyph is emboldened vertically. */
110 /* Expressed in 26.6 pixel format. */
113 /* bitmap :: A handle to the target bitmap. */
116 /* FreeType error code. 0~means success. */
119 /* The current implementation restricts `xStrength' to be less than */
120 /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
122 /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
123 /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
125 FT_EXPORT( FT_Error
)
126 FT_Bitmap_Embolden( FT_Library library
,
132 /*************************************************************************/
135 /* FT_Bitmap_Convert */
138 /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
139 /* bitmap object with depth 8bpp, making the number of used bytes per */
140 /* line (a.k.a. the `pitch') a multiple of `alignment'. */
143 /* library :: A handle to a library object. */
145 /* source :: The source bitmap. */
147 /* alignment :: The pitch of the bitmap is a multiple of this */
148 /* parameter. Common values are 1, 2, or 4. */
151 /* target :: The target bitmap. */
154 /* FreeType error code. 0~means success. */
157 /* It is possible to call @FT_Bitmap_Convert multiple times without */
158 /* calling @FT_Bitmap_Done (the memory is simply reallocated). */
160 /* Use @FT_Bitmap_Done to finally remove the bitmap object. */
162 /* The `library' argument is taken to have access to FreeType's */
163 /* memory handling functions. */
165 FT_EXPORT( FT_Error
)
166 FT_Bitmap_Convert( FT_Library library
,
167 const FT_Bitmap
*source
,
172 /*************************************************************************/
175 /* FT_GlyphSlot_Own_Bitmap */
178 /* Make sure that a glyph slot owns `slot->bitmap'. */
181 /* slot :: The glyph slot. */
184 /* FreeType error code. 0~means success. */
187 /* This function is to be used in combination with */
188 /* @FT_Bitmap_Embolden. */
190 FT_EXPORT( FT_Error
)
191 FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot
);
194 /*************************************************************************/
200 /* Destroy a bitmap object created with @FT_Bitmap_New. */
203 /* library :: A handle to a library object. */
205 /* bitmap :: The bitmap object to be freed. */
208 /* FreeType error code. 0~means success. */
211 /* The `library' argument is taken to have access to FreeType's */
212 /* memory handling functions. */
214 FT_EXPORT( FT_Error
)
215 FT_Bitmap_Done( FT_Library library
,
224 #endif /* __FTBITMAP_H__ */