home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / ft-beta.zip / freetype / lib / ttraster.h < prev    next >
C/C++ Source or Header  |  1997-10-06  |  5KB  |  134 lines

  1. /*******************************************************************
  2.  *
  3.  *  ttraster.h                                                 v 1.4
  4.  *
  5.  *  The FreeType glyph rasterizer.
  6.  *
  7.  *  Copyright 1996, 1997 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 "freetype.h"  /* for TT_Glyph_Outline */
  47. #include "ttcommon.h"
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53.   /* We provide two different builds of the scan-line converter  */
  54.   /* The static build uses global variables and isn't re-entrant */
  55.   /* The indirect build is re-entrant but accesses all variables */
  56.   /* indirectly.                                                 */
  57.   /*                                                             */
  58.   /* As a consequence, the indirect build is about 10% slower    */
  59.   /* than the static one on a _Pentium_ ( this could get worse   */
  60.   /* on older processors ), but the code size is reduced by      */
  61.   /* more than 30% !                                             */
  62.   /*                                                             */
  63.   /* The indirect build is now the default, defined in           */
  64.   /* ttconfig.h. Be careful if you experiment with this.         */
  65.   /*                                                             */
  66.  
  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 waste memory..              */
  72.   /*                                                             */
  73.  
  74.   #ifdef TT_STATIC_RASTER
  75.   
  76.     #define  RAS_ARGS
  77.     #define  RAS_ARG
  78.   
  79.     #define  RAS_VARS
  80.     #define  RAS_VAR
  81.  
  82.     #define  RAS_OPS
  83.     #define  RAS_OP
  84.  
  85.   #else
  86.  
  87.     #define  RAS_ARGS  TRaster_Instance*  raster,
  88.     #define  RAS_ARG   TRaster_Instance*  raster
  89.  
  90.     #define  RAS_VARS  raster,
  91.     #define  RAS_VAR   raster
  92.  
  93.     #define  RAS_OPS   ((TRaster_Instance*)engine.raster_component),
  94.     #define  RAS_OP    ((TRaster_Instance*)engine.raster_component)
  95.  
  96.   #endif
  97.  
  98.   typedef struct _TRaster_Instance  TRaster_Instance;
  99.  
  100.   /* Render one glyph in the target bitmap, using drop-out control */
  101.   /* mode 'scan'.                                                  */
  102.   TT_Error  Render_Glyph( RAS_ARGS  TT_Glyph_Outline*  glyph,
  103.                                     TT_Raster_Map*     target );
  104.  
  105.   /* Render one gray-level glyph in the target pixmap.              */
  106.   /* Palette points to an array of 5 colors used for the rendering. */
  107.   /* Use NULL to reuse the last palette. Default is VGA graylevels. */
  108.   TT_Error  Render_Gray_Glyph( RAS_ARGS  TT_Glyph_Outline*  glyph,
  109.                                          TT_Raster_Map*     target,
  110.                                          char*              palette );
  111.  
  112.   void  Set_High_Precision( RAS_ARGS  int   High );
  113.   /* Enables high precision (slow) rendering */
  114.  
  115.   void Set_Second_Pass( RAS_ARGS  int  pass );
  116.   /* Enable horizontal drop-out control. Only vertical drop outs are */
  117.   /* checked when this flag isn't set.                               */
  118.  
  119.   TT_Error  TTRaster_Init();
  120.   /* Initialize rasterizer */
  121.  
  122.   TT_Error  TTRaster_Done();
  123.   /* Finalize it */
  124.  
  125.  
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129.  
  130. #endif /* RASTER_H */
  131.  
  132.  
  133. /* End */
  134.