mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
extras: WebpToSDL -> WebPToSDL
this normalizes the function case to what's more commonly used in the project Change-Id: If614cb8eff4afba96b2468e28c52d850651a759b
This commit is contained in:
parent
1d58575b18
commit
ed92a62649
@ -649,7 +649,7 @@ if(WEBP_BUILD_WEBP_JS)
|
||||
set_target_properties(
|
||||
webp_js
|
||||
PROPERTIES LINK_FLAGS "-sWASM=0 \
|
||||
-sEXPORTED_FUNCTIONS=_WebpToSDL -sINVOKE_RUN=0 \
|
||||
-sEXPORTED_FUNCTIONS=_WebPToSDL -sINVOKE_RUN=0 \
|
||||
-sEXPORTED_RUNTIME_METHODS=cwrap")
|
||||
set_target_properties(webp_js PROPERTIES OUTPUT_NAME webp)
|
||||
target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
|
||||
@ -662,7 +662,7 @@ if(WEBP_BUILD_WEBP_JS)
|
||||
set_target_properties(
|
||||
webp_wasm
|
||||
PROPERTIES LINK_FLAGS "-sWASM=1 \
|
||||
-sEXPORTED_FUNCTIONS=_WebpToSDL -sINVOKE_RUN=0 \
|
||||
-sEXPORTED_FUNCTIONS=_WebPToSDL -sINVOKE_RUN=0 \
|
||||
-sEXPORTED_RUNTIME_METHODS=cwrap")
|
||||
target_compile_definitions(webp_wasm PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
|
||||
|
||||
|
@ -75,7 +75,7 @@ int main(int argc, char* argv[]) {
|
||||
fprintf(stderr, "File too large.\n");
|
||||
goto Error;
|
||||
}
|
||||
ok = WebpToSDL((const char*)webp, (int)webp_size);
|
||||
ok = WebPToSDL((const char*)webp, (int)webp_size);
|
||||
free((void*)webp);
|
||||
if (!ok) {
|
||||
WFPRINTF(stderr, "Error decoding file %s\n", (const W_CHAR*)file);
|
||||
|
@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
static int init_ok = 0;
|
||||
int WebpToSDL(const char* data, unsigned int data_size) {
|
||||
int WebPToSDL(const char* data, unsigned int data_size) {
|
||||
int ok = 0;
|
||||
VP8StatusCode status;
|
||||
WebPDecoderConfig config;
|
||||
|
@ -14,9 +14,9 @@
|
||||
#ifndef WEBP_EXTRAS_WEBP_TO_SDL_H_
|
||||
#define WEBP_EXTRAS_WEBP_TO_SDL_H_
|
||||
|
||||
// Exports the method WebpToSDL(const char* data, int data_size) which decodes
|
||||
// Exports the method WebPToSDL(const char* data, int data_size) which decodes
|
||||
// a WebP bitstream into an RGBA SDL surface.
|
||||
// Return false on failure.
|
||||
extern int WebpToSDL(const char* data, unsigned int data_size);
|
||||
extern int WebPToSDL(const char* data, unsigned int data_size);
|
||||
|
||||
#endif // WEBP_EXTRAS_WEBP_TO_SDL_H_
|
||||
|
@ -18,7 +18,7 @@
|
||||
var WebpToCanvas;
|
||||
|
||||
function init() {
|
||||
WebpToCanvas = Module.cwrap('WebpToSDL', 'number', ['array', 'number']);
|
||||
WebpToCanvas = Module.cwrap('WebPToSDL', 'number', ['array', 'number']);
|
||||
}
|
||||
window.onload = init;
|
||||
|
||||
|
@ -34,7 +34,7 @@ function decode(webp_data, canvas_id) {
|
||||
var result;
|
||||
if (Module["asm"] != undefined) {
|
||||
// wrapper for the function decoding a WebP into a canvas object
|
||||
WebpToCanvas = Module.cwrap('WebpToSDL', 'number', ['array', 'number']);
|
||||
WebpToCanvas = Module.cwrap('WebPToSDL', 'number', ['array', 'number']);
|
||||
// get the canvas to decode into
|
||||
var canvas = document.getElementById(canvas_id);
|
||||
if (canvas == null) return;
|
||||
|
Loading…
Reference in New Issue
Block a user