-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgumption.h
64 lines (53 loc) · 1.01 KB
/
gumption.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "point_search.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef EXPORT_DLL
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif
struct Region {
Rect* rect;
Rect* crect;
int n;
Point* ranksort;
Region* left;
Region* right;
Region* lrmid;
Region* bottom;
Region* top;
Region* btmid;
float subw, subh;
};
struct GumpSearchContext {
int32_t N;
// Binary search
Point* xsort;
Point* ysort;
// Region search
Region* root;
Point* ranksort;
Rect* trim;
// Grid search
Point* gridsort;
Point*** grid;
Rect** grect;
Rect** drect;
int** dlen;
Rect* bounds;
double area;
double dx, dy;
// Current search
Point** blocks;
int* blocki;
int* blockn;
float w;
float h;
};
SearchContext* __stdcall DLL_API create(const Point* points_begin, const Point* points_end);
int32_t __stdcall DLL_API search(SearchContext* sc, const Rect rect, const int32_t count, Point* out_points);
SearchContext* __stdcall DLL_API destroy(SearchContext* sc);
#ifdef __cplusplus
}
#endif