colorcalibration also for manual wb - #20304
Conversation
|
Did you intend to include cmixer_orig.c.txt in the PR? |
See the end of the description:
|
6631dc3 to
be0ad7a
Compare
|
@ralfbrown : extra files removed, thank for your patience |
ce74cf6 to
daae18d
Compare
daae18d to
5474b61
Compare
|
A first complete code reading and remembering your comments before; generally i think this is a minor but very good improvement and will certainly help with some issues. Also it make the intention more clear and fixes some common misunderstandings. I spotted some places like this: Could you explain if/why this is nevessary or is it just code-style? |
|
The key is the line: correction[k] = chr->D65coeffs[k] / chr->wb_coeffs[k];This used to be something like (below is one concrete example): chr->D65coeffs[0] / chr->as_shot[0]The new denominator comes from typedef struct dt_iop_temperature_params_t
{
float red; // $MIN: 0.0 $MAX: 8.0
float green; // $MIN: 0.0 $MAX: 8.0
float blue; // $MIN: 0.0 $MAX: 8.0
float various; // $MIN: 0.0 $MAX: 8.0
int preset;
} dt_iop_temperature_params_t;One option would be to restrict the values to If I misunderstood the question, please let me know. |
5474b61 to
6d612e0
Compare
fa618ac to
6156826
Compare
152cb16 to
b529102
Compare
b529102 to
994a97c
Compare
994a97c to
5217b8c
Compare
217d52f to
3e8cb65
Compare
|
Any updates? There have been no new commits for a while, just resolving conflicts. |
|
@kofa73 : This gets under the radar and I had many things to do for the AI integration. The discussion on pixl.us was difficult and my motivation was quite down for some time... I'm still a simple human :) I'll get back to this for 5.6. |
da026dd to
4b80cd0
Compare
4b80cd0 to
ff4c93f
Compare
ff4c93f to
02a71e6
Compare
|
Ok, I see this has been reviewed and blessed by @jenshannoschwalm so I'll test as soon as the conflict is resolved. The code looks ok to me, I just need to play with this to have a better understanding of the workflow. TIA. |
…eckbox; populate dev->chroma->late_correction based on checkbox-driven late_correction flag for 'legacy' modes (DT_IOP_TEMP_AS_SHOT, DT_IOP_TEMP_SPOT, DT_IOP_TEMP_USER)
…rything is purple.
…coeffs into find_temperature_from_wb_coeffs, find_temperature_from_as_shot_coeffs; added handling to channelmixerrgb.c + altered logic for 'late correction' check
…alidate wb_coeffs for find_temperature_from_wb_coeffs as well as in find_temperature_from_as_shot_coeffs; fix copy-pasted comment in channelmixerrgb.c#gui_changed
…UMINANT_CAMERA was added
… comment maintenance
… for color calibration' (late_correction)); fixed behaviour when WB disabled; removed unused code
… WB disabled temperature.c: keep the module handle published even when disabled (comment in develop.h already promised 'always available for GUI reports'). commit params nulled it when disabled -> early exit in channelmixerrgb.c _set_trouble_messages -> 'white balance missing' never shown. channelmixerrgb.c: fix potential null pointer dereference if worker sets chr->temperature to null; minor rename/cleanup
…h left-over gui->reset to DT_ENTER|LEAVE_GUI_UPDATE
…rity), no need to allocate + copy xy in illuminants.h find_illuminant_xy_from_wb_coeffs; no need for 0 check after isnormal
…ore opposed), so already part of hash
02a71e6 to
0e66d2a
Compare
|
I'm running the usual panel review on it (eating my own dog food) :-) Update: oh boy. :-D |
|
I'm not sure to understand the workflow here. If you click on "prepare data for color calibration" we don't have the warning about duplicate WB setting. This is fine. Now as soon as I change the temp or hue in the panel the user defined tab is selected (pencil). Fine but the image is not changed in any way. Actually you can drag de sliders in all direction and it changes nothing. That's really unexpected and certainly something even worst than the current situation with the two possible WB settings. Also why in the last tab (ref camera, the light bulb) there is no check for "prepare data for color calibration"? Again this is quite confusing. All in all, the UI/UX is not good to me and far more messy than the current one. Maybe there is room for improvement? |
Yes, also discovered by the bots. I'll take care of it, not a big deal.
prepare data for color calibration is simply the late correction exposed, and camera reference does not use it (no late correction is needed, as the data is already "correct": it uses the camera reference multipliers, there's nothing to "correct" (convert from arbitrary WB multipliers to reference multipliers)). Previously, late correction was only used by "as shot to reference", and "to reference" is exactly what we need for the user modes, as well (in colorin, undo the multipliers applied in white balance and apply camera reference multipliers, so color calibration receives reference-referred data).
Sure, and I thank you for the feedback. I have no better idea, unfortunately: late correction has to be set somehow. Maybe I can check if there's a color calibration instance with CAT on the pipeline, and adjust it automatically. |
Addresses #19873
What this would buy us:
Quoting 1c5df70, which introduced as-shot to reference - the excerpt below is about the use of reference (D65) multipliers:
Changes:
temperature.cto explicitly control thelate_correctionflag in 'user' / 'manual' modeslate_correctionis always off in 'camera reference' mode, always on in 'as-shot to reference')chr->as_shotwithchr->wb_coeffsinhighlights.c,colorin.c,opposed.candsegbased.cilluminants.h:DT_ILLUMINANT_FROM_WB, plus handling in conditionals, similar toDT_ILLUMINANT_CAMERA, but relying ondev->chroma->wb_coeffsfind_temperature_from_raw_coeffs:find_temperature_from_as_shot_coeffsfind_temperature_from_wb_coeffs, to allow directly using coefficients fromtemperature.c, instead of always going through ratios relative to the D65 valueswb_coeffstoilluminant_to_xyfor absolute coefficients fromtemperature.c; renamed paramcustom_wbtocorrection_ratiosto express what it represents; passed tofind_temperature_from_wb_coeffsinDT_ILLUMINANT_FROM_WBmodechannelmixerrgb.c:_dev_is_D65_chromano longer needsas_shotmultipliers inlate_correctionmode_get_white_balance_coeffto_get_d65_correction_ratiosfind_temperature_from_wb_coeffsto handleDT_ILLUMINANT_FROM_WBDraft for now, to allow discussion (and I haven't tested much, but wanted to make the changes visible to others;plus, I need to clean up some temp files)