@@ -1141,6 +1141,7 @@ def toggle_modal(n_clicks, is_open):
11411141 State (_uid ("encoding-transfer-function-field" ), "value" ),
11421142 State (_uid ("rgb-display-colourspace-select" ), "value" ),
11431143 State (_uid ("illuminant-select" ), "value" ),
1144+ State (_uid ("cct-field" ), "value" ),
11441145 State (_uid ("illuminant-datatable" ), "data" ),
11451146 State (_uid ("chromatic-adaptation-transform-select" ), "value" ),
11461147 State (_uid ("optimisation-space-select" ), "value" ),
@@ -1170,6 +1171,7 @@ def compute_idt_camera(
11701171 encoding_transfer_function ,
11711172 RGB_display_colourspace ,
11721173 illuminant_name ,
1174+ illuminant_custom_temperature ,
11731175 illuminant_data ,
11741176 chromatic_adaptation_transform ,
11751177 optimisation_space ,
@@ -1217,6 +1219,9 @@ def compute_idt_camera(
12171219 *RGB* display colourspace.
12181220 illuminant_name : str
12191221 Name of the illuminant.
1222+ illuminant_custom_temperature : float
1223+ Custom correlated colour temperature (CCT) in Kelvin for Blackbody
1224+ or Daylight illuminants.
12201225 illuminant_data : list
12211226 List of wavelength dicts of illuminant data.
12221227 chromatic_adaptation_transform : str
@@ -1249,6 +1254,7 @@ def compute_idt_camera(
12491254 'Computing "IDT" with "%s" using parameters:\n '
12501255 '\t RGB Display Colourspace : "%s"\n '
12511256 '\t Illuminant Name : "%s"\n '
1257+ '\t Illuminant Custom Temperature : "%s"\n '
12521258 '\t Illuminant Data : "%s"\n '
12531259 '\t Chromatic Adaptation Transform : "%s"\n '
12541260 '\t Optimisation Space : "%s"\n '
@@ -1261,6 +1267,7 @@ def compute_idt_camera(
12611267 generator_name ,
12621268 RGB_display_colourspace ,
12631269 illuminant_name ,
1270+ illuminant_custom_temperature ,
12641271 illuminant_data ,
12651272 chromatic_adaptation_transform ,
12661273 optimisation_space ,
@@ -1359,6 +1366,7 @@ def compute_idt_camera(
13591366 encoding_colourspace = encoding_colourspace ,
13601367 encoding_transfer_function = encoding_transfer_function ,
13611368 illuminant = illuminant_name ,
1369+ illuminant_custom_temperature = float (illuminant_custom_temperature ),
13621370 )
13631371 _IDT_GENERATOR_APPLICATION = IDTGeneratorApplication (
13641372 generator_name , project_settings
@@ -1368,12 +1376,16 @@ def compute_idt_camera(
13681376 _HASH_IDT_ARCHIVE = hash_file (_PATH_UPLOADED_IDT_ARCHIVE )
13691377 LOGGER .debug ('"Archive hash: "%s"' , _HASH_IDT_ARCHIVE )
13701378
1371- if _CACHE_DATA_ARCHIVE_TO_SAMPLES .get (_HASH_IDT_ARCHIVE ) is None :
1379+ # Include illuminant and temperature in cache key since they affect
1380+ # reference samples
1381+ cache_key = f"{ _HASH_IDT_ARCHIVE } _{ illuminant_name } _{ illuminant_custom_temperature } "
1382+
1383+ if _CACHE_DATA_ARCHIVE_TO_SAMPLES .get (cache_key ) is None :
13721384 _IDT_GENERATOR_APPLICATION .extract (_PATH_UPLOADED_IDT_ARCHIVE )
13731385 os .remove (_PATH_UPLOADED_IDT_ARCHIVE )
13741386 _IDT_GENERATOR_APPLICATION .validate_project_settings ()
13751387 _IDT_GENERATOR_APPLICATION .generator .sample ()
1376- _CACHE_DATA_ARCHIVE_TO_SAMPLES [_HASH_IDT_ARCHIVE ] = (
1388+ _CACHE_DATA_ARCHIVE_TO_SAMPLES [cache_key ] = (
13771389 _IDT_GENERATOR_APPLICATION .project_settings .data ,
13781390 _IDT_GENERATOR_APPLICATION .generator .samples_analysis ,
13791391 _IDT_GENERATOR_APPLICATION .generator .baseline_exposure ,
@@ -1383,7 +1395,7 @@ def compute_idt_camera(
13831395 _IDT_GENERATOR_APPLICATION .project_settings .data ,
13841396 _IDT_GENERATOR_APPLICATION .generator ._samples_analysis , # noqa: SLF001
13851397 _IDT_GENERATOR_APPLICATION .generator ._baseline_exposure , # noqa: SLF001
1386- ) = _CACHE_DATA_ARCHIVE_TO_SAMPLES [_HASH_IDT_ARCHIVE ]
1398+ ) = _CACHE_DATA_ARCHIVE_TO_SAMPLES [cache_key ]
13871399
13881400 generator = _IDT_GENERATOR_APPLICATION .generator
13891401 project_settings = _IDT_GENERATOR_APPLICATION .project_settings
0 commit comments