Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2208)

Unified Diff: third_party/libwebp/enc/picture.c

Issue 10496016: Add RGBX BGRX support to WEBPImportPicture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/libwebp/enc/picture.c
diff --git a/third_party/libwebp/enc/picture.c b/third_party/libwebp/enc/picture.c
index 2f3c96e8ef0f3082abc6029826627f29c74aa650..9c8e06c70dd6594f4ff2c968b847616f5a312d2f 100644
--- a/third_party/libwebp/enc/picture.c
+++ b/third_party/libwebp/enc/picture.c
@@ -593,6 +593,22 @@ int WebPPictureImportBGRA(WebPPicture* const picture,
return Import(picture, rgba, rgba_stride, 4, 1, 1);
}
+int WebPPictureImportRGBX(WebPPicture* const picture,
+ const uint8_t* const rgbx, int rgbx_stride) {
+ // In libwebp.next, assert picture->user_argb_input here.
skal 2012/06/04 04:34:55 not necessarily. What if you want to convert to YU
+ picture->colorspace &= ~WEBP_CSP_ALPHA_BIT;
+ if (!WebPPictureAlloc(picture)) return 0;
+ return Import(picture, rgbx, rgbx_stride, 4, 0, 0);
+}
+
+int WebPPictureImportBGRX(WebPPicture* const picture,
+ const uint8_t* const rgbx, int rgbx_stride) {
+ // In libwebp.next, assert picture->user_argb_input here.
skal 2012/06/04 04:34:55 here too
+ picture->colorspace &= ~WEBP_CSP_ALPHA_BIT;
+ if (!WebPPictureAlloc(picture)) return 0;
+ return Import(picture, rgbx, rgbx_stride, 4, 1, 0);
+}
+
//------------------------------------------------------------------------------
// Simplest call:

Powered by Google App Engine
This is Rietveld 408576698