26 float rgbd[3],
int rgbi[3],
const uint16_t level,
29 for(
int c = 0; c < 3; c++)
36 for(
int c = 0; c < 3; c++)
39 for(
int c = 0; c < 3; c++)
40 rgbi[c] = ((
int)
rgbd[c] < 0) ? 0 : (((int)
rgbd[c] > level - 2) ? level - 2 : (int)
rgbd[c]);
42 for(
int c = 0; c < 3; c++)
64 const float *
const restrict clut,
const uint16_t level,
67 const int level2 = level * level;
70 for(
size_t k = 0;
k < (size_t)(
pixel_nb * 4);
k += 4)
72 const float *
const input =
in +
k;
73 float *
const output =
out +
k;
158 const float *
const restrict clut,
const uint16_t level,
161 const int level2 = level * level;
164 for(
size_t k = 0;
k < (size_t)(
pixel_nb * 4);
k += 4)
166 const float *
const input =
in +
k;
167 float *
const output =
out +
k;
181 tmp[1] = clut[
i + 1] * (1 -
rgbd[0]) + clut[
j + 1] *
rgbd[0];
182 tmp[2] = clut[
i + 2] * (1 -
rgbd[0]) + clut[
j + 2] *
rgbd[0];
185 j = (
color + level + 1) * 3;
188 tmp[4] = clut[
i + 1] * (1 -
rgbd[0]) + clut[
j + 1] *
rgbd[0];
189 tmp[5] = clut[
i + 2] * (1 -
rgbd[0]) + clut[
j + 2] *
rgbd[0];
199 tmp[1] = clut[
i + 1] * (1 -
rgbd[0]) + clut[
j + 1] *
rgbd[0];
200 tmp[2] = clut[
i + 2] * (1 -
rgbd[0]) + clut[
j + 2] *
rgbd[0];
206 tmp[4] = clut[
i + 1] * (1 -
rgbd[0]) + clut[
j + 1] *
rgbd[0];
207 tmp[5] = clut[
i + 2] * (1 -
rgbd[0]) + clut[
j + 2] *
rgbd[0];
213 output[0] = output[0] * (1 -
rgbd[2]) +
tmp[0] *
rgbd[2];
214 output[1] = output[1] * (1 -
rgbd[2]) +
tmp[1] *
rgbd[2];
215 output[2] = output[2] * (1 -
rgbd[2]) +
tmp[2] *
rgbd[2];
223 const float *
const restrict clut,
const uint16_t level,
226 const int level2 = level * level;
229 for(
size_t k = 0;
k < (size_t)(
pixel_nb * 4);
k += 4)
231 const float *
const input =
in +
k;
232 float *
const output =
out +
k;
301 switch(interpolation)
const dt_colormatrix_t dt_aligned_pixel_t out
float *const restrict const size_t k
@ DT_LUT3D_INTERP_PYRAMID
@ DT_LUT3D_INTERP_TETRAHEDRAL
@ DT_LUT3D_INTERP_TRILINEAR
#define __OMP_PARALLEL_FOR__(...)
__DT_CLONE_TARGETS__ void dt_lut3d_pyramid_interp(const float *const in, float *const out, const size_t pixel_nb, const float *const restrict clut, const uint16_t level, const float normalization)
void dt_lut3d_apply(const float *const in, float *const out, const size_t pixel_nb, const float *const clut, const uint16_t level, const float normalization, const dt_lut3d_interpolation_t interpolation)
Apply one interpolation model over a packed RGB CLUT.
__DT_CLONE_TARGETS__ void dt_lut3d_tetrahedral_interp(const float *const in, float *const out, const size_t pixel_nb, const float *const restrict clut, const uint16_t level, const float normalization)
__DT_CLONE_TARGETS__ void dt_lut3d_trilinear_interp(const float *const in, float *const out, const size_t pixel_nb, const float *const restrict clut, const uint16_t level, const float normalization)
static void _prepare_lut_input(const float *const input, float normalized[3], float residual[3], float rgbd[3], int rgbi[3], const uint16_t level, const float safe_normalization)
float dt_aligned_pixel_simd_t __attribute__((vector_size(16), aligned(16)))
Apply one channel's tone curve to each of the three colour channels, or pass the channel through unto...
#define __DT_CLONE_TARGETS__