beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / src / cairo-traps-private.h
blobdcaf40d18638649bcad26d1f78ebbca14b08a33a
1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2002 University of Southern California
4 * Copyright © 2005 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it either under the terms of the GNU Lesser General Public
8 * License version 2.1 as published by the Free Software Foundation
9 * (the "LGPL") or, at your option, under the terms of the Mozilla
10 * Public License Version 1.1 (the "MPL"). If you do not alter this
11 * notice, a recipient may use your version of this file under either
12 * the MPL or the LGPL.
14 * You should have received a copy of the LGPL along with this library
15 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
17 * You should have received a copy of the MPL along with this library
18 * in the file COPYING-MPL-1.1
20 * The contents of this file are subject to the Mozilla Public License
21 * Version 1.1 (the "License"); you may not use this file except in
22 * compliance with the License. You may obtain a copy of the License at
23 * http://www.mozilla.org/MPL/
25 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
26 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
27 * the specific language governing rights and limitations.
29 * The Original Code is the cairo graphics library.
31 * The Initial Developer of the Original Code is University of Southern
32 * California.
34 * Contributor(s):
35 * Carl D. Worth <cworth@cworth.org>
38 #ifndef CAIRO_TRAPS_PRIVATE_H
39 #define CAIRO_TRAPS_PRIVATE_H
41 #include "cairo-compiler-private.h"
42 #include "cairo-error-private.h"
43 #include "cairo-types-private.h"
45 CAIRO_BEGIN_DECLS
47 struct _cairo_traps {
48 cairo_status_t status;
50 cairo_box_t bounds;
51 const cairo_box_t *limits;
52 int num_limits;
54 unsigned int maybe_region : 1; /* hint: 0 implies that it cannot be */
55 unsigned int has_intersections : 1;
56 unsigned int is_rectilinear : 1;
57 unsigned int is_rectangular : 1;
59 int num_traps;
60 int traps_size;
61 cairo_trapezoid_t *traps;
62 cairo_trapezoid_t traps_embedded[16];
65 /* cairo-traps.c */
66 cairo_private void
67 _cairo_traps_init (cairo_traps_t *traps);
69 cairo_private void
70 _cairo_traps_init_with_clip (cairo_traps_t *traps,
71 const cairo_clip_t *clip);
73 cairo_private void
74 _cairo_traps_limit (cairo_traps_t *traps,
75 const cairo_box_t *boxes,
76 int num_boxes);
78 cairo_private cairo_status_t
79 _cairo_traps_init_boxes (cairo_traps_t *traps,
80 const cairo_boxes_t *boxes);
82 cairo_private void
83 _cairo_traps_clear (cairo_traps_t *traps);
85 cairo_private void
86 _cairo_traps_fini (cairo_traps_t *traps);
88 #define _cairo_traps_status(T) (T)->status
90 cairo_private void
91 _cairo_traps_translate (cairo_traps_t *traps, int x, int y);
93 cairo_private void
94 _cairo_traps_tessellate_triangle_with_edges (cairo_traps_t *traps,
95 const cairo_point_t t[3],
96 const cairo_point_t edges[4]);
98 cairo_private void
99 _cairo_traps_tessellate_convex_quad (cairo_traps_t *traps,
100 const cairo_point_t q[4]);
102 cairo_private cairo_status_t
103 _cairo_traps_tessellate_rectangle (cairo_traps_t *traps,
104 const cairo_point_t *top_left,
105 const cairo_point_t *bottom_right);
107 cairo_private void
108 _cairo_traps_add_trap (cairo_traps_t *traps,
109 cairo_fixed_t top, cairo_fixed_t bottom,
110 const cairo_line_t *left,
111 const cairo_line_t *right);
113 cairo_private int
114 _cairo_traps_contain (const cairo_traps_t *traps,
115 double x, double y);
117 cairo_private void
118 _cairo_traps_extents (const cairo_traps_t *traps,
119 cairo_box_t *extents);
121 cairo_private cairo_int_status_t
122 _cairo_traps_extract_region (cairo_traps_t *traps,
123 cairo_antialias_t antialias,
124 cairo_region_t **region);
126 cairo_private cairo_bool_t
127 _cairo_traps_to_boxes (cairo_traps_t *traps,
128 cairo_antialias_t antialias,
129 cairo_boxes_t *boxes);
131 cairo_private cairo_status_t
132 _cairo_traps_path (const cairo_traps_t *traps,
133 cairo_path_fixed_t *path);
135 cairo_private cairo_int_status_t
136 _cairo_rasterise_polygon_to_traps (cairo_polygon_t *polygon,
137 cairo_fill_rule_t fill_rule,
138 cairo_antialias_t antialias,
139 cairo_traps_t *traps);
141 CAIRO_END_DECLS
143 #endif /* CAIRO_TRAPS_PRIVATE_H */