23#ifndef DT_PIXEL_RGB_NORMS_H
24#define DT_PIXEL_RGB_NORMS_H
47 work_profile->unbounded_coeffs_in,
58 return (
in[0] +
in[1] +
in[2]) / 3.0f;
62 return in[0] +
in[1] +
in[2];
74 return (
in[0] *
R +
in[1] * G +
in[2] *
B) / (
R + G +
B);
76 else return (
in[0] +
in[1] +
in[2]) / 3.0f;
static float dt_camera_rgb_luminance(const float4 rgb)
The colour-profile struct and the maths over it: the derived matrix/LUT engine.
static float dt_rgb_norm(const float *in, const int norm, const dt_iop_order_iccprofile_info_t *const work_profile)
A profile reduced to the arithmetic the pixel loop can run: two matrices and six tone-curve LUTs,...
int nonlinearlut
Non-zero when the profile has tone curves at all; tested as a boolean everywhere, but it is really th...
int lutsize
Entry count of each of the six LUTs. Always 65536 in practice: both callers of dt_ioppr_init_profile_...
float * lut_in[3]
Per-channel encoded -> linear tone curve, lutsize entries each, sampled over [0,1]....
dt_colormatrix_t matrix_in
RGB -> XYZ (D50), row-major. matrix_in[1][*] is the luminance row. NaN in [0][0] marks the whole prof...