summaryrefslogtreecommitdiff
path: root/base/gxscanc.h
blob: 024edff64b8645536309e054d8b35c5910d932d3 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* Copyright (C) 2001-2023 Artifex Software, Inc.
   All Rights Reserved.

   This software is provided AS-IS with no warranty, either express or
   implied.

   This software is distributed under license and may not be copied,
   modified or distributed except as expressly authorized under the terms
   of the license contained in the file LICENSE in this distribution.

   Refer to licensing information at http://www.artifex.com or contact
   Artifex Software, Inc.,  39 Mesa Street, Suite 108A, San Francisco,
   CA 94129, USA, for further information.
*/

/* $Id: gxpath.h 8022 2007-06-05 22:23:38Z giles $ */
/* Fixed-point path procedures */
/* Requires gxfixed.h */

#ifndef gxscanc_INCLUDED
#  define gxscanc_INCLUDED

#include "gxpath.h"
#include "gxdevice.h"

/* The routines and types in this interface use */
/* device, rather than user, coordinates, and fixed-point, */
/* rather than floating, representation. */

#ifndef inline
#define inline __inline
#endif /* inline */

/* Opaque type for an edgebuffer */
typedef struct gx_edgebuffer_s gx_edgebuffer;

struct gx_edgebuffer_s {
    int  base;
    int  height;
    int  xmin;
    int  xmax;
    int *index;
    int *table;
};

typedef struct {
    int (*scan_convert)(gx_device     * gs_restrict pdev,
                        gx_path       * gs_restrict path,
                  const gs_fixed_rect * gs_restrict rect,
                        gx_edgebuffer * gs_restrict edgebuffer,
                        fixed                       flatness);
    int (*filter)(gx_device       * gs_restrict pdev,
                  gx_edgebuffer   * gs_restrict edgebuffer,
                  int                           rule);
    int (*fill)(gx_device       * gs_restrict pdev,
          const gx_device_color * gs_restrict pdevc,
                gx_edgebuffer   * gs_restrict edgebuffer,
                int                           log_op);
} gx_scan_converter_t;

/* "Pixel centre" scanline routines */
int
gx_scan_convert(gx_device     * gs_restrict pdev,
                gx_path       * gs_restrict path,
          const gs_fixed_rect * gs_restrict rect,
                gx_edgebuffer * gs_restrict edgebuffer,
                fixed                       flatness);

int
gx_filter_edgebuffer(gx_device       * gs_restrict pdev,
                     gx_edgebuffer   * gs_restrict edgebuffer,
                     int                           rule);

int
gx_fill_edgebuffer(gx_device       * gs_restrict pdev,
             const gx_device_color * gs_restrict pdevc,
                   gx_edgebuffer   * gs_restrict edgebuffer,
                   int                           log_op);

/* "Any Part of a Pixel" (app) scanline routines */
int
gx_scan_convert_app(gx_device     * gs_restrict pdev,
                    gx_path       * gs_restrict path,
              const gs_fixed_rect * gs_restrict rect,
                    gx_edgebuffer * gs_restrict edgebuffer,
                    fixed                       flatness);

int
gx_filter_edgebuffer_app(gx_device       * gs_restrict pdev,
                         gx_edgebuffer   * gs_restrict edgebuffer,
                         int                           rule);

int
gx_fill_edgebuffer_app(gx_device       * gs_restrict pdev,
                 const gx_device_color * gs_restrict pdevc,
                       gx_edgebuffer   * gs_restrict edgebuffer,
                       int                           log_op);

/* "Pixel centre" trapezoid routines */
int
gx_scan_convert_tr(gx_device     * gs_restrict pdev,
                   gx_path       * gs_restrict path,
             const gs_fixed_rect * gs_restrict rect,
                   gx_edgebuffer * gs_restrict edgebuffer,
                   fixed                       flatness);

int
gx_filter_edgebuffer_tr(gx_device       * gs_restrict pdev,
                        gx_edgebuffer   * gs_restrict edgebuffer,
                        int                           rule);

int
gx_fill_edgebuffer_tr(gx_device       * gs_restrict pdev,
                const gx_device_color * gs_restrict pdevc,
                      gx_edgebuffer   * gs_restrict edgebuffer,
                      int                           log_op);

/* "Any Part of a Pixel" (app) trapezoid routines */
int
gx_scan_convert_tr_app(gx_device     * gs_restrict pdev,
                       gx_path       * gs_restrict path,
                 const gs_fixed_rect * gs_restrict rect,
                       gx_edgebuffer * gs_restrict edgebuffer,
                       fixed                       flatness);

int
gx_filter_edgebuffer_tr_app(gx_device       * gs_restrict pdev,
                            gx_edgebuffer   * gs_restrict edgebuffer,
                            int                           rule);

int
gx_fill_edgebuffer_tr_app(gx_device       * gs_restrict pdev,
                    const gx_device_color * gs_restrict pdevc,
                          gx_edgebuffer   * gs_restrict edgebuffer,
                          int                           log_op);

extern gx_scan_converter_t gx_scan_converter;
extern gx_scan_converter_t gx_scan_converter_app;
extern gx_scan_converter_t gx_scan_converter_tr;
extern gx_scan_converter_t gx_scan_converter_tr_app;

int
gx_scan_convert_and_fill(const gx_scan_converter_t *sc,
                               gx_device       *dev,
                               gx_path         *ppath,
                         const gs_fixed_rect   *ibox,
                               fixed            flat,
                               int              rule,
                         const gx_device_color *pdevc,
                               int              lop);

/* Equivalent to filling it full of 0's */
void gx_edgebuffer_init(gx_edgebuffer * edgebuffer);

void gx_edgebuffer_fin(gx_device     * pdev,
                       gx_edgebuffer * edgebuffer);


#endif /* gxscanc_INCLUDED */