30 return (float8)(MAT0, MAT1, MAT2, MAT3, MAT4, MAT5, 0, 0);
45 const float4 in_x_coords = (float4)(coord.s0, 1 + coord.s0, 2 + coord.s0, 3 + coord.s0);
47 const float4 new_x = mad( in_x_coords, (float4)(mtx.s0) , mad((float4)(coord.s1), (float4)(mtx.s2), (float4)(mtx.s4)));
49 const float4 new_y = mad(in_x_coords, (float4)(mtx.s1), mad((float4)(coord.s1), (float4)(mtx.s3), (float4)(mtx.s5)));
50 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)
#define IMAGE_DECLARATION(name)
const float8 build_affine_mtx()
Returns a vector of floats contaning the matrix coefficients.
#define CONVERT_TO_IMAGE_STRUCT(name)
__kernel void warp_affine_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 an affine transform on an image interpolating with the NEAREAST NEIGHBOUR method...
__kernel void warp_affine_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 an affine transform on an image interpolating with the BILINEAR method.
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.
const float8 apply_affine_transform(const float2 coord, const float8 mtx)
Transforms 4 2D coordinates using the formula:
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 ...