From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- third_party/jpeg-xl/lib/jxl/blending.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'third_party/jpeg-xl/lib/jxl/blending.cc') diff --git a/third_party/jpeg-xl/lib/jxl/blending.cc b/third_party/jpeg-xl/lib/jxl/blending.cc index ccb168ee45..7575ec6e4a 100644 --- a/third_party/jpeg-xl/lib/jxl/blending.cc +++ b/third_party/jpeg-xl/lib/jxl/blending.cc @@ -6,7 +6,6 @@ #include "lib/jxl/blending.h" #include "lib/jxl/alpha.h" -#include "lib/jxl/image_ops.h" namespace jxl { @@ -29,11 +28,11 @@ bool NeedsBlending(const FrameHeader& frame_header) { return true; } -void PerformBlending(const float* const* bg, const float* const* fg, - float* const* out, size_t x0, size_t xsize, - const PatchBlending& color_blending, - const PatchBlending* ec_blending, - const std::vector& extra_channel_info) { +Status PerformBlending( + const float* const* bg, const float* const* fg, float* const* out, + size_t x0, size_t xsize, const PatchBlending& color_blending, + const PatchBlending* ec_blending, + const std::vector& extra_channel_info) { bool has_alpha = false; size_t num_ec = extra_channel_info.size(); for (size_t i = 0; i < num_ec; i++) { @@ -42,7 +41,7 @@ void PerformBlending(const float* const* bg, const float* const* fg, break; } } - ImageF tmp(xsize, 3 + num_ec); + JXL_ASSIGN_OR_RETURN(ImageF tmp, ImageF::Create(xsize, 3 + num_ec)); // Blend extra channels first so that we use the pre-blending alpha. for (size_t i = 0; i < num_ec; i++) { if (ec_blending[i].mode == PatchBlendMode::kAdd) { @@ -146,6 +145,7 @@ void PerformBlending(const float* const* bg, const float* const* fg, for (size_t i = 0; i < 3 + num_ec; i++) { if (xsize != 0) memcpy(out[i] + x0, tmp.Row(i), xsize * sizeof(**out)); } + return true; } } // namespace jxl -- cgit v1.2.3