Home | History | Annotate | Download | only in src

Lines Matching full:curve

29 // The curve is stored in segments, where each segment can be sampled or specified by parameters.
30 // a 16.bit simplification of the *whole* curve is kept for optimization purposes. For float operation,
35 // be called with the type id as a negative value, and a sampled version of the reversed curve
61 9, // # of curve types
62 { 1, 2, 3, 4, 5, 6, 7, 8, 108 }, // Parametric curve ID
209 // no optimation curve is computed. nSegments may also be zero in the inverse case, where only the
210 // optimization curve is given. Both features simultaneously is an error
221 cmsSignalError(ContextID, cmsERROR_RANGE, "Couldn't create tone curve of more than 65530 entries");
226 cmsSignalError(ContextID, cmsERROR_RANGE, "Couldn't create tone curve with zero segments and no table");
249 // This 16-bit table contains a limited precision representation of the whole curve and is kept for
563 // Unsupported parametric curve. Should never reach here
617 // Create an empty gamma curve, by using tables. This specifies only the limited-precision part, and leaves the
667 // Use a segmented curve to store the floating point table
672 // A segmented tone curve should have function segments in the first and last positions
673 // Initialize segmented curve part up to 0 to constant value = samples[0]
709 // Parameters goes as: Curve, a, b, c, d, e, f
711 // if type is negative, then the curve is analyticaly inverted
722 cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Invalid parametric curve type %d", Type);
747 // Free all memory taken by the gamma curve
748 void CMSEXPORT cmsFreeToneCurve(cmsToneCurve* Curve)
753 // Curve->InterpParams may be null
754 if (Curve == NULL || Curve->InterpParams == NULL) return;
756 ContextID = Curve ->InterpParams->ContextID;
758 _cmsFreeInterpParams(Curve ->InterpParams);
759 Curve ->InterpParams = NULL;
761 if (Curve -> Table16) {
762 _cmsFree(ContextID, Curve ->Table16);
763 Curve ->Table16 = NULL;
766 if (Curve ->Segments) {
770 for (i=0; i < Curve ->nSegments; i++) {
772 if (Curve ->Segments[i].SampledPoints) {
773 _cmsFree(ContextID, Curve ->Segments[i].SampledPoints);
774 Curve ->Segments[i].SampledPoints = NULL;
777 if (Curve ->SegInterp[i] != 0) {
778 _cmsFreeInterpParams(Curve->SegInterp[i]);
779 Curve->SegInterp[i] = NULL;
783 _cmsFree(ContextID, Curve ->Segments);
784 Curve ->Segments = NULL;
785 _cmsFree(ContextID, Curve ->SegInterp);
786 Curve ->SegInterp = NULL;
789 if (Curve -> Evals) {
790 _cmsFree(ContextID, Curve -> Evals);
791 Curve -> Evals = NULL;
794 if (Curve) {
795 _cmsFree(ContextID, Curve);
796 Curve = NULL;
801 void CMSEXPORT cmsFreeToneCurveTriple(cmsToneCurve* Curve[3])
804 _cmsAssert(Curve != NULL);
806 if (Curve[0] != NULL) cmsFreeToneCurve(Curve[0]);
807 if (Curve[1] != NULL) cmsFreeToneCurve(Curve[1]);
808 if (Curve[2] != NULL) cmsFreeToneCurve(Curve[2]);
810 Curve[0] = Curve[1] = Curve[2] = NULL;
1060 // Smooths a curve sampled at regular intervals.
1122 cmsBool CMSEXPORT cmsIsToneCurveLinear(const cmsToneCurve* Curve)
1127 _cmsAssert(Curve != NULL);
1129 for (i=0; i < Curve ->nEntries; i++) {
1131 diff = abs((int) Curve->Table16[i] - (int) _cmsQuantizeVal(i, Curve ->nEntries));
1152 // Curve direction
1211 cmsFloat32Number CMSEXPORT cmsEvalToneCurveFloat(const cmsToneCurve* Curve, cmsFloat32Number v)
1213 _cmsAssert(Curve != NULL);
1215 // Check for 16 bits table. If so, this is a limited-precision tone curve
1216 if (Curve ->nSegments == 0) {
1221 Out = cmsEvalToneCurve16(Curve, In);
1226 return (cmsFloat32Number) EvalSegmentedFn(Curve, v);
1230 cmsUInt16Number CMSEXPORT cmsEvalToneCurve16(const cmsToneCurve* Curve, cmsUInt16Number v)
1234 _cmsAssert(Curve != NULL);
1236 Curve ->InterpParams ->Interpolation.Lerp16(&v, &out, Curve ->InterpParams);
1242 // A mathematical procedure for finding the best-fitting curve to a given set of points by
1243 // minimizing the sum of the squares of the offsets ("the residuals") of the points from the curve.