-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoom.h
48 lines (31 loc) · 918 Bytes
/
Loom.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
#ifndef _LOOM_
#define _LOOM_
// Luke Schlather
// Friday, April 30 2010
// Licensed under the LGPL
#include<vector>
#include<map>
typedef unsigned char uchar;
#include "ImageSet.h"
typedef std::vector <std::vector <int> > Configuration;
void print(const Configuration& src);
class Loom {
Configuration config;
std::multimap<int,char**> weights;
// ImageSet library;
cimg_library::CImg<uchar> pattern;
int cellularWidth;
int cellularHeight;
void destroy();
// void clearWeights();
public:
Loom(int x, int y, int count);
~Loom() { destroy();}
Configuration& getConfiguration() { return config;}
// Distance/Weight/Quality function. Checks weights table to see if
// it's already been computed for that cell position against the
// given id, and if not, computes the weight and places it in the
// table.
uchar weight(int id, int x, int y);
};
#endif // _LOOM_