[Webkit-unassigned] [Bug 186272] [GTK][WPE] Support JPEG 2000 images

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 23 03:24:21 PST 2019


--- Comment #21 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 359745
  --> https://bugs.webkit.org/attachment.cgi?id=359745

View in context: https://bugs.webkit.org/attachment.cgi?id=359745&action=review

>>> Source/WebCore/platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp:57
>>> +    *b = std::max(0, std::min(upb, y + static_cast<int>(1.772 * static_cast<float>(cb))));
>> Why not use matrix coefficients wholly, like it's done in the color_esycc_to_rgb() function in openjpeg?
>> Instead of std::min/std::max, you could consider using clampTo<>(), but keeping all of calculation in float.
>> So for r value, you'd have:
>>     r = static_cast<int>(clampTo<float>(y - 0.0000368 + 1.40199 * cr, 0, upb));
> I have no idea, this code is copied from OpenJPEG. I just used min/max instead of the ifs in the original code. I'll use clamp as you suggest.

color_esycc_to_rgb() is used when color space is OPJ_CLRSPC_EYCC. We don't support that one (yet).

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190123/ff1f2881/attachment.html>

More information about the webkit-unassigned mailing list