color-lcms: relax cmlcms_fill_in_output_inv_eotf_vcgt()
Relax the types of color transformations categories where this function can be used. Yes, it is only useful for BLEND_TO_OUTPUT, but that is for the user of this function to take care of. This function always works as named regardless. The only condition is that output_inv_eotf_vcgt has been populated, so fill_in_curves() may as well assert that. While at it, make the code a little more concise. The 'len' assertion belongs in fill_in_curves() because that is where the problem would appear if the assertion failed. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
06d89fe192
commit
711b27797d
@ -59,6 +59,10 @@ fill_in_curves(cmsToneCurve *curves[3], float *values, unsigned len)
|
||||
unsigned i;
|
||||
cmsFloat32Number x;
|
||||
|
||||
assert(len > 1);
|
||||
for (i = 0; i < 3; i++)
|
||||
assert(curves[i]);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
x = (double)i / (len - 1);
|
||||
R_lut[i] = cmsEvalToneCurveFloat(curves[0], x);
|
||||
@ -72,13 +76,10 @@ cmlcms_fill_in_output_inv_eotf_vcgt(struct weston_color_transform *xform_base,
|
||||
float *values, unsigned len)
|
||||
{
|
||||
struct cmlcms_color_transform *xform = get_xform(xform_base);
|
||||
struct cmlcms_color_profile *p = xform->search_key.output_profile;
|
||||
|
||||
assert(xform->search_key.category == CMLCMS_CATEGORY_BLEND_TO_OUTPUT);
|
||||
|
||||
assert(len > 1);
|
||||
|
||||
fill_in_curves(xform->search_key.output_profile->output_inv_eotf_vcgt,
|
||||
values, len);
|
||||
assert(p && "output_profile");
|
||||
fill_in_curves(p->output_inv_eotf_vcgt, values, len);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user