w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cairo-spans-private.h
Go to the documentation of this file.
1 /* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */
2 /* cairo - a vector graphics library with display and print output
3  *
4  * Copyright (c) 2008 M Joonas Pihlaja
5  *
6  * Permission is hereby granted, free of charge, to any person
7  * obtaining a copy of this software and associated documentation
8  * files (the "Software"), to deal in the Software without
9  * restriction, including without limitation the rights to use,
10  * copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following
13  * conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  */
27 #ifndef CAIRO_SPANS_PRIVATE_H
28 #define CAIRO_SPANS_PRIVATE_H
29 #include "cairo-types-private.h"
30 #include "cairo-compiler-private.h"
31 
32 /* Number of bits of precision used for alpha. */
33 #define CAIRO_SPANS_UNIT_COVERAGE_BITS 8
34 #define CAIRO_SPANS_UNIT_COVERAGE ((1 << CAIRO_SPANS_UNIT_COVERAGE_BITS)-1)
35 
36 /* A structure representing an open-ended horizontal span of constant
37  * pixel coverage. */
38 typedef struct _cairo_half_open_span {
39  int32_t x; /* The inclusive x-coordinate of the start of the span. */
40  uint8_t coverage; /* The pixel coverage for the pixels to the right. */
41  uint8_t inverse; /* between regular mask and clip */
43 
44 /* Span renderer interface. Instances of renderers are provided by
45  * surfaces if they want to composite spans instead of trapezoids. */
48  /* Private status variable. */
50 
51  /* Called to destroy the renderer. */
53 
54  /* Render the spans on row y of the destination by whatever compositing
55  * method is required. */
57  (*render_rows) (void *abstract_renderer,
58  int y, int height,
59  const cairo_half_open_span_t *coverages,
60  unsigned num_coverages);
61 
62  /* Called after all rows have been rendered to perform whatever
63  * final rendering step is required. This function is called just
64  * once before the renderer is destroyed. */
65  cairo_status_t (*finish) (void *abstract_renderer);
66 };
67 
68 /* Scan converter interface. */
71  /* Destroy this scan converter. */
73 
74  /* Generates coverage spans for rows for the added edges and calls
75  * the renderer function for each row. After generating spans the
76  * only valid thing to do with the converter is to destroy it. */
77  cairo_status_t (*generate) (void *abstract_converter,
78  cairo_span_renderer_t *renderer);
79 
80  /* Private status. Read with _cairo_scan_converter_status(). */
82 };
83 
84 /* Scan converter constructors. */
85 
88  int ymin,
89  int xmax,
90  int ymax,
91  cairo_fill_rule_t fill_rule,
95  const cairo_polygon_t *polygon);
96 
99  int ymin,
100  int xmax,
101  int ymax,
102  cairo_fill_rule_t fill_rule,
106  const cairo_polygon_t *polygon);
107 
110  int ymin,
111  int xmax,
112  int ymax,
113  cairo_fill_rule_t fill_rule);
116  const cairo_polygon_t *polygon);
117 
121  cairo_fill_rule_t fill_rule,
123 
126 
128 
131  void *base;
132  int count;
133  int size;
138 
139 cairo_private void
142 
145  const cairo_box_t *box,
146  int dir);
147 
150 
153 
154  int xmin, xmax;
155 
158  void *base;
159  int count;
160  int size;
165 
166 cairo_private void
168  const cairo_box_t *extents,
169  cairo_fill_rule_t fill_rule);
170 
173  const cairo_polygon_t *polygon);
174 
175 /* cairo-spans.c: */
176 
179 
181 _cairo_scan_converter_status (void *abstract_converter);
182 
184 _cairo_scan_converter_set_error (void *abstract_converter,
186 
189 
191 _cairo_span_renderer_status (void *abstract_renderer);
192 
193 /* Set the renderer into an error state. This sets all the method
194  * pointers except ->destroy() of the renderer to no-op
195  * implementations that just return the error status. */
197 _cairo_span_renderer_set_error (void *abstract_renderer,
199 
203  const cairo_pattern_t *pattern,
204  cairo_fill_rule_t fill_rule,
206  const cairo_composite_rectangles_t *rects,
208  cairo_region_t *clip_region);
209 
210 #endif /* CAIRO_SPANS_PRIVATE_H */
#define height(a)
Definition: aptex-macros.h:200
#define cairo_private
#define CAIRO_STACK_BUFFER_SIZE
cairo_status_t _cairo_span_renderer_status(void *abstract_renderer)
Definition: cairo-spans.c:165
cairo_scan_converter_t * _cairo_clip_tor_scan_converter_create(cairo_clip_t *clip, cairo_polygon_t *polygon, cairo_fill_rule_t fill_rule, cairo_antialias_t antialias)
void _cairo_rectangular_scan_converter_init(cairo_rectangular_scan_converter_t *self, const cairo_rectangle_int_t *extents)
cairo_scan_converter_t * _cairo_mono_scan_converter_create(int xmin, int ymin, int xmax, int ymax, cairo_fill_rule_t fill_rule)
void _cairo_botor_scan_converter_init(cairo_botor_scan_converter_t *self, const cairo_box_t *extents, cairo_fill_rule_t fill_rule)
cairo_status_t _cairo_botor_scan_converter_add_polygon(cairo_botor_scan_converter_t *converter, const cairo_polygon_t *polygon)
cairo_span_renderer_t * _cairo_span_renderer_create_in_error(cairo_status_t error)
Definition: cairo-spans.c:198
struct _cairo_half_open_span cairo_half_open_span_t
struct _cairo_botor_scan_converter cairo_botor_scan_converter_t
cairo_status_t _cairo_rectangular_scan_converter_add_box(cairo_rectangular_scan_converter_t *self, const cairo_box_t *box, int dir)
cairo_status_t _cairo_surface_composite_polygon(cairo_surface_t *surface, cairo_operator_t op, const cairo_pattern_t *pattern, cairo_fill_rule_t fill_rule, cairo_antialias_t antialias, const cairo_composite_rectangles_t *rects, cairo_polygon_t *polygon, cairo_region_t *clip_region)
cairo_scan_converter_t * _cairo_tor_scan_converter_create(int xmin, int ymin, int xmax, int ymax, cairo_fill_rule_t fill_rule, cairo_antialias_t antialias)
cairo_status_t _cairo_span_renderer_set_error(void *abstract_renderer, cairo_status_t error)
Definition: cairo-spans.c:172
struct _cairo_rectangular_scan_converter cairo_rectangular_scan_converter_t
cairo_status_t _cairo_tor22_scan_converter_add_polygon(void *converter, const cairo_polygon_t *polygon)
cairo_status_t _cairo_scan_converter_status(void *abstract_converter)
Definition: cairo-spans.c:51
cairo_status_t _cairo_tor_scan_converter_add_polygon(void *converter, const cairo_polygon_t *polygon)
cairo_status_t _cairo_scan_converter_set_error(void *abstract_converter, cairo_status_t error)
Definition: cairo-spans.c:58
cairo_status_t _cairo_mono_scan_converter_add_polygon(void *converter, const cairo_polygon_t *polygon)
cairo_scan_converter_t * _cairo_scan_converter_create_in_error(cairo_status_t error)
Definition: cairo-spans.c:81
cairo_scan_converter_t * _cairo_tor22_scan_converter_create(int xmin, int ymin, int xmax, int ymax, cairo_fill_rule_t fill_rule, cairo_antialias_t antialias)
enum _cairo_operator cairo_operator_t
enum _cairo_fill_rule cairo_fill_rule_t
enum _cairo_antialias cairo_antialias_t
enum _cairo_status cairo_status_t
void(* cairo_destroy_func_t)(void *data)
Definition: cairo.h:232
#define error(a)
Definition: dviinfo.c:48
kerning y
Definition: ttdriver.c:212
signed int int32_t
Definition: stdint.h:77
unsigned char uint8_t
Definition: stdint.h:78
static cairo_surface_t * surface
Definition: pdftocairo.cc:234
static GooString antialias
Definition: pdftocairo.cc:119
#define dir
struct _cairo_botor_scan_converter::_cairo_botor_scan_converter_chunk chunks
char buf[(512 *sizeof(int))]
cairo_scan_converter_t base
struct _cairo_botor_scan_converter::_cairo_botor_scan_converter_chunk * tail
struct _cairo_rectangular_scan_converter::_cairo_rectangular_scan_converter_chunk chunks
struct _cairo_rectangular_scan_converter::_cairo_rectangular_scan_converter_chunk * tail
cairo_status_t(* generate)(void *abstract_converter, cairo_span_renderer_t *renderer)
cairo_destroy_func_t destroy
cairo_destroy_func_t destroy
cairo_status_t(* finish)(void *abstract_renderer)
cairo_status_t(* render_rows)(void *abstract_renderer, int y, int height, const cairo_half_open_span_t *coverages, unsigned num_coverages)
Definition: jquant2.c:258
Definition: sh.h:1226