forked from smistad/OpenCLUtilityLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHistogramPyramids.hpp
More file actions
68 lines (61 loc) · 1.79 KB
/
Copy pathHistogramPyramids.hpp
File metadata and controls
68 lines (61 loc) · 1.79 KB
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
65
66
67
68
#ifndef HISTOGRAMPYRAMIDS_HPP_
#define HISTOGRAMPYRAMIDS_HPP_
#include "Context.hpp"
#include <vector>
namespace oul {
/**
* Abstract class for all HistogramPyramids
*/
class HistogramPyramid {
public:
static void compileCode(oul::Context &context);
int getSum();
virtual cl::Buffer createPositionBuffer() = 0;
virtual void deleteHPlevels() = 0;
protected:
oul::Context context; //this will call the default constructor in Context
int size;
int sum;
};
/**
* 2D Histogram pyramid
*/
class HistogramPyramid2D : public HistogramPyramid {
public:
HistogramPyramid2D(oul::Context &context);
void create(cl::Image2D &image, int, int);
cl::Buffer createPositionBuffer();
void deleteHPlevels();
void traverse(cl::Kernel &kernel, int);
private:
std::vector<cl::Image2D> HPlevels;
};
/**
* 3D Histogram pyramid (that uses 3D textures)
*/
class HistogramPyramid3D : public HistogramPyramid {
public:
HistogramPyramid3D(oul::Context &context);
void create(cl::Image3D &image, int, int, int);
cl::Buffer createPositionBuffer();
void deleteHPlevels();
void traverse(cl::Kernel &kernel, int);
private:
std::vector<cl::Image3D> HPlevels;
};
/**
* 3D Histogram pyramid (which uses buffers instead of textures)
*/
class HistogramPyramid3DBuffer : public HistogramPyramid {
public:
HistogramPyramid3DBuffer(oul::Context &context);
void create(cl::Buffer &buffer, int, int, int);
cl::Buffer createPositionBuffer();
void deleteHPlevels();
void traverse(cl::Kernel &kernel, int);
private:
int sizeX,sizeY,sizeZ;
std::vector<cl::Buffer> HPlevels;
};
} // end namespace
#endif /* HISTOGRAMPYRAMIDS_HPP_ */