Merge changes I6a4d0a04,Ibc37b91e into main

* changes:
  decode.h: wrap idec example in /* */
  decode.h: fix decode example
This commit is contained in:
James Zern 2023-08-18 00:38:04 +00:00 committed by Gerrit Code Review
commit 943b932a7e

View File

@ -251,23 +251,24 @@ typedef enum VP8StatusCode {
// WebPIDecoder object. This object can be left in a SUSPENDED state if the
// picture is only partially decoded, pending additional input.
// Code example:
//
// WebPInitDecBuffer(&output_buffer);
// output_buffer.colorspace = mode;
// ...
// WebPIDecoder* idec = WebPINewDecoder(&output_buffer);
// while (additional_data_is_available) {
// // ... (get additional data in some new_data[] buffer)
// status = WebPIAppend(idec, new_data, new_data_size);
// if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) {
// break; // an error occurred.
// }
//
// // The above call decodes the current available buffer.
// // Part of the image can now be refreshed by calling
// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc.
// }
// WebPIDelete(idec);
/*
WebPInitDecBuffer(&output_buffer);
output_buffer.colorspace = mode;
...
WebPIDecoder* idec = WebPINewDecoder(&output_buffer);
while (additional_data_is_available) {
// ... (get additional data in some new_data[] buffer)
status = WebPIAppend(idec, new_data, new_data_size);
if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) {
break; // an error occurred.
}
// The above call decodes the current available buffer.
// Part of the image can now be refreshed by calling
// WebPIDecGetRGB()/WebPIDecGetYUVA() etc.
}
WebPIDelete(idec);
*/
// Creates a new incremental decoder with the supplied buffer parameter.
// This output_buffer can be passed NULL, in which case a default output buffer
@ -389,7 +390,7 @@ WEBP_EXTERN const WebPDecBuffer* WebPIDecodedArea(
CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK);
// C) Adjust 'config', if needed
config.no_fancy_upsampling = 1;
config.options.no_fancy_upsampling = 1;
config.output.colorspace = MODE_BGRA;
// etc.