summaryrefslogtreecommitdiff
path: root/drivers/webp/enc/picture_tools.c
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2016-07-14 09:03:14 +0200
committerGitHub <noreply@github.com>2016-07-14 09:03:14 +0200
commit1f2110956b8f66fc3c6c89f74f0dfeb6c2265e45 (patch)
tree6232703f2e5ddeb2ff9bb6fda050f673aec6a402 /drivers/webp/enc/picture_tools.c
parent26baaf447abb85c7a1670141ffa6a41f3287601e (diff)
parente55c6f823251fcff366c7ce93b3ab0bf1fdedd68 (diff)
Merge pull request #5592 from volzhs/libwebp-0.5.1
Update webp driver to 0.5.1
Diffstat (limited to 'drivers/webp/enc/picture_tools.c')
-rw-r--r--drivers/webp/enc/picture_tools.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/webp/enc/picture_tools.c b/drivers/webp/enc/picture_tools.c
index 7c73646397..bf97af8408 100644
--- a/drivers/webp/enc/picture_tools.c
+++ b/drivers/webp/enc/picture_tools.c
@@ -11,6 +11,8 @@
//
// Author: Skal (pascal.massimino@gmail.com)
+#include <assert.h>
+
#include "./vp8enci.h"
#include "../dsp/yuv.h"
@@ -120,6 +122,24 @@ void WebPCleanupTransparentArea(WebPPicture* pic) {
#undef SIZE
#undef SIZE2
+void WebPCleanupTransparentAreaLossless(WebPPicture* const pic) {
+ int x, y, w, h;
+ uint32_t* argb;
+ assert(pic != NULL && pic->use_argb);
+ w = pic->width;
+ h = pic->height;
+ argb = pic->argb;
+
+ for (y = 0; y < h; ++y) {
+ for (x = 0; x < w; ++x) {
+ if ((argb[x] & 0xff000000) == 0) {
+ argb[x] = 0x00000000;
+ }
+ }
+ argb += pic->argb_stride;
+ }
+}
+
//------------------------------------------------------------------------------
// Blend color and remove transparency info