introduce a generic WebPPictureHasTransparency() function

VP8-lossy will now avoid writing an ALPH chunk if the
alpha values are trivial.

+ changed DumpPicture() accordingly in cwebp
+ prevented the -d option to be active with lossless
 (DumpPicture wouldn't work).

Change-Id: I34fdb108a2b6207e93fa6cd00b1d2509a8e1dc4b
This commit is contained in:
Pascal Massimino
2012-06-04 15:50:05 -07:00
parent d2b6c6c03b
commit 437999fb77
5 changed files with 41 additions and 13 deletions

View File

@ -293,6 +293,11 @@ WEBP_EXTERN(int) WebPPictureImportBGRA(
// area, to help compressibility (no guarantee, though).
WEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* const picture);
// Scan the picture 'pic' for the presence of non fully opaque alpha values.
// Returns true in such case. Otherwise returns false (indicating that the
// alpha plane can be ignored altogether e.g.).
WEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* const pic);
//------------------------------------------------------------------------------
// Main call