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
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"
48 cairo_status_t status;
50 const cairo_box_t *limits;
53 unsigned int maybe_region : 1; /* hint: 0 implies that it cannot be */
54 unsigned int has_intersections : 1;
55 unsigned int is_rectilinear : 1;
56 unsigned int is_rectangular : 1;
60 cairo_trapezoid_t *traps;
61 cairo_trapezoid_t traps_embedded[16];
66 _cairo_traps_init (cairo_traps_t *traps);
69 _cairo_traps_init_with_clip (cairo_traps_t *traps,
70 const cairo_clip_t *clip);
73 _cairo_traps_limit (cairo_traps_t *traps,
74 const cairo_box_t *boxes,
77 cairo_private cairo_status_t
78 _cairo_traps_init_boxes (cairo_traps_t *traps,
79 const cairo_boxes_t *boxes);
82 _cairo_traps_clear (cairo_traps_t *traps);
85 _cairo_traps_fini (cairo_traps_t *traps);
87 #define _cairo_traps_status(T) (T)->status
90 _cairo_traps_translate (cairo_traps_t *traps, int x, int y);
92 cairo_private cairo_status_t
93 _cairo_traps_tessellate_rectangle (cairo_traps_t *traps,
94 const cairo_point_t *top_left,
95 const cairo_point_t *bottom_right);
98 _cairo_traps_add_trap (cairo_traps_t *traps,
99 cairo_fixed_t top, cairo_fixed_t bottom,
100 cairo_line_t *left, cairo_line_t *right);
103 _cairo_traps_contain (const cairo_traps_t *traps,
107 _cairo_traps_extents (const cairo_traps_t *traps,
108 cairo_box_t *extents);
110 cairo_private cairo_int_status_t
111 _cairo_traps_extract_region (cairo_traps_t *traps,
112 cairo_antialias_t antialias,
113 cairo_region_t **region);
115 cairo_private cairo_bool_t
116 _cairo_traps_to_boxes (cairo_traps_t *traps,
117 cairo_antialias_t antialias,
118 cairo_boxes_t *boxes);
120 cairo_private cairo_status_t
121 _cairo_traps_path (const cairo_traps_t *traps,
122 cairo_path_fixed_t *path);
124 cairo_private cairo_int_status_t
125 _cairo_rasterise_polygon_to_traps (cairo_polygon_t *polygon,
126 cairo_fill_rule_t fill_rule,
127 cairo_antialias_t antialias,
128 cairo_traps_t *traps);
132 #endif /* CAIRO_TRAPS_PRIVATE_H */