vrshoot

diff libs/ft2static/freetype/ftbitmap.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/ft2static/freetype/ftbitmap.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,227 @@
     1.4 +/***************************************************************************/
     1.5 +/*                                                                         */
     1.6 +/*  ftbitmap.h                                                             */
     1.7 +/*                                                                         */
     1.8 +/*    FreeType utility functions for bitmaps (specification).              */
     1.9 +/*                                                                         */
    1.10 +/*  Copyright 2004, 2005, 2006, 2008 by                                    */
    1.11 +/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
    1.12 +/*                                                                         */
    1.13 +/*  This file is part of the FreeType project, and may only be used,       */
    1.14 +/*  modified, and distributed under the terms of the FreeType project      */
    1.15 +/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    1.16 +/*  this file you indicate that you have read the license and              */
    1.17 +/*  understand and accept it fully.                                        */
    1.18 +/*                                                                         */
    1.19 +/***************************************************************************/
    1.20 +
    1.21 +
    1.22 +#ifndef __FTBITMAP_H__
    1.23 +#define __FTBITMAP_H__
    1.24 +
    1.25 +
    1.26 +#include <ft2build.h>
    1.27 +#include FT_FREETYPE_H
    1.28 +
    1.29 +#ifdef FREETYPE_H
    1.30 +#error "freetype.h of FreeType 1 has been loaded!"
    1.31 +#error "Please fix the directory search order for header files"
    1.32 +#error "so that freetype.h of FreeType 2 is found first."
    1.33 +#endif
    1.34 +
    1.35 +
    1.36 +FT_BEGIN_HEADER
    1.37 +
    1.38 +
    1.39 +  /*************************************************************************/
    1.40 +  /*                                                                       */
    1.41 +  /* <Section>                                                             */
    1.42 +  /*    bitmap_handling                                                    */
    1.43 +  /*                                                                       */
    1.44 +  /* <Title>                                                               */
    1.45 +  /*    Bitmap Handling                                                    */
    1.46 +  /*                                                                       */
    1.47 +  /* <Abstract>                                                            */
    1.48 +  /*    Handling FT_Bitmap objects.                                        */
    1.49 +  /*                                                                       */
    1.50 +  /* <Description>                                                         */
    1.51 +  /*    This section contains functions for converting FT_Bitmap objects.  */
    1.52 +  /*                                                                       */
    1.53 +  /*************************************************************************/
    1.54 +
    1.55 +
    1.56 +  /*************************************************************************/
    1.57 +  /*                                                                       */
    1.58 +  /* <Function>                                                            */
    1.59 +  /*    FT_Bitmap_New                                                      */
    1.60 +  /*                                                                       */
    1.61 +  /* <Description>                                                         */
    1.62 +  /*    Initialize a pointer to an @FT_Bitmap structure.                   */
    1.63 +  /*                                                                       */
    1.64 +  /* <InOut>                                                               */
    1.65 +  /*    abitmap :: A pointer to the bitmap structure.                      */
    1.66 +  /*                                                                       */
    1.67 +  FT_EXPORT( void )
    1.68 +  FT_Bitmap_New( FT_Bitmap  *abitmap );
    1.69 +
    1.70 +
    1.71 +  /*************************************************************************/
    1.72 +  /*                                                                       */
    1.73 +  /* <Function>                                                            */
    1.74 +  /*    FT_Bitmap_Copy                                                     */
    1.75 +  /*                                                                       */
    1.76 +  /* <Description>                                                         */
    1.77 +  /*    Copy a bitmap into another one.                                    */
    1.78 +  /*                                                                       */
    1.79 +  /* <Input>                                                               */
    1.80 +  /*    library :: A handle to a library object.                           */
    1.81 +  /*                                                                       */
    1.82 +  /*    source  :: A handle to the source bitmap.                          */
    1.83 +  /*                                                                       */
    1.84 +  /* <Output>                                                              */
    1.85 +  /*    target  :: A handle to the target bitmap.                          */
    1.86 +  /*                                                                       */
    1.87 +  /* <Return>                                                              */
    1.88 +  /*    FreeType error code.  0~means success.                             */
    1.89 +  /*                                                                       */
    1.90 +  FT_EXPORT( FT_Error )
    1.91 +  FT_Bitmap_Copy( FT_Library        library,
    1.92 +                  const FT_Bitmap  *source,
    1.93 +                  FT_Bitmap        *target);
    1.94 +
    1.95 +
    1.96 +  /*************************************************************************/
    1.97 +  /*                                                                       */
    1.98 +  /* <Function>                                                            */
    1.99 +  /*    FT_Bitmap_Embolden                                                 */
   1.100 +  /*                                                                       */
   1.101 +  /* <Description>                                                         */
   1.102 +  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */
   1.103 +  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */
   1.104 +  /*    borders are kept unchanged.                                        */
   1.105 +  /*                                                                       */
   1.106 +  /* <Input>                                                               */
   1.107 +  /*    library   :: A handle to a library object.                         */
   1.108 +  /*                                                                       */
   1.109 +  /*    xStrength :: How strong the glyph is emboldened horizontally.      */
   1.110 +  /*                 Expressed in 26.6 pixel format.                       */
   1.111 +  /*                                                                       */
   1.112 +  /*    yStrength :: How strong the glyph is emboldened vertically.        */
   1.113 +  /*                 Expressed in 26.6 pixel format.                       */
   1.114 +  /*                                                                       */
   1.115 +  /* <InOut>                                                               */
   1.116 +  /*    bitmap    :: A handle to the target bitmap.                        */
   1.117 +  /*                                                                       */
   1.118 +  /* <Return>                                                              */
   1.119 +  /*    FreeType error code.  0~means success.                             */
   1.120 +  /*                                                                       */
   1.121 +  /* <Note>                                                                */
   1.122 +  /*    The current implementation restricts `xStrength' to be less than   */
   1.123 +  /*    or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */
   1.124 +  /*                                                                       */
   1.125 +  /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */
   1.126 +  /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */
   1.127 +  /*                                                                       */
   1.128 +  FT_EXPORT( FT_Error )
   1.129 +  FT_Bitmap_Embolden( FT_Library  library,
   1.130 +                      FT_Bitmap*  bitmap,
   1.131 +                      FT_Pos      xStrength,
   1.132 +                      FT_Pos      yStrength );
   1.133 +
   1.134 +
   1.135 +  /*************************************************************************/
   1.136 +  /*                                                                       */
   1.137 +  /* <Function>                                                            */
   1.138 +  /*    FT_Bitmap_Convert                                                  */
   1.139 +  /*                                                                       */
   1.140 +  /* <Description>                                                         */
   1.141 +  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a  */
   1.142 +  /*    bitmap object with depth 8bpp, making the number of used bytes per */
   1.143 +  /*    line (a.k.a. the `pitch') a multiple of `alignment'.               */
   1.144 +  /*                                                                       */
   1.145 +  /* <Input>                                                               */
   1.146 +  /*    library   :: A handle to a library object.                         */
   1.147 +  /*                                                                       */
   1.148 +  /*    source    :: The source bitmap.                                    */
   1.149 +  /*                                                                       */
   1.150 +  /*    alignment :: The pitch of the bitmap is a multiple of this         */
   1.151 +  /*                 parameter.  Common values are 1, 2, or 4.             */
   1.152 +  /*                                                                       */
   1.153 +  /* <Output>                                                              */
   1.154 +  /*    target    :: The target bitmap.                                    */
   1.155 +  /*                                                                       */
   1.156 +  /* <Return>                                                              */
   1.157 +  /*    FreeType error code.  0~means success.                             */
   1.158 +  /*                                                                       */
   1.159 +  /* <Note>                                                                */
   1.160 +  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */
   1.161 +  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */
   1.162 +  /*                                                                       */
   1.163 +  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */
   1.164 +  /*                                                                       */
   1.165 +  /*    The `library' argument is taken to have access to FreeType's       */
   1.166 +  /*    memory handling functions.                                         */
   1.167 +  /*                                                                       */
   1.168 +  FT_EXPORT( FT_Error )
   1.169 +  FT_Bitmap_Convert( FT_Library        library,
   1.170 +                     const FT_Bitmap  *source,
   1.171 +                     FT_Bitmap        *target,
   1.172 +                     FT_Int            alignment );
   1.173 +
   1.174 +
   1.175 +  /*************************************************************************/
   1.176 +  /*                                                                       */
   1.177 +  /* <Function>                                                            */
   1.178 +  /*    FT_GlyphSlot_Own_Bitmap                                            */
   1.179 +  /*                                                                       */
   1.180 +  /* <Description>                                                         */
   1.181 +  /*    Make sure that a glyph slot owns `slot->bitmap'.                   */
   1.182 +  /*                                                                       */
   1.183 +  /* <Input>                                                               */
   1.184 +  /*    slot :: The glyph slot.                                            */
   1.185 +  /*                                                                       */
   1.186 +  /* <Return>                                                              */
   1.187 +  /*    FreeType error code.  0~means success.                             */
   1.188 +  /*                                                                       */
   1.189 +  /* <Note>                                                                */
   1.190 +  /*    This function is to be used in combination with                    */
   1.191 +  /*    @FT_Bitmap_Embolden.                                               */
   1.192 +  /*                                                                       */
   1.193 +  FT_EXPORT( FT_Error )
   1.194 +  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );
   1.195 +
   1.196 +
   1.197 +  /*************************************************************************/
   1.198 +  /*                                                                       */
   1.199 +  /* <Function>                                                            */
   1.200 +  /*    FT_Bitmap_Done                                                     */
   1.201 +  /*                                                                       */
   1.202 +  /* <Description>                                                         */
   1.203 +  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */
   1.204 +  /*                                                                       */
   1.205 +  /* <Input>                                                               */
   1.206 +  /*    library :: A handle to a library object.                           */
   1.207 +  /*                                                                       */
   1.208 +  /*    bitmap  :: The bitmap object to be freed.                          */
   1.209 +  /*                                                                       */
   1.210 +  /* <Return>                                                              */
   1.211 +  /*    FreeType error code.  0~means success.                             */
   1.212 +  /*                                                                       */
   1.213 +  /* <Note>                                                                */
   1.214 +  /*    The `library' argument is taken to have access to FreeType's       */
   1.215 +  /*    memory handling functions.                                         */
   1.216 +  /*                                                                       */
   1.217 +  FT_EXPORT( FT_Error )
   1.218 +  FT_Bitmap_Done( FT_Library  library,
   1.219 +                  FT_Bitmap  *bitmap );
   1.220 +
   1.221 +
   1.222 +  /* */
   1.223 +
   1.224 +
   1.225 +FT_END_HEADER
   1.226 +
   1.227 +#endif /* __FTBITMAP_H__ */
   1.228 +
   1.229 +
   1.230 +/* END */