Skip to content

Commit 21af8fe

Browse files
committed
wb: Fixed publishing of late_correction in temperature.c
1 parent 70084bd commit 21af8fe

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

src/iop/temperature.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ typedef struct dt_iop_temperature_data_t
104104
{
105105
float coeffs[4];
106106
int preset;
107+
gboolean late_correction;
107108
} dt_iop_temperature_data_t;
108109

109110
typedef struct dt_iop_temperature_global_data_t
@@ -554,7 +555,7 @@ static inline void _publish_chroma(dt_dev_pixelpipe_iop_t *piece)
554555
d->coeffs[k] * piece->pipe->dsc.processed_maximum[k];
555556
chr->wb_coeffs[k] = d->coeffs[k];
556557
}
557-
chr->late_correction = (d->preset == DT_IOP_TEMP_D65_LATE);
558+
chr->late_correction = d->late_correction;
558559
}
559560

560561
void process(dt_iop_module_t *self,
@@ -745,18 +746,24 @@ void commit_params(dt_iop_module_t *self,
745746

746747
d->preset = p->preset;
747748

749+
gboolean effective_late_correction = FALSE;
750+
751+
if (p->preset == DT_IOP_TEMP_D65_LATE)
752+
effective_late_correction = TRUE;
753+
else if (p->preset == DT_IOP_TEMP_D65)
754+
effective_late_correction = FALSE;
755+
else
756+
effective_late_correction = p->late_correction;
757+
758+
d->late_correction = effective_late_correction;
759+
760+
chr->late_correction = effective_late_correction;
761+
762+
chr->temperature = piece->enabled ? self : NULL;
748763
/* Make sure the chroma information stuff is valid
749764
If piece is disabled we always clear the trouble message and
750765
make sure chroma does know there is no temperature module.
751766
*/
752-
if(p->preset == DT_IOP_TEMP_D65_LATE)
753-
chr->late_correction = TRUE;
754-
else if(p->preset == DT_IOP_TEMP_D65)
755-
chr->late_correction = FALSE;
756-
else
757-
chr->late_correction = p->late_correction;
758-
759-
chr->temperature = piece->enabled ? self : NULL;
760767
if(pipe->type & DT_DEV_PIXELPIPE_PREVIEW && !piece->enabled)
761768
dt_iop_set_module_trouble_message(self, NULL, NULL, NULL);
762769
}

0 commit comments

Comments
 (0)