(function() { const __exports = {}; let wasm; let cachegetUint8Memory = null; function getUint8Memory() { if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) { cachegetUint8Memory = new Uint8Array(wasm.memory.buffer); } return cachegetUint8Memory; } let WASM_VECTOR_LEN = 0; function passArray8ToWasm(arg) { const ptr = wasm.__wbindgen_malloc(arg.length * 1); getUint8Memory().set(arg, ptr / 1); WASM_VECTOR_LEN = arg.length; return ptr; } let cachegetInt32Memory = null; function getInt32Memory() { if (cachegetInt32Memory === null || cachegetInt32Memory.buffer !== wasm.memory.buffer) { cachegetInt32Memory = new Int32Array(wasm.memory.buffer); } return cachegetInt32Memory; } function getArrayU8FromWasm(ptr, len) { return getUint8Memory().subarray(ptr / 1, ptr / 1 + len); } /** * @param {Uint8Array} input_image * @param {number} input_width * @param {number} input_height * @param {number} output_width * @param {number} output_height * @param {number} typ_idx * @param {boolean} premultiply * @param {boolean} color_space_conversion * @returns {Uint8Array} */ __exports.resize = function(input_image, input_width, input_height, output_width, output_height, typ_idx, premultiply, color_space_conversion) { const retptr = 8; const ret = wasm.resize(retptr, passArray8ToWasm(input_image), WASM_VECTOR_LEN, input_width, input_height, output_width, output_height, typ_idx, premultiply, color_space_conversion); const memi32 = getInt32Memory(); const v0 = getArrayU8FromWasm(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1]).slice(); wasm.__wbindgen_free(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1] * 1); return v0; }; function init(module) { let result; const imports = {}; if (module instanceof URL || typeof module === 'string' || module instanceof Request) { const response = fetch(module); if (typeof WebAssembly.instantiateStreaming === 'function') { result = WebAssembly.instantiateStreaming(response, imports) .catch(e => { console.warn("`WebAssembly.instantiateStreaming` failed. Assuming this is because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); return response .then(r => r.arrayBuffer()) .then(bytes => WebAssembly.instantiate(bytes, imports)); }); } else { result = response .then(r => r.arrayBuffer()) .then(bytes => WebAssembly.instantiate(bytes, imports)); } } else { result = WebAssembly.instantiate(module, imports) .then(result => { if (result instanceof WebAssembly.Instance) { return { instance: result, module }; } else { return result; } }); } return result.then(({instance, module}) => { wasm = instance.exports; init.__wbindgen_wasm_module = module; return wasm; }); } self.wasm_bindgen = Object.assign(init, __exports); })();