-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwarpPerspective.h
More file actions
35 lines (30 loc) · 884 Bytes
/
warpPerspective.h
File metadata and controls
35 lines (30 loc) · 884 Bytes
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
#ifndef WARP_PERSPECTIVE_H
#define WARP_PERSPECTIVE_H
#include <CL/cl.h>
#include <iostream>
#include <vector>
#include <stdexcept>
// OpenCL kernel source code
extern const char* warpPerspectiveKernel;
class WarpPerspective {
public:
WarpPerspective(cl_context context_, cl_command_queue queue_, cl_device_id device_);
~WarpPerspective();
void allocateBuffers(int src_width, int src_height, int dst_width, int dst_height);
void setKernelArgs(const cl_mem clSrc, const cl_mem clDst, const cl_mem clM, float border_value);
void releaseBuffers();
void compute();
private:
void buildKernels();
cl_context context;
cl_command_queue queue;
cl_device_id device;
cl_program program;
cl_kernel kernel;
size_t global_size[2];
int src_width;
int src_height;
int dst_width;
int dst_height;
};
#endif // WARP_PERSPECTIVE_H