1 /* Libart_LGPL - library of basic graphic primitives 2 * Copyright (C) 1998 Raph Levien 3 * 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. 8 * 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. 13 * 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. 18 */ 19 20 #ifndef __ART_RECT_H__ 21 #define __ART_RECT_H__ 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 typedef struct _ArtDRect ArtDRect; 28 typedef struct _ArtIRect ArtIRect; 29 30 struct _ArtDRect { 31 /*< public >*/ 32 double x0, y0, x1, y1; 33 }; 34 35 struct _ArtIRect { 36 /*< public >*/ 37 int x0, y0, x1, y1; 38 }; 39 40 /* Make a copy of the rectangle. */ 41 void art_irect_copy (ArtIRect *dest, const ArtIRect *src); 42 43 /* Find the smallest rectangle that includes both source rectangles. */ 44 void art_irect_union (ArtIRect *dest, 45 const ArtIRect *src1, const ArtIRect *src2); 46 47 /* Return the intersection of the two rectangles */ 48 void art_irect_intersect (ArtIRect *dest, 49 const ArtIRect *src1, const ArtIRect *src2); 50 51 /* Return true if the rectangle is empty. */ 52 int art_irect_empty (const ArtIRect *src); 53 54 /* Make a copy of the rectangle. */ 55 void art_drect_copy (ArtDRect *dest, const ArtDRect *src); 56 57 /* Find the smallest rectangle that includes both source rectangles. */ 58 void art_drect_union (ArtDRect *dest, 59 const ArtDRect *src1, const ArtDRect *src2); 60 61 /* Return the intersection of the two rectangles */ 62 void art_drect_intersect (ArtDRect *dest, 63 const ArtDRect *src1, const ArtDRect *src2); 64 65 /* Return true if the rectangle is empty. */ 66 int art_drect_empty (const ArtDRect *src); 67 68 void 69 art_drect_affine_transform (ArtDRect *dst, const ArtDRect *src, 70 const double matrix[6]); 71 72 void art_drect_to_irect (ArtIRect *dst, ArtDRect *src); 73 74 #ifdef __cplusplus 75 } 76 #endif 77 78 #endif 79