-
Notifications
You must be signed in to change notification settings - Fork 0
/
Loom.cpp
51 lines (42 loc) · 1.05 KB
/
Loom.cpp
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
// Luke Schlather
// Friday, April 30 2010
// Licensed under the GPLv3
#include<iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "Loom.h"
using namespace std;
using namespace cimg_library;
void print(const Configuration& src) {
cout << endl;
for(int x=0;x<src.size();++x) {
for(int y=0;y<src[x].size();++y) {
cout << src[x][y] << ", ";
}
cout << endl;
}
}
void Loom::destroy() {
multimap<int,char**>::iterator end = weights.end();
for (multimap<int,char**>::iterator img=weights.begin();img!=end;++img) {
//delete the arrays
}
}
Loom::Loom(int w, int h,int count) {
Configuration config;
for( int x=0;x<w;++x) {
config.push_back(vector<int>());
for( int y=0;y<h;++y) {
config[x].push_back( rand() % count);
}
}
}
// uchar Loom::weight(int id, int x, int y) {
// int cellwidth = library.getWidth();
// int cellheight = library.getHeight();
// CImg<uchar> *cell = &(library(id));
// int xcorner = x*cellwidth;
// int ycorner = y*cellheight;
// return 0;
// }