36 const float4 in_x_coords = (float4)(coord.s0, 1 + coord.s0, 2 + coord.s0, 3 + coord.s0);
37 const float4 new_x = (in_x_coords + ((float4)(0.5f))) * (float4)(scale.s0);
38 const float4 new_y = (float4)((coord.s1 + 0.5f) * scale.s1);
39 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);
51 const float4 in_x_coords = (float4)(coord.s0, 1 + coord.s0, 2 + coord.s0, 3 + coord.s0);
52 const float4 new_x = (in_x_coords + ((float4)(0.5f))) * (float4)(scale.s0) - (float4)(0.5f);
53 const float4 new_y = (float4)((coord.s1 + 0.5f) * scale.s1 - 0.5f);
54 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);
79 const float input_width,
80 const float input_height,
81 const float output_width,
82 const float output_height)
86 const float2 r = (float2)(input_width / output_width, input_height / output_height);
113 const float input_width,
114 const float input_height,
115 const float output_width,
116 const float output_height)
120 const float2 r = (float2)(input_width / output_width, input_height / output_height);
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)
#define CONVERT_TO_IMAGE_STRUCT(name)
const float8 transform_bilinear(const float2 coord, const float2 scale)
Transforms four 2D coordinates.
__kernel void scale_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 float input_width, const float input_height, const float output_width, const float output_height)
Performs an affine transformation on an image interpolating with the BILINEAR method.
const float8 transform_nearest(const float2 coord, const float2 scale)
Transforms four 2D coordinates.
__kernel void scale_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 float input_width, const float input_height, const float output_width, const float output_height)
Performs an affine transformation on an image interpolating with the NEAREAST NEIGHBOUR 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 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 ...