New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / graphics / ispointinregion.c
blobbb5c25de2c66d1144ad064478f012c83e5be3515
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function AndRegionRegion()
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include <graphics/regions.h>
10 #include "intregions.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/graphics.h>
17 AROS_LH3(BOOL, IsPointInRegion,
19 /* SYNOPSIS */
20 AROS_LHA(struct Region *, Reg, A0),
21 AROS_LHA(WORD, x, D0),
22 AROS_LHA(WORD, y, D1),
24 /* LOCATION */
25 struct GfxBase *, GfxBase, 190, Graphics)
27 /* FUNCTION
28 Checks if the point (x, y) is contained in the region Reg
30 INPUTS
31 region1 - pointer to a region structure
32 x - The point's 'x' coord
33 y - The point's 'y' coord
35 RESULT
36 TRUE if the point is contained, FALSE otherwise
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 XorRegionRegion(), OrRegionRegion()
47 INTERNALS
49 HISTORY
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 struct RegionRectangle *rr;
57 if (!_IsPointInRect(Bounds(Reg), x, y))
58 return FALSE;
60 x -= MinX(Reg);
61 y -= MinY(Reg);
63 for
65 rr = Reg->RegionRectangle;
66 rr;
67 rr = rr->Next
70 if (y > MaxY(rr)) continue;
71 if (y < MinY(rr)) return FALSE;
72 if (x < MinX(rr)) continue;
73 if (x > MaxX(rr)) continue;
75 return TRUE;
78 return FALSE;
80 AROS_LIBFUNC_EXIT