| OLD | NEW |
| 1 // Copyright 2011 Google Inc. | 1 // Copyright 2011 Google Inc. |
| 2 // | 2 // |
| 3 // This code is licensed under the same terms as WebM: | 3 // This code is licensed under the same terms as WebM: |
| 4 // Software License Agreement: http://www.webmproject.org/license/software/ | 4 // Software License Agreement: http://www.webmproject.org/license/software/ |
| 5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ | 5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ |
| 6 // ----------------------------------------------------------------------------- | 6 // ----------------------------------------------------------------------------- |
| 7 // | 7 // |
| 8 // WebP encoder: main interface | 8 // WebP encoder: main interface |
| 9 // | 9 // |
| 10 // Author: Skal (pascal.massimino@gmail.com) | 10 // Author: Skal (pascal.massimino@gmail.com) |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // Returns false in case of error (invalid parameter or insufficient memory). | 242 // Returns false in case of error (invalid parameter or insufficient memory). |
| 243 WEBP_EXTERN(int) WebPPictureRescale(WebPPicture* const pic, | 243 WEBP_EXTERN(int) WebPPictureRescale(WebPPicture* const pic, |
| 244 int width, int height); | 244 int width, int height); |
| 245 | 245 |
| 246 // Colorspace conversion function to import RGB samples. | 246 // Colorspace conversion function to import RGB samples. |
| 247 // Previous buffer will be free'd, if any. | 247 // Previous buffer will be free'd, if any. |
| 248 // *rgb buffer should have a size of at least height * rgb_stride. | 248 // *rgb buffer should have a size of at least height * rgb_stride. |
| 249 // Returns 0 in case of memory error. | 249 // Returns 0 in case of memory error. |
| 250 WEBP_EXTERN(int) WebPPictureImportRGB( | 250 WEBP_EXTERN(int) WebPPictureImportRGB( |
| 251 WebPPicture* const picture, const uint8_t* const rgb, int rgb_stride); | 251 WebPPicture* const picture, const uint8_t* const rgb, int rgb_stride); |
| 252 // Same, but for RGBA buffer | 252 // Same, but for RGBA buffer. |
| 253 WEBP_EXTERN(int) WebPPictureImportRGBA( | 253 WEBP_EXTERN(int) WebPPictureImportRGBA( |
| 254 WebPPicture* const picture, const uint8_t* const rgba, int rgba_stride); | 254 WebPPicture* const picture, const uint8_t* const rgba, int rgba_stride); |
| 255 // Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format |
| 256 // input buffer ignoring the alpha channel. Avoids needing to copy the data |
| 257 // to a temporary 24-bit RGB buffer to import the RGB only. |
| 258 WEBP_EXTERN(int) WebPPictureImportRGBX( |
| 259 WebPPicture* const picture, const uint8_t* const rgbx, int rgbx_stride); |
| 255 | 260 |
| 256 // Variant of the above, but taking BGR(A) input: | 261 // Variants of the above, but taking BGR(A|X) input. |
| 257 WEBP_EXTERN(int) WebPPictureImportBGR( | 262 WEBP_EXTERN(int) WebPPictureImportBGR( |
| 258 WebPPicture* const picture, const uint8_t* const bgr, int bgr_stride); | 263 WebPPicture* const picture, const uint8_t* const bgr, int bgr_stride); |
| 259 WEBP_EXTERN(int) WebPPictureImportBGRA( | 264 WEBP_EXTERN(int) WebPPictureImportBGRA( |
| 260 WebPPicture* const picture, const uint8_t* const bgra, int bgra_stride); | 265 WebPPicture* const picture, const uint8_t* const bgra, int bgra_stride); |
| 266 WEBP_EXTERN(int) WebPPictureImportBGRX( |
| 267 WebPPicture* const picture, const uint8_t* const bgrx, int bgrx_stride); |
| 261 | 268 |
| 262 //------------------------------------------------------------------------------ | 269 //------------------------------------------------------------------------------ |
| 263 // Main call | 270 // Main call |
| 264 | 271 |
| 265 // Main encoding call, after config and picture have been initialized. | 272 // Main encoding call, after config and picture have been initialized. |
| 266 // 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), | 273 // 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), |
| 267 // and the 'config' object must be a valid one. | 274 // and the 'config' object must be a valid one. |
| 268 // Returns false in case of error, true otherwise. | 275 // Returns false in case of error, true otherwise. |
| 269 // In case of error, picture->error_code is updated accordingly. | 276 // In case of error, picture->error_code is updated accordingly. |
| 270 WEBP_EXTERN(int) WebPEncode( | 277 WEBP_EXTERN(int) WebPEncode( |
| 271 const WebPConfig* const config, WebPPicture* const picture); | 278 const WebPConfig* const config, WebPPicture* const picture); |
| 272 | 279 |
| 273 //------------------------------------------------------------------------------ | 280 //------------------------------------------------------------------------------ |
| 274 | 281 |
| 275 #if defined(__cplusplus) || defined(c_plusplus) | 282 #if defined(__cplusplus) || defined(c_plusplus) |
| 276 } // extern "C" | 283 } // extern "C" |
| 277 #endif | 284 #endif |
| 278 | 285 |
| 279 #endif /* WEBP_WEBP_ENCODE_H_ */ | 286 #endif /* WEBP_WEBP_ENCODE_H_ */ |
| OLD | NEW |