You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
craft-develop: keep warm-green white balance smooth - #4405
Apps can keep warm, strongly green white-balance adjustments from jumping abruptly while leaving saved edits unchanged.
Follow-up to storytold/lightcraft#2527. At Tint +150 and the reported Canon EOS M6 As Shot settings, the pinned checked-white-balance path switches from the identity fallback to a much larger blue gain as temperature crosses 3800–4000 K. Bradford divides by the source cone response, so a near-zero response produces a large gain before the existing guard can reject it.
Add an opt-in shared matrix helper that holds the source at a small positive cone floor. Normal whites, camera-space rebalancing and the existing API are unchanged. LightCraft can adopt the opt-in with a new render process after a shared dependency update.
The new smooth_tint_avoids_the_warm_green_bradford_jump regression covers tint and temperature sweeps and exact preservation of an ordinary white. It fails with the old path and passes with the new one. Windows: 236 craft-develop unit tests passed, 12 ignored. Formatting passed. Strict Clippy reports the same three pre-existing warnings as the current base in colorops.rs and sensor/color.rs, and none in the changed file.
Summary by CodeRabbit
New Features
White-balance adjustments now support a smooth-tint option, helping warm and strongly tinted settings transition more gradually while keeping image gains stable.
Standard white-balance results remain consistent with the existing adjustment path.
No actionable comments were generated in the recent review.
Walkthrough
The white-balance matrix API adds a smooth-tint path. It bounds the requested white before checked Bradford adaptation. The existing entry point retains its prior checked-versus-legacy behavior.
The new public function enables smooth-tint handling. The shared implementation preserves unchanged-white and camera-rebalance exits and luminance normalization. The new bound keeps Bradford cone responses above the specified floor, with fallback to Rec.2020 neutral for invalid inputs. A test checks ordinary whites and sampled warm, high-tint transitions.
Issue 778: The change covers the warm-green white-balance range noted in its shared RAW development work item.
Issue 587: The change addresses the described warm-green cone-floor and checked white-balance behavior. The issue’s LightCraft and PhotoCraft adoption work remains open.
Suggested reviewers:dylanmtaylor, dotcoocoo
Merge Risk: Minimal · up to 3cf31
This adds an opt-in white-balance path that avoids abrupt blue-gain jumps for warm, strongly green adjustments. Existing callers keep their current behavior, and no concrete defect was found, so the change looks safe to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "craft-develop: keep warm-green white balance smooth" matches the main change. The PR adds an opt-in helper, wb_matrix_for_with_smooth_tint, that sets a cone floor to stop abrupt blue-gain j…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "craft-develop: keep warm-green white balance smooth" matches the main change. The PR adds an opt-in helper, wb_matrix_for_with_smooth_tint, that sets a cone floor to stop abrupt blue-gain jumps for warm, strongly green white-balance adjustments. The title names the affected crate, the white-balance area, and the smoothing goal. It does not mention that the change is opt-in, but it does not need to cover every detail.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between aa7e668 and 3cf313d.
Files selected for processing: 1
crates/develop/src/local.rs
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apps can keep warm, strongly green white-balance adjustments from jumping abruptly while leaving saved edits unchanged.
Follow-up to storytold/lightcraft#2527. At Tint +150 and the reported Canon EOS M6 As Shot settings, the pinned checked-white-balance path switches from the identity fallback to a much larger blue gain as temperature crosses 3800–4000 K. Bradford divides by the source cone response, so a near-zero response produces a large gain before the existing guard can reject it.
Add an opt-in shared matrix helper that holds the source at a small positive cone floor. Normal whites, camera-space rebalancing and the existing API are unchanged. LightCraft can adopt the opt-in with a new render process after a shared dependency update.
The new
smooth_tint_avoids_the_warm_green_bradford_jumpregression covers tint and temperature sweeps and exact preservation of an ordinary white. It fails with the old path and passes with the new one. Windows: 236 craft-develop unit tests passed, 12 ignored. Formatting passed. Strict Clippy reports the same three pre-existing warnings as the current base in colorops.rs and sensor/color.rs, and none in the changed file.Summary by CodeRabbit