1 /***************************************************************************/
5 /* FreeType renderer modules public interface (specification). */
7 /* Copyright 1996-2001 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 __FTRENDER_H__
20 #define __FTRENDER_H__
31 /*************************************************************************/
34 /* module_management */
36 /*************************************************************************/
39 /* create a new glyph object */
41 (*FT_Glyph_Init_Func)( FT_Glyph glyph,
44 /* destroys a given glyph object */
46 (*FT_Glyph_Done_Func)( FT_Glyph glyph );
49 (*FT_Glyph_Transform_Func)( FT_Glyph glyph,
54 (*FT_Glyph_BBox_Func)( FT_Glyph glyph,
58 (*FT_Glyph_Copy_Func)( FT_Glyph source,
62 (*FT_Glyph_Prepare_Func)( FT_Glyph glyph,
66 struct FT_Glyph_Class_
69 FT_Glyph_Format glyph_format;
70 FT_Glyph_Init_Func glyph_init;
71 FT_Glyph_Done_Func glyph_done;
72 FT_Glyph_Copy_Func glyph_copy;
73 FT_Glyph_Transform_Func glyph_transform;
74 FT_Glyph_BBox_Func glyph_bbox;
75 FT_Glyph_Prepare_Func glyph_prepare;
80 (*FTRenderer_render)( FT_Renderer renderer,
86 (*FTRenderer_transform)( FT_Renderer renderer,
92 (*FTRenderer_getCBox)( FT_Renderer renderer,
97 (*FTRenderer_setMode)( FT_Renderer renderer,
99 FT_Pointer mode_ptr );
102 /*************************************************************************/
105 /* FT_Renderer_Class */
108 /* The renderer module class descriptor. */
111 /* root :: The root FT_Module_Class fields. */
113 /* glyph_format :: The glyph image format this renderer handles. */
115 /* render_glyph :: A method used to render the image that is in a */
116 /* given glyph slot into a bitmap. */
118 /* set_mode :: A method used to pass additional parameters. */
120 /* raster_class :: For `ft_glyph_format_outline' renderers only, this */
121 /* is a pointer to its raster's class. */
123 /* raster :: For `ft_glyph_format_outline' renderers only. this */
124 /* is a pointer to the corresponding raster object, */
127 typedef struct FT_Renderer_Class_
129 FT_Module_Class root;
131 FT_Glyph_Format glyph_format;
133 FTRenderer_render render_glyph;
134 FTRenderer_transform transform_glyph;
135 FTRenderer_getCBox get_glyph_cbox;
136 FTRenderer_setMode set_mode;
138 FT_Raster_Funcs* raster_class;
143 /*************************************************************************/
146 /* FT_Get_Renderer */
149 /* Retrieves the current renderer for a given glyph format. */
152 /* library :: A handle to the library object. */
154 /* format :: The glyph format. */
157 /* A renderer handle. 0 if none found. */
160 /* An error will be returned if a module already exists by that name, */
161 /* or if the module requires a version of FreeType that is too great. */
163 /* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
164 /* renderer by its name, use FT_Get_Module(). */
166 FT_EXPORT( FT_Renderer )
167 FT_Get_Renderer( FT_Library library,
168 FT_Glyph_Format format );
171 /*************************************************************************/
174 /* FT_Set_Renderer */
177 /* Sets the current renderer to use, and set additional mode. */
180 /* library :: A handle to the library object. */
183 /* renderer :: A handle to the renderer object. */
185 /* num_params :: The number of additional parameters. */
187 /* parameters :: Additional parameters. */
190 /* FreeType error code. 0 means success. */
193 /* In case of success, the renderer will be used to convert glyph */
194 /* images in the renderer's known format into bitmaps. */
196 /* This doesn't change the current renderer for other formats. */
198 FT_EXPORT( FT_Error )
199 FT_Set_Renderer( FT_Library library,
200 FT_Renderer renderer,
202 FT_Parameter* parameters );
210 #endif /* __FTRENDER_H__ */