Keep planarized reference image around across runs
This commit is contained in:
16
cli/index.js
16
cli/index.js
@ -24,10 +24,16 @@ async function optimize(bitmapIn, encode, decode) {
|
||||
let bitmapOut;
|
||||
let binaryOut;
|
||||
|
||||
const { visdif } = await visdifModule();
|
||||
const { VisDiff } = await visdifModule();
|
||||
const comparator = new VisDiff(
|
||||
bitmapIn.data,
|
||||
bitmapIn.width,
|
||||
bitmapIn.height
|
||||
);
|
||||
do {
|
||||
binaryOut = await encode(bitmapIn, quality);
|
||||
bitmapOut = await decode(binaryOut);
|
||||
butteraugliDistance = comparator.distance(bitmapOut.data);
|
||||
console.log({
|
||||
butteraugliDistance,
|
||||
quality,
|
||||
@ -35,12 +41,6 @@ async function optimize(bitmapIn, encode, decode) {
|
||||
binaryOut,
|
||||
bitmapOut
|
||||
});
|
||||
butteraugliDistance = visdif(
|
||||
bitmapIn.data,
|
||||
bitmapOut.data,
|
||||
bitmapIn.width,
|
||||
bitmapIn.height
|
||||
);
|
||||
if (butteraugliDistance > butteraugliGoal) {
|
||||
quality += inc;
|
||||
} else {
|
||||
@ -53,6 +53,8 @@ async function optimize(bitmapIn, encode, decode) {
|
||||
attempts < maxRounds
|
||||
);
|
||||
|
||||
comparator.delete();
|
||||
|
||||
return {
|
||||
bitmap: bitmapOut,
|
||||
binary: binaryOut,
|
||||
|
@ -5,50 +5,57 @@
|
||||
using namespace emscripten;
|
||||
using namespace butteraugli;
|
||||
|
||||
double visdif(std::string rgba1, std::string rgba2, int width, int height) {
|
||||
const char* rgba1p = rgba1.c_str();
|
||||
const char* rgba2p = rgba2.c_str();
|
||||
// One Image8 for each color channel + alpha
|
||||
std::vector<ImageF> img1;
|
||||
img1.push_back(ImageF(width, height));
|
||||
img1.push_back(ImageF(width, height));
|
||||
img1.push_back(ImageF(width, height));
|
||||
img1.push_back(ImageF(width, height));
|
||||
std::vector<ImageF> img2;
|
||||
img2.push_back(ImageF(width, height));
|
||||
img2.push_back(ImageF(width, height));
|
||||
img2.push_back(ImageF(width, height));
|
||||
img2.push_back(ImageF(width, height));
|
||||
// Convert from interleaved RGBA to separate channels
|
||||
// Turns an interleaved RGBA buffer into 4 planes for each color channel
|
||||
void planarize(std::vector<ImageF>& img,
|
||||
const char* rgba,
|
||||
int width,
|
||||
int height,
|
||||
float gamma = 2.2) {
|
||||
assert(img.size() == 0);
|
||||
img.push_back(ImageF(width, height));
|
||||
img.push_back(ImageF(width, height));
|
||||
img.push_back(ImageF(width, height));
|
||||
img.push_back(ImageF(width, height));
|
||||
for (int y = 0; y < height; y++) {
|
||||
float* const img1_row_r = img1[0].Row(y);
|
||||
float* const img1_row_g = img1[1].Row(y);
|
||||
float* const img1_row_b = img1[2].Row(y);
|
||||
float* const img1_row_a = img1[3].Row(y);
|
||||
float* const img2_row_r = img2[0].Row(y);
|
||||
float* const img2_row_g = img2[1].Row(y);
|
||||
float* const img2_row_b = img2[2].Row(y);
|
||||
float* const img2_row_a = img2[3].Row(y);
|
||||
float* const row_r = img[0].Row(y);
|
||||
float* const row_g = img[1].Row(y);
|
||||
float* const row_b = img[2].Row(y);
|
||||
float* const row_a = img[3].Row(y);
|
||||
for (int x = 0; x < width; x++) {
|
||||
img1_row_r[x] = 255.0 * pow(rgba1p[y * width * 4 + x * 4 + 0] / 255.0, 2.2);
|
||||
img1_row_g[x] = 255.0 * pow(rgba1p[y * width * 4 + x * 4 + 1] / 255.0, 2.2);
|
||||
img1_row_b[x] = 255.0 * pow(rgba1p[y * width * 4 + x * 4 + 2] / 255.0, 2.2);
|
||||
img1_row_a[x] = 255.0 * pow(rgba1p[y * width * 4 + x * 4 + 3] / 255.0, 2.2);
|
||||
img2_row_r[x] = 255.0 * pow(rgba2p[y * width * 4 + x * 4 + 0] / 255.0, 2.2);
|
||||
img2_row_g[x] = 255.0 * pow(rgba2p[y * width * 4 + x * 4 + 1] / 255.0, 2.2);
|
||||
img2_row_b[x] = 255.0 * pow(rgba2p[y * width * 4 + x * 4 + 2] / 255.0, 2.2);
|
||||
img2_row_a[x] = 255.0 * pow(rgba2p[y * width * 4 + x * 4 + 3] / 255.0, 2.2);
|
||||
row_r[x] = 255.0 * pow(rgba[y * width * 4 + x * 4 + 0] / 255.0, gamma);
|
||||
row_g[x] = 255.0 * pow(rgba[y * width * 4 + x * 4 + 1] / 255.0, gamma);
|
||||
row_b[x] = 255.0 * pow(rgba[y * width * 4 + x * 4 + 2] / 255.0, gamma);
|
||||
row_a[x] = 255.0 * pow(rgba[y * width * 4 + x * 4 + 3] / 255.0, gamma);
|
||||
}
|
||||
}
|
||||
|
||||
ImageF diffmap;
|
||||
double diffvalue;
|
||||
if (!ButteraugliInterface(img1, img2, 1.0, diffmap, diffvalue)) {
|
||||
return -1.0;
|
||||
}
|
||||
return diffvalue;
|
||||
}
|
||||
class VisDiff {
|
||||
private:
|
||||
std::vector<ImageF> ref_img;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
public:
|
||||
VisDiff(std::string ref_img, int width, int height) {
|
||||
planarize(this->ref_img, ref_img.c_str(), width, height);
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
}
|
||||
|
||||
double distance(std::string other_img) {
|
||||
std::vector<ImageF> img;
|
||||
planarize(img, other_img.c_str(), width, height);
|
||||
|
||||
ImageF diffmap;
|
||||
double diffvalue;
|
||||
if (!ButteraugliInterface(ref_img, img, 1.0, diffmap, diffvalue)) {
|
||||
return -1.0;
|
||||
}
|
||||
return diffvalue;
|
||||
}
|
||||
};
|
||||
|
||||
EMSCRIPTEN_BINDINGS(my_module) {
|
||||
function("visdif", &visdif);
|
||||
class_<VisDiff>("VisDiff").constructor<std::string, int, int>().function("distance",
|
||||
&VisDiff::distance);
|
||||
}
|
||||
|
@ -7,49 +7,64 @@ function(visdif) {
|
||||
visdif = visdif || {};
|
||||
|
||||
|
||||
var d;d||(d=typeof visdif !== 'undefined' ? visdif : {});var aa,ba;d.ready=new Promise(function(a,b){aa=a;ba=b});var r={},t;for(t in d)d.hasOwnProperty(t)&&(r[t]=d[t]);var u=!1,v=!1,ca=!1,da=!1;u="object"===typeof window;v="function"===typeof importScripts;ca="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node;da=!u&&!ca&&!v;var w="",x,z,ea,fa;
|
||||
if(ca)w=v?require("path").dirname(w)+"/":__dirname+"/",x=function(a,b){ea||(ea=require("fs"));fa||(fa=require("path"));a=fa.normalize(a);return ea.readFileSync(a,b?null:"utf8")},z=function(a){a=x(a,!0);a.buffer||(a=new Uint8Array(a));a.buffer||A("Assertion failed: undefined");return a},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(a){throw a;}),process.on("unhandledRejection",A),d.inspect=function(){return"[Emscripten Module object]"};
|
||||
else if(da)"undefined"!=typeof read&&(x=function(a){return read(a)}),z=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");"object"===typeof a||A("Assertion failed: undefined");return a},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(u||v)v?w=self.location.href:document.currentScript&&(w=document.currentScript.src),_scriptDir&&
|
||||
(w=_scriptDir),0!==w.indexOf("blob:")?w=w.substr(0,w.lastIndexOf("/")+1):w="",x=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},v&&(z=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});var ha=d.print||console.log.bind(console),B=d.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(d[t]=r[t]);r=null;var D;d.wasmBinary&&(D=d.wasmBinary);var noExitRuntime;
|
||||
d.noExitRuntime&&(noExitRuntime=d.noExitRuntime);"object"!==typeof WebAssembly&&A("no native wasm support detected");var E,ia=new WebAssembly.Table({initial:33,maximum:33,element:"anyfunc"}),ja=!1,ka="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
|
||||
function F(a,b,c){var e=b+c;for(c=b;a[c]&&!(c>=e);)++c;if(16<c-b&&a.subarray&&ka)return ka.decode(a.subarray(b,c));for(e="";b<c;){var f=a[b++];if(f&128){var g=a[b++]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|g);else{var l=a[b++]&63;f=224==(f&240)?(f&15)<<12|g<<6|l:(f&7)<<18|g<<12|l<<6|a[b++]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e}
|
||||
function la(a,b,c){var e=G;if(0<c){c=b+c-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var l=a.charCodeAt(++f);g=65536+((g&1023)<<10)|l&1023}if(127>=g){if(b>=c)break;e[b++]=g}else{if(2047>=g){if(b+1>=c)break;e[b++]=192|g>>6}else{if(65535>=g){if(b+2>=c)break;e[b++]=224|g>>12}else{if(b+3>=c)break;e[b++]=240|g>>18;e[b++]=128|g>>12&63}e[b++]=128|g>>6&63}e[b++]=128|g&63}}e[b]=0}}var ma="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;
|
||||
function na(a,b){var c=a>>1;for(var e=c+b/2;!(c>=e)&&H[c];)++c;c<<=1;if(32<c-a&&ma)return ma.decode(G.subarray(a,c));c=0;for(e="";;){var f=I[a+2*c>>1];if(0==f||c==b/2)return e;++c;e+=String.fromCharCode(f)}}function oa(a,b,c){void 0===c&&(c=2147483647);if(2>c)return 0;c-=2;var e=b;c=c<2*a.length?c/2:a.length;for(var f=0;f<c;++f)I[b>>1]=a.charCodeAt(f),b+=2;I[b>>1]=0;return b-e}function pa(a){return 2*a.length}
|
||||
function qa(a,b){for(var c=0,e="";!(c>=b/4);){var f=K[a+4*c>>2];if(0==f)break;++c;65536<=f?(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023)):e+=String.fromCharCode(f)}return e}function ra(a,b,c){void 0===c&&(c=2147483647);if(4>c)return 0;var e=b;c=e+c-4;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var l=a.charCodeAt(++f);g=65536+((g&1023)<<10)|l&1023}K[b>>2]=g;b+=4;if(b+4>c)break}K[b>>2]=0;return b-e}
|
||||
function sa(a){for(var b=0,c=0;c<a.length;++c){var e=a.charCodeAt(c);55296<=e&&57343>=e&&++c;b+=4}return b}var L,ta,G,I,H,K,M,ua,va;function wa(a){L=a;d.HEAP8=ta=new Int8Array(a);d.HEAP16=I=new Int16Array(a);d.HEAP32=K=new Int32Array(a);d.HEAPU8=G=new Uint8Array(a);d.HEAPU16=H=new Uint16Array(a);d.HEAPU32=M=new Uint32Array(a);d.HEAPF32=ua=new Float32Array(a);d.HEAPF64=va=new Float64Array(a)}var xa=d.INITIAL_MEMORY||16777216;d.wasmMemory?E=d.wasmMemory:E=new WebAssembly.Memory({initial:xa/65536,maximum:32768});
|
||||
E&&(L=E.buffer);xa=L.byteLength;wa(L);K[5740]=5266E3;function N(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b(d);else{var c=b.K;"number"===typeof c?void 0===b.H?d.dynCall_v(c):d.dynCall_vi(c,b.H):c(void 0===b.H?null:b.H)}}}var ya=[],za=[],Aa=[],Ba=[];function Ca(){var a=d.preRun.shift();ya.unshift(a)}var O=0,Da=null,Q=null;d.preloadedImages={};d.preloadedAudios={};
|
||||
function A(a){if(d.onAbort)d.onAbort(a);B(a);ja=!0;a=new WebAssembly.RuntimeError("abort("+a+"). Build with -s ASSERTIONS=1 for more info.");ba(a);throw a;}function Ea(a){var b=R;return String.prototype.startsWith?b.startsWith(a):0===b.indexOf(a)}function Fa(){return Ea("data:application/octet-stream;base64,")}var R="visdif.wasm";if(!Fa()){var Ga=R;R=d.locateFile?d.locateFile(Ga,w):w+Ga}
|
||||
function Ha(){try{if(D)return new Uint8Array(D);if(z)return z(R);throw"both async and sync fetching of the wasm failed";}catch(a){A(a)}}function Ia(){return D||!u&&!v||"function"!==typeof fetch||Ea("file://")?new Promise(function(a){a(Ha())}):fetch(R,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+R+"'";return a.arrayBuffer()}).catch(function(){return Ha()})}za.push({K:function(){Ja()}});function S(){return 0<S.I}
|
||||
function Ka(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var La=void 0;function T(a){for(var b="";G[a];)b+=La[G[a++]];return b}var U={},V={},Ma={};function Na(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}
|
||||
function Oa(a,b){a=Na(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)}function Pa(a){var b=Error,c=Oa(a,function(e){this.name=a;this.message=e;e=Error(e).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}
|
||||
var Sa=void 0;function W(a){throw new Sa(a);}var Ta=void 0;function Ua(a,b){function c(k){k=b(k);if(k.length!==e.length)throw new Ta("Mismatched type converter count");for(var h=0;h<e.length;++h)X(e[h],k[h])}var e=[];e.forEach(function(k){Ma[k]=a});var f=Array(a.length),g=[],l=0;a.forEach(function(k,h){V.hasOwnProperty(k)?f[h]=V[k]:(g.push(k),U.hasOwnProperty(k)||(U[k]=[]),U[k].push(function(){f[h]=V[k];++l;l===g.length&&c(f)}))});0===g.length&&c(f)}
|
||||
function X(a,b,c){c=c||{};if(!("argPackAdvance"in b))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=b.name;a||W('type "'+e+'" must have a positive integer typeid pointer');if(V.hasOwnProperty(a)){if(c.L)return;W("Cannot register type '"+e+"' twice")}V[a]=b;delete Ma[a];U.hasOwnProperty(a)&&(b=U[a],delete U[a],b.forEach(function(f){f()}))}var Va=[],Y=[{},{value:void 0},{value:null},{value:!0},{value:!1}];
|
||||
function Wa(a){switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var b=Va.length?Va.pop():Y.length;Y[b]={M:1,value:a};return b}}function Xa(a){return this.fromWireType(M[a>>2])}function Ya(a){if(null===a)return"null";var b=typeof a;return"object"===b||"array"===b||"function"===b?a.toString():""+a}
|
||||
function Za(a,b){switch(b){case 2:return function(c){return this.fromWireType(ua[c>>2])};case 3:return function(c){return this.fromWireType(va[c>>3])};default:throw new TypeError("Unknown float type: "+a);}}function $a(a){var b=Function;if(!(b instanceof Function))throw new TypeError("new_ called with constructor type "+typeof b+" which is not a function");var c=Oa(b.name||"unknownFunctionName",function(){});c.prototype=b.prototype;c=new c;a=b.apply(c,a);return a instanceof Object?a:c}
|
||||
function ab(a){for(;a.length;){var b=a.pop();a.pop()(b)}}function bb(a,b){var c=d;if(void 0===c[a].F){var e=c[a];c[a]=function(){c[a].F.hasOwnProperty(arguments.length)||W("Function '"+b+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+c[a].F+")!");return c[a].F[arguments.length].apply(this,arguments)};c[a].F=[];c[a].F[e.J]=e}}
|
||||
function cb(a,b,c){d.hasOwnProperty(a)?((void 0===c||void 0!==d[a].F&&void 0!==d[a].F[c])&&W("Cannot register public name '"+a+"' twice"),bb(a,a),d.hasOwnProperty(c)&&W("Cannot register multiple overloads of a function with the same number of arguments ("+c+")!"),d[a].F[c]=b):(d[a]=b,void 0!==c&&(d[a].O=c))}function db(a,b){for(var c=[],e=0;e<a;e++)c.push(K[(b>>2)+e]);return c}
|
||||
function eb(a,b){a=T(a);var c=d["dynCall_"+a];for(var e=[],f=1;f<a.length;++f)e.push("a"+f);f="return function dynCall_"+(a+"_"+b)+"("+e.join(", ")+") {\n";f+=" return dynCall(rawFunction"+(e.length?", ":"")+e.join(", ")+");\n";c=(new Function("dynCall","rawFunction",f+"};\n"))(c,b);"function"!==typeof c&&W("unknown function pointer with signature "+a+": "+b);return c}var fb=void 0;function gb(a){a=hb(a);var b=T(a);Z(a);return b}
|
||||
function ib(a,b){function c(g){f[g]||V[g]||(Ma[g]?Ma[g].forEach(c):(e.push(g),f[g]=!0))}var e=[],f={};b.forEach(c);throw new fb(a+": "+e.map(gb).join([", "]));}function jb(a,b,c){switch(b){case 0:return c?function(e){return ta[e]}:function(e){return G[e]};case 1:return c?function(e){return I[e>>1]}:function(e){return H[e>>1]};case 2:return c?function(e){return K[e>>2]}:function(e){return M[e>>2]};default:throw new TypeError("Unknown integer type: "+a);}}
|
||||
for(var kb=[null,[],[]],lb=Array(256),mb=0;256>mb;++mb)lb[mb]=String.fromCharCode(mb);La=lb;Sa=d.BindingError=Pa("BindingError");Ta=d.InternalError=Pa("InternalError");d.count_emval_handles=function(){for(var a=0,b=5;b<Y.length;++b)void 0!==Y[b]&&++a;return a};d.get_first_emval=function(){for(var a=5;a<Y.length;++a)if(void 0!==Y[a])return Y[a];return null};fb=d.UnboundTypeError=Pa("UnboundTypeError");
|
||||
var ob={d:function(a,b,c,e){A("Assertion failed: "+(a?F(G,a,void 0):"")+", at: "+[b?b?F(G,b,void 0):"":"unknown filename",c,e?e?F(G,e,void 0):"":"unknown function"])},q:function(a){return nb(a)},p:function(a){"uncaught_exception"in S?S.I++:S.I=1;throw a;},k:function(a,b,c,e,f){var g=Ka(c);b=T(b);X(a,{name:b,fromWireType:function(l){return!!l},toWireType:function(l,k){return k?e:f},argPackAdvance:8,readValueFromPointer:function(l){if(1===c)var k=ta;else if(2===c)k=I;else if(4===c)k=K;else throw new TypeError("Unknown boolean type size: "+
|
||||
b);return this.fromWireType(k[l>>g])},G:null})},j:function(a,b){b=T(b);X(a,{name:b,fromWireType:function(c){var e=Y[c].value;4<c&&0===--Y[c].M&&(Y[c]=void 0,Va.push(c));return e},toWireType:function(c,e){return Wa(e)},argPackAdvance:8,readValueFromPointer:Xa,G:null})},i:function(a,b,c){c=Ka(c);b=T(b);X(a,{name:b,fromWireType:function(e){return e},toWireType:function(e,f){if("number"!==typeof f&&"boolean"!==typeof f)throw new TypeError('Cannot convert "'+Ya(f)+'" to '+this.name);return f},argPackAdvance:8,
|
||||
readValueFromPointer:Za(b,c),G:null})},m:function(a,b,c,e,f,g){var l=db(b,c);a=T(a);f=eb(e,f);cb(a,function(){ib("Cannot call "+a+" due to unbound types",l)},b-1);Ua(l,function(k){var h=[k[0],null].concat(k.slice(1)),n=k=a,p=f,q=h.length;2>q&&W("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var y=null!==h[1]&&!1,C=!1,m=1;m<h.length;++m)if(null!==h[m]&&void 0===h[m].G){C=!0;break}var Qa="void"!==h[0].name,J="",P="";for(m=0;m<q-2;++m)J+=(0!==m?", ":"")+"arg"+m,
|
||||
P+=(0!==m?", ":"")+"arg"+m+"Wired";n="return function "+Na(n)+"("+J+") {\nif (arguments.length !== "+(q-2)+") {\nthrowBindingError('function "+n+" called with ' + arguments.length + ' arguments, expected "+(q-2)+" args!');\n}\n";C&&(n+="var destructors = [];\n");var Ra=C?"destructors":"null";J="throwBindingError invoker fn runDestructors retType classParam".split(" ");p=[W,p,g,ab,h[0],h[1]];y&&(n+="var thisWired = classParam.toWireType("+Ra+", this);\n");for(m=0;m<q-2;++m)n+="var arg"+m+"Wired = argType"+
|
||||
m+".toWireType("+Ra+", arg"+m+"); // "+h[m+2].name+"\n",J.push("argType"+m),p.push(h[m+2]);y&&(P="thisWired"+(0<P.length?", ":"")+P);n+=(Qa?"var rv = ":"")+"invoker(fn"+(0<P.length?", ":"")+P+");\n";if(C)n+="runDestructors(destructors);\n";else for(m=y?1:2;m<h.length;++m)q=1===m?"thisWired":"arg"+(m-2)+"Wired",null!==h[m].G&&(n+=q+"_dtor("+q+"); // "+h[m].name+"\n",J.push(q+"_dtor"),p.push(h[m].G));Qa&&(n+="var ret = retType.fromWireType(rv);\nreturn ret;\n");J.push(n+"}\n");h=$a(J).apply(null,p);
|
||||
m=b-1;if(!d.hasOwnProperty(k))throw new Ta("Replacing nonexistant public symbol");void 0!==d[k].F&&void 0!==m?d[k].F[m]=h:(d[k]=h,d[k].J=m);return[]})},b:function(a,b,c,e,f){function g(n){return n}b=T(b);-1===f&&(f=4294967295);var l=Ka(c);if(0===e){var k=32-8*c;g=function(n){return n<<k>>>k}}var h=-1!=b.indexOf("unsigned");X(a,{name:b,fromWireType:g,toWireType:function(n,p){if("number"!==typeof p&&"boolean"!==typeof p)throw new TypeError('Cannot convert "'+Ya(p)+'" to '+this.name);if(p<e||p>f)throw new TypeError('Passing a number "'+
|
||||
Ya(p)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+e+", "+f+"]!");return h?p>>>0:p|0},argPackAdvance:8,readValueFromPointer:jb(b,l,0!==e),G:null})},a:function(a,b,c){function e(g){g>>=2;var l=M;return new f(L,l[g+1],l[g])}var f=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];c=T(c);X(a,{name:c,fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{L:!0})},g:function(a,b){b=T(b);var c="std::string"===
|
||||
b;X(a,{name:b,fromWireType:function(e){var f=M[e>>2];if(c)for(var g=e+4,l=0;l<=f;++l){var k=e+4+l;if(l==f||0==G[k]){g=g?F(G,g,k-g):"";if(void 0===h)var h=g;else h+=String.fromCharCode(0),h+=g;g=k+1}}else{h=Array(f);for(l=0;l<f;++l)h[l]=String.fromCharCode(G[e+4+l]);h=h.join("")}Z(e);return h},toWireType:function(e,f){f instanceof ArrayBuffer&&(f=new Uint8Array(f));var g="string"===typeof f;g||f instanceof Uint8Array||f instanceof Uint8ClampedArray||f instanceof Int8Array||W("Cannot pass non-string to std::string");
|
||||
var l=(c&&g?function(){for(var n=0,p=0;p<f.length;++p){var q=f.charCodeAt(p);55296<=q&&57343>=q&&(q=65536+((q&1023)<<10)|f.charCodeAt(++p)&1023);127>=q?++n:n=2047>=q?n+2:65535>=q?n+3:n+4}return n}:function(){return f.length})(),k=nb(4+l+1);M[k>>2]=l;if(c&&g)la(f,k+4,l+1);else if(g)for(g=0;g<l;++g){var h=f.charCodeAt(g);255<h&&(Z(k),W("String has UTF-16 code units that do not fit in 8 bits"));G[k+4+g]=h}else for(g=0;g<l;++g)G[k+4+g]=f[g];null!==e&&e.push(Z,k);return k},argPackAdvance:8,readValueFromPointer:Xa,
|
||||
G:function(e){Z(e)}})},e:function(a,b,c){c=T(c);if(2===b){var e=na;var f=oa;var g=pa;var l=function(){return H};var k=1}else 4===b&&(e=qa,f=ra,g=sa,l=function(){return M},k=2);X(a,{name:c,fromWireType:function(h){for(var n=M[h>>2],p=l(),q,y=h+4,C=0;C<=n;++C){var m=h+4+C*b;if(C==n||0==p[m>>k])y=e(y,m-y),void 0===q?q=y:(q+=String.fromCharCode(0),q+=y),y=m+b}Z(h);return q},toWireType:function(h,n){"string"!==typeof n&&W("Cannot pass non-string to C++ string type "+c);var p=g(n),q=nb(4+p+b);M[q>>2]=p>>
|
||||
k;f(n,q+4,p+b);null!==h&&h.push(Z,q);return q},argPackAdvance:8,readValueFromPointer:Xa,G:function(h){Z(h)}})},l:function(a,b){b=T(b);X(a,{N:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},f:function(){A()},o:function(a,b,c){G.copyWithin(a,b,b+c)},c:function(a){a>>>=0;var b=G.length;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);e=Math.max(16777216,a,e);0<e%65536&&(e+=65536-e%65536);a:{try{E.grow(Math.min(2147483648,e)-L.byteLength+
|
||||
65535>>>16);wa(E.buffer);var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},h:function(a,b,c,e){for(var f=0,g=0;g<c;g++){for(var l=K[b+8*g>>2],k=K[b+(8*g+4)>>2],h=0;h<k;h++){var n=G[l+h],p=kb[a];0===n||10===n?((1===a?ha:B)(F(p,0)),p.length=0):p.push(n)}f+=k}K[e>>2]=f;return 0},memory:E,n:function(){},table:ia};
|
||||
(function(){function a(f){d.asm=f.exports;O--;d.monitorRunDependencies&&d.monitorRunDependencies(O);0==O&&(null!==Da&&(clearInterval(Da),Da=null),Q&&(f=Q,Q=null,f()))}function b(f){a(f.instance)}function c(f){return Ia().then(function(g){return WebAssembly.instantiate(g,e)}).then(f,function(g){B("failed to asynchronously prepare wasm: "+g);A(g)})}var e={a:ob};O++;d.monitorRunDependencies&&d.monitorRunDependencies(O);if(d.instantiateWasm)try{return d.instantiateWasm(e,a)}catch(f){return B("Module.instantiateWasm callback failed with error: "+
|
||||
f),!1}(function(){if(D||"function"!==typeof WebAssembly.instantiateStreaming||Fa()||Ea("file://")||"function"!==typeof fetch)return c(b);fetch(R,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(b,function(g){B("wasm streaming compile failed: "+g);B("falling back to ArrayBuffer instantiation");return c(b)})})})();return{}})();
|
||||
var Ja=d.___wasm_call_ctors=function(){return(Ja=d.___wasm_call_ctors=d.asm.r).apply(null,arguments)},nb=d._malloc=function(){return(nb=d._malloc=d.asm.s).apply(null,arguments)},Z=d._free=function(){return(Z=d._free=d.asm.t).apply(null,arguments)},hb=d.___getTypeName=function(){return(hb=d.___getTypeName=d.asm.u).apply(null,arguments)};d.___embind_register_native_and_builtin_types=function(){return(d.___embind_register_native_and_builtin_types=d.asm.v).apply(null,arguments)};
|
||||
d.dynCall_diiiii=function(){return(d.dynCall_diiiii=d.asm.w).apply(null,arguments)};d.dynCall_diiii=function(){return(d.dynCall_diiii=d.asm.x).apply(null,arguments)};d.dynCall_vi=function(){return(d.dynCall_vi=d.asm.y).apply(null,arguments)};d.dynCall_ii=function(){return(d.dynCall_ii=d.asm.z).apply(null,arguments)};d.dynCall_iiii=function(){return(d.dynCall_iiii=d.asm.A).apply(null,arguments)};d.dynCall_viiiiii=function(){return(d.dynCall_viiiiii=d.asm.B).apply(null,arguments)};
|
||||
d.dynCall_viiiii=function(){return(d.dynCall_viiiii=d.asm.C).apply(null,arguments)};d.dynCall_viiii=function(){return(d.dynCall_viiii=d.asm.D).apply(null,arguments)};d.dynCall_jiji=function(){return(d.dynCall_jiji=d.asm.E).apply(null,arguments)};var pb;Q=function qb(){pb||rb();pb||(Q=qb)};
|
||||
function rb(){function a(){if(!pb&&(pb=!0,d.calledRun=!0,!ja)){N(za);N(Aa);aa(d);if(d.onRuntimeInitialized)d.onRuntimeInitialized();if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;){var b=d.postRun.shift();Ba.unshift(b)}N(Ba)}}if(!(0<O)){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)Ca();N(ya);0<O||(d.setStatus?(d.setStatus("Running..."),setTimeout(function(){setTimeout(function(){d.setStatus("")},1);a()},1)):a())}}
|
||||
d.run=rb;if(d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);0<d.preInit.length;)d.preInit.pop()();noExitRuntime=!0;rb();
|
||||
var e;e||(e=typeof visdif !== 'undefined' ? visdif : {});var ba,ca;e.ready=new Promise(function(a,b){ba=a;ca=b});var da={},q;for(q in e)e.hasOwnProperty(q)&&(da[q]=e[q]);var ea=!1,v=!1,fa=!1,ha=!1;ea="object"===typeof window;v="function"===typeof importScripts;fa="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node;ha=!ea&&!fa&&!v;var z="",ia,ja,ka,la;
|
||||
if(fa)z=v?require("path").dirname(z)+"/":__dirname+"/",ia=function(a,b){ka||(ka=require("fs"));la||(la=require("path"));a=la.normalize(a);return ka.readFileSync(a,b?null:"utf8")},ja=function(a){a=ia(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(a){throw a;}),process.on("unhandledRejection",A),e.inspect=function(){return"[Emscripten Module object]"};else if(ha)"undefined"!=
|
||||
typeof read&&(ia=function(a){return read(a)}),ja=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");assert("object"===typeof a);return a},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(ea||v)v?z=self.location.href:document.currentScript&&(z=document.currentScript.src),_scriptDir&&(z=_scriptDir),0!==z.indexOf("blob:")?z=z.substr(0,
|
||||
z.lastIndexOf("/")+1):z="",ia=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},v&&(ja=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});var ma=e.print||console.log.bind(console),B=e.printErr||console.warn.bind(console);for(q in da)da.hasOwnProperty(q)&&(e[q]=da[q]);da=null;var na;e.wasmBinary&&(na=e.wasmBinary);var noExitRuntime;e.noExitRuntime&&(noExitRuntime=e.noExitRuntime);
|
||||
"object"!==typeof WebAssembly&&A("no native wasm support detected");var C,oa=new WebAssembly.Table({initial:39,maximum:39,element:"anyfunc"}),pa=!1;function assert(a,b){a||A("Assertion failed: "+b)}var qa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
|
||||
function ra(a,b,c){var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16<c-b&&a.subarray&&qa)return qa.decode(a.subarray(b,c));for(d="";b<c;){var f=a[b++];if(f&128){var g=a[b++]&63;if(192==(f&224))d+=String.fromCharCode((f&31)<<6|g);else{var k=a[b++]&63;f=224==(f&240)?(f&15)<<12|g<<6|k:(f&7)<<18|g<<12|k<<6|a[b++]&63;65536>f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else d+=String.fromCharCode(f)}return d}
|
||||
function sa(a,b,c){var d=D;if(0<c){c=b+c-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var k=a.charCodeAt(++f);g=65536+((g&1023)<<10)|k&1023}if(127>=g){if(b>=c)break;d[b++]=g}else{if(2047>=g){if(b+1>=c)break;d[b++]=192|g>>6}else{if(65535>=g){if(b+2>=c)break;d[b++]=224|g>>12}else{if(b+3>=c)break;d[b++]=240|g>>18;d[b++]=128|g>>12&63}d[b++]=128|g>>6&63}d[b++]=128|g&63}}d[b]=0}}var ta="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;
|
||||
function ua(a,b){var c=a>>1;for(var d=c+b/2;!(c>=d)&&va[c];)++c;c<<=1;if(32<c-a&&ta)return ta.decode(D.subarray(a,c));c=0;for(d="";;){var f=E[a+2*c>>1];if(0==f||c==b/2)return d;++c;d+=String.fromCharCode(f)}}function wa(a,b,c){void 0===c&&(c=2147483647);if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var f=0;f<c;++f)E[b>>1]=a.charCodeAt(f),b+=2;E[b>>1]=0;return b-d}function xa(a){return 2*a.length}
|
||||
function ya(a,b){for(var c=0,d="";!(c>=b/4);){var f=F[a+4*c>>2];if(0==f)break;++c;65536<=f?(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|f&1023)):d+=String.fromCharCode(f)}return d}function za(a,b,c){void 0===c&&(c=2147483647);if(4>c)return 0;var d=b;c=d+c-4;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var k=a.charCodeAt(++f);g=65536+((g&1023)<<10)|k&1023}F[b>>2]=g;b+=4;if(b+4>c)break}F[b>>2]=0;return b-d}
|
||||
function Aa(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);55296<=d&&57343>=d&&++c;b+=4}return b}var G,Ba,D,E,va,F,I,Ca,Da;function Ea(a){G=a;e.HEAP8=Ba=new Int8Array(a);e.HEAP16=E=new Int16Array(a);e.HEAP32=F=new Int32Array(a);e.HEAPU8=D=new Uint8Array(a);e.HEAPU16=va=new Uint16Array(a);e.HEAPU32=I=new Uint32Array(a);e.HEAPF32=Ca=new Float32Array(a);e.HEAPF64=Da=new Float64Array(a)}var Fa=e.INITIAL_MEMORY||16777216;
|
||||
e.wasmMemory?C=e.wasmMemory:C=new WebAssembly.Memory({initial:Fa/65536,maximum:32768});C&&(G=C.buffer);Fa=G.byteLength;Ea(G);F[5836]=5266384;function Ga(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b(e);else{var c=b.ia;"number"===typeof c?void 0===b.aa?e.dynCall_v(c):e.dynCall_vi(c,b.aa):c(void 0===b.aa?null:b.aa)}}}var Ha=[],Ia=[],Ja=[],Ka=[];function La(){var a=e.preRun.shift();Ha.unshift(a)}var J=0,Ma=null,Na=null;e.preloadedImages={};e.preloadedAudios={};
|
||||
function A(a){if(e.onAbort)e.onAbort(a);B(a);pa=!0;a=new WebAssembly.RuntimeError("abort("+a+"). Build with -s ASSERTIONS=1 for more info.");ca(a);throw a;}function Oa(a){var b=K;return String.prototype.startsWith?b.startsWith(a):0===b.indexOf(a)}function Pa(){return Oa("data:application/octet-stream;base64,")}var K="visdif.wasm";if(!Pa()){var Qa=K;K=e.locateFile?e.locateFile(Qa,z):z+Qa}
|
||||
function Ra(){try{if(na)return new Uint8Array(na);if(ja)return ja(K);throw"both async and sync fetching of the wasm failed";}catch(a){A(a)}}function Sa(){return na||!ea&&!v||"function"!==typeof fetch||Oa("file://")?new Promise(function(a){a(Ra())}):fetch(K,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+K+"'";return a.arrayBuffer()}).catch(function(){return Ra()})}Ia.push({ia:function(){Ta()}});function Ua(){return 0<Ua.da}
|
||||
function Va(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var Wa=void 0;function L(a){for(var b="";D[a];)b+=Wa[D[a++]];return b}var M={},N={},Xa={};function Ya(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}
|
||||
function Za(a,b){a=Ya(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)}function $a(a){var b=Error,c=Za(a,function(d){this.name=a;this.message=d;d=Error(d).stack;void 0!==d&&(this.stack=this.toString()+"\n"+d.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}
|
||||
var O=void 0;function R(a){throw new O(a);}var ab=void 0;function bb(a){throw new ab(a);}function cb(a,b,c){function d(h){h=c(h);h.length!==a.length&&bb("Mismatched type converter count");for(var m=0;m<a.length;++m)S(a[m],h[m])}a.forEach(function(h){Xa[h]=b});var f=Array(b.length),g=[],k=0;b.forEach(function(h,m){N.hasOwnProperty(h)?f[m]=N[h]:(g.push(h),M.hasOwnProperty(h)||(M[h]=[]),M[h].push(function(){f[m]=N[h];++k;k===g.length&&d(f)}))});0===g.length&&d(f)}
|
||||
function S(a,b,c){c=c||{};if(!("argPackAdvance"in b))throw new TypeError("registerType registeredInstance requires argPackAdvance");var d=b.name;a||R('type "'+d+'" must have a positive integer typeid pointer');if(N.hasOwnProperty(a)){if(c.la)return;R("Cannot register type '"+d+"' twice")}N[a]=b;delete Xa[a];M.hasOwnProperty(a)&&(b=M[a],delete M[a],b.forEach(function(f){f()}))}function db(a){return{count:a.count,U:a.U,W:a.W,K:a.K,L:a.L,M:a.M,N:a.N}}
|
||||
function eb(a){R(a.I.L.J.name+" instance already deleted")}var fb=!1;function gb(){}function hb(a){--a.count.value;0===a.count.value&&(a.M?a.N.T(a.M):a.L.J.T(a.K))}function ib(a){if("undefined"===typeof FinalizationGroup)return ib=function(b){return b},a;fb=new FinalizationGroup(function(b){for(var c=b.next();!c.done;c=b.next())c=c.value,c.K?hb(c):console.warn("object already deleted: "+c.K)});ib=function(b){fb.register(b,b.I,b.I);return b};gb=function(b){fb.unregister(b.I)};return ib(a)}
|
||||
var jb=void 0,kb=[];function lb(){for(;kb.length;){var a=kb.pop();a.I.U=!1;a["delete"]()}}function T(){}var mb={};function nb(a,b,c){if(void 0===a[b].P){var d=a[b];a[b]=function(){a[b].P.hasOwnProperty(arguments.length)||R("Function '"+c+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[b].P+")!");return a[b].P[arguments.length].apply(this,arguments)};a[b].P=[];a[b].P[d.Y]=d}}
|
||||
function ob(a,b){e.hasOwnProperty(a)?(R("Cannot register public name '"+a+"' twice"),nb(e,a,a),e.hasOwnProperty(void 0)&&R("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),e[a].P[void 0]=b):e[a]=b}function pb(a,b,c,d,f,g,k,h){this.name=a;this.constructor=b;this.V=c;this.T=d;this.O=f;this.ja=g;this.X=k;this.ha=h;this.na=[]}
|
||||
function qb(a,b,c){for(;b!==c;)b.X||R("Expected null or instance of "+c.name+", got an instance of "+b.name),a=b.X(a),b=b.O;return a}function rb(a,b){if(null===b)return this.ba&&R("null is not a valid "+this.name),0;b.I||R('Cannot pass "'+U(b)+'" as a '+this.name);b.I.K||R("Cannot pass deleted object as a pointer of type "+this.name);return qb(b.I.K,b.I.L.J,this.J)}
|
||||
function ub(a,b){if(null===b){this.ba&&R("null is not a valid "+this.name);if(this.$){var c=this.oa();null!==a&&a.push(this.T,c);return c}return 0}b.I||R('Cannot pass "'+U(b)+'" as a '+this.name);b.I.K||R("Cannot pass deleted object as a pointer of type "+this.name);!this.Z&&b.I.L.Z&&R("Cannot convert argument of type "+(b.I.N?b.I.N.name:b.I.L.name)+" to parameter type "+this.name);c=qb(b.I.K,b.I.L.J,this.J);if(this.$)switch(void 0===b.I.M&&R("Passing raw pointer to smart pointer is illegal"),this.ra){case 0:b.I.N===
|
||||
this?c=b.I.M:R("Cannot convert argument of type "+(b.I.N?b.I.N.name:b.I.L.name)+" to parameter type "+this.name);break;case 1:c=b.I.M;break;case 2:if(b.I.N===this)c=b.I.M;else{var d=b.clone();c=this.pa(c,vb(function(){d["delete"]()}));null!==a&&a.push(this.T,c)}break;default:R("Unsupporting sharing policy")}return c}
|
||||
function wb(a,b){if(null===b)return this.ba&&R("null is not a valid "+this.name),0;b.I||R('Cannot pass "'+U(b)+'" as a '+this.name);b.I.K||R("Cannot pass deleted object as a pointer of type "+this.name);b.I.L.Z&&R("Cannot convert argument of type "+b.I.L.name+" to parameter type "+this.name);return qb(b.I.K,b.I.L.J,this.J)}function xb(a){return this.fromWireType(I[a>>2])}function yb(a,b,c){if(b===c)return a;if(void 0===c.O)return null;a=yb(a,b,c.O);return null===a?null:c.ha(a)}var zb={};
|
||||
function Ab(a,b){for(void 0===b&&R("ptr should not be undefined");a.O;)b=a.X(b),a=a.O;return zb[b]}function Bb(a,b){b.L&&b.K||bb("makeClassHandle requires ptr and ptrType");!!b.N!==!!b.M&&bb("Both smartPtrType and smartPtr must be specified");b.count={value:1};return ib(Object.create(a,{I:{value:b}}))}function V(a,b,c,d){this.name=a;this.J=b;this.ba=c;this.Z=d;this.$=!1;this.T=this.pa=this.oa=this.fa=this.ra=this.ma=void 0;void 0!==b.O?this.toWireType=ub:(this.toWireType=d?rb:wb,this.R=null)}
|
||||
function Cb(a,b){e.hasOwnProperty(a)||bb("Replacing nonexistant public symbol");e[a]=b;e[a].Y=void 0}function W(a,b){a=L(a);var c=e["dynCall_"+a];for(var d=[],f=1;f<a.length;++f)d.push("a"+f);f="return function dynCall_"+(a+"_"+b)+"("+d.join(", ")+") {\n";f+=" return dynCall(rawFunction"+(d.length?", ":"")+d.join(", ")+");\n";c=(new Function("dynCall","rawFunction",f+"};\n"))(c,b);"function"!==typeof c&&R("unknown function pointer with signature "+a+": "+b);return c}var Db=void 0;
|
||||
function Eb(a){a=Fb(a);var b=L(a);X(a);return b}function Gb(a,b){function c(g){f[g]||N[g]||(Xa[g]?Xa[g].forEach(c):(d.push(g),f[g]=!0))}var d=[],f={};b.forEach(c);throw new Db(a+": "+d.map(Eb).join([", "]));}function Hb(a,b){for(var c=[],d=0;d<a;d++)c.push(F[(b>>2)+d]);return c}function Ib(a){for(;a.length;){var b=a.pop();a.pop()(b)}}
|
||||
function Jb(a){var b=Function;if(!(b instanceof Function))throw new TypeError("new_ called with constructor type "+typeof b+" which is not a function");var c=Za(b.name||"unknownFunctionName",function(){});c.prototype=b.prototype;c=new c;a=b.apply(c,a);return a instanceof Object?a:c}var Kb=[],Y=[{},{value:void 0},{value:null},{value:!0},{value:!1}];
|
||||
function vb(a){switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var b=Kb.length?Kb.pop():Y.length;Y[b]={qa:1,value:a};return b}}function U(a){if(null===a)return"null";var b=typeof a;return"object"===b||"array"===b||"function"===b?a.toString():""+a}function Lb(a,b){switch(b){case 2:return function(c){return this.fromWireType(Ca[c>>2])};case 3:return function(c){return this.fromWireType(Da[c>>3])};default:throw new TypeError("Unknown float type: "+a);}}
|
||||
function Mb(a,b,c){switch(b){case 0:return c?function(d){return Ba[d]}:function(d){return D[d]};case 1:return c?function(d){return E[d>>1]}:function(d){return va[d>>1]};case 2:return c?function(d){return F[d>>2]}:function(d){return I[d>>2]};default:throw new TypeError("Unknown integer type: "+a);}}for(var Nb=[null,[],[]],Ob=Array(256),Pb=0;256>Pb;++Pb)Ob[Pb]=String.fromCharCode(Pb);Wa=Ob;O=e.BindingError=$a("BindingError");ab=e.InternalError=$a("InternalError");
|
||||
T.prototype.isAliasOf=function(a){if(!(this instanceof T&&a instanceof T))return!1;var b=this.I.L.J,c=this.I.K,d=a.I.L.J;for(a=a.I.K;b.O;)c=b.X(c),b=b.O;for(;d.O;)a=d.X(a),d=d.O;return b===d&&c===a};T.prototype.clone=function(){this.I.K||eb(this);if(this.I.W)return this.I.count.value+=1,this;var a=ib(Object.create(Object.getPrototypeOf(this),{I:{value:db(this.I)}}));a.I.count.value+=1;a.I.U=!1;return a};
|
||||
T.prototype["delete"]=function(){this.I.K||eb(this);this.I.U&&!this.I.W&&R("Object already scheduled for deletion");gb(this);hb(this.I);this.I.W||(this.I.M=void 0,this.I.K=void 0)};T.prototype.isDeleted=function(){return!this.I.K};T.prototype.deleteLater=function(){this.I.K||eb(this);this.I.U&&!this.I.W&&R("Object already scheduled for deletion");kb.push(this);1===kb.length&&jb&&jb(lb);this.I.U=!0;return this};V.prototype.ka=function(a){this.fa&&(a=this.fa(a));return a};
|
||||
V.prototype.ea=function(a){this.T&&this.T(a)};V.prototype.argPackAdvance=8;V.prototype.readValueFromPointer=xb;V.prototype.deleteObject=function(a){if(null!==a)a["delete"]()};
|
||||
V.prototype.fromWireType=function(a){function b(){return this.$?Bb(this.J.V,{L:this.ma,K:c,N:this,M:a}):Bb(this.J.V,{L:this,K:a})}var c=this.ka(a);if(!c)return this.ea(a),null;var d=Ab(this.J,c);if(void 0!==d){if(0===d.I.count.value)return d.I.K=c,d.I.M=a,d.clone();d=d.clone();this.ea(a);return d}d=this.J.ja(c);d=mb[d];if(!d)return b.call(this);d=this.Z?d.ga:d.pointerType;var f=yb(c,this.J,d.J);return null===f?b.call(this):this.$?Bb(d.J.V,{L:d,K:f,N:this,M:a}):Bb(d.J.V,{L:d,K:f})};
|
||||
e.getInheritedInstanceCount=function(){return Object.keys(zb).length};e.getLiveInheritedInstances=function(){var a=[],b;for(b in zb)zb.hasOwnProperty(b)&&a.push(zb[b]);return a};e.flushPendingDeletes=lb;e.setDelayFunction=function(a){jb=a;kb.length&&jb&&jb(lb)};Db=e.UnboundTypeError=$a("UnboundTypeError");e.count_emval_handles=function(){for(var a=0,b=5;b<Y.length;++b)void 0!==Y[b]&&++a;return a};e.get_first_emval=function(){for(var a=5;a<Y.length;++a)if(void 0!==Y[a])return Y[a];return null};
|
||||
var Rb={d:function(a,b,c,d){A("Assertion failed: "+(a?ra(D,a,void 0):"")+", at: "+[b?b?ra(D,b,void 0):"":"unknown filename",c,d?d?ra(D,d,void 0):"":"unknown function"])},s:function(a){return Qb(a)},o:function(a){"uncaught_exception"in Ua?Ua.da++:Ua.da=1;throw a;},j:function(a,b,c,d,f){var g=Va(c);b=L(b);S(a,{name:b,fromWireType:function(k){return!!k},toWireType:function(k,h){return h?d:f},argPackAdvance:8,readValueFromPointer:function(k){if(1===c)var h=Ba;else if(2===c)h=E;else if(4===c)h=F;else throw new TypeError("Unknown boolean type size: "+
|
||||
b);return this.fromWireType(h[k>>g])},R:null})},n:function(a,b,c,d,f,g,k,h,m,l,n,t,u){n=L(n);g=W(f,g);h&&(h=W(k,h));l&&(l=W(m,l));u=W(t,u);var y=Ya(n);ob(y,function(){Gb("Cannot construct "+n+" due to unbound types",[d])});cb([a,b,c],d?[d]:[],function(r){r=r[0];if(d){var w=r.J;var p=w.V}else p=T.prototype;r=Za(y,function(){if(Object.getPrototypeOf(this)!==H)throw new O("Use 'new' to construct "+n);if(void 0===x.S)throw new O(n+" has no accessible constructor");var P=x.S[arguments.length];if(void 0===
|
||||
P)throw new O("Tried to invoke ctor of "+n+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(x.S).toString()+") parameters instead!");return P.apply(this,arguments)});var H=Object.create(p,{constructor:{value:r}});r.prototype=H;var x=new pb(n,r,H,u,w,g,h,l);w=new V(n,x,!0,!1);p=new V(n+"*",x,!1,!1);var Z=new V(n+" const*",x,!1,!0);mb[a]={pointerType:p,ga:Z};Cb(y,r);return[w,p,Z]})},m:function(a,b,c,d,f,g){assert(0<b);var k=Hb(b,c);f=W(d,f);var h=[g],m=[];cb([],[a],
|
||||
function(l){l=l[0];var n="constructor "+l.name;void 0===l.J.S&&(l.J.S=[]);if(void 0!==l.J.S[b-1])throw new O("Cannot register multiple constructors with identical number of parameters ("+(b-1)+") for class '"+l.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");l.J.S[b-1]=function(){Gb("Cannot construct "+l.name+" due to unbound types",k)};cb([],k,function(t){l.J.S[b-1]=function(){arguments.length!==b-1&&R(n+" called with "+arguments.length+
|
||||
" arguments, expected "+(b-1));m.length=0;h.length=b;for(var u=1;u<b;++u)h[u]=t[u].toWireType(m,arguments[u-1]);u=f.apply(null,h);Ib(m);return t[0].fromWireType(u)};return[]});return[]})},l:function(a,b,c,d,f,g,k,h){var m=Hb(c,d);b=L(b);g=W(f,g);cb([],[a],function(l){function n(){Gb("Cannot call "+t+" due to unbound types",m)}l=l[0];var t=l.name+"."+b;h&&l.J.na.push(b);var u=l.J.V,y=u[b];void 0===y||void 0===y.P&&y.className!==l.name&&y.Y===c-2?(n.Y=c-2,n.className=l.name,u[b]=n):(nb(u,b,t),u[b].P[c-
|
||||
2]=n);cb([],m,function(r){var w=t,p=l,H=g,x=r.length;2>x&&R("argTypes array size mismatch! Must at least get return value and 'this' types!");var Z=null!==r[1]&&null!==p,P=!1;for(p=1;p<r.length;++p)if(null!==r[p]&&void 0===r[p].R){P=!0;break}var sb="void"!==r[0].name,Q="",aa="";for(p=0;p<x-2;++p)Q+=(0!==p?", ":"")+"arg"+p,aa+=(0!==p?", ":"")+"arg"+p+"Wired";w="return function "+Ya(w)+"("+Q+") {\nif (arguments.length !== "+(x-2)+") {\nthrowBindingError('function "+w+" called with ' + arguments.length + ' arguments, expected "+
|
||||
(x-2)+" args!');\n}\n";P&&(w+="var destructors = [];\n");var tb=P?"destructors":"null";Q="throwBindingError invoker fn runDestructors retType classParam".split(" ");H=[R,H,k,Ib,r[0],r[1]];Z&&(w+="var thisWired = classParam.toWireType("+tb+", this);\n");for(p=0;p<x-2;++p)w+="var arg"+p+"Wired = argType"+p+".toWireType("+tb+", arg"+p+"); // "+r[p+2].name+"\n",Q.push("argType"+p),H.push(r[p+2]);Z&&(aa="thisWired"+(0<aa.length?", ":"")+aa);w+=(sb?"var rv = ":"")+"invoker(fn"+(0<aa.length?", ":"")+aa+
|
||||
");\n";if(P)w+="runDestructors(destructors);\n";else for(p=Z?1:2;p<r.length;++p)x=1===p?"thisWired":"arg"+(p-2)+"Wired",null!==r[p].R&&(w+=x+"_dtor("+x+"); // "+r[p].name+"\n",Q.push(x+"_dtor"),H.push(r[p].R));sb&&(w+="var ret = retType.fromWireType(rv);\nreturn ret;\n");Q.push(w+"}\n");r=Jb(Q).apply(null,H);void 0===u[b].P?(r.Y=c-2,u[b]=r):u[b].P[c-2]=r;return[]});return[]})},r:function(a,b){b=L(b);S(a,{name:b,fromWireType:function(c){var d=Y[c].value;4<c&&0===--Y[c].qa&&(Y[c]=void 0,Kb.push(c));
|
||||
return d},toWireType:function(c,d){return vb(d)},argPackAdvance:8,readValueFromPointer:xb,R:null})},i:function(a,b,c){c=Va(c);b=L(b);S(a,{name:b,fromWireType:function(d){return d},toWireType:function(d,f){if("number"!==typeof f&&"boolean"!==typeof f)throw new TypeError('Cannot convert "'+U(f)+'" to '+this.name);return f},argPackAdvance:8,readValueFromPointer:Lb(b,c),R:null})},b:function(a,b,c,d,f){function g(l){return l}b=L(b);-1===f&&(f=4294967295);var k=Va(c);if(0===d){var h=32-8*c;g=function(l){return l<<
|
||||
h>>>h}}var m=-1!=b.indexOf("unsigned");S(a,{name:b,fromWireType:g,toWireType:function(l,n){if("number"!==typeof n&&"boolean"!==typeof n)throw new TypeError('Cannot convert "'+U(n)+'" to '+this.name);if(n<d||n>f)throw new TypeError('Passing a number "'+U(n)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+d+", "+f+"]!");return m?n>>>0:n|0},argPackAdvance:8,readValueFromPointer:Mb(b,k,0!==d),R:null})},a:function(a,b,c){function d(g){g>>=2;var k=I;return new f(G,
|
||||
k[g+1],k[g])}var f=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];c=L(c);S(a,{name:c,fromWireType:d,argPackAdvance:8,readValueFromPointer:d},{la:!0})},g:function(a,b){b=L(b);var c="std::string"===b;S(a,{name:b,fromWireType:function(d){var f=I[d>>2];if(c)for(var g=d+4,k=0;k<=f;++k){var h=d+4+k;if(k==f||0==D[h]){g=g?ra(D,g,h-g):"";if(void 0===m)var m=g;else m+=String.fromCharCode(0),m+=g;g=h+1}}else{m=Array(f);for(k=0;k<f;++k)m[k]=String.fromCharCode(D[d+
|
||||
4+k]);m=m.join("")}X(d);return m},toWireType:function(d,f){f instanceof ArrayBuffer&&(f=new Uint8Array(f));var g="string"===typeof f;g||f instanceof Uint8Array||f instanceof Uint8ClampedArray||f instanceof Int8Array||R("Cannot pass non-string to std::string");var k=(c&&g?function(){for(var l=0,n=0;n<f.length;++n){var t=f.charCodeAt(n);55296<=t&&57343>=t&&(t=65536+((t&1023)<<10)|f.charCodeAt(++n)&1023);127>=t?++l:l=2047>=t?l+2:65535>=t?l+3:l+4}return l}:function(){return f.length})(),h=Qb(4+k+1);I[h>>
|
||||
2]=k;if(c&&g)sa(f,h+4,k+1);else if(g)for(g=0;g<k;++g){var m=f.charCodeAt(g);255<m&&(X(h),R("String has UTF-16 code units that do not fit in 8 bits"));D[h+4+g]=m}else for(g=0;g<k;++g)D[h+4+g]=f[g];null!==d&&d.push(X,h);return h},argPackAdvance:8,readValueFromPointer:xb,R:function(d){X(d)}})},f:function(a,b,c){c=L(c);if(2===b){var d=ua;var f=wa;var g=xa;var k=function(){return va};var h=1}else 4===b&&(d=ya,f=za,g=Aa,k=function(){return I},h=2);S(a,{name:c,fromWireType:function(m){for(var l=I[m>>2],
|
||||
n=k(),t,u=m+4,y=0;y<=l;++y){var r=m+4+y*b;if(y==l||0==n[r>>h])u=d(u,r-u),void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),u=r+b}X(m);return t},toWireType:function(m,l){"string"!==typeof l&&R("Cannot pass non-string to C++ string type "+c);var n=g(l),t=Qb(4+n+b);I[t>>2]=n>>h;f(l,t+4,n+b);null!==m&&m.push(X,t);return t},argPackAdvance:8,readValueFromPointer:xb,R:function(m){X(m)}})},k:function(a,b){b=L(b);S(a,{sa:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},e:function(){A()},
|
||||
q:function(a,b,c){D.copyWithin(a,b,b+c)},c:function(a){a>>>=0;var b=D.length;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);d=Math.max(16777216,a,d);0<d%65536&&(d+=65536-d%65536);a:{try{C.grow(Math.min(2147483648,d)-G.byteLength+65535>>>16);Ea(C.buffer);var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},h:function(a,b,c,d){for(var f=0,g=0;g<c;g++){for(var k=F[b+8*g>>2],h=F[b+(8*g+4)>>2],m=0;m<h;m++){var l=D[k+m],n=Nb[a];0===l||10===l?((1===a?ma:
|
||||
B)(ra(n,0)),n.length=0):n.push(l)}f+=h}F[d>>2]=f;return 0},memory:C,p:function(){},table:oa};
|
||||
(function(){function a(f){e.asm=f.exports;J--;e.monitorRunDependencies&&e.monitorRunDependencies(J);0==J&&(null!==Ma&&(clearInterval(Ma),Ma=null),Na&&(f=Na,Na=null,f()))}function b(f){a(f.instance)}function c(f){return Sa().then(function(g){return WebAssembly.instantiate(g,d)}).then(f,function(g){B("failed to asynchronously prepare wasm: "+g);A(g)})}var d={a:Rb};J++;e.monitorRunDependencies&&e.monitorRunDependencies(J);if(e.instantiateWasm)try{return e.instantiateWasm(d,a)}catch(f){return B("Module.instantiateWasm callback failed with error: "+
|
||||
f),!1}(function(){if(na||"function"!==typeof WebAssembly.instantiateStreaming||Pa()||Oa("file://")||"function"!==typeof fetch)return c(b);fetch(K,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(b,function(g){B("wasm streaming compile failed: "+g);B("falling back to ArrayBuffer instantiation");return c(b)})})})();return{}})();
|
||||
var Ta=e.___wasm_call_ctors=function(){return(Ta=e.___wasm_call_ctors=e.asm.t).apply(null,arguments)},Qb=e._malloc=function(){return(Qb=e._malloc=e.asm.u).apply(null,arguments)},X=e._free=function(){return(X=e._free=e.asm.v).apply(null,arguments)},Fb=e.___getTypeName=function(){return(Fb=e.___getTypeName=e.asm.w).apply(null,arguments)};e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.x).apply(null,arguments)};
|
||||
e.dynCall_ii=function(){return(e.dynCall_ii=e.asm.y).apply(null,arguments)};e.dynCall_vi=function(){return(e.dynCall_vi=e.asm.z).apply(null,arguments)};e.dynCall_dii=function(){return(e.dynCall_dii=e.asm.A).apply(null,arguments)};e.dynCall_iiiii=function(){return(e.dynCall_iiiii=e.asm.B).apply(null,arguments)};e.dynCall_iiii=function(){return(e.dynCall_iiii=e.asm.C).apply(null,arguments)};e.dynCall_diii=function(){return(e.dynCall_diii=e.asm.D).apply(null,arguments)};
|
||||
e.dynCall_viiiiii=function(){return(e.dynCall_viiiiii=e.asm.E).apply(null,arguments)};e.dynCall_viiiii=function(){return(e.dynCall_viiiii=e.asm.F).apply(null,arguments)};e.dynCall_viiii=function(){return(e.dynCall_viiii=e.asm.G).apply(null,arguments)};e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.H).apply(null,arguments)};var Sb;Na=function Tb(){Sb||Ub();Sb||(Na=Tb)};
|
||||
function Ub(){function a(){if(!Sb&&(Sb=!0,e.calledRun=!0,!pa)){Ga(Ia);Ga(Ja);ba(e);if(e.onRuntimeInitialized)e.onRuntimeInitialized();if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var b=e.postRun.shift();Ka.unshift(b)}Ga(Ka)}}if(!(0<J)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)La();Ga(Ha);0<J||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1);a()},1)):a())}}
|
||||
e.run=Ub;if(e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();noExitRuntime=!0;Ub();
|
||||
|
||||
|
||||
return visdif.ready
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user