diff options
author | Marti Maria <marti.maria@littlecms.com> | 2023-04-23 17:54:36 +0200 |
---|---|---|
committer | Marti Maria <marti.maria@littlecms.com> | 2023-04-23 17:54:36 +0200 |
commit | 88b4c773d06368f1ecdd4b4ba1b75e1c6694531d (patch) | |
tree | 3115d0faafbf38139fcb82ed31a1109a8d269303 /src/cmsgamma.c | |
parent | b3144b8018a26df755b46a02583ff6ea466f532c (diff) | |
download | lcms2-88b4c773d06368f1ecdd4b4ba1b75e1c6694531d.tar.gz |
add a way to get segments from tone curves
- Add a way to get segments from tone curves
- Add a check for windows in meson file of fast-float plugin
Diffstat (limited to 'src/cmsgamma.c')
-rw-r--r-- | src/cmsgamma.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmsgamma.c b/src/cmsgamma.c index 1031fc1..24b2ada 100644 --- a/src/cmsgamma.c +++ b/src/cmsgamma.c @@ -1491,13 +1491,13 @@ cmsFloat64Number CMSEXPORT cmsEstimateGamma(const cmsToneCurve* t, cmsFloat64Num return (sum / n); // The mean } +// Retrieve segments on tone curves -// Retrieve parameters on one-segment tone curves - -cmsFloat64Number* CMSEXPORT cmsGetToneCurveParams(const cmsToneCurve* t) +const cmsCurveSegment* CMSEXPORT cmsGetToneCurveSegment(cmsInt32Number n, const cmsToneCurve* t) { _cmsAssert(t != NULL); - if (t->nSegments != 1) return NULL; - return t->Segments[0].Params; + if (n < 0 || n >= (cmsInt32Number) t->nSegments) return NULL; + return t->Segments + n; } + |