mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 05:38:05 +02:00
color-lcms: properly print 16-bit sampled curves
There's a case we were missing when printing the tone curves: the ones with zero segments. These are 16-bit sampled curves. Start taking them into account. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
parent
4a40ae7718
commit
625a74d369
1 changed files with 19 additions and 3 deletions
|
|
@ -221,19 +221,35 @@ static void
|
|||
curve_print(const cmsToneCurve *curve, struct weston_log_scope *scope)
|
||||
{
|
||||
const cmsCurveSegment *seg;
|
||||
cmsUInt32Number n_entries;
|
||||
unsigned int i;
|
||||
|
||||
weston_log_scope_printf(scope, "%*sSegments\n", 9, "");
|
||||
|
||||
for (i = 0; ; i++) {
|
||||
seg = cmsGetToneCurveSegment(i, curve);
|
||||
if (!seg)
|
||||
break;
|
||||
|
||||
if (i == 0)
|
||||
weston_log_scope_printf(scope, "%*sSegments\n", 9, "");
|
||||
|
||||
segment_print(seg, scope);
|
||||
}
|
||||
if (i > 0)
|
||||
return;
|
||||
|
||||
if (i == 0)
|
||||
n_entries = cmsGetToneCurveEstimatedTableEntries(curve);
|
||||
|
||||
/* We have a curve with 0 segments and 0 entries... we are not expecting
|
||||
* seeing this case. */
|
||||
if (n_entries <= 0) {
|
||||
weston_log_scope_printf(scope, "%*sNo segments\n", 12, "");
|
||||
return;
|
||||
}
|
||||
|
||||
/* We have a curve with 0 segments but n_entries > 0. That's a 16-bit
|
||||
* sampled curve. */
|
||||
weston_log_scope_printf(scope, "%*sNo segments, 16-bit sampled curve " \
|
||||
"with %u samples\n", 12, "", n_entries);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue