Description: keep API compatibility for 2.16 Version 2.16 removed cmsGetToneCurveParams() from the public API without changing the SONAME. This patch reintroduces the function to keep API compatibility. Author: Thomas Weber <tweber@debian.org> Bug: https://github.com/mm2/Little-CMS/issues/429 Forwarded: no Last-Update: 2023-12-25 --- a/include/lcms2.h +++ b/include/lcms2.h @@ -1239,7 +1239,7 @@ CMSAPI cmsBool CMSEXPORT cmsIsToneCurveDescending(const cmsToneCurve* t); CMSAPI cmsInt32Number CMSEXPORT cmsGetToneCurveParametricType(const cmsToneCurve* t); CMSAPI cmsFloat64Number CMSEXPORT cmsEstimateGamma(const cmsToneCurve* t, cmsFloat64Number Precision); - +CMSAPI cmsFloat64Number* CMSEXPORT cmsGetToneCurveParams(const cmsToneCurve* t); CMSAPI const cmsCurveSegment* CMSEXPORT cmsGetToneCurveSegment(cmsInt32Number n, const cmsToneCurve* t); // Tone curve tabular estimation --- a/src/cmsgamma.c +++ b/src/cmsgamma.c @@ -1511,3 +1511,12 @@ return t->Segments + n; } +// Retrieve parameters on one-segment tone curves + +cmsFloat64Number* CMSEXPORT cmsGetToneCurveParams(const cmsToneCurve* t) +{ + _cmsAssert(t != NULL); + + if (t->nSegments != 1) return NULL; + return t->Segments[0].Params; +}