9 #if defined(KERNEL_INTEGRATE_TRAJECTORY) || defined(KERNEL_CONNECT_CHANNELS) \ 10 || defined(KERNEL_MAP_CHANNEL_HEADS) || defined(KERNEL_COUNT_DOWNCHANNELS) \ 11 || defined(KERNEL_LINK_HILLSLOPES) || defined(KERNEL_SEGMENT_HILLSLOPES) \ 12 || defined(KERNEL_SUBSEGMENT_FLANKS) || defined(KERNEL_HILLSLOPE_LENGTHS) 42 const __global float2 *uv_array,
43 float2 *dxy1_vec, float2 *dxy2_vec,
44 float2 *uv1_vec, float2 *uv2_vec,
46 float2 *next_vec, uint *idx) {
54 *next_vec = vec+*dxy2_vec;
59 #if defined(KERNEL_INTEGRATE_TRAJECTORY) && defined(IS_RNG_AVAILABLE) 86 const __global float2 *uv_array,
88 float2 *dxy1_vec, float2 *dxy2_vec,
89 float2 *uv1_vec, float2 *uv2_vec,
90 const float2 vec, float2 *next_vec,
97 *uv1_vec /= fast_length(*uv1_vec);
101 *uv2_vec /= fast_length(*uv2_vec);
103 *next_vec = vec+*dxy2_vec;
static float2 speed_interpolator(float2 vec, __global const float2 *uv_array)
Bilinearly interpolate a velocity vector (choice of row-major or column-major arrays).
static float2 approximate(float2 raw_position)
Approximate a float vector at the resolution provided by a scaled byte vector.
static void compute_step_vec(const float dt, const __global float2 *uv_array, float2 *dxy1_vec, float2 *dxy2_vec, float2 *uv1_vec, float2 *uv2_vec, const float2 vec, float2 *next_vec, uint *idx)
Compute a 2nd-order Runge-Kutta integration step along a streamline.
static uint get_array_idx(float2 vec)
Compute the array index of the padded grid pixel pointed to by a float2 grid position vector (choice ...
static float2 lehmer_rand_vec(uint *rng_state)
Generate a Lehmer RNG float2 vector random variate .
static void compute_step_vec_jittered(const float dt, const __global float2 *uv_array, uint *rng_state, float2 *dxy1_vec, float2 *dxy2_vec, float2 *uv1_vec, float2 *uv2_vec, const float2 vec, float2 *next_vec, uint *idx)
Compute a jittered 2nd-order Runge-Kutta integration step along a streamline.