Commit 6150fcb9 authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Commit Bot

Add the YUVAToRGBA template function.

Replace the four very similar conversion functions (YUVAToBGRA8888,
YAToMono8888, YUVAToRGBAHalfFloat, YAToMonoHalfFloat) with the
YUVAToRGBA template function, with the color_type (kMono or kColor),
InputType (uint8_t or uint16_t), and OutputType (uint32_t or uint64_t)
template parameters. This avoids code duplication and was suggested by
Peter Kasting.

Also remove the pixel.Scale(alpha / max_channel) call in YUVAToBGRA8888.
It might be left over from Dale's attempts to get alpha right, i.e.,
forcing premultiply alpha.

Bug: 960620
Change-Id: Ibc8dd429d6360f7dc5f37721f1fb2b67d8ec0d2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2142341
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758290}
parent 71793db7
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment