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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 again, RGBA buffer, ignoring the alpha channel | |
skal
2012/06/04 04:34:55
you can add a comment about why this is useful com
| |
256 WEBP_EXTERN(int) WebPPictureImportRGBX( | |
257 WebPPicture* const picture, const uint8_t* const rgbx, int rgbx_stride); | |
255 | 258 |
256 // Variant of the above, but taking BGR(A) input: | 259 // Variant of the above, but taking BGR(A) input |
257 WEBP_EXTERN(int) WebPPictureImportBGR( | 260 WEBP_EXTERN(int) WebPPictureImportBGR( |
258 WebPPicture* const picture, const uint8_t* const bgr, int bgr_stride); | 261 WebPPicture* const picture, const uint8_t* const bgr, int bgr_stride); |
259 WEBP_EXTERN(int) WebPPictureImportBGRA( | 262 WEBP_EXTERN(int) WebPPictureImportBGRA( |
260 WebPPicture* const picture, const uint8_t* const bgra, int bgra_stride); | 263 WebPPicture* const picture, const uint8_t* const bgra, int bgra_stride); |
264 WEBP_EXTERN(int) WebPPictureImportBGRX( | |
265 WebPPicture* const picture, const uint8_t* const bgrx, int bgrx_stride); | |
261 | 266 |
262 //------------------------------------------------------------------------------ | 267 //------------------------------------------------------------------------------ |
263 // Main call | 268 // Main call |
264 | 269 |
265 // Main encoding call, after config and picture have been initialized. | 270 // Main encoding call, after config and picture have been initialized. |
266 // 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), | 271 // 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), |
267 // and the 'config' object must be a valid one. | 272 // and the 'config' object must be a valid one. |
268 // Returns false in case of error, true otherwise. | 273 // Returns false in case of error, true otherwise. |
269 // In case of error, picture->error_code is updated accordingly. | 274 // In case of error, picture->error_code is updated accordingly. |
270 WEBP_EXTERN(int) WebPEncode( | 275 WEBP_EXTERN(int) WebPEncode( |
271 const WebPConfig* const config, WebPPicture* const picture); | 276 const WebPConfig* const config, WebPPicture* const picture); |
272 | 277 |
273 //------------------------------------------------------------------------------ | 278 //------------------------------------------------------------------------------ |
274 | 279 |
275 #if defined(__cplusplus) || defined(c_plusplus) | 280 #if defined(__cplusplus) || defined(c_plusplus) |
276 } // extern "C" | 281 } // extern "C" |
277 #endif | 282 #endif |
278 | 283 |
279 #endif /* WEBP_WEBP_ENCODE_H_ */ | 284 #endif /* WEBP_WEBP_ENCODE_H_ */ |
OLD | NEW |