beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / src / cairo-clip-private.h
blob5fc05a64e938afcab0124c59d9da971ec94105b3
1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2005 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it either under the terms of the GNU Lesser General Public
7 * License version 2.1 as published by the Free Software Foundation
8 * (the "LGPL") or, at your option, under the terms of the Mozilla
9 * Public License Version 1.1 (the "MPL"). If you do not alter this
10 * notice, a recipient may use your version of this file under either
11 * the MPL or the LGPL.
13 * You should have received a copy of the LGPL along with this library
14 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
16 * You should have received a copy of the MPL along with this library
17 * in the file COPYING-MPL-1.1
19 * The contents of this file are subject to the Mozilla Public License
20 * Version 1.1 (the "License"); you may not use this file except in
21 * compliance with the License. You may obtain a copy of the License at
22 * http://www.mozilla.org/MPL/
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26 * the specific language governing rights and limitations.
28 * The Original Code is the cairo graphics library.
30 * The Initial Developer of the Original Code is Red Hat, Inc.
32 * Contributor(s):
33 * Kristian Høgsberg <krh@redhat.com>
34 * Chris Wilson <chris@chris-wilson.co.uk>
37 #ifndef CAIRO_CLIP_PRIVATE_H
38 #define CAIRO_CLIP_PRIVATE_H
40 #include "cairo-types-private.h"
42 #include "cairo-boxes-private.h"
43 #include "cairo-error-private.h"
44 #include "cairo-compiler-private.h"
45 #include "cairo-error-private.h"
46 #include "cairo-path-fixed-private.h"
47 #include "cairo-reference-count-private.h"
49 extern const cairo_private cairo_rectangle_list_t _cairo_rectangles_nil;
51 struct _cairo_clip_path {
52 cairo_reference_count_t ref_count;
53 cairo_path_fixed_t path;
54 cairo_fill_rule_t fill_rule;
55 double tolerance;
56 cairo_antialias_t antialias;
57 cairo_clip_path_t *prev;
60 struct _cairo_clip {
61 cairo_rectangle_int_t extents;
62 cairo_clip_path_t *path;
64 cairo_box_t *boxes;
65 int num_boxes;
67 cairo_region_t *region;
68 cairo_bool_t is_region;
70 cairo_box_t embedded_box;
73 cairo_private cairo_clip_t *
74 _cairo_clip_create (void);
76 cairo_private cairo_clip_path_t *
77 _cairo_clip_path_reference (cairo_clip_path_t *clip_path);
79 cairo_private void
80 _cairo_clip_path_destroy (cairo_clip_path_t *clip_path);
82 cairo_private void
83 _cairo_clip_destroy (cairo_clip_t *clip);
85 cairo_private extern const cairo_clip_t __cairo_clip_all;
87 cairo_private cairo_clip_t *
88 _cairo_clip_copy (const cairo_clip_t *clip);
90 cairo_private cairo_clip_t *
91 _cairo_clip_copy_region (const cairo_clip_t *clip);
93 cairo_private cairo_clip_t *
94 _cairo_clip_copy_path (const cairo_clip_t *clip);
96 cairo_private cairo_clip_t *
97 _cairo_clip_translate (cairo_clip_t *clip, int tx, int ty);
99 cairo_private cairo_clip_t *
100 _cairo_clip_transform (cairo_clip_t *clip, const cairo_matrix_t *m);
102 cairo_private cairo_clip_t *
103 _cairo_clip_copy_with_translation (const cairo_clip_t *clip, int tx, int ty);
105 cairo_private cairo_bool_t
106 _cairo_clip_equal (const cairo_clip_t *clip_a,
107 const cairo_clip_t *clip_b);
109 cairo_private cairo_clip_t *
110 _cairo_clip_intersect_rectangle (cairo_clip_t *clip,
111 const cairo_rectangle_int_t *rectangle);
113 cairo_private cairo_clip_t *
114 _cairo_clip_intersect_clip (cairo_clip_t *clip,
115 const cairo_clip_t *other);
117 cairo_private cairo_clip_t *
118 _cairo_clip_intersect_box (cairo_clip_t *clip,
119 const cairo_box_t *box);
121 cairo_private cairo_clip_t *
122 _cairo_clip_intersect_boxes (cairo_clip_t *clip,
123 const cairo_boxes_t *boxes);
125 cairo_private cairo_clip_t *
126 _cairo_clip_intersect_rectilinear_path (cairo_clip_t *clip,
127 const cairo_path_fixed_t *path,
128 cairo_fill_rule_t fill_rule,
129 cairo_antialias_t antialias);
131 cairo_private cairo_clip_t *
132 _cairo_clip_intersect_path (cairo_clip_t *clip,
133 const cairo_path_fixed_t *path,
134 cairo_fill_rule_t fill_rule,
135 double tolerance,
136 cairo_antialias_t antialias);
138 cairo_private const cairo_rectangle_int_t *
139 _cairo_clip_get_extents (const cairo_clip_t *clip);
141 cairo_private cairo_surface_t *
142 _cairo_clip_get_surface (const cairo_clip_t *clip, cairo_surface_t *dst, int *tx, int *ty);
144 cairo_private cairo_surface_t *
145 _cairo_clip_get_image (const cairo_clip_t *clip,
146 cairo_surface_t *target,
147 const cairo_rectangle_int_t *extents);
149 cairo_private cairo_status_t
150 _cairo_clip_combine_with_surface (const cairo_clip_t *clip,
151 cairo_surface_t *dst,
152 int dst_x, int dst_y);
154 cairo_private cairo_clip_t *
155 _cairo_clip_from_boxes (const cairo_boxes_t *boxes);
157 cairo_private cairo_region_t *
158 _cairo_clip_get_region (const cairo_clip_t *clip);
160 cairo_private cairo_bool_t
161 _cairo_clip_is_region (const cairo_clip_t *clip);
163 cairo_private cairo_clip_t *
164 _cairo_clip_reduce_to_rectangle (const cairo_clip_t *clip,
165 const cairo_rectangle_int_t *r);
167 cairo_private cairo_clip_t *
168 _cairo_clip_reduce_for_composite (const cairo_clip_t *clip,
169 cairo_composite_rectangles_t *extents);
171 cairo_private cairo_bool_t
172 _cairo_clip_contains_rectangle (const cairo_clip_t *clip,
173 const cairo_rectangle_int_t *rect);
175 cairo_private cairo_bool_t
176 _cairo_clip_contains_box (const cairo_clip_t *clip,
177 const cairo_box_t *box);
179 cairo_private cairo_bool_t
180 _cairo_clip_contains_extents (const cairo_clip_t *clip,
181 const cairo_composite_rectangles_t *extents);
183 cairo_private cairo_rectangle_list_t*
184 _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate);
186 cairo_private cairo_rectangle_list_t *
187 _cairo_rectangle_list_create_in_error (cairo_status_t status);
189 cairo_private cairo_bool_t
190 _cairo_clip_is_polygon (const cairo_clip_t *clip);
192 cairo_private cairo_int_status_t
193 _cairo_clip_get_polygon (const cairo_clip_t *clip,
194 cairo_polygon_t *polygon,
195 cairo_fill_rule_t *fill_rule,
196 cairo_antialias_t *antialias);
198 #endif /* CAIRO_CLIP_PRIVATE_H */