Home | History | Annotate | Download | only in cl_kernel
      1 /*
      2  * function: kernel_wire_frame
      3  *
      4  * output_y:              Y channel image2d_t as write only
      5  * output_uv:             uv channel image2d_t as write only
      6  * wire_frames_coords:    coordinates of wire frames
      7  * coords_num:            number of coordinates to be processed
      8  */
      9 
     10 __kernel void kernel_wire_frame (
     11     __write_only image2d_t output_y, __write_only image2d_t output_uv,
     12     __global uint2 *wire_frames_coords, uint coords_num,
     13     float border_y, float border_u, float border_v)
     14 {
     15     if (coords_num == 0) {
     16         return;
     17     }
     18 
     19     int gid = get_global_id (0);
     20     if (gid >= coords_num) {
     21         return;
     22     }
     23 
     24     uint2 coord = wire_frames_coords [gid];
     25 
     26     write_imagef (output_y, (int2)(coord.x / 2, coord.y), (float4)(border_y));
     27     if (coord.y % 2 == 0) {
     28         write_imagef (output_uv, (int2)(coord.x / 2, coord.y / 2), (float4)(border_u, border_v, 0.0f, 0.0f));
     29     }
     30 }
     31