00001 /* 00002 * types.h 00003 * 00004 * Created on: 10 lut 2015 00005 * Author: pmaciol 00006 */ 00007 00008 #ifndef TYPES_H_ 00009 #define TYPES_H_ 00010 00011 #ifndef __OPENCL_VERSION__ 00012 #include <CL/cl.h> 00013 #include <CL/cl_platform.h> 00014 typedef cl_float3 float3; 00015 typedef cl_float2 float2; 00016 typedef cl_int3 int3; 00017 typedef cl_int2 int2; 00018 00019 #endif 00020 00021 typedef struct _gridinfo_t { 00022 double min[3]; 00023 double max[3]; 00024 double cellSize[3]; 00025 int resolution[3]; 00026 } grid_t; 00027 00028 struct gridaccel_s 00029 { 00030 #ifdef __OPENCL_VERSION__ 00031 __constant gridinfo_t * gridinfo; 00032 __constant int * grid; 00033 __constant int * cells; 00034 #else 00035 cl_mem gridinfo; 00036 cl_mem grid; 00037 cl_mem cells; 00038 #endif 00039 }; 00040 00041 struct frameconfig_s 00042 { 00043 float3 eyepoint; 00044 float3 lookat; 00045 float3 upvector; 00046 int2 angles; 00047 }; 00048 00049 struct pixel_s 00050 { 00051 float3 color; 00052 float fill; 00053 unsigned int lock; 00054 }; 00055 00056 struct reconstruct_s 00057 { 00058 int pixelNumber; 00059 float importance; 00060 unsigned int randomSeed; 00061 }; 00062 00063 struct ray_s 00064 { 00065 float3 origin; 00066 float3 direction; 00067 struct reconstruct_s reconstructInfo; 00068 }; 00069 00070 struct elem_info { 00071 float vts[3*6]; 00072 float pls[4*5]; 00073 float min_v; 00074 float max_v; 00075 }; 00076 00077 typedef elem_info elem_info_t; 00078 00079 struct coeffs_info { 00080 short pdeg; 00081 short base; 00082 int nr_shap; 00083 float coeffs[128]; 00084 }; 00085 00086 typedef coeffs_info coeffs_info_t; 00087 00088 /* 00089 * This structure is passed once between the host and kernel for 00090 * data initialized before the run. 00091 */ 00092 typedef struct raycaster_context { 00093 cl_float4 dir_top_start; 00094 cl_float4 dir_bottom_start; 00095 cl_float4 dir_bottom_stop; 00096 cl_float4 eyeP; 00097 cl_float4 lightP; 00098 cl_int2 window_size; 00099 cl_float epsilon; 00100 cl_int maxIterations; 00101 cl_int stride; 00102 cl_int pad[3]; 00103 } rcc_t; 00104 00105 typedef struct { 00106 /* camera parameters */ 00107 float fov; 00108 float aspect; 00109 float translate[2]; 00110 float zoom; 00111 float curRotation[16]; 00112 00113 /* rendering parameters */ 00114 int shadows; /* whether self-shadowing is being rendered */ 00115 } camera_t; 00116 00117 00118 00119 00120 00121 00122 00123 00124 #endif /* TYPES_H_ */