aboutsummaryrefslogtreecommitdiff
path: root/drivers/webp/enc/picture_tools.c
diff options
context:
space:
mode:
authorvolzhs2016-07-08 19:29:58 +0900
committervolzhs2016-07-08 21:44:40 +0900
commitddd446f274d33d8624da3fd842c23e9ede0e6b11 (patch)
treef3b5de16472af57350b4f1de8d40b64365423b90 /drivers/webp/enc/picture_tools.c
parentdc58be9f3542d640771722187959f56f042b5baa (diff)
downloadgodot-ddd446f274d33d8624da3fd842c23e9ede0e6b11.tar.gz
godot-ddd446f274d33d8624da3fd842c23e9ede0e6b11.tar.zst
godot-ddd446f274d33d8624da3fd842c23e9ede0e6b11.zip
Update webp driver to 0.5.1 (upstream)
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 7c7364639..bf97af840 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