48 uchar16 top = vload16(0,
offset(&src, -1, -1));
49 uchar16 middle = vload16(0,
offset(&src, -1, 0));
50 uchar16 bottom = vload16(0,
offset(&src, -1, 1));
52 uchar16 tmp = max(top, max(middle, bottom));
53 uchar8 out = max(tmp.s01234567, max(tmp.s12345678, tmp.s23456789));
55 vstore8(out, 0, dst.
ptr);
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
#define CONVERT_TO_IMAGE_STRUCT(name)
#define IMAGE_DECLARATION(name)
SimpleTensor< float > src
Structure to hold Image information.
__global uchar * ptr
Pointer to the starting postion of the buffer.
__kernel void dilate(__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)
This function dilates an input image.