fix crashes reported by Debian Cylab Mayhem Team
[swftools.git] / lib / art / art_rect.h
blob088079f7128bbd3c65f70c7c077e4af0484c2ef0
1 /* Libart_LGPL - library of basic graphic primitives
2 * Copyright (C) 1998 Raph Levien
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __ART_RECT_H__
21 #define __ART_RECT_H__
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
27 typedef struct _ArtDRect ArtDRect;
28 typedef struct _ArtIRect ArtIRect;
30 struct _ArtDRect {
31 /*< public >*/
32 double x0, y0, x1, y1;
35 struct _ArtIRect {
36 /*< public >*/
37 int x0, y0, x1, y1;
40 /* Make a copy of the rectangle. */
41 void art_irect_copy (ArtIRect *dest, const ArtIRect *src);
43 /* Find the smallest rectangle that includes both source rectangles. */
44 void art_irect_union (ArtIRect *dest,
45 const ArtIRect *src1, const ArtIRect *src2);
47 /* Return the intersection of the two rectangles */
48 void art_irect_intersect (ArtIRect *dest,
49 const ArtIRect *src1, const ArtIRect *src2);
51 /* Return true if the rectangle is empty. */
52 int art_irect_empty (const ArtIRect *src);
54 /* Make a copy of the rectangle. */
55 void art_drect_copy (ArtDRect *dest, const ArtDRect *src);
57 /* Find the smallest rectangle that includes both source rectangles. */
58 void art_drect_union (ArtDRect *dest,
59 const ArtDRect *src1, const ArtDRect *src2);
61 /* Return the intersection of the two rectangles */
62 void art_drect_intersect (ArtDRect *dest,
63 const ArtDRect *src1, const ArtDRect *src2);
65 /* Return true if the rectangle is empty. */
66 int art_drect_empty (const ArtDRect *src);
68 void
69 art_drect_affine_transform (ArtDRect *dst, const ArtDRect *src,
70 const double matrix[6]);
72 void art_drect_to_irect (ArtIRect *dst, ArtDRect *src);
74 #ifdef __cplusplus
76 #endif
78 #endif