mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
add WebPPictureImportRGBX() and WebPPictureImportBGRX()
When importing BGRA or RGBA data for encoding, provide variants of the WEBPImportPicture API for RGBX and BRGX data meaning the alpha channel should be ignored. Author: noel@chromium.org from Chromium patch: https://chromiumcodereview.appspot.com/10496016/ Change-Id: I15fcaa4160c69a2b5549394204b6e6d7a1c5d333
This commit is contained in:
committed by
Pascal Massimino
parent
437999fb77
commit
27519bc2b6
@ -604,6 +604,16 @@ int WebPPictureImportBGRA(WebPPicture* const picture,
|
||||
return Import(picture, rgba, rgba_stride, 4, 1, 1);
|
||||
}
|
||||
|
||||
int WebPPictureImportRGBX(WebPPicture* const picture,
|
||||
const uint8_t* const rgba, int rgba_stride) {
|
||||
return Import(picture, rgba, rgba_stride, 4, 0, 0);
|
||||
}
|
||||
|
||||
int WebPPictureImportBGRX(WebPPicture* const picture,
|
||||
const uint8_t* const rgba, int rgba_stride) {
|
||||
return Import(picture, rgba, rgba_stride, 4, 1, 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helper: clean up fully transparent area to help compressibility.
|
||||
|
||||
|
Reference in New Issue
Block a user