summaryrefslogtreecommitdiff
path: root/src/sdf/ftsdf.h
blob: d06f59a8e8e3b9df0ab55805d4f439b430f710dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

#ifndef FTSDF_H_
#define FTSDF_H_

#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
#include <freetype/ftimage.h>

FT_BEGIN_HEADER

  /* default spread value */
  #define DEFAULT_SPREAD  8

  /* minimum spread supported by the rasterizer. */
  #define MIN_SPREAD      2

  /* maximum spread supported by the rasterizer. */
  #define MAX_SPREAD      32

  /* TEMPORARY */
  typedef enum Optimizations_ {
    OPTIMIZATION_NONE = 0,  /* default: check all points against all edges  */
    OPTIMIZATION_BB   = 1,  /* use bounding box to check nearby grid points */
    OPTIMIZATION_SUB  = 2,  /* subdivide then use bounding box              */
    OPTIMIZATION_CG   = 3   /* use coarse grid to only check relevant edges */

  } Optimizations;
  /* --------- */

  /**************************************************************************
   *
   * @struct:
   *   SDF_Raster_Params
   *
   * @description:
   *   This struct must be used for the raster render function
   *   `FT_Raster_Render_Func' instead of `FT_Raster_Params' because
   *   the rasterizer require some addition information to render properly.
   *
   * @fields:
   *   [TODO]
   *
   */
  typedef struct  SDF_Raster_Params_
  {
    FT_Raster_Params  root;
    FT_UInt           spread;
    FT_Bool           flip_sign;
    FT_Bool           flip_y;

    /* TEMPORARY */
    FT_Int            optimization;

  } SDF_Raster_Params;

  FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_sdf_raster;

FT_END_HEADER

#endif /* FTSDF_H_ */

/* END */