-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSpotFinder.h
54 lines (43 loc) · 1 KB
/
SpotFinder.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
#ifndef KAIK_SPOTFINDER_HDR
#define KAIK_SPOTFINDER_HDR
#include <vector>
struct AIClasses;
struct CachePoint {
float maxValueInBox;
int x;
int y;
unsigned isValid:1;
unsigned isMasked:1;
};
class CSpotFinder {
public:
CSpotFinder(AIClasses* ai, int height, int width);
~CSpotFinder();
void SetBackingArray(float* map, int height, int width);
float* GetSumMap();
void InvalidateSumMap(int coordx, int coordy, int clearRadius);
void SetRadius(int radius);
void BackingArrayChanged();
CachePoint* GetBestCachePoint(int x, int y);
private:
float* MakeSumMap();
void MakeCachePoints();
void UpdateSumMapArea(int cacheX, int cacheY);
void UpdateSumMap();
// temp
void UpdateSumMap(int coordx, int coordy, int clearRadius);
bool haveTheBestSpotReady;
bool isValid;
int bestSpotX;
int bestSpotY;
int MapHeight;
int MapWidth;
int TotalCells;
int radius;
float* MexArrayA;
float* TempAverage;
int* xend;
AIClasses* ai;
std::vector<CachePoint> cachePoints;
};
#endif