Commits on Source (7)
-
When we don't have cmsGetToneCurveSegment() at disposal, we are not able to inspect the LittleCMS color curves and convert them to Weston's internal representation of color curves. In such case, we need to fallback to a more generic solution (using LUT's). For now we always fallback to the LUT's, but in the next commits we'll add support to inspect the curves and convert them to the internal representations that we'll add. This will allow us to tweak the tolerance in the color-icc-output tests. But if we continue running these tests for systems without cmsGetToneCurveSegment() at disposal, they may fail. We already have a LittleCMS version in the CI that has cmsGetToneCurveSegment(). So skip color-icc-output when we don't have this function. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
5ddbdb7a -
Not a behavior change, but this allow us to decide what function pointer to use within this function (instead of forcing callers to decide that). In the following commits this will be helpful. We'll add more curves besides 3x1D LUT's and, depending on the curve, the function pointer signature may differ. Also, we now pass the xform directly to the function, and it can select the curves depending if it is being called for a pre or a post curve. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
80d97db8 -
Currently in translate_curve_element() we always translate the curve into a LUT. But in the future we'll be able to translate the curves to parametric ones. So move the current code to a new function translate_curve_element_LUT(), so that in translate_curve_element() we are able to call one of the two functions (_LUT() or _parametric()). No behavior changes, just preparation for the upcoming patches. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
aff6029d -
Given a certain curveset, get_parametric_curveset_params() returns true if the curveset contains parametric curves. Also, it returns the parameters of the curveset (for each curve) and if the input should be clamped or not. This is not a generic function, it will specifically work for some well behaved curveset. E.g. we return false if there are more than 3 curves (one per color channel). Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
aee3e313 -
In the next commit we'll add support for more color curves. So move lut_3x1d to an union. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
d9e2eca1 -
Until now, all the curves would be represented with 3x1D LUT's. Now we support LINPOW and POWLIN curves (arbitrary names that we've picked). We can use these curves to represent LittleCMS curves type 1, 4 and their inverses -1, -4. The reason why we want that is because we gain precision using the parametric curves (compared to the LUT's); Surprisingly we had to increase the tolerance of the sRGB->adobeRGB MAT test. Our analysis is that the inverse EOTF power-law curve with exponent 1.0 / 2.2 amplifies errors more than the LUT, specially for input (optical) values closer to zero. That makes sense, because this curve is more sensible to input values closer to zero (i.e. little input variation results in lots of output variation). And this model makes sense, as humans are more capable of perceiving changes of light intensity in the dark. But the downside of all that is that for input values closer to zero, a little bit of noise increases significantly the error. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
9002667a -
On commit "color: add support to parametric curves in weston_color_curve" we've added support for some parametric curves in Weston. This helped us to be more precise in some cases in which we'd have to fallback to LUT's otherwise. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
de8e3168