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:Peter Kasting <pkasting@chromium.org> Reviewed-by:
Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/master@{#758290}
Showing
This diff is collapsed.
Please register or sign in to comment