-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel.cuh
72 lines (48 loc) · 1.77 KB
/
kernel.cuh
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
69
70
71
72
#ifndef _KERNEL_H
#define _KERNEL_H
#include <GL/gl.h>
#include <cuda.h>
#include <cuda_gl_interop.h>
#include "volumegenerator.h"
#include "params.h"
#include "cs123math/CS123Algebra.h"
extern "C" {
#define SLICE_NONE -1
#define SLICE_PLANE 0
#define SLICE_PLANE_CUT 1
#define TRANSFER_PRESET_DEFAULT -1
#define TRANSFER_PRESET_ENGINE 0
#define TRANSFER_PRESET_MRI 1
struct slice_params {
int type;
float params[6];
};
struct camera_params {
float origin[3];
float fovX, fovY;
float scale[3]; // TODO: This probably shouldn't be a member of camera_params
};
struct shading_params {
int transferPreset;
bool phongShading;
};
void initCuda();
void registerCudaResources(GLuint input0, GLuint input1, GLuint output);
void runCuda(int width,
int height,
struct slice_params slice,
struct camera_params camera,
struct shading_params shading,
cudaArray* volumeArray);
void cudaLoadVolume(byte* texels, size_t size, Vector3 dims,
float transferFunction[1024], cudaArray** volumeArray); // load volumetric texture
}
// ############## Robin's extra stuff for slicing
void invoke_slice_kernel(float *buffer, BufferParameters bp, SliceParameters sp, canonicalOrientation c, float3 scale);
void invoke_advanced_slice_kernel(float *buffer, BufferParameters bp, Matrix4x4 trans, float3 scale);
// NOTE: Perhaps pass in matrix format...
__global__
void slice_kernel(float *buffer, BufferParameters bp, SliceParameters sp, canonicalOrientation c, float3 scale);
__global__
void advanced_slice_kernel(float *buffer, BufferParameters bp, REAL* trans, float3 scale);
#endif