96#define INVERSE_SQRT_3 0.5773502691896258f
109#define FILMIC_RECONSTRUCT_DEPRECATED 16.0f
110#define SAFETY_MARGIN 0.01f
112#define DT_GUI_CURVE_EDITOR_INSET DT_PIXEL_APPLY_DPI(1)
429 return _(
"tone mapping|curve|view transform|contrast|saturation|highlights");
435 "for display on SDR screens and paper prints\n"
436 "while preventing clipping in non-destructive ways"),
437 _(
"corrective and creative"),
438 _(
"linear or non-linear, RGB, scene-referred"),
439 _(
"non-linear, RGB"),
440 _(
"non-linear, RGB, display-referred"));
503 geometry->grey_display =
powf(
CLAMP(
p->grey_point_target,
p->black_point_target,
p->white_point_target) / 100.0f,
504 1.0f /
p->output_power);
506 geometry->grey_display =
powf(0.1845f, 1.0f /
p->output_power);
508 const float dynamic_range =
p->white_point_source -
p->black_point_source;
509 geometry->grey_log =
fabsf(
p->black_point_source) / dynamic_range;
510 geometry->black_display =
powf(
CLAMP(
p->black_point_target, 0.0f,
p->grey_point_target) / 100.0f,
511 1.0f /
p->output_power);
512 geometry->white_display =
powf(
fmaxf(
p->white_point_target,
p->grey_point_target) / 100.0f,
513 1.0f /
p->output_power);
515 const float slope =
p->contrast * dynamic_range / 8.0f;
548 const float latitude =
CLAMP(
p->latitude, 0.0f, 100.0f) / 100.0f;
549 const float balance =
CLAMP(
p->balance, -50.0f, 50.0f) / 100.0f;
572 float *
const toe,
float *
const shoulder)
578 *toe =
CLAMP(
p->latitude, 0.0f, 100.0f);
579 *shoulder =
CLAMP(
p->latitude, 0.0f, 100.0f);
590 const float toe,
const float shoulder,
591 float *
const latitude,
float *
const balance)
596 *latitude =
p->latitude;
597 *balance =
p->balance;
632 float grey_log =
spline.x[2];
635 float black_display =
spline.y[0];
636 float grey_display =
spline.y[2];
637 float white_display =
spline.y[4];
639 float toe_display =
fminf(
spline.y[1], grey_display);
640 float shoulder_display =
fmaxf(
spline.y[3], grey_display);
642 float hardness =
n->output_power;
643 float contrast = (shoulder_display - toe_display) / (shoulder_log - toe_log);
645 float linear_intercept = grey_display - (contrast * grey_log);
650 toe_log = (toe_display - linear_intercept) / contrast;
656 shoulder_log = (shoulder_display - linear_intercept) / contrast;
659 contrast *= 8.0f / (
n->white_point_source -
n->black_point_source);
660 contrast *= hardness *
powf(grey_display, hardness-1.0f);
662 const float latitude =
CLAMP((shoulder_display - toe_display) / ((white_display - black_display) - 2.0f *
scaled_safety_margin), 0.0f, 0.99f);
677 n->black_point_target =
powf(black_display, hardness) * 100.0f;
678 n->white_point_target =
powf(white_display, hardness) * 100.0f;
680 n->latitude = latitude * 100.0f;
681 n->contrast = contrast;
682 n->balance = balance * 100.0f;
693 float grey_point_source;
694 float black_point_source;
695 float white_point_source;
696 float security_factor;
697 float grey_point_target;
698 float black_point_target;
699 float white_point_target;
714 n->grey_point_source = o->grey_point_source;
715 n->white_point_source = o->white_point_source;
716 n->black_point_source = o->black_point_source;
717 n->security_factor = o->security_factor;
718 n->grey_point_target = o->grey_point_target;
719 n->black_point_target = o->black_point_target;
720 n->white_point_target = o->white_point_target;
721 n->output_power = o->output_power;
722 n->latitude = o->latitude;
723 n->contrast = o->contrast;
724 n->saturation = o->saturation;
725 n->balance = o->balance;
726 n->preserve_color = o->preserve_color;
729 n->reconstruct_threshold
731 n->reconstruct_bloom_vs_details =
d->reconstruct_bloom_vs_details;
732 n->reconstruct_grey_vs_color =
d->reconstruct_grey_vs_color;
733 n->reconstruct_structure_vs_texture =
d->reconstruct_structure_vs_texture;
734 n->reconstruct_feather = 3.0f;
736 n->auto_hardness =
TRUE;
737 n->custom_grey =
TRUE;
738 n->high_quality_reconstruction = 0;
739 n->noise_distribution =
d->noise_distribution;
740 n->noise_level = 0.f;
742 n->compensate_icc_black =
FALSE;
750 float grey_point_source;
751 float black_point_source;
752 float white_point_source;
753 float reconstruct_threshold;
754 float reconstruct_feather;
755 float reconstruct_bloom_vs_details;
756 float reconstruct_grey_vs_color;
757 float reconstruct_structure_vs_texture;
758 float security_factor;
759 float grey_point_target;
760 float black_point_target;
761 float white_point_target;
771 int high_quality_reconstruction;
782 n->grey_point_source = o->grey_point_source;
783 n->white_point_source = o->white_point_source;
784 n->black_point_source = o->black_point_source;
785 n->security_factor = o->security_factor;
786 n->grey_point_target = o->grey_point_target;
787 n->black_point_target = o->black_point_target;
788 n->white_point_target = o->white_point_target;
789 n->output_power = o->output_power;
790 n->latitude = o->latitude;
791 n->contrast = o->contrast;
792 n->saturation = o->saturation;
793 n->balance = o->balance;
794 n->preserve_color = o->preserve_color;
795 n->shadows = o->shadows;
796 n->highlights = o->highlights;
797 n->reconstruct_threshold = o->reconstruct_threshold;
798 n->reconstruct_bloom_vs_details = o->reconstruct_bloom_vs_details;
799 n->reconstruct_grey_vs_color = o->reconstruct_grey_vs_color;
800 n->reconstruct_structure_vs_texture = o->reconstruct_structure_vs_texture;
801 n->reconstruct_feather = o->reconstruct_feather;
802 n->version = o->version;
803 n->auto_hardness = o->auto_hardness;
804 n->custom_grey = o->custom_grey;
805 n->high_quality_reconstruction = o->high_quality_reconstruction;
806 n->noise_level =
d->noise_level;
807 n->noise_distribution =
d->noise_distribution;
808 n->noise_level = 0.f;
810 n->compensate_icc_black =
FALSE;
818 float grey_point_source;
819 float black_point_source;
820 float white_point_source;
821 float reconstruct_threshold;
822 float reconstruct_feather;
823 float reconstruct_bloom_vs_details;
825 float reconstruct_grey_vs_color;
827 float reconstruct_structure_vs_texture;
829 float security_factor;
830 float grey_point_target;
831 float black_point_target;
832 float white_point_target;
843 gboolean auto_hardness;
844 gboolean custom_grey;
845 int high_quality_reconstruction;
847 int noise_distribution;
859 n->grey_point_source = o->grey_point_source;
860 n->white_point_source = o->white_point_source;
861 n->black_point_source = o->black_point_source;
862 n->security_factor = o->security_factor;
863 n->grey_point_target = o->grey_point_target;
864 n->black_point_target = o->black_point_target;
865 n->white_point_target = o->white_point_target;
866 n->output_power = o->output_power;
867 n->latitude = o->latitude;
868 n->contrast = o->contrast;
869 n->saturation = o->saturation;
870 n->balance = o->balance;
871 n->preserve_color = o->preserve_color;
872 n->shadows = o->shadows;
873 n->highlights = o->highlights;
874 n->reconstruct_threshold = o->reconstruct_threshold;
875 n->reconstruct_bloom_vs_details = o->reconstruct_bloom_vs_details;
876 n->reconstruct_grey_vs_color = o->reconstruct_grey_vs_color;
877 n->reconstruct_structure_vs_texture = o->reconstruct_structure_vs_texture;
878 n->reconstruct_feather = o->reconstruct_feather;
879 n->version = o->version;
880 n->auto_hardness = o->auto_hardness;
881 n->custom_grey = o->custom_grey;
882 n->high_quality_reconstruction = o->high_quality_reconstruction;
883 n->noise_level =
d->noise_level;
884 n->noise_distribution =
d->noise_distribution;
885 n->noise_level =
d->noise_level;
887 n->compensate_icc_black =
FALSE;
895 float grey_point_source;
896 float black_point_source;
897 float white_point_source;
898 float reconstruct_threshold;
899 float reconstruct_feather;
900 float reconstruct_bloom_vs_details;
901 float reconstruct_grey_vs_color;
902 float reconstruct_structure_vs_texture;
903 float security_factor;
904 float grey_point_target;
905 float black_point_target;
906 float white_point_target;
915 gboolean auto_hardness;
916 gboolean custom_grey;
917 int high_quality_reconstruction;
921 gboolean compensate_icc_black;
929 switch(o->internal_version)
957 for(
int c = 0; c < 3; c++)
999 work_profile->unbounded_coeffs_in, work_profile->
lutsize,
1007 return pixel[0] * 0.2225045f +
pixel[1] * 0.7168786f +
pixel[2] * 0.0606169f;
1026 work_profile->unbounded_coeffs_in, work_profile->
lutsize,
1034 return pixel[0] * 0.2225045f +
pixel[1] * 0.7168786f +
pixel[2] * 0.0606169f;
1048 const float dynamic_range)
1055 const float dynamic_range)
1058 return grey *
exp2f(dynamic_range *
x + black);
1077 if(
x < latitude_min)
1094 const float ty = latitude_min * M2[2] + M1[2];
1095 const float u = M2[2] * (
x - latitude_min) / M1[0];
1096 result = M1[0] * (u /
powf(1.f +
powf(u, M2[0]), 1.f / M2[0])) + ty;
1102 result = M1[0] +
x * (M2[0] +
x * (M3[0] +
x * (M4[0] +
x * M5[0])));
1107 result = M1[0] +
x * (M2[0] +
x * (M3[0] +
x * M4[0]));
1112 const float xi = latitude_min -
x;
1113 const float rat =
xi * (
xi * M2[0] + 1.f);
1114 result = M4[0] - M1[0] *
rat / (
rat + M3[0]);
1117 else if(
x > latitude_max)
1125 result = M4[2] -
fmaxf(0.f, M3[1] *
powf(
fmaxf(1.f -
x, 0.f), M4[1]));
1130 const float ty = latitude_max * M2[2] + M1[2];
1131 const float u = M2[2] * (
x - latitude_max) / M1[1];
1132 result = M1[1] * (u /
powf(1.f +
powf(u, M2[1]), 1.f / M2[1])) + ty;
1138 result = M1[1] +
x * (M2[1] +
x * (M3[1] +
x * (M4[1] +
x * M5[1])));
1143 result = M1[1] +
x * (M2[1] +
x * (M3[1] +
x * M4[1]));
1148 const float xi =
x - latitude_max;
1149 const float rat =
xi * (
xi * M2[1] + 1.f);
1150 result = M4[1] + M1[1] *
rat / (
rat + M3[1]);
1156 result = M1[2] +
x * M2[2];
1165 const float saturation)
1180 const float saturation)
1184 const float sat2 = 0.5f /
sqrtf(saturation);
1199#define MAX_NUM_SCALES 10
1202 const float normalize,
const float feathering,
const size_t width,
1203 const size_t height,
const size_t ch)
1250 const size_t idx =
i *
width +
j;
1251 const size_t index = idx * 4;
1252 const float weight = mask[idx];
1275 const size_t height,
const size_t ch,
const float gamma,
1277 const float delta,
const size_t s,
const size_t scales)
1282 const float alpha = mask[
k /
ch];
1307 for(
size_t c = 0; c < 4; c++)
1328 const size_t height,
const size_t ch,
const float gamma,
1330 const float delta,
const size_t s,
const size_t scales)
1348 const float alpha = mask[
k /
ch];
1369 for(
size_t c = 0; c < 4; c++)
1376 const float residual = (s == scales - 1) ?
LF_c[c] : 0.f;
1406 for(
size_t c = 0; c < 4; ++c)
HF[4*
k + c] =
texture[4*
k + c] = detail[4*
k + c] -
LF[4*
k + c];
1476 for(
int s = 0; s < scales; ++s)
1502 const int mult = 1 << s;
1548 for(
int c = 0; c < 3; c++)
1553 const float lum = (work_profile)
1555 work_profile->unbounded_coeffs_in,
1563 for(
int c = 0; c < 3; c++)
1589 for(
int c = 0; c < 3; c++)
1594 const float lum = (work_profile)
1596 work_profile->unbounded_coeffs_in,
1604 for(
int c = 0; c < 3; c++)
1742 const dt_aligned_pixel_simd_t
matrix1,
const dt_aligned_pixel_simd_t
matrix2)
1754 const float r =
Yrg[1] - 0.21902143f;
1755 const float g =
Yrg[2] - 0.54371398f;
1757 const float cos_h =
c != 0.f ?
r /
c : 1.f;
1758 const float sin_h =
c != 0.f ?
g /
c : 0.f;
1765 const dt_aligned_pixel_simd_t
matrix1,
const dt_aligned_pixel_simd_t
matrix2)
1770 const dt_aligned_pixel_simd_t
Yrg = {
1772 in[1] * in[2] + 0.21902143f,
1773 in[1] * in[3] + 0.54371398f,
1781 const float saturation)
1823#define CIE_Y_1931_to_CIE_Y_2006(x) (1.05785528f * (x))
1831 + coeffs[1] * (0.0206185567010309f *
cos_h + 0.608247422680412f *
sin_h)
1849 const float numerator = -0.427506877216495f
1850 * (Y * (coeffs[0] + 0.856492345150334f * coeffs[1] + 0.554995960637719f * coeffs[2])
1865 const float eps = 1e-3f;
1877 return max_chroma >= 0.f ? max_chroma :
FLT_MAX;
1892 + coeffs[1] * (0.0206185567010309f *
cos_h + 0.608247422680412f *
sin_h)
1898 const float numerator = -0.427506877216495f * (coeffs[0] + 0.856492345150334f * coeffs[1] + 0.554995960637719f * coeffs[2]);
1900 return max_chroma >= 0.f ? max_chroma :
FLT_MAX;
1906 const float cos_h,
const float sin_h,
const float chroma)
1933 const dt_aligned_pixel_simd_t
Yrg = {
1935 Ych[1] *
Ych[2] + 0.21902143f,
1936 Ych[1] *
Ych[3] + 0.54371398f,
1943 if(Yrg[1] + Yrg[2] > 1.f)
max_c =
fminf((1.f - 0.21902143f - 0.54371398f) / (
Ych[2] +
Ych[3]),
max_c);
1945 return (dt_aligned_pixel_simd_t){
Ych[0],
max_c,
Ych[2],
Ych[3] };
1976 dt_aligned_pixel_simd_t
RGB_out
2020 dt_aligned_pixel_simd_t
pix_out
2026 const dt_aligned_pixel_simd_t
LMS
2140 for(
size_t c = 0;
c < 3;
c++)
2179 const dt_aligned_pixel_simd_t
pix_out
2274 const dt_aligned_pixel_simd_t
max_rgb
2334 for(
size_t r = 0;
r < 4;
r++)
2335 for(
size_t c = 0; c < 4; c++)
M[
r][c] = (
r == c &&
r < 3) ? 1.f : 0.f;
2345 const float inset[3],
const float rotation[3],
2351 for(
size_t r = 0;
r < 3;
r++)
2356 for(
size_t i = 0;
i < 3;
i++)
2366 const float scale = 1.f -
CLAMPF(inset[
i], 0.f, 0.9f);
2383 for(
size_t r = 0;
r < 3;
r++)
2384 for(
size_t c = 0; c < 3; c++)
P_prime[
r][c] *= s[c];
2629 const float norm =
norms[
k];
2674 tiling->maxbuf_cl = 1.0f;
2691 tiling->factor_cl = 2.0f;
2701 tiling->factor_cl = 9.0f;
2717 const size_t ch = 4;
2736 = hl_deprecated ?
NULL
2745 = hl_deprecated ?
FALSE
2822 data,
piece, roi_in, roi_out))
2855 roi_out->
height,
ch, black_display, white_display);
2860 roi_out->
height,
ch, black_display, white_display);
2952 for(
int s = 0; s < scales; ++s)
2974 const int mult = 1 << s;
2980 .yoffset = 0, .yfactor = 1,
2981 .cellsize = 4 *
sizeof(float), .overhead = 0,
2982 .sizex = 1 << 16, .sizey = 1 };
3017 .yoffset = 2 *
mult, .yfactor = 1,
3018 .cellsize = 4 *
sizeof(float), .overhead = 0,
3019 .sizex = 1, .sizey = 1 << 16 };
3063 size_t origin[] = { 0, 0, 0 };
3211 const gboolean hl_deprecated =
d->hl_deprecated;
3266 const float noise_level =
d->noise_level / scale;
3286 if(
d->high_quality_reconstruction > 0)
3293 for(
int i = 0;
i <
d->high_quality_reconstruction;
i++)
3334 const float white_display =
powf(
spline.y[4],
d->output_power);
3335 const float black_display =
powf(
spline.y[0],
d->output_power);
3463 const float prev_grey =
p->grey_point_source;
3464 p->grey_point_source =
CLAMP(100.f * grey, 0.001f, 100.0f);
3466 p->black_point_source =
p->black_point_source -
grey_var;
3467 p->white_point_source =
p->white_point_source +
grey_var;
3468 p->output_power =
logf(
p->grey_point_target / 100.0f)
3469 /
logf(-
p->black_point_source / (
p->white_point_source -
p->black_point_source));
3492 float EVmin =
CLAMP(
log2f(black / (
p->grey_point_source / 100.0f)), -16.0f, -1.0f);
3493 EVmin *= (1.0f +
p->security_factor / 100.0f);
3496 p->output_power =
logf(
p->grey_point_target / 100.0f)
3497 /
logf(-
p->black_point_source / (
p->white_point_source -
p->black_point_source));
3519 float EVmax =
CLAMP(
log2f(white / (
p->grey_point_source / 100.0f)), 1.0f, 16.0f);
3520 EVmax *= (1.0f +
p->security_factor / 100.0f);
3522 p->white_point_source =
EVmax;
3523 p->output_power =
logf(
p->grey_point_target / 100.0f)
3524 /
logf(-
p->black_point_source / (
p->white_point_source -
p->black_point_source));
3545 p->grey_point_source =
CLAMP(100.f * grey, 0.001f, 100.0f);
3550 float EVmax =
CLAMP(
log2f(white / (
p->grey_point_source / 100.0f)), 1.0f, 16.0f);
3551 EVmax *= (1.0f +
p->security_factor / 100.0f);
3555 float EVmin =
CLAMP(
log2f(black / (
p->grey_point_source / 100.0f)), -16.0f, -1.0f);
3556 EVmin *= (1.0f +
p->security_factor / 100.0f);
3559 p->white_point_source =
EVmax;
3560 p->output_power =
logf(
p->grey_point_target / 100.0f)
3561 /
logf(-
p->black_point_source / (
p->white_point_source -
p->black_point_source));
3584 const float *
const restrict in = (
const float *)
i;
3590 for(
size_t k = 0;
k < (size_t)roi_out->
width * roi_out->
height * 4;
k += 4)
3594 work_profile->unbounded_coeffs_in, work_profile->
lutsize,
3607 const float grey =
p->grey_point_source / 100.0f;
3612 EVmax *= (1.0f +
p->security_factor / 100.0f);
3615 EVmin *= (1.0f +
p->security_factor / 100.0f);
3618 p->white_point_source =
EVmax;
3619 p->output_power =
logf(
p->grey_point_target / 100.0f)
3620 /
logf(-
p->black_point_source / (
p->white_point_source -
p->black_point_source));
3627 (
void *)picker, (
void *)
pipe,
3634 if(picker ==
g->grey_point_source)
3636 else if(picker ==
g->black_point_source)
3638 else if(picker ==
g->white_point_source)
3640 else if(picker ==
g->auto_button)
3655 g->show_mask = !(
g->show_mask);
3675 const float transition_x,
const float transition_y,
3689 float grey_display = 0.4638f;
3695 grey_display =
powf(
CLAMP(
p->grey_point_target,
p->black_point_target,
p->white_point_target) / 100.0f,
3696 1.0f / (
p->output_power));
3701 grey_display =
powf(0.1845f, 1.0f / (
p->output_power));
3704 const float white_source =
p->white_point_source;
3705 const float black_source =
p->black_point_source;
3706 const float dynamic_range = white_source - black_source;
3710 const float grey_log =
fabsf(
p->black_point_source) / dynamic_range;
3714 float black_display, white_display;
3722 black_display =
CLAMP(
p->black_point_target, 0.0f,
p->grey_point_target) / 100.0f;
3723 white_display =
fmaxf(
p->white_point_target,
p->grey_point_target) / 100.0f;
3728 black_display =
powf(
CLAMP(
p->black_point_target, 0.0f,
p->grey_point_target) / 100.0f,
3729 1.0f / (
p->output_power));
3731 =
powf(
fmaxf(
p->white_point_target,
p->grey_point_target) / 100.0f, 1.0f / (
p->output_power));
3734 float toe_log, shoulder_log, toe_display, shoulder_display, contrast;
3735 float balance =
CLAMP(
p->balance, -50.0f, 50.0f) / 100.0f;
3738 float latitude =
CLAMP(
p->latitude, 0.0f, 100.0f) / 100.0f * dynamic_range;
3739 contrast =
CLAMP(
p->contrast, 1.00001f, 6.0f);
3743 toe_log = grey_log - latitude / dynamic_range *
fabsf(black_source / dynamic_range);
3744 shoulder_log = grey_log + latitude / dynamic_range *
fabsf(white_source / dynamic_range);
3747 float linear_intercept = grey_display - (contrast * grey_log);
3750 toe_display = (toe_log * contrast + linear_intercept);
3751 shoulder_display = (shoulder_log * contrast + linear_intercept);
3754 const float norm =
sqrtf(contrast * contrast + 1.0f);
3757 const float coeff = -((2.0f * latitude) / dynamic_range) * balance;
3759 toe_display +=
coeff * contrast / norm;
3760 shoulder_display +=
coeff * contrast / norm;
3761 toe_log +=
coeff / norm;
3762 shoulder_log +=
coeff / norm;
3791 spline->x[3] = shoulder_log;
3794 spline->y[0] = black_display;
3795 spline->y[1] = toe_display;
3796 spline->y[2] = grey_display;
3797 spline->y[3] = shoulder_display;
3798 spline->y[4] = white_display;
3804 spline->type[1] =
p->highlights;
3829 spline->M2[2] = contrast;
3867 const float tx =
spline->x[1];
3868 const float ty =
spline->y[1];
3869 const float y0 =
spline->y[0];
3870 const float dx =
fmaxf(1e-6f, tx);
3871 const float dy =
fmaxf(1e-6f, ty - y0);
3884 4. *
Tl3, 3. *
Tl2, 2. *
Tl, 1., 0.,
3885 12. *
Tl2, 6. *
Tl, 2., 0., 0. };
3902 3. *
Tl2, 2. *
Tl, 1., 0.,
3903 6. *
Tl, 2., 0., 0. };
3918 const float P0[2] = { toe_log, toe_display };
3919 const float x =
P0[0] -
P1[0];
3920 const float y =
P0[1] -
P1[1];
3921 const float g = contrast;
3922 const float b =
g / (2.f * y) + (
sqrtf(
sqf(
x *
g / y + 1.f) - 4.f) - 1.f) / (2.f *
x);
3923 const float c = y /
g * (b *
sqf(
x) +
x) / (b *
sqf(
x) +
x - (y /
g));
3924 const float a = c *
g;
3928 spline->M4[0] = toe_display;
3944 const float dx =
fmaxf(1e-6f, 1.f -
sx);
3955 3. *
Sl2, 2. *
Sl, 1., 0.,
3956 6. *
Sl, 2., 0., 0. };
3974 4. *
Sl3, 3. *
Sl2, 2. *
Sl, 1., 0.,
3975 12. *
Sl2, 6. *
Sl, 2., 0., 0. };
3990 const float P0[2] = { shoulder_log, shoulder_display };
3991 const float x =
P1[0] -
P0[0];
3992 const float y =
P1[1] -
P0[1];
3993 const float g = contrast;
3994 const float b =
g / (2.f * y) + (
sqrtf(
sqf(
x *
g / y + 1.f) - 4.f) - 1.f) / (2.f *
x);
3995 const float c = y /
g * (b *
sqf(
x) +
x) / (b *
sqf(
x) +
x - (y /
g));
3996 const float a = c *
g;
4000 spline->M4[1] = shoulder_display;
4012 float grey_source = 0.1845f, grey_display = 0.4638f;
4016 grey_source =
p->grey_point_source / 100.0f;
4017 grey_display =
powf(
p->grey_point_target / 100.0f, 1.0f / (
p->output_power));
4022 grey_source = 0.1845f;
4023 grey_display =
powf(0.1845f, 1.0f / (
p->output_power));
4027 const float white_source =
p->white_point_source;
4028 const float black_source =
p->black_point_source;
4029 const float dynamic_range = white_source - black_source;
4032 const float grey_log =
fabsf(
p->black_point_source) / dynamic_range;
4035 float contrast =
p->contrast;
4040 contrast = 1.0001f * grey_display / grey_log;
4044 d->dynamic_range = dynamic_range;
4045 d->black_source = black_source;
4046 d->grey_source = grey_source;
4047 d->output_power =
p->output_power;
4048 d->contrast = contrast;
4049 d->version =
p->version;
4050 d->spline_version =
p->spline_version;
4051 d->preserve_color =
p->preserve_color;
4052 d->high_quality_reconstruction =
p->high_quality_reconstruction;
4053 d->noise_level =
p->noise_level;
4064 memset(
d->softproof_filename, 0,
sizeof(
d->softproof_filename));
4067 d->softproof_type =
settings.softproof_type;
4068 g_strlcpy(
d->softproof_filename,
settings.softproof_filename,
sizeof(
d->softproof_filename));
4069 d->softproof_intent =
settings.softproof_intent;
4081 d->saturation =
p->saturation / 100.0f;
4083 d->saturation = (2.0f *
p->saturation / 100.0f + 1.0f);
4099 d->agx_beta_hue = 0.5f * (
agx_axis + 1.f);
4101 d->sigma_toe =
powf(
d->spline.latitude_min / 3.0f, 2.0f);
4102 d->sigma_shoulder =
powf((1.0f -
d->spline.latitude_max) / 3.0f, 2.0f);
4105 d->reconstruct_threshold =
powf(2.0f, white_source +
p->reconstruct_threshold) * grey_source;
4106 d->reconstruct_feather =
exp2f(12.f /
p->reconstruct_feather);
4109 d->normalize =
d->reconstruct_feather /
d->reconstruct_threshold;
4110 d->reconstruct_structure_vs_texture = (
p->reconstruct_structure_vs_texture / 100.0f + 1.f) / 2.f;
4111 d->reconstruct_bloom_vs_details = (
p->reconstruct_bloom_vs_details / 100.0f + 1.f) / 2.f;
4112 d->reconstruct_grey_vs_color = (
p->reconstruct_grey_vs_color / 100.0f + 1.f) / 2.f;
4156 float shoulder = 0.0f;
4173 &
p->latitude, &
p->balance);
4208 g->gui_show_labels =
dt_conf_get_int(
"plugins/darkroom/filmicrgb/graph_show_labels");
4210 g->gui_sizes_inited =
FALSE;
4227 d->white_point_source =
module->so->get_f("white_point_source")->Float.Default;
4228 d->output_power =
module->so->get_f("output_power")->Float.Default;
4243 d->white_point_source = exposure + 2.45f;
4244 d->black_point_source =
d->white_point_source - 12.f;
4245 d->output_power =
logf(
d->grey_point_target / 100.0f)
4246 /
logf(-
d->black_point_source / (
d->white_point_source -
d->black_point_source));
4248 module->workflow_enabled = TRUE;
4250 dt_iop_fmt_log(
module,
"reload_defaults: class=%s needs_rawprepare=%d -> workflow_enabled=%d white=%.3f black=%.3f",
4253 d->white_point_source,
d->black_point_source);
4259 const int program = 22;
4340 if(!
g->gui_sizes_inited)
return;
4370 const float scale = 0.85;
4372 button->
icon(cr, -scale * button->
w / 2., -scale * button->
h / 2., scale * button->
w, scale * button->
h, 0,
NULL);
4409 g->line_height =
g->ink.height;
4415 g->sign_width =
g->ink.width / 2.0;
4421 g->zero_width =
g->ink.width;
4427 float margin_bottom;
4428 if(
g->gui_show_labels)
4431 margin_left = 3. *
g->zero_width + 2. *
g->inset;
4432 margin_bottom = 2. *
g->line_height + 4. *
g->inset;
4436 margin_left =
g->inset;
4437 margin_bottom =
g->inset;
4440 const float margin_top = 2. *
g->line_height +
g->inset;
4443 g->graph_width =
g->allocation.width - margin_right - margin_left;
4444 g->graph_height =
g->allocation.height - margin_bottom - margin_top;
4452 g->buttons[
i].right =
g->allocation.width;
4456 g->buttons[
i].w =
g->buttons[
i].right -
g->buttons[
i].left;
4457 g->buttons[
i].h =
g->buttons[
i].bottom -
g->buttons[
i].top;
4461 g->gui_sizes_inited =
TRUE;
4471 const float grey =
p->grey_point_source / 100.f;
4472 const float DR =
p->white_point_source -
p->black_point_source;
4483 g_strlcpy(text,
_(
"look only"),
sizeof(text));
4485 g_strlcpy(text,
_(
"look + mapping (lin)"),
sizeof(text));
4487 g_strlcpy(text,
_(
"look + mapping (log)"),
sizeof(text));
4489 g_strlcpy(text,
_(
"dynamic range mapping"),
sizeof(text));
4496 cairo_rectangle(cr,
g->allocation.width - margin_left -
g->ink.width -
g->ink.x - 2. *
g->inset,
4497 -
g->line_height -
g->inset - 0.5 *
g->ink.height -
g->ink.y -
g->inset,
4498 g->ink.width + 3. *
g->inset,
g->ink.height + 2. *
g->inset);
4503 cairo_move_to(cr,
g->allocation.width - margin_left -
g->ink.width -
g->ink.x -
g->inset,
4504 -
g->line_height -
g->inset - 0.5 *
g->ink.height -
g->ink.y);
4547 const float saturation = (2.0f *
p->saturation / 100.0f + 1.0f);
4548 const float sigma_toe =
powf(
g->spline.latitude_min / 3.0f, 2.0f);
4549 const float sigma_shoulder =
powf((1.0f -
g->spline.latitude_max) / 3.0f, 2.0f);
4563 for(
int k = 1;
k < 256;
k++)
4565 float x =
k / 255.0;
4580 for(
int k = 1;
k < 256;
k++)
4582 float x =
k / 255.0;
4603 g->spline.M5,
g->spline.latitude_min,
g->spline.latitude_max,
g->spline.type));
4612 for(
int k = 1;
k < 256;
k++)
4616 float x =
powf(
k / 255.0f, 2.4f);
4625 g->spline.latitude_min,
g->spline.latitude_max,
g->spline.type);
4633 const float margin = 1
E-5;
4634 if(y >
g->spline.y[4] + margin)
4650 y =
powf(y,
p->output_power);
4668 float x_grey =
g->spline.x[2];
4669 float y_grey =
g->spline.y[2];
4695 const float central_slope = (
g->spline.y[3] -
g->spline.y[1]) *
g->graph_width / ((
g->spline.x[3] -
g->spline.x[1]) *
g->graph_height);
4698 for(
int k = 0;
k < 5;
k++)
4702 float x =
g->spline.x[
k];
4703 float y =
g->spline.y[
k];
4704 const float ymin =
g->spline.y[0];
4705 const float ymax =
g->spline.y[4];
4714 if(contrast_clamped)
4731 y =
powf(y,
p->output_power);
4764 if(
g->gui_show_labels)
4767 const float x_legend_top =
g->graph_height + 0.5 *
g->line_height;
4771 snprintf(text,
sizeof(text),
"%.0f",
p->grey_point_target);
4775 (1.0 -
y_grey) *
g->graph_height - 0.5 *
g->ink.height -
g->ink.y);
4782 snprintf(text,
sizeof(text),
"%+.1f", 0.f);
4784 snprintf(text,
sizeof(text),
"%.0f",
p->grey_point_source);
4794 snprintf(text,
sizeof(text),
"%.0f",
p->black_point_target);
4798 (1.0 -
y_black) *
g->graph_height - 0.5 *
g->ink.height -
g->ink.y);
4804 snprintf(text,
sizeof(text),
"%.0f",
p->white_point_target);
4808 (1.0 -
y_white) *
g->graph_height - 0.5 *
g->ink.height -
g->ink.y);
4815 snprintf(text,
sizeof(text),
"%+.1f",
p->black_point_source);
4817 snprintf(text,
sizeof(text),
"%.0f",
exp2f(
p->black_point_source) *
p->grey_point_source);
4828 snprintf(text,
sizeof(text),
"%+.1f",
p->white_point_source);
4832 snprintf(text,
sizeof(text),
"%.0f \342\206\222", 100.f);
4834 snprintf(text,
sizeof(text),
"%.0f",
exp2f(
p->white_point_source) *
p->grey_point_source);
4841 + 2. * (
x_white > 1.f) *
g->sign_width,
4856 snprintf(text,
sizeof(text),
_(
"(%.0f %%)"),
exp2f(
p->white_point_source) *
p->grey_point_source);
4859 cairo_move_to(cr,
g->allocation.width -
g->ink.width -
g->ink.x - margin_left,
4860 g->graph_height + 3. *
g->inset +
g->line_height -
g->ink.y);
4872 g_strlcpy(text,
_(
"% display"),
sizeof(text));
4876 -
g->line_height -
g->inset - 0.5 *
g->ink.height -
g->ink.y);
4884 g_strlcpy(text,
_(
"EV scene"),
sizeof(text));
4888 g_strlcpy(text,
_(
"% camera"),
sizeof(text));
4893 g->graph_height + 3. *
g->inset +
g->line_height -
g->ink.y);
4909 const float y_display =
g->allocation.height / 3.f +
g->line_height;
4910 const float y_scene = 2. *
g->allocation.height / 3.f +
g->line_height;
4920 if(
g->gui_show_labels)
4976 = -
fmaxf(
log2f(
p->black_point_target /
p->grey_point_target),
5007 g->spline.M5,
g->spline.latitude_min,
g->spline.latitude_max,
g->spline.type);
5024 g->spline.M5,
g->spline.latitude_min,
g->spline.latitude_max,
g->spline.type);
5068 for(
int i =
floorf(
p->black_point_source);
i <
ceilf(
p->white_point_source);
i++)
5088 if((
float)
i >
p->black_point_source && (
float)
i < p->white_point_source)
5093 g->spline.M5,
g->spline.latitude_min,
g->spline.latitude_max,
g->spline.type);
5158 snprintf(text,
sizeof(text),
"%+.1f",
p->black_point_source);
5167 snprintf(text,
sizeof(text),
"%+.1f", 0.f);
5176 snprintf(text,
sizeof(text),
"%+.1f",
p->white_point_source);
5185 snprintf(text,
sizeof(text),
"%.0f",
p->black_point_target);
5194 snprintf(text,
sizeof(text),
"%.0f",
p->grey_point_target);
5203 snprintf(text,
sizeof(text),
"%.0f",
p->white_point_target);
5252 else if(event->button == 1)
5269 g->gui_show_labels = !
g->gui_show_labels;
5271 dt_conf_set_int(
"plugins/darkroom/filmicrgb/graph_show_labels",
g->gui_show_labels);
5281 else if(event->button == 3)
5297 g->gui_show_labels = !
g->gui_show_labels;
5299 dt_conf_set_int(
"plugins/darkroom/filmicrgb/graph_show_labels",
g->gui_show_labels);
5319 g->gui_hover =
TRUE;
5343 if(!
g->gui_sizes_inited)
return FALSE;
5346 const float y =
event->y;
5347 const float x =
event->x;
5349 if(
x > 0. &&
x < g->allocation.width && y > 0. &&
y < g->allocation.height)
g->gui_hover =
TRUE;
5360 if(
x >
g->buttons[
i].left &&
x < g->buttons[
i].right && y >
g->buttons[
i].top &&
y < g->buttons[
i].bottom)
5363 g->buttons[
i].mouse_hover =
TRUE;
5364 g->active_button =
i;
5370 g->buttons[
i].mouse_hover =
FALSE;
5381 "the bright curve is the filmic tone mapping curve\n"
5382 "the dark curve is the desaturation curve."));
5391 "left click: cycle forward.\n"
5392 "right click: cycle backward.\n"
5393 "double-click: reset to look view."));
5423 g->gui_show_labels =
TRUE;
5425 g->gui_sizes_inited =
FALSE;
5452 g->grey_point_source
5457 _(
"adjust to match the average luminance of the image's subject.\n"
5458 "the value entered here will then be remapped to 18.45%.\n"
5459 "decrease the value to increase the overall brightness."));
5462 g->white_point_source
5467 _(
"number of stops between middle gray and pure white.\n"
5468 "this is a reading a lightmeter would give you on the scene.\n"
5469 "adjust so highlights clipping is avoided"));
5472 g->black_point_source
5477 g->black_point_source,
_(
"number of stops between middle gray and pure black.\n"
5478 "this is a reading a lightmeter would give you on the scene.\n"
5479 "increase to get more contrast.\ndecrease to recover more details in low-lights."));
5486 "useful to give a safety margin to extreme luminances."));
5495 "this will fit the luminance range inside the histogram bounds.\n"
5496 "works better for landscapes and evenly-lit pictures\n"
5497 "but fails for high-keys, low-keys and high-ISO pictures.\n"
5498 "this is not an artificial intelligence, but a simple guess.\n"
5499 "ensure you understand its assumptions before using it."));
5507 "this is not recommended in general.\n"
5508 "fix the global exposure in the exposure module instead.\n"
5509 "disable to use standard 18.45 %% middle gray."));
5522 _(
"set the exposure threshold upon which\n"
5523 "clipped highlights get reconstructed.\n"
5524 "values are relative to the scene white point.\n"
5525 "0 EV means the threshold is the same as the scene white point.\n"
5526 "decrease to include more areas,\n"
5527 "increase to exclude more areas."));
5532 _(
"soften the transition between clipped highlights and valid pixels.\n"
5533 "decrease to make the transition harder and sharper,\n"
5534 "increase to make the transition softer and blurrier."));
5553 _(
"decide which reconstruction strategy to favor,\n"
5554 "between inpainting a smooth color gradient,\n"
5555 "or trying to recover the textured details.\n"
5556 "0% is an equal mix of both.\n"
5557 "increase if at least one RGB channel is not clipped.\n"
5558 "decrease if all RGB channels are clipped over large areas."));
5564 _(
"decide which reconstruction strategy to favor,\n"
5565 "between blooming highlights like film does,\n"
5566 "or trying to recover sharp details.\n"
5567 "0% is an equal mix of both.\n"
5568 "increase if you want more details.\n"
5569 "decrease if you want more blur."));
5576 _(
"decide which reconstruction strategy to favor,\n"
5577 "between recovering monochromatic highlights,\n"
5578 "or trying to recover colorful highlights.\n"
5579 "0% is an equal mix of both.\n"
5580 "increase if you want more color.\n"
5581 "decrease if you see magenta or out-of-gamut highlights."));
5589 _(
"run extra passes of chromaticity reconstruction.\n"
5590 "more iterations means more color propagation from neighbourhood.\n"
5591 "this will be slower but will yield more neutral highlights.\n"
5592 "it also helps with difficult cases of magenta highlights."));
5597 "this avoids highlights to look too smooth\n"
5598 "when the picture is noisy overall,\n"
5599 "so they blend with the rest of the picture."));
5604 "this is useful to match natural sensor noise pattern.\n"));
5616 "affects mostly the mid-tones"));
5621 "increase to make highlights brighter and less compressed.\n"
5622 "decrease to mute highlights."));
5634 _(
"distance between middle gray and the start of the highlights roll-off.\n"
5635 "0% keeps the shoulder at middle gray, 100% pushes it to the point where the\n"
5636 "current slope would hit the output white level."));
5645 _(
"distance between middle gray and the start of the shadows roll-off.\n"
5646 "0% keeps the toe at middle gray, 100% pushes it to the point where the\n"
5647 "current slope would hit the output black level."));
5653 "perceptual (default) is a generalized sigmoid derived from a\n"
5654 "perceptual appearance model: always smooth and monotonic.\n"
5655 "hard/soft/safe are the legacy polynomial/rational segments;\n"
5656 "hard compresses highlights more, soft less."));
5660 "perceptual (default) is a generalized sigmoid derived from a\n"
5661 "perceptual appearance model: always smooth and monotonic.\n"
5662 "hard/soft/safe are the legacy polynomial/rational segments;\n"
5663 "hard compresses shadows more, soft less."));
5672 "specifically at extreme luminances.\n"
5673 "increase if shadows and/or highlights are under-saturated."));
5677 "may reinforce chromatic aberrations and chroma noise,\n"
5678 "so ensure they are properly corrected elsewhere.\n"));
5686 _(
"v3 is darktable 3.0 desaturation method, same as color balance.\n"
5687 "v4 is a newer desaturation method, based on spectral purity of light.\n"
5688 "v8 tone maps each RGB channel separately in an inset rendering space:\n"
5689 "highlights bleach toward white and hues drift as tonal compression\n"
5690 "increases, with a parametric hue recovery on the saturation slider."));
5696 _(
"how the latitude, balance and contrast place the toe and\n"
5697 "shoulder nodes of the curve (not the shape between them —\n"
5698 "that is 'contrast in shadows/highlights').\n"
5699 "v3 (2021) is recommended; v1/v2 are kept for older edits."));
5704 g->auto_hardness,
_(
"enable to auto-set the look hardness depending on the scene white and black points.\n"
5705 "this keeps the middle gray on the identity line and improves fast tuning.\n"
5706 "disable if you want a manual control."));
5716 "this should be 0%\nexcept if you want a faded look"));
5722 _(
"middle gray value of the target display or color space.\n"
5723 "you should never touch that unless you know what you are doing."));
5730 "this should be 100%\nexcept if you want a faded look"));
5737 "plugins/darkroom/filmicrgb/graphheight", 230, 100),
5747 if(
IS_NULL_PTR(w) || w ==
g->auto_hardness || w ==
g->security_factor || w ==
g->grey_point_source
5748 || w ==
g->black_point_source || w ==
g->white_point_source)
5752 if(w ==
g->security_factor || w ==
g->grey_point_source)
5754 float prev = *(
float *)previous;
5755 if(w ==
g->security_factor)
5757 float ratio = (
p->security_factor - prev) / (prev + 100.0f);
5759 float EVmin =
p->black_point_source;
5762 float EVmax =
p->white_point_source;
5765 p->white_point_source =
EVmax;
5766 p->black_point_source =
EVmin;
5771 p->black_point_source =
p->black_point_source -
grey_var;
5772 p->white_point_source =
p->white_point_source +
grey_var;
5779 if(
p->auto_hardness)
5780 p->output_power =
logf(
p->grey_point_target / 100.0f)
5781 /
logf(-
p->black_point_source / (
p->white_point_source -
p->black_point_source));
5795 "saturation is not affected: valid diffuse colors\n"
5796 "(skin tones, product colors) keep their saturation and\n"
5797 "strongly compressed colors bleach, at any setting.\n"
5798 "-100%% is pure AgX: full hue drift (the 'film' look).\n"
5799 "0%% (default) removes half the hue drift.\n"
5800 "+100%% restores the original hues exactly."));
5807 "specifically at extreme luminances.\n"
5808 "increase if shadows and/or highlights are under-saturated."));
5814 "specifically at medium luminances.\n"
5815 "increase if midtones are under-saturated."));
5821 "Negative values bleache highlights at constant hue and luminance.\n"
5822 "Zero is an equal mix of both strategies."));
5831 if(
IS_NULL_PTR(w) || w ==
g->reconstruct_bloom_vs_details)
5833 if(
p->reconstruct_bloom_vs_details == -100.f)
void dt_gui_set_pango_resolution(PangoLayout *layout)
static void error(char *msg)
void dt_bauhaus_slider_set_soft_range(GtkWidget *widget, float soft_min, float soft_max)
void dt_bauhaus_slider_set_digits(GtkWidget *widget, int val)
float dt_bauhaus_slider_get(GtkWidget *widget)
void dt_bauhaus_slider_set_soft_max(GtkWidget *widget, float val)
void dt_bauhaus_slider_set(GtkWidget *widget, float pos)
void dt_bauhaus_widget_set_label(GtkWidget *widget, const char *label)
GtkWidget * dt_bauhaus_slider_new_with_range(dt_bauhaus_t *bh, dt_gui_module_t *self, float min, float max, float step, float defval, int digits)
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
static __DT_CLONE_TARGETS__ void normalize(float *const buffer, const size_t width, const size_t height, const float norm)
static void blur_2D_Bspline(const float *const restrict in, float *const restrict out, const size_t width, const size_t height)
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
static const dt_colormatrix_t XYZ_D65_to_D50_CAT16
return vector dt_simd_set1(valid ?(scaling+NORM_MIN) :NORM_MIN)
static float dt_camera_rgb_luminance(const float4 rgb)
void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep)
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
dt_iop_order_iccprofile_info_t * dt_colorspaces_add_profile(const dt_colorspaces_color_profile_type_t profile_type, const char *profile_filename, const int intent)
Find-or-build the derived matrix/LUT data for a profile identity, memoised.
void dt_ioppr_free_iccprofile_params_cl(dt_colorspaces_iccprofile_info_cl_t **_profile_info_cl, cl_float **_profile_lut_cl, cl_mem *_dev_profile_info, cl_mem *_dev_profile_lut)
free parameters build with the previous function.
cl_int dt_ioppr_build_iccprofile_params_cl(const dt_iop_order_iccprofile_info_t *const profile_info, const int devid, dt_colorspaces_iccprofile_info_cl_t **_profile_info_cl, cl_float **_profile_lut_cl, cl_mem *_dev_profile_info, cl_mem *_dev_profile_lut)
build the required parameters for a kernel that uses a profile info.
const float *const const float coeff[3]
static float4 LMS_to_XYZ(const float4 LMS)
static float4 Yrg_to_LMS(const float4 Yrg)
static float4 LMS_to_Yrg(const float4 LMS)
static float4 XYZ_to_LMS(const float4 XYZ)
void dt_colorprofiles_get_settings(dt_colorprofiles_settings_t *const out)
Copy the current settings into caller-provided storage, under one lock.
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
static dt_aligned_pixel_t rgb
static const float const float const float min
static dt_aligned_pixel_t XYZ
const dt_colormatrix_t dt_aligned_pixel_t out
dt_store_simd_aligned(out, dt_mat3x4_mul_vec4(vin, dt_colormatrix_row_to_simd(matrix, 0), dt_colormatrix_row_to_simd(matrix, 1), dt_colormatrix_row_to_simd(matrix, 2)))
static const dt_colormatrix_t M
void dt_conf_set_int(const char *name, int val)
int dt_conf_get_int(const char *name)
Integer for name, clamped to the bounds declared in the XML.
dt_image_pipe_class_t dt_image_pipe_class(const dt_image_t *img)
const char * dt_image_pipe_class_name(const dt_image_pipe_class_t klass)
float dt_image_get_exposure_bias(const struct dt_image_t *image_storage)
gboolean dt_image_needs_rawprepare(const dt_image_t *img)
int dt_get_num_openmp_threads(void)
Number of OpenMP threads the application decided to use.
struct dt_bauhaus_t * dt_bauhaus_get_global(void)
static float4 dt_noise_generator_simd(const dt_noise_distribution_t distribution, const float4 mu, const float4 param, uint state[4])
static unsigned int splitmix32(const unsigned long seed)
static float xoshiro128plus(uint state[4])
#define dt_dev_add_history_item(dev, module, enable, redraw)
#define dt_dev_pixelpipe_update_history_main(dev)
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_output_profile_info(const struct dt_dev_pixelpipe_t *pipe)
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_work_profile_info(const struct dt_dev_pixelpipe_t *pipe)
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_current_profile_info(dt_iop_module_t *module, const struct dt_dev_pixelpipe_t *pipe)
__DT_CLONE_TARGETS__ dt_iop_order_iccprofile_info_t * dt_ioppr_get_iop_work_profile_info(struct dt_iop_module_t *module, GList *iop_list)
@ DT_DEV_PIXELPIPE_DISPLAY_MASK
@ DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU
@ DT_DEV_PIXELPIPE_DISPLAY_NONE
GtkWidget * geometry
its size, under the preview
static float dt_log_scale_axis(const float x, const float base)
static void set_color(cairo_t *cr, GdkRGBA color)
static void dt_draw_grid(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom)
static void dt_draw_loglog_grid(cairo_t *cr, const int num, const int left, const int top, const int right, const int bottom, const float base)
static void weight(const float *c1, const float *c2, const float sharpen, dt_aligned_pixel_t weight)
static void toe_shoulder_callback(GtkWidget *slider, gpointer user_data)
static gboolean area_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static void _filmic_agx_Yrg_to_xyz_D50(const dt_aligned_pixel_t Yrg, dt_aligned_pixel_t xyz_D50)
static gboolean area_scroll_callback(GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
const char ** description(struct dt_iop_module_t *self)
static gboolean area_leave_notify(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static gboolean _filmic_agx_build_displaced(const dt_iop_order_iccprofile_info_t *const work_profile, const float inset[3], const float rotation[3], dt_colormatrix_t M)
static __DT_CLONE_TARGETS__ void display_mask(const float *const restrict mask, float *const restrict out, const size_t width, const size_t height)
dt_iop_filmic_noise_distribution_t
@ DT_FILMIC_NOISE_UNIFORM
@ DT_FILMIC_NOISE_POISSONIAN
@ DT_FILMIC_NOISE_GAUSSIAN
dt_iop_filmicrgb_curve_type_t
@ DT_FILMIC_CURVE_RATIONAL
@ DT_FILMIC_CURVE_SIGMOID
void gui_reset(dt_iop_module_t *self)
void filmic_gui_draw_icon(cairo_t *cr, struct dt_iop_filmicrgb_gui_button_data_t *button, struct dt_iop_filmicrgb_gui_data_t *g)
static gboolean dt_iop_tonecurve_draw(GtkWidget *widget, cairo_t *crf, gpointer user_data)
dt_iop_filmic_rgb_gui_mode_t
@ DT_FILMIC_GUI_BASECURVE
@ DT_FILMIC_GUI_BASECURVE_LOG
static const dt_iop_order_iccprofile_info_t * _filmic_get_output_profile(const dt_dev_pixelpipe_t *pipe, const dt_iop_filmicrgb_data_t *const data)
static __DT_CLONE_TARGETS__ void filmic_split_v1(const float *const restrict in, float *const restrict out, const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_filmicrgb_data_t *const data, const dt_iop_filmic_rgb_spline_t spline, const size_t width, const size_t height)
void reload_defaults(dt_iop_module_t *module)
static __DT_CLONE_TARGETS__ void wavelets_reconstruct_RGB(const float *const restrict HF, const float *const restrict LF, const float *const restrict texture, const float *const restrict mask, float *const restrict reconstructed, const size_t width, const size_t height, const size_t ch, const float gamma, const float gamma_comp, const float beta, const float beta_comp, const float delta, const size_t s, const size_t scales)
static void _filmic_agx_xyz_D50_to_Yrg(const dt_aligned_pixel_t xyz_D50, dt_aligned_pixel_t Yrg)
dt_iop_filmicrgb_colorscience_type_t
@ DT_FILMIC_COLORSCIENCE_V1
@ DT_FILMIC_COLORSCIENCE_V2
@ DT_FILMIC_COLORSCIENCE_V7
@ DT_FILMIC_COLORSCIENCE_V9
@ DT_FILMIC_COLORSCIENCE_V5
@ DT_FILMIC_COLORSCIENCE_V4
@ DT_FILMIC_COLORSCIENCE_V6
@ DT_FILMIC_COLORSCIENCE_V3
@ DT_FILMIC_COLORSCIENCE_V10
@ DT_FILMIC_COLORSCIENCE_V8
__DT_CLONE_TARGETS__ int process(dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const restrict ivoid, void *const restrict ovoid)
void gui_update(dt_iop_module_t *self)
Refresh GUI controls from current params and configuration.
static void dt_cairo_draw_arrow(cairo_t *cr, double origin_x, double origin_y, double destination_x, double destination_y, gboolean show_head)
static void apply_auto_grey(dt_iop_module_t *self, const dt_iop_order_iccprofile_info_t *const work_profile)
static __DT_CLONE_TARGETS__ void filmic_chroma_v2_v3(const float *const restrict in, float *const restrict out, const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_filmicrgb_data_t *const data, const dt_iop_filmic_rgb_spline_t spline, const int variant, const size_t width, const size_t height, const size_t ch, const dt_iop_filmicrgb_colorscience_type_t colorscience_version)
static void apply_auto_black(dt_iop_module_t *self, const dt_iop_order_iccprofile_info_t *const work_profile)
static __DT_CLONE_TARGETS__ void wavelets_reconstruct_ratios(const float *const restrict HF, const float *const restrict LF, const float *const restrict texture, const float *const restrict mask, float *const restrict reconstructed, const size_t width, const size_t height, const size_t ch, const float gamma, const float gamma_comp, const float beta, const float beta_comp, const float delta, const size_t s, const size_t scales)
static void _mat3_identity(dt_colormatrix_t M)
static void _filmic_update_hl_deprecation(dt_iop_module_t *self)
void gui_focus(struct dt_iop_module_t *self, gboolean in)
static cl_int reconstruct_highlights_cl(const dt_dev_pixelpipe_t *pipe, cl_mem in, cl_mem mask, cl_mem reconstructed, const dt_iop_filmicrgb_reconstruction_type_t variant, dt_iop_filmicrgb_global_data_t *const gd, const dt_iop_filmicrgb_data_t *const data, const dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *const roi_in)
#define CIE_Y_1931_to_CIE_Y_2006(x)
static __DT_CLONE_TARGETS__ void filmic_chroma_v4(const float *const restrict in, float *const restrict out, const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_order_iccprofile_info_t *const export_profile, const dt_iop_filmicrgb_data_t *const data, const dt_iop_filmic_rgb_spline_t spline, const int variant, const size_t width, const size_t height, const size_t ch, const dt_iop_filmicrgb_colorscience_type_t colorscience_version, const float display_black, const float display_white)
static __DT_CLONE_TARGETS__ void filmic_chroma_v1(const float *const restrict in, float *const restrict out, const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_filmicrgb_data_t *const data, const dt_iop_filmic_rgb_spline_t spline, const int variant, const size_t width, const size_t height)
static __DT_CLONE_TARGETS__ void filmic_split_v4(const float *const restrict in, float *const restrict out, const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_order_iccprofile_info_t *const export_profile, const dt_iop_filmicrgb_data_t *const data, const dt_iop_filmic_rgb_spline_t spline, const int variant, const size_t width, const size_t height, const size_t ch, const dt_iop_filmicrgb_colorscience_type_t colorscience_version, const float display_black, const float display_white)
void gui_init(dt_iop_module_t *self)
dt_iop_filmicrgb_methods_type_t
@ DT_FILMIC_METHOD_POWER_NORM
@ DT_FILMIC_METHOD_EUCLIDEAN_NORM_V1
@ DT_FILMIC_METHOD_MAX_RGB
@ DT_FILMIC_METHOD_EUCLIDEAN_NORM_V2
@ DT_FILMIC_METHOD_LUMINANCE
static __DT_CLONE_TARGETS__ void filmic_split_v2_v3(const float *const restrict in, float *const restrict out, const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_filmicrgb_data_t *const data, const dt_iop_filmic_rgb_spline_t spline, const size_t width, const size_t height)
static float log_tonemapping(const float x, const float grey, const float black, const float dynamic_range)
dt_iop_filmicrgb_reconstruction_type_t
@ DT_FILMIC_RECONSTRUCT_RATIOS
@ DT_FILMIC_RECONSTRUCT_RGB
static void filmic_v3_legacy_to_direct(const dt_iop_filmicrgb_params_t *const p, float *const toe, float *const shoulder)
void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
dt_iop_filmicrgb_gui_button_t
@ DT_FILMIC_GUI_BUTTON_LAST
@ DT_FILMIC_GUI_BUTTON_LABELS
@ DT_FILMIC_GUI_BUTTON_TYPE
void tiling_callback(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling)
static __DT_CLONE_TARGETS__ int get_scales(const dt_dev_pixelpipe_t *const pipe, const dt_iop_roi_t *roi_in, const dt_dev_pixelpipe_iop_t *const piece)
static int reconstruct_highlights(const dt_dev_pixelpipe_t *const pipe, const float *const restrict in, const float *const restrict mask, float *const restrict reconstructed, const dt_iop_filmicrgb_reconstruction_type_t variant, const size_t ch, const dt_iop_filmicrgb_data_t *const data, const dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out)
void commit_params(dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
static void apply_auto_white_point_source(dt_iop_module_t *self, const dt_iop_order_iccprofile_info_t *const work_profile)
static float exp_tonemapping_v2(const float x, const float grey, const float black, const float dynamic_range)
void cleanup_global(dt_iop_module_so_t *module)
static void filmic_prepare_simd_matrices(const dt_colormatrix_t input_matrix, const dt_colormatrix_t output_matrix, const dt_colormatrix_t export_input_matrix, const dt_colormatrix_t export_output_matrix, dt_iop_filmicrgb_simd_matrices_t *const simd_matrices)
static gboolean area_enter_notify(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
void cleanup_pipe(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
static __DT_CLONE_TARGETS__ gint mask_clipped_pixels(const float *const restrict in, float *const restrict mask, const float normalize, const float feathering, const size_t width, const size_t height, const size_t ch)
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
void input_format(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc)
static gboolean area_motion_notify(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
static void inpaint_noise(const float *const in, const float *const mask, float *const inpainted, const float noise_level, const float threshold, const dt_noise_distribution_t noise_distribution, const size_t width, const size_t height)
static void apply_autotune(dt_iop_module_t *self, const dt_iop_order_iccprofile_info_t *const work_profile)
static __DT_CLONE_TARGETS__ void filmic_agx(const float *const restrict in, float *const restrict out, const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_order_iccprofile_info_t *const export_profile, const dt_iop_filmicrgb_data_t *const data, const dt_iop_filmic_rgb_spline_t spline, const size_t width, const size_t height, const size_t ch, const float display_black, const float display_white)
static __DT_CLONE_TARGETS__ void filmic_v5(const float *const restrict in, float *const restrict out, const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_order_iccprofile_info_t *const export_profile, const dt_iop_filmicrgb_data_t *const data, const dt_iop_filmic_rgb_spline_t spline, const size_t width, const size_t height, const size_t ch, const float display_black, const float display_white)
static gboolean filmic_v3_compute_geometry(const dt_iop_filmicrgb_params_t *const p, dt_iop_filmicrgb_v3_geometry_t *const geometry)
static void show_mask_callback(GtkToggleButton *button, GdkEventButton *event, gpointer user_data)
static __DT_CLONE_TARGETS__ void wavelets_detail_level(const float *const restrict detail, const float *const restrict LF, float *const restrict HF, float *const restrict texture, const size_t width, const size_t height, const size_t ch)
static void convert_to_spline_v3(dt_iop_filmicrgb_params_t *n)
static __DT_CLONE_TARGETS__ void compute_ratios(const float *const restrict in, float *const restrict norms, float *const restrict ratios, const dt_iop_order_iccprofile_info_t *const work_profile, const int variant, const size_t width, const size_t height)
static void filmic_v3_direct_to_legacy(const dt_iop_filmicrgb_params_t *const p, const float toe, const float shoulder, float *const latitude, float *const balance)
dt_iop_filmicrgb_spline_version_type_t
@ DT_FILMIC_SPLINE_VERSION_V2
@ DT_FILMIC_SPLINE_VERSION_V3
@ DT_FILMIC_SPLINE_VERSION_V1
static float filmic_sigmoid_scale(const float limit_x, const float limit_y, const float transition_x, const float transition_y, const float slope, const float power)
void init_pipe(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
static void filmic_gui_sync_toe_shoulder(dt_iop_module_t *self)
void init_global(dt_iop_module_so_t *module)
void autoset(struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *i)
static void filmic_agx_prepare_bracket(const dt_iop_order_iccprofile_info_t *const work_profile, const dt_iop_filmicrgb_colorscience_type_t variant, dt_colormatrix_t inset, dt_colormatrix_t outset)
static gboolean filmic_v3_compute_nodes_from_legacy(const dt_iop_filmicrgb_params_t *const p, dt_iop_filmicrgb_v3_geometry_t *const geometry, dt_iop_filmicrgb_v3_nodes_t *const nodes)
int process_cl(struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out)
static gboolean _filmic_is_agx(const dt_iop_filmicrgb_colorscience_type_t v)
static __DT_CLONE_TARGETS__ void init_reconstruct(const float *const restrict in, const float *const restrict mask, float *const restrict reconstructed, const size_t width, const size_t height)
void color_picker_apply(dt_iop_module_t *self, GtkWidget *picker, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
static float linear_saturation(const float x, const float luminance, const float saturation)
static gboolean dt_iop_filmic_rgb_compute_spline(const dt_iop_filmicrgb_params_t *const p, struct dt_iop_filmic_rgb_spline_t *const spline)
#define FILMIC_RECONSTRUCT_DEPRECATED
static __DT_CLONE_TARGETS__ void restore_ratios(float *const restrict ratios, const float *const restrict norms, const size_t width, const size_t height)
int legacy_params(dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version)
gboolean runtime_data_hash(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
static int gauss_solve(double *A, double *b, int n)
const char ** dt_iop_set_description(dt_iop_module_t *module, const char *main_text, const char *purpose, const char *input, const char *process, const char *output)
float dt_dev_get_module_scale(const dt_dev_pixelpipe_t *const pipe, const dt_iop_roi_t *const roi_in)
void dt_iop_set_cache_bypass(dt_iop_module_t *module, gboolean state)
void dt_iop_request_focus(dt_iop_module_t *module)
Move darkroom focus to module, or clear it with NULL.
#define dt_iop_fmt_log(module, fmt,...)
Debug helper to trace a module's input-format-driven decisions on the -d pipe channel (DT_DEBUG_PIPE)...
@ IOP_FLAGS_INCLUDE_IN_STYLES
@ IOP_FLAGS_SUPPORTS_BLENDING
GtkWidget * dt_iop_togglebutton_new(dt_iop_module_t *self, const char *section, const gchar *label, const gchar *ctrl_label, GCallback callback, gboolean local, guint accel_key, GdkModifierType mods, DTGTKCairoPaintIconFunc paint, GtkWidget *box)
GtkWidget * dt_bauhaus_toggle_from_params(dt_iop_module_t *self, const char *param)
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
GtkWidget * dt_bauhaus_combobox_from_params(dt_iop_module_t *self, const char *param)
static dt_iop_gui_data_t * dt_iop_gui_data(const struct dt_iop_module_t *m)
The module's GUI data blob, NULL-safe for headless callers: IOP process() implementations read it for...
#define IOP_GUI_ALLOC(module)
GtkWidget * dt_ui_section_label_new(const gchar *str)
GtkWidget * dt_ui_label_new(const gchar *str)
static const dt_dev_pixelpipe_t * pipe
static const dt_dev_pixelpipe_t const dt_dev_pixelpipe_iop_t * piece
static const dt_dev_pixelpipe_t const dt_dev_pixelpipe_iop_t int int int int * origin_y
static const dt_dev_pixelpipe_t const dt_dev_pixelpipe_iop_t int int int * origin_x
_lib_location_type_t type
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
float *const restrict luminance
float *const restrict const size_t k
float *const restrict const size_t const size_t ch
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define CLAMPF(a, mn, mx)
float DT_ALIGNED_ARRAY dt_colormatrix_t[4][4]
static void transpose_3xSSE(const dt_colormatrix_t input, dt_colormatrix_t output)
static void pack_3xSSE_to_3x4(const dt_colormatrix_t input, float output[12])
static void dt_colormatrix_mul(dt_colormatrix_t dst, const dt_colormatrix_t m1, const dt_colormatrix_t m2)
static int mat3SSEinv(dt_colormatrix_t dst, const dt_colormatrix_t src)
#define dt_free_align(ptr)
Release memory from dt_alloc_align() and set ptr to NULL.
static void * dt_calloc_align(size_t size)
dt_alloc_align() followed by a zero fill.
#define DT_ALIGNED_ARRAY
Align an object on a cacheline boundary, so AVX2 can load it whole.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
DT_MODULE() for a module whose params struct is introspected.
GtkWidget * dt_ui_notebook_page(GtkNotebook *notebook, const char *text, const char *tooltip)
GtkNotebook * dt_ui_notebook_new()
void dt_ui_notebook_set_picker_owner(GtkNotebook *notebook, gpointer owner)
Register an opaque owner for a GtkNotebook's page switches, and report every "switch_page" to the hos...
int dt_opencl_local_buffer_opt(const int devid, const int kernel, dt_opencl_local_buffer_t *factors)
int dt_opencl_enqueue_kernel_2d(const int dev, const int kernel, const size_t *sizes)
void * dt_opencl_alloc_device_buffer(const int devid, const size_t size)
void * dt_opencl_alloc_device(const int devid, const int width, const int height, const int bpp)
int dt_opencl_create_kernel(const int prog, const char *name)
void * dt_opencl_copy_host_to_device_constant(const int devid, const size_t size, void *host)
int dt_opencl_write_buffer_to_device(const int devid, void *host, void *device, const size_t offset, const size_t size, const int blocking)
int dt_opencl_enqueue_copy_image(const int devid, cl_mem src, cl_mem dst, size_t *orig_src, size_t *orig_dst, size_t *region)
int dt_opencl_read_buffer_from_device(const int devid, void *host, void *device, const size_t offset, const size_t size, const int blocking)
void dt_opencl_free_kernel(const int kernel)
int dt_opencl_set_kernel_arg(const int dev, const int kernel, const int num, const size_t size, const void *arg)
int dt_opencl_enqueue_kernel_2d_with_local(const int dev, const int kernel, const size_t *sizes, const size_t *local)
void dt_opencl_release_mem_object(cl_mem mem)
#define __OMP_SIMD__(...)
#define dt_omploop_sfence()
#define __OMP_DECLARE_SIMD__(...)
#define __OMP_PARALLEL_FOR__(...)
#define __OMP_PARALLEL_FOR_SIMD__(...)
static float fmaxabsf(const float a, const float b)
static float clamp_simd(const float x)
#define dt_pixelpipe_cache_alloc_align_float_cache(pixels, id)
#define dt_pixelpipe_cache_free_align(mem)
#define dt_pixelpipe_cache_alloc_align_float(pixels, pipe)
dt_iop_color_intent_t
ICC rendering intent, as stored in iop params and in conf.
dt_colorspaces_color_profile_type_t
@ DT_COLORSPACE_NONE
No profile / "take it from the image settings". Never matches a list entry.
dt_colorspaces_color_mode_t
What the output transform is being asked to show: the picture, or a proof of it.
static cairo_surface_t * dt_cairo_image_surface_create(cairo_format_t format, int width, int height)
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
#define for_each_channel(_var,...)
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...
static const dt_aligned_pixel_simd_t value
const float uint32_t state[4]
const float const int flip
Consistent snapshot of the display and soft-proofing settings.
The device-side view of a dt_iop_order_iccprofile_info_t: the scalar fields only.
dt_dev_pixelpipe_type_t type
dt_iop_buffer_type_t datatype
dt_iop_filmicrgb_curve_type_t type[2]
int high_quality_reconstruction
float reconstruct_feather
char softproof_filename[512]
float reconstruct_structure_vs_texture
float reconstruct_grey_vs_color
dt_noise_distribution_t noise_distribution
dt_colorspaces_color_profile_type_t softproof_type
float reconstruct_bloom_vs_details
dt_iop_color_intent_t softproof_intent
dt_colorspaces_color_mode_t softproof_mode
struct dt_iop_filmic_rgb_spline_t spline DT_ALIGNED_ARRAY
float reconstruct_threshold
int kernel_filmic_rgb_chroma
int kernel_filmic_bspline_vertical
int kernel_filmic_rgb_split
int kernel_filmic_wavelets_reconstruct
int kernel_filmic_wavelets_detail
int kernel_filmic_show_mask
int kernel_filmic_compute_ratios
int kernel_filmic_init_reconstruct
int kernel_filmic_restore_ratios
int kernel_filmic_bspline_vertical_local
int kernel_filmic_bspline_horizontal
int kernel_filmic_inpaint_noise
int kernel_filmic_bspline_horizontal_local
GtkWidget * high_quality_reconstruction
GtkWidget * autoset_display_gamma
GtkWidget * reconstruct_grey_vs_color
GtkWidget * auto_hardness
dt_iop_filmicrgb_gui_button_data_t buttons[DT_FILMIC_GUI_BUTTON_LAST]
GtkWidget * reconstruct_bloom_vs_details
GtkWidget * reconstruct_threshold
GtkWidget * show_highlight_mask
GtkWidget * white_point_target
GtkWidget * grey_point_source
GtkWidget * spline_version
GtkStyleContext * context
GtkWidget * preserve_color
dt_iop_filmicrgb_gui_button_t active_button
GtkWidget * grey_point_target
dt_iop_filmic_rgb_gui_mode_t gui_mode
GtkWidget * black_point_source
GtkWidget * reconstruct_structure_vs_texture
GtkWidget * reconstruct_page
GtkWidget * reconstruct_feather
GtkWidget * noise_distribution
GtkWidget * black_point_target
struct dt_iop_filmic_rgb_spline_t spline DT_ALIGNED_ARRAY
GtkWidget * white_point_source
GtkWidget * security_factor
GtkWidget * compensate_icc_black
float reconstruct_threshold
float reconstruct_grey_vs_color
float reconstruct_feather
dt_iop_filmicrgb_curve_type_t shadows
dt_iop_filmicrgb_spline_version_type_t spline_version
dt_iop_filmicrgb_colorscience_type_t version
dt_iop_filmic_noise_distribution_t noise_distribution
dt_iop_filmicrgb_methods_type_t preserve_color
int high_quality_reconstruction
dt_iop_filmicrgb_curve_type_t highlights
float reconstruct_bloom_vs_details
gboolean compensate_icc_black
float reconstruct_structure_vs_texture
dt_aligned_pixel_simd_t input[3]
dt_aligned_pixel_simd_t output[3]
dt_aligned_pixel_simd_t export_output[3]
dt_aligned_pixel_simd_t export_input[3]
gboolean contrast_clamped
dt_iop_params_t * default_params
struct dt_iop_module_gui_t * gui
struct dt_develop_t * dev
dt_iop_global_data_t * global_data
dt_aligned_pixel_t picked_color_min
dt_aligned_pixel_t picked_color_max
dt_aligned_pixel_t picked_color
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_...
dt_colormatrix_t matrix_out
XYZ (D50) -> RGB, row-major; the inverse of matrix_in.
float * lut_in[3]
Per-channel encoded -> linear tone curve, lutsize entries each, sampled over [0,1]....
dt_colormatrix_t matrix_in_transposed
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...
Region of interest passed through the pixelpipe.
#define __DT_CLONE_TARGETS__