Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /*******************************************************************
  2.  *
  3.  *  ttraster.h                                                 v 1.4
  4.  *
  5.  *  The FreeType glyph rasterizer.
  6.  *
  7.  *  Copyright 1996-1999 by
  8.  *  David Turner, Robert Wilhelm, and Werner Lemberg
  9.  *
  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.
  15.  *
  16.  *  NOTES:
  17.  *
  18.  *  This version supports the following:
  19.  *
  20.  *    - direct grayscaling
  21.  *    - sub-banding
  22.  *    - drop-out modes 4 and 5
  23.  *    - second pass for complete drop-out control (bitmap only)
  24.  *    - variable precision
  25.  *
  26.  *
  27.  *   Changes between 1.4 and 1.3:
  28.  *
  29.  *   Mainly performance tunings:
  30.  *
  31.  *   - Line_Down() and Bezier_Down() now use the functions Line_Up()
  32.  *     and Bezier_Up() to do their work.
  33.  *   - optimized Split_Bezier()
  34.  *   - optimized linked lists used during sweeps
  35.  *
  36.  *   Changes between 1.2 and 1.3:
  37.  *
  38.  *     - made the engine optionaly re-entrant.  Saves a lot
  39.  *       of code for a moderate performance hit.
  40.  *
  41.  ******************************************************************/
  42.  
  43. #ifndef TTRASTER_H
  44. #define TTRASTER_H
  45.  
  46. #include "ttconfig.h"
  47. #include "freetype.h"  /* for TT_Outline */
  48. #include "ttengine.h"
  49.  
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif
  53.  
  54.   /* We provide two different builds of the scan-line converter  */
  55.   /* The static build uses global variables and isn't            */
  56.   /* re-entrant.                                                 */
  57.   /* The indirect build is re-entrant but accesses all variables */
  58.   /* indirectly.                                                 */
  59.   /*                                                             */
  60.   /* As a consequence, the indirect build is about 10% slower    */
  61.   /* than the static one on a _Pentium_ (this could get worse    */
  62.   /* on older processors), but the code size is reduced by       */
  63.   /* more than 30% !                                             */
  64.   /*                                                             */
  65.   /* The indirect build is now the default, defined in           */
  66.   /* ttconfig.h.  Be careful if you experiment with this.        */
  67.  
  68.   /* Note also that, though its code can be re-entrant, the      */
  69.   /* component is always used in thread-safe mode.  This is      */
  70.   /* simply due to the fact that we want to use a single         */
  71.   /* render pool (of 64 Kb), and not to waste memory.            */
  72.  
  73. #ifdef TT_STATIC_RASTER
  74.  
  75. #define  RAS_ARGS  /* void */
  76. #define  RAS_ARG   /* void */
  77.  
  78. #define  RAS_VARS  /* void */
  79. #define  RAS_VAR   /* void */
  80.  
  81. #else
  82.  
  83. #define  RAS_ARGS  TRaster_Instance*  raster,
  84. #define  RAS_ARG   TRaster_Instance*  raster
  85.  
  86. #define  RAS_VARS  raster,
  87. #define  RAS_VAR   raster
  88.  
  89. #endif
  90.  
  91.  
  92.   struct  TRaster_Instance_;
  93.   typedef struct TRaster_Instance_  TRaster_Instance;
  94.  
  95.   /* Render one glyph in the target bitmap, using drop-out control */
  96.   /* mode 'scan'.                                                  */
  97.   LOCAL_DEF
  98.   TT_Error  Render_Glyph( RAS_ARGS TT_Outline*     glyph,
  99.                                    TT_Raster_Map*  target );
  100.  
  101. #ifdef TT_CONFIG_OPTION_GRAY_SCALING
  102.   /* Render one gray-level glyph in the target pixmap.              */
  103.   /* Palette points to an array of 5 colors used for the rendering. */
  104.   /* Use NULL to reuse the last palette. Default is VGA graylevels. */
  105.   LOCAL_DEF
  106.   TT_Error  Render_Gray_Glyph( RAS_ARGS TT_Outline*     glyph,
  107.                                         TT_Raster_Map*  target,
  108.                                         Byte*           palette );
  109. #endif
  110.  
  111.   /* Initialize rasterizer */
  112.   LOCAL_DEF
  113.   TT_Error  TTRaster_Init( PEngine_Instance  engine );
  114.  
  115.   /* Finalize it */
  116.   LOCAL_DEF
  117.   TT_Error  TTRaster_Done( PEngine_Instance  engine );
  118.  
  119.  
  120. #ifdef __cplusplus
  121. }
  122. #endif
  123.  
  124. #endif /* TTRASTER_H */
  125.  
  126.  
  127. /* END */
  128.