30 return (float16)(MAT0, MAT1, MAT2, MAT3, MAT4, MAT5, MAT6, MAT7, MAT8, 0, 0, 0, (float4)0);
48 const float4 in_x_coords = (float4)(coord.s0, 1 + coord.s0, 2 + coord.s0, 3 + coord.s0);
50 const float4 z = (float4)mad(in_x_coords, (float4)(mtx.s2), mad((float4)(coord.s1), (float4)(mtx.s5), (float4)(mtx.s8)));
53 const float4 new_x = (float4)mad(in_x_coords, (float4)(mtx.s0), mad((float4)(coord.s1), (float4)(mtx.s3), (float4)(mtx.s6))) / z;
55 const float4 new_y = (float4)mad(in_x_coords, (float4)(mtx.s1), mad((float4)(coord.s1), (float4)(mtx.s4), (float4)(mtx.s7))) / z;
56 return (float8)(new_x.s0, new_y.s0, new_x.s1, new_y.s1, new_x.s2, new_y.s2, new_x.s3, new_y.s3);
const float8 clamp_to_border(float8 coords, const float width, const float height)
Clamps the given coordinates to the borders.
#define CONVERT_TO_IMAGE_STRUCT_NO_STEP(name)
const float8 apply_perspective_transform(const float2 coord, const float16 mtx)
Transforms four 2D coordinates using the formula:
#define IMAGE_DECLARATION(name)
#define CONVERT_TO_IMAGE_STRUCT(name)
const float16 build_perspective_mtx()
Returns the perspective matrix.
Structure to hold Image information.
__global uchar * ptr
Pointer to the starting postion of the buffer.
const DATA_TYPE4 read_texels4(const Image *in, const int8 coords)
Reads four texels from the input image.
const float2 get_current_coords()
Returns the current thread coordinates.
__kernel void warp_perspective_nearest_neighbour(__global uchar *in_ptr, uint in_stride_x, uint in_step_x, uint in_stride_y, uint in_step_y, uint in_offset_first_element_in_bytes, __global uchar *out_ptr, uint out_stride_x, uint out_step_x, uint out_stride_y, uint out_step_y, uint out_offset_first_element_in_bytes, const int width, const int height)
Performs perspective transformation on an image interpolating with the NEAREAST NEIGHBOUR method...
__kernel void warp_perspective_bilinear(__global uchar *in_ptr, uint in_stride_x, uint in_step_x, uint in_stride_y, uint in_step_y, uint in_offset_first_element_in_bytes, __global uchar *out_ptr, uint out_stride_x, uint out_step_x, uint out_stride_y, uint out_step_y, uint out_offset_first_element_in_bytes, const int width, const int height)
Performs a perspective transform on an image interpolating with the BILINEAR method.
const DATA_TYPE4 bilinear_interpolate(const Image *in, const float8 coords, const float width, const float height)
Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the ...