-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathintimage.h
39 lines (32 loc) · 830 Bytes
/
intimage.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
#ifndef INTIMAGE_H
#define INTIMAGE_H
#include <iostream>
#include <cassert>
#include <cstring>
using namespace std;
class IntImage
{
public:
IntImage()
{
pix = NULL;
}
IntImage(const int w, const int h)
{
assert(w > 0); assert(h > 0);
width = w; height = h;
pix = new double[w*h];
memset(pix, 0, sizeof(double)*w*h);
}
double *pix;
int width, height;
double getPixel(const int x, const int y);
void setPixel(const int x, const int y, const double val);
float boxIntegral(const int x0, const int y0, const int cols, const int rows);
virtual ~IntImage()
{
if(pix != NULL)
delete [] pix;
}
};
#endif // INTIMAGE_H