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(
|
set_target_properties(
|
||||||
webp_js
|
webp_js
|
||||||
PROPERTIES LINK_FLAGS "-sWASM=0 \
|
PROPERTIES LINK_FLAGS "-sWASM=0 \
|
||||||
-sEXPORTED_FUNCTIONS=_WebpToSDL -sINVOKE_RUN=0 \
|
-sEXPORTED_FUNCTIONS=_WebPToSDL -sINVOKE_RUN=0 \
|
||||||
-sEXPORTED_RUNTIME_METHODS=cwrap")
|
-sEXPORTED_RUNTIME_METHODS=cwrap")
|
||||||
set_target_properties(webp_js PROPERTIES OUTPUT_NAME webp)
|
set_target_properties(webp_js PROPERTIES OUTPUT_NAME webp)
|
||||||
target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
|
target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
|
||||||
@ -662,7 +662,7 @@ if(WEBP_BUILD_WEBP_JS)
|
|||||||
set_target_properties(
|
set_target_properties(
|
||||||
webp_wasm
|
webp_wasm
|
||||||
PROPERTIES LINK_FLAGS "-sWASM=1 \
|
PROPERTIES LINK_FLAGS "-sWASM=1 \
|
||||||
-sEXPORTED_FUNCTIONS=_WebpToSDL -sINVOKE_RUN=0 \
|
-sEXPORTED_FUNCTIONS=_WebPToSDL -sINVOKE_RUN=0 \
|
||||||
-sEXPORTED_RUNTIME_METHODS=cwrap")
|
-sEXPORTED_RUNTIME_METHODS=cwrap")
|
||||||
target_compile_definitions(webp_wasm PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
|
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");
|
fprintf(stderr, "File too large.\n");
|
||||||
goto Error;
|
goto Error;
|
||||||
}
|
}
|
||||||
ok = WebpToSDL((const char*)webp, (int)webp_size);
|
ok = WebPToSDL((const char*)webp, (int)webp_size);
|
||||||
free((void*)webp);
|
free((void*)webp);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
WFPRINTF(stderr, "Error decoding file %s\n", (const W_CHAR*)file);
|
WFPRINTF(stderr, "Error decoding file %s\n", (const W_CHAR*)file);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int init_ok = 0;
|
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;
|
int ok = 0;
|
||||||
VP8StatusCode status;
|
VP8StatusCode status;
|
||||||
WebPDecoderConfig config;
|
WebPDecoderConfig config;
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#ifndef WEBP_EXTRAS_WEBP_TO_SDL_H_
|
#ifndef WEBP_EXTRAS_WEBP_TO_SDL_H_
|
||||||
#define 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.
|
// a WebP bitstream into an RGBA SDL surface.
|
||||||
// Return false on failure.
|
// 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_
|
#endif // WEBP_EXTRAS_WEBP_TO_SDL_H_
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
var WebpToCanvas;
|
var WebpToCanvas;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
WebpToCanvas = Module.cwrap('WebpToSDL', 'number', ['array', 'number']);
|
WebpToCanvas = Module.cwrap('WebPToSDL', 'number', ['array', 'number']);
|
||||||
}
|
}
|
||||||
window.onload = init;
|
window.onload = init;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ function decode(webp_data, canvas_id) {
|
|||||||
var result;
|
var result;
|
||||||
if (Module["asm"] != undefined) {
|
if (Module["asm"] != undefined) {
|
||||||
// wrapper for the function decoding a WebP into a canvas object
|
// 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
|
// get the canvas to decode into
|
||||||
var canvas = document.getElementById(canvas_id);
|
var canvas = document.getElementById(canvas_id);
|
||||||
if (canvas == null) return;
|
if (canvas == null) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user