ftrender.h

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ftrender.h                                                             */
00004 /*                                                                         */
00005 /*    FreeType renderer modules public interface (specification).          */
00006 /*                                                                         */
00007 /*  Copyright 1996-2001, 2005, 2006 by                                     */
00008 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
00009 /*                                                                         */
00010 /*  This file is part of the FreeType project, and may only be used,       */
00011 /*  modified, and distributed under the terms of the FreeType project      */
00012 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00013 /*  this file you indicate that you have read the license and              */
00014 /*  understand and accept it fully.                                        */
00015 /*                                                                         */
00016 /***************************************************************************/
00017 
00018 
00019 #ifndef __FTRENDER_H__
00020 #define __FTRENDER_H__
00021 
00022 
00023 #include <ft2build.h>
00024 #include FT_MODULE_H
00025 #include FT_GLYPH_H
00026 
00027 
00028 FT_BEGIN_HEADER
00029 
00030 
00031   /*************************************************************************/
00032   /*                                                                       */
00033   /* <Section>                                                             */
00034   /*    module_management                                                  */
00035   /*                                                                       */
00036   /*************************************************************************/
00037 
00038 
00039   /* create a new glyph object */
00040   typedef FT_Error
00041   (*FT_Glyph_InitFunc)( FT_Glyph      glyph,
00042                         FT_GlyphSlot  slot );
00043 
00044   /* destroys a given glyph object */
00045   typedef void
00046   (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );
00047 
00048   typedef void
00049   (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,
00050                              const FT_Matrix*  matrix,
00051                              const FT_Vector*  delta );
00052 
00053   typedef void
00054   (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,
00055                            FT_BBox*  abbox );
00056 
00057   typedef FT_Error
00058   (*FT_Glyph_CopyFunc)( FT_Glyph   source,
00059                         FT_Glyph   target );
00060 
00061   typedef FT_Error
00062   (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,
00063                            FT_GlyphSlot  slot );
00064 
00065 /* deprecated */
00066 #define FT_Glyph_Init_Func       FT_Glyph_InitFunc
00067 #define FT_Glyph_Done_Func       FT_Glyph_DoneFunc
00068 #define FT_Glyph_Transform_Func  FT_Glyph_TransformFunc
00069 #define FT_Glyph_BBox_Func       FT_Glyph_GetBBoxFunc
00070 #define FT_Glyph_Copy_Func       FT_Glyph_CopyFunc
00071 #define FT_Glyph_Prepare_Func    FT_Glyph_PrepareFunc
00072 
00073 
00074   struct  FT_Glyph_Class_
00075   {
00076     FT_Long                 glyph_size;
00077     FT_Glyph_Format         glyph_format;
00078     FT_Glyph_InitFunc       glyph_init;
00079     FT_Glyph_DoneFunc       glyph_done;
00080     FT_Glyph_CopyFunc       glyph_copy;
00081     FT_Glyph_TransformFunc  glyph_transform;
00082     FT_Glyph_GetBBoxFunc    glyph_bbox;
00083     FT_Glyph_PrepareFunc    glyph_prepare;
00084   };
00085 
00086 
00087   typedef FT_Error
00088   (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,
00089                              FT_GlyphSlot      slot,
00090                              FT_UInt           mode,
00091                              const FT_Vector*  origin );
00092 
00093   typedef FT_Error
00094   (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,
00095                                 FT_GlyphSlot      slot,
00096                                 const FT_Matrix*  matrix,
00097                                 const FT_Vector*  delta );
00098 
00099 
00100   typedef void
00101   (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,
00102                               FT_GlyphSlot  slot,
00103                               FT_BBox*      cbox );
00104 
00105 
00106   typedef FT_Error
00107   (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,
00108                               FT_ULong     mode_tag,
00109                               FT_Pointer   mode_ptr );
00110 
00111 /* deprecated identifiers */
00112 #define FTRenderer_render  FT_Renderer_RenderFunc
00113 #define FTRenderer_transform  FT_Renderer_TransformFunc
00114 #define FTRenderer_getCBox  FT_Renderer_GetCBoxFunc
00115 #define FTRenderer_setMode  FT_Renderer_SetModeFunc
00116 
00117 
00118   /*************************************************************************/
00119   /*                                                                       */
00120   /* <Struct>                                                              */
00121   /*    FT_Renderer_Class                                                  */
00122   /*                                                                       */
00123   /* <Description>                                                         */
00124   /*    The renderer module class descriptor.                              */
00125   /*                                                                       */
00126   /* <Fields>                                                              */
00127   /*    root            :: The root @FT_Module_Class fields.               */
00128   /*                                                                       */
00129   /*    glyph_format    :: The glyph image format this renderer handles.   */
00130   /*                                                                       */
00131   /*    render_glyph    :: A method used to render the image that is in a  */
00132   /*                       given glyph slot into a bitmap.                 */
00133   /*                                                                       */
00134   /*    transform_glyph :: A method used to transform the image that is in */
00135   /*                       a given glyph slot.                             */
00136   /*                                                                       */
00137   /*    get_glyph_cbox  :: A method used to access the glyph's cbox.       */
00138   /*                                                                       */
00139   /*    set_mode        :: A method used to pass additional parameters.    */
00140   /*                                                                       */
00141   /*    raster_class    :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */
00142   /*                       This is a pointer to its raster's class.        */
00143   /*                                                                       */
00144   /*    raster          :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */
00145   /*                       This is a pointer to the corresponding raster   */
00146   /*                       object, if any.                                 */
00147   /*                                                                       */
00148   typedef struct  FT_Renderer_Class_
00149   {
00150     FT_Module_Class            root;
00151 
00152     FT_Glyph_Format            glyph_format;
00153 
00154     FT_Renderer_RenderFunc     render_glyph;
00155     FT_Renderer_TransformFunc  transform_glyph;
00156     FT_Renderer_GetCBoxFunc    get_glyph_cbox;
00157     FT_Renderer_SetModeFunc    set_mode;
00158 
00159     FT_Raster_Funcs*           raster_class;
00160 
00161   } FT_Renderer_Class;
00162 
00163 
00164   /*************************************************************************/
00165   /*                                                                       */
00166   /* <Function>                                                            */
00167   /*    FT_Get_Renderer                                                    */
00168   /*                                                                       */
00169   /* <Description>                                                         */
00170   /*    Retrieve the current renderer for a given glyph format.            */
00171   /*                                                                       */
00172   /* <Input>                                                               */
00173   /*    library :: A handle to the library object.                         */
00174   /*                                                                       */
00175   /*    format  :: The glyph format.                                       */
00176   /*                                                                       */
00177   /* <Return>                                                              */
00178   /*    A renderer handle.  0~if none found.                               */
00179   /*                                                                       */
00180   /* <Note>                                                                */
00181   /*    An error will be returned if a module already exists by that name, */
00182   /*    or if the module requires a version of FreeType that is too great. */
00183   /*                                                                       */
00184   /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */
00185   /*    renderer by its name, use @FT_Get_Module.                          */
00186   /*                                                                       */
00187   FT_EXPORT( FT_Renderer )
00188   FT_Get_Renderer( FT_Library       library,
00189                    FT_Glyph_Format  format );
00190 
00191 
00192   /*************************************************************************/
00193   /*                                                                       */
00194   /* <Function>                                                            */
00195   /*    FT_Set_Renderer                                                    */
00196   /*                                                                       */
00197   /* <Description>                                                         */
00198   /*    Set the current renderer to use, and set additional mode.          */
00199   /*                                                                       */
00200   /* <InOut>                                                               */
00201   /*    library    :: A handle to the library object.                      */
00202   /*                                                                       */
00203   /* <Input>                                                               */
00204   /*    renderer   :: A handle to the renderer object.                     */
00205   /*                                                                       */
00206   /*    num_params :: The number of additional parameters.                 */
00207   /*                                                                       */
00208   /*    parameters :: Additional parameters.                               */
00209   /*                                                                       */
00210   /* <Return>                                                              */
00211   /*    FreeType error code.  0~means success.                             */
00212   /*                                                                       */
00213   /* <Note>                                                                */
00214   /*    In case of success, the renderer will be used to convert glyph     */
00215   /*    images in the renderer's known format into bitmaps.                */
00216   /*                                                                       */
00217   /*    This doesn't change the current renderer for other formats.        */
00218   /*                                                                       */
00219   FT_EXPORT( FT_Error )
00220   FT_Set_Renderer( FT_Library     library,
00221                    FT_Renderer    renderer,
00222                    FT_UInt        num_params,
00223                    FT_Parameter*  parameters );
00224 
00225 
00226   /* */
00227 
00228 
00229 FT_END_HEADER
00230 
00231 #endif /* __FTRENDER_H__ */
00232 
00233 
00234 /* END */

Generated on Tue Jul 5 14:13:38 2011 for ROOT_528-00b_version by  doxygen 1.5.1