OLD | NEW |
1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
9 // | 9 // |
10 // WebP encoder: main interface | 10 // WebP encoder: main interface |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 WebPPicture* picture, WebPEncCSP colorspace, float dithering); | 474 WebPPicture* picture, WebPEncCSP colorspace, float dithering); |
475 | 475 |
476 // Performs 'smart' RGBA->YUVA420 downsampling and colorspace conversion. | 476 // Performs 'smart' RGBA->YUVA420 downsampling and colorspace conversion. |
477 // Downsampling is handled with extra care in case of color clipping. This | 477 // Downsampling is handled with extra care in case of color clipping. This |
478 // method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better | 478 // method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better |
479 // YUV representation. | 479 // YUV representation. |
480 // Returns false in case of error. | 480 // Returns false in case of error. |
481 WEBP_EXTERN(int) WebPPictureSmartARGBToYUVA(WebPPicture* picture); | 481 WEBP_EXTERN(int) WebPPictureSmartARGBToYUVA(WebPPicture* picture); |
482 | 482 |
483 // Converts picture->yuv to picture->argb and sets picture->use_argb to true. | 483 // Converts picture->yuv to picture->argb and sets picture->use_argb to true. |
484 // The input format must be YUV_420 or YUV_420A. | 484 // The input format must be YUV_420 or YUV_420A. The conversion from YUV420 to |
485 // Note that the use of this method is discouraged if one has access to the | 485 // ARGB incurs a small loss too. |
486 // raw ARGB samples, since using YUV420 is comparatively lossy. Also, the | 486 // Note that the use of this colorspace is discouraged if one has access to the |
487 // conversion from YUV420 to ARGB incurs a small loss too. | 487 // raw ARGB samples, since using YUV420 is comparatively lossy. |
488 // Returns false in case of error. | 488 // Returns false in case of error. |
489 WEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture); | 489 WEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture); |
490 | 490 |
491 // Helper function: given a width x height plane of RGBA or YUV(A) samples | 491 // Helper function: given a width x height plane of RGBA or YUV(A) samples |
492 // clean-up the YUV or RGB samples under fully transparent area, to help | 492 // clean-up the YUV or RGB samples under fully transparent area, to help |
493 // compressibility (no guarantee, though). | 493 // compressibility (no guarantee, though). |
494 WEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture); | 494 WEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture); |
495 | 495 |
496 // Scan the picture 'picture' for the presence of non fully opaque alpha values. | 496 // Scan the picture 'picture' for the presence of non fully opaque alpha values. |
497 // Returns true in such case. Otherwise returns false (indicating that the | 497 // Returns true in such case. Otherwise returns false (indicating that the |
(...skipping 20 matching lines...) Expand all Loading... |
518 // another is provided but they both incur some loss. | 518 // another is provided but they both incur some loss. |
519 WEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture); | 519 WEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture); |
520 | 520 |
521 //------------------------------------------------------------------------------ | 521 //------------------------------------------------------------------------------ |
522 | 522 |
523 #ifdef __cplusplus | 523 #ifdef __cplusplus |
524 } // extern "C" | 524 } // extern "C" |
525 #endif | 525 #endif |
526 | 526 |
527 #endif /* WEBP_WEBP_ENCODE_H_ */ | 527 #endif /* WEBP_WEBP_ENCODE_H_ */ |
OLD | NEW |