summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libwebp/src/dsp/alpha_processing.c
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2021-02-18 15:58:00 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2021-03-01 14:20:32 +0100
commit59aaed8409c1f3da2df426eba06d682d6bd7ec9b (patch)
tree10d17cecd1cc954107839c9564824938ae1a72c0 /src/3rdparty/libwebp/src/dsp/alpha_processing.c
parent879601802798ac253a68e91bcd78d9c2e3f24011 (diff)
Update bundled libwebp to version 1.2.0
[ChangeLog][Third-Party Code] Update bundled libwebp to version 1.2.0 Pick-to: 6.1 6.0 5.15 5.12 Change-Id: Idb95b278c613361d82ea32bd9f591fbe87bfe66f Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/3rdparty/libwebp/src/dsp/alpha_processing.c')
-rw-r--r--src/3rdparty/libwebp/src/dsp/alpha_processing.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/3rdparty/libwebp/src/dsp/alpha_processing.c b/src/3rdparty/libwebp/src/dsp/alpha_processing.c
index 819d139..3a27990 100644
--- a/src/3rdparty/libwebp/src/dsp/alpha_processing.c
+++ b/src/3rdparty/libwebp/src/dsp/alpha_processing.c
@@ -359,6 +359,11 @@ static int HasAlpha32b_C(const uint8_t* src, int length) {
return 0;
}
+static void AlphaReplace_C(uint32_t* src, int length, uint32_t color) {
+ int x;
+ for (x = 0; x < length; ++x) if ((src[x] >> 24) == 0) src[x] = color;
+}
+
//------------------------------------------------------------------------------
// Simple channel manipulations.
@@ -400,6 +405,7 @@ void (*WebPPackRGB)(const uint8_t* r, const uint8_t* g, const uint8_t* b,
int (*WebPHasAlpha8b)(const uint8_t* src, int length);
int (*WebPHasAlpha32b)(const uint8_t* src, int length);
+void (*WebPAlphaReplace)(uint32_t* src, int length, uint32_t color);
//------------------------------------------------------------------------------
// Init function
@@ -428,6 +434,7 @@ WEBP_DSP_INIT_FUNC(WebPInitAlphaProcessing) {
WebPHasAlpha8b = HasAlpha8b_C;
WebPHasAlpha32b = HasAlpha32b_C;
+ WebPAlphaReplace = AlphaReplace_C;
// If defined, use CPUInfo() to overwrite some pointers with faster versions.
if (VP8GetCPUInfo != NULL) {
@@ -469,4 +476,5 @@ WEBP_DSP_INIT_FUNC(WebPInitAlphaProcessing) {
assert(WebPPackRGB != NULL);
assert(WebPHasAlpha8b != NULL);
assert(WebPHasAlpha32b != NULL);
+ assert(WebPAlphaReplace != NULL);
}