summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/blending.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/blending.cc')
-rw-r--r--third_party/jpeg-xl/lib/jxl/blending.cc14
1 files changed, 7 insertions, 7 deletions
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<ExtraChannelInfo>& 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<ExtraChannelInfo>& 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