!function(e,f){if("object"==typeof exports&&"object"==typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var s=f();for(var a in s)("object"==typeof exports?exports:e)[a]=s[a]}}(self,(function(){return e=[],f=0,self.onmessage=function(s){if("channeldata"===s.data.msgtype)e[s.data.channelindex]=new Uint8Array(s.data.data),0===f&&(f=e[s.data.channelindex].length),self.fused||(self.fused=new Uint8Array(4*f),self.workerindex=s.data.workerindex);else if("fuse"===s.data.msgtype){!function(s,a){var d,t,r,o,l,n,u,i,x,c,h,m,p,g,b,y,v,w=s.length,M=4*f;for(g=0;g<M;g+=4)self.fused[g+0]=0,self.fused[g+1]=0,self.fused[g+2]=0,self.fused[g+3]=255;var k=0;if("m"===a){for(b=0;b<w;++b)if(p=(l=s[b]).chIndex,e[p]&&l.rgbColor)for(h=e[p],m=l.lut,y=0,v=0;y<f;y+=1,v+=4)n=m[4*(k=h[y])+0],u=m[4*k+1],i=m[4*k+2],c=(x=m[4*k+3])/255,d=self.fused[v+0],self.fused[v+0]=Math.max(d,n*c),t=self.fused[v+1],self.fused[v+1]=Math.max(t,u*c),r=self.fused[v+2],self.fused[v+2]=Math.max(r,i*c),o=self.fused[v+3],self.fused[v+3]=Math.max(o,x)}else if("a"===a){var C=0;for(b=0;b<w;++b)p=(l=s[b]).chIndex,e[p]&&l.rgbColor&&C++;for(b=0;b<w;++b)if(p=(l=s[b]).chIndex,e[p]&&l.rgbColor&&l.rgbColor)for(h=e[p],m=l.lut,y=0,v=0;y<f;y+=1,v+=4)n=m[4*(k=h[y])+0],u=m[4*k+1],i=m[4*k+2],c=(x=m[4*k+3])/255,self.fused[v+0]+=n*c/C,self.fused[v+1]+=u*c/C,self.fused[v+2]+=i*c/C,self.fused[v+3]+=x/C}}(s.data.combination,s.data.fuseMethod);var a={data:self.fused,workerindex:self.workerindex};postMessage(a,[a.data.buffer]),self.fused=new Uint8Array(4*f)}},{};var e,f}));
//# sourceMappingURL=744.index.js.map