123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- read_only image2d_t projection_{},
- %nl
- pixel.x = mad(voxel.x, cosines{1}, mad(voxel.y, sines{1}, center.x));
- pixel.y = mad(tmp_x, sines{1}, mad(tmp_y, cosines{1}, tmp));
- result {2}= read_imagef (projection_{0}, sampler, pixel).x;
- %nl
- kernel void backproject_burst_{0} (
- {1}
- global float *volume,
- const sampler_t sampler,
- const int3 real_size,
- const float2 center,
- const float2 x_region,
- const float2 y_region,
- const float2 z_region,
- const float sin_lamino,
- const float cos_lamino,
- const float{2} sines,
- const float{2} cosines,
- const int cumulate)
- {{
- int idx = get_global_id (0);
- int idy = get_global_id (1);
- int idz = get_global_id (2);
- float result, tmp, tmp_x, tmp_y;
- float2 pixel;
- float3 voxel;
- if (idx < real_size.x && idy < real_size.y && idz < real_size.z) {{
- voxel.x = mad((float) idx, x_region.y, x_region.x);
- voxel.y = mad((float) idy, y_region.y, y_region.x);
- voxel.z = mad((float) idz, z_region.y, z_region.x);
- tmp = mad(voxel.z, sin_lamino, center.y);
- tmp_x = voxel.x * cos_lamino;
- tmp_y = -voxel.y * cos_lamino;
- {3}
- if (cumulate) {{
- volume[idz * real_size.x * real_size.y + idy * real_size.x + idx] += result;
- }} else {{
- volume[idz * real_size.x * real_size.y + idy * real_size.x + idx] = result;
- }}
- }}
- }}
|