Skip to content

[refactor] make ceres optional#302

Merged
antond-weta merged 6 commits into
AcademySoftwareFoundation:mainfrom
antond-weta:no_ceres
Jul 9, 2026
Merged

[refactor] make ceres optional#302
antond-weta merged 6 commits into
AcademySoftwareFoundation:mainfrom
antond-weta:no_ceres

Conversation

@antond-weta

Copy link
Copy Markdown
Contributor

Description

Implements a non-linear solver making the dependency on Ceres optional. Both solvers are available when built with Ceres, and the Ceres is used by default. The solvers are switchable in runtime, but that option is not currently exposed to the users, only being used in unit tests.

Tests

Yes, full coverage.
There are extensive tests comparing the new solver with the old one.

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable. (Check if there is no
    need to update the documentation, for example if this is a bug fix that
    doesn't change the API.)
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

};

constexpr double v_6_29__3 = 6.0 * 6.0 * 6.0 / 29.0 / 29.0 / 29.0;
constexpr double v_29_6__2 = 29.0 * 29.0 / 6.0 / 6.0;

@soswow soswow Jul 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

literally magic numbers, lol
comment would be super helpful here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

constexpr double v_29_6__2 = 29.0 * 29.0 / 6.0 / 6.0;

// The non-linear perceptual function of the XYZ to LAB conversion.
template <typename T> T lab_F( T arg )

@soswow soswow Jul 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not call it then XYZ_to_LAB?
upd: ah! I can see one below )

// Go_ = (Rs-Bs) when j == 2, 0 otherwise
// Go_ = (Gs-Bs) when j == 3, 0 otherwise
// Bo_ = (Rs-Bs) when j == 4, 0 otherwise
// Bo_ = (Gs-Bs) when j == 5, 0 otherwise

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these above? Forgotted commented out code or part of explaination?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this explains what is in the matrix out_rgb_ below

@codecov-commenter

codecov-commenter commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.57082% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.87%. Comparing base (0292c6d) to head (f4848b5).

Files with missing lines Patch % Lines
src/rawtoaces_core/core_math.cpp 99.57% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #302      +/-   ##
==========================================
+ Coverage   91.32%   91.87%   +0.54%     
==========================================
  Files          17       17              
  Lines        3551     3777     +226     
  Branches      527      558      +31     
==========================================
+ Hits         3243     3470     +227     
+ Misses        308      307       -1     
Files with missing lines Coverage Δ
src/rawtoaces_core/rawtoaces_core.cpp 98.38% <ø> (ø)
src/rawtoaces_core/core_math.cpp 99.80% <99.57%> (+0.48%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0292c6d...f4848b5. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@soswow soswow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GOOD

Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
@antond-weta antond-weta merged commit 174bfa2 into AcademySoftwareFoundation:main Jul 9, 2026
26 of 50 checks passed
@antond-weta antond-weta deleted the no_ceres branch July 9, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants