mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
dwebp: move webp decoding to example_util
this will allow reuse by cwebp Change-Id: I667252fdacfc5436112d21b040ca299273ec1515
This commit is contained in:
@ -19,6 +19,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct WebPDecoderConfig;
|
||||
struct WebPBitstreamFeatures;
|
||||
|
||||
// Allocates storage for entire file 'file_name' and returns contents and size
|
||||
// in 'data' and 'data_size'. Returns 1 on success, 0 otherwise. '*data' should
|
||||
// be deleted using free().
|
||||
@ -35,6 +38,32 @@ int ExUtilReadFromStdin(const uint8_t** data, size_t* data_size);
|
||||
int ExUtilWriteFile(const char* const file_name,
|
||||
const uint8_t* data, size_t data_size);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// WebP decoding
|
||||
|
||||
// Prints an informative error message regarding decode failure of 'in_file'.
|
||||
// 'status' is treated as a VP8StatusCode and if valid will be printed as a
|
||||
// text string.
|
||||
void ExUtilPrintWebPError(const char* const in_file, int status);
|
||||
|
||||
// Reads a WebP from 'in_file', returning the contents and size in 'data' and
|
||||
// 'data_size'. 'bitstream' is populated using WebPGetFeatures().
|
||||
// Returns true on success.
|
||||
int ExUtilLoadWebP(const char* const in_file,
|
||||
const uint8_t** data, size_t* data_size,
|
||||
struct WebPBitstreamFeatures* bitstream);
|
||||
|
||||
// Decodes the WebP contained in 'data'. 'config' is a structure previously
|
||||
// initialized by WebPInitDecoderConfig(). 'config->output' should have the
|
||||
// desired colorspace selected. If 'incremental' is set to true the WebP
|
||||
// incremental decoder will be used. 'verbose' will cause decode timing to be
|
||||
// reported.
|
||||
// Returns the decoder status. On success 'config->output' will contain the
|
||||
// decoded picture.
|
||||
enum VP8StatusCode ExUtilDecodeWebP(const uint8_t* const data, size_t data_size,
|
||||
int incremental, int verbose,
|
||||
struct WebPDecoderConfig* const config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user