+
- -
+
- - - - + - - - + +
  • -
  • - - - - -
  • + + + + + + +
  • + + + + + -
  • - - - - - - - - - -
  • - - - - - - -
  • - + + + + +
  • + + Subpixel Rendering + +
  • + + + + + - - - + +
  • -
  • - - - - -
  • - + + + +
  • + + Cache Sub-System + +
  • + + + + + @@ -740,129 +699,126 @@ - + + +
  • - - + -
  • - - - - -
  • + + + - - - - -
  • - - Module Management - -
  • - + +
  • + + Glyph Stroker + +
  • + + + + - - - - -
  • - - GZIP Streams - -
  • - + +
  • + + System Interface + +
  • + + + + - - - - -
  • - - LZW Streams - -
  • - + +
  • + + Module Management + +
  • + + + + - - - - -
  • - - BZIP2 Streams - -
  • - + +
  • + + GZIP Streams + +
  • + + + + - - - - -
  • - - External Debugging APIs - -
  • - + +
  • + + LZW Streams + +
  • + + + + - - - - + + +
  • + + BZIP2 Streams + +
  • + + + + + - - - + +
  • -
  • - - - - -
  • - + + + + +
  • + + Error Code Values + +
  • + + + + + - - - + +
  • -
  • - - - - -
  • - + + + + +
  • + + OpenType Validation + +
  • + + + + + @@ -1193,29 +1120,31 @@
    - -
    +
    -
    -
    +
    @@ -1326,10 +1252,15 @@

    Scanline Converter

    Synopsis

    -

    A raster or a rasterizer is a scan converter in charge of producing a pixel coverage bitmap that can be used as an alpha channel when compositing a glyph with a background. FreeType comes with two rasterizers: bilevel raster1 and anti-aliased smooth are two separate modules. They are usually called from the high-level FT_Load_Glyph or FT_Render_Glyph functions and produce the entire coverage bitmap at once, while staying largely invisible to users.

    -

    Instead of working with complete coverage bitmaps, it is also possible to intercept consecutive pixel runs on the same scanline with the same coverage, called spans, and process them individually. Only the smooth rasterizer permits this when calling FT_Outline_Render with FT_Raster_Params as described below.

    -

    Working with either complete bitmaps or spans it is important to think of them as colorless coverage objects suitable as alpha channels to blend arbitrary colors with a background. For best results, it is recommended to use gamma correction, too.

    -

    This section also describes the public API needed to set up alternative FT_Renderer modules.

    +

    This section contains technical definitions.

    +

    FT_Raster

    +

    Defined in FT_IMAGE_H (freetype/ftimage.h).

    +
      typedef struct FT_RasterRec_*  FT_Raster;
    +
    + +

    An opaque handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap.

    +
    +

    FT_Span

    Defined in FT_IMAGE_H (freetype/ftimage.h).

      typedef struct  FT_Span_
    @@ -1341,8 +1272,9 @@
       } FT_Span;
     
    -

    A structure to model a single span of consecutive pixels when rendering an anti-aliased bitmap.

    +

    A structure used to model a single span of gray pixels when rendering an anti-aliased bitmap.

    fields

    +
    x

    The span's horizontal start position.

    @@ -1358,7 +1290,7 @@

    note

    This structure is used by the span drawing callback type named FT_SpanFunc that takes the y coordinate of the span as a parameter.

    -

    The anti-aliased rasterizer produces coverage values from 0 to 255, this is, from completely transparent to completely opaque.

    +

    The coverage value is always between 0 and 255. If you want less gray values, the callback function has to reduce them.


    FT_SpanFunc

    @@ -1372,8 +1304,9 @@ #define FT_Raster_Span_Func FT_SpanFunc -

    A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the pixel spans on each scan line.

    +

    A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the gray pixel spans on each scan line.

    input

    +
    y

    The scanline's upward y coordinate.

    @@ -1391,8 +1324,8 @@

    note

    -

    This callback allows client applications to directly render the spans of the anti-aliased bitmap to any kind of surfaces.

    -

    This can be used to write anti-aliased outlines directly to a given background bitmap using alpha compositing. It can also be used for oversampling and averaging.

    +

    This callback allows client applications to directly render the gray spans of the anti-aliased bitmap to any kind of surfaces.

    +

    This can be used to write anti-aliased outlines directly to a given background bitmap, and even perform translucency.


    FT_Raster_Params

    @@ -1414,6 +1347,7 @@

    A structure to hold the parameters used by a raster's render function, passed as an argument to FT_Outline_Render.

    fields

    +
    target

    The target bitmap.

    @@ -1457,7 +1391,6 @@ #define FT_RASTER_FLAG_AA 0x1 #define FT_RASTER_FLAG_DIRECT 0x2 #define FT_RASTER_FLAG_CLIP 0x4 -#define FT_RASTER_FLAG_SDF 0x8 /* these constants are deprecated; use the corresponding */ /* `FT_RASTER_FLAG_XXX` values instead */ @@ -1469,6 +1402,7 @@

    A list of bit flag constants as used in the flags field of a FT_Raster_Params structure.

    values

    + -
    FT_RASTER_FLAG_DEFAULT

    This value is 0.

    @@ -1483,24 +1417,10 @@
    FT_RASTER_FLAG_CLIP

    This flag is only used in direct rendering mode. If set, the output will be clipped to a box specified in the clip_box field of the FT_Raster_Params structure. Otherwise, the clip_box is effectively set to the bounding box and all spans are generated.

    FT_RASTER_FLAG_SDF -

    This flag is set to indicate that a signed distance field glyph image should be generated. This is only used while rendering with the FT_RENDER_MODE_SDF render mode.

    -

    -

    FT_Raster

    -

    Defined in FT_IMAGE_H (freetype/ftimage.h).

    -
      typedef struct FT_RasterRec_*  FT_Raster;
    -
    - -

    An opaque handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap.

    -

    note

    - -

    In FreeType 2, all rasters are now encapsulated within specific FT_Renderer modules and only used in their context.

    -
    -

    FT_Raster_NewFunc

    Defined in FT_IMAGE_H (freetype/ftimage.h).

      typedef int
    @@ -1512,6 +1432,7 @@
     
     

    A function used to create a new raster object.

    input

    +
    memory

    A handle to the memory allocator.

    @@ -1519,6 +1440,7 @@

    output

    +
    raster

    A handle to the new raster object.

    @@ -1543,6 +1465,7 @@

    A function used to destroy a given raster object.

    input

    +
    raster

    A handle to the raster object.

    @@ -1564,6 +1487,7 @@

    FreeType used to provide an area of memory called the ‘render pool’ available to all registered rasterizers. This was not thread safe, however, and now FreeType never allocates this pool.

    This function is called after a new raster object is created.

    input

    +
    raster

    A handle to the new raster object.

    @@ -1593,6 +1517,7 @@

    This function is a generic facility to change modes or attributes in a given raster. This can be used for debugging purposes, or simply to allow implementation-specific ‘features’ in a given raster module.

    input

    +
    raster

    A handle to the new raster object.

    @@ -1618,6 +1543,7 @@

    Invoke a given raster to scan-convert a given glyph image into a target bitmap.

    input

    +
    raster

    A handle to the raster object.

    @@ -1653,6 +1579,7 @@

    A structure used to describe a given raster class to the library.

    fields

    +
    glyph_format

    The supported glyph format for this raster.

    @@ -1695,6 +1622,9 @@

    Deprecated, unimplemented.


    + + + @@ -1704,60 +1634,59 @@ - -
    -
    -
    - - - + + + -- cgit v1.2.3