UNPKG

ry-vue-map

Version:

ry公共组件库

1 lines 2.89 kB
(("undefined"!==typeof self?self:this)["webpackJsonpryui"]=("undefined"!==typeof self?self:this)["webpackJsonpryui"]||[]).push([[3],{"852f":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return u}));var r=n("b3f7");const o=9,i=256,s=257,f=12;function l(e,t,n){const r=t%8,o=Math.floor(t/8),i=8-r,f=t+n-8*(o+1);let l=8*(o+2)-(t+n);const c=8*(o+2)-t;if(l=Math.max(0,l),o>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),s;let a=e[o]&2**(8-r)-1;a<<=n-i;let u=a;if(o+1<e.length){let t=e[o+1]>>>l;t<<=Math.max(0,n-c),u+=t}if(f>8&&o+2<e.length){const r=8*(o+3)-(t+n),i=e[o+2]>>>r;u+=i}return u}function c(e,t){for(let n=t.length-1;n>=0;n--)e.push(t[n]);return e}function a(e){const t=new Uint16Array(4093),n=new Uint8Array(4093);for(let o=0;o<=257;o++)t[o]=4096,n[o]=o;let r=258,a=o,u=0;function h(){r=258,a=o}function d(e){const t=l(e,u,a);return u+=a,t}function w(e,o){return n[r]=o,t[r]=e,r++,r-1}function p(e){const r=[];for(let o=e;4096!==o;o=t[o])r.push(n[o]);return r}const g=[];h();const y=new Uint8Array(e);let b,m=d(y);while(m!==s){if(m===i){h(),m=d(y);while(m===i)m=d(y);if(m===s)break;if(m>i)throw new Error("corrupted code at scanline "+m);{const e=p(m);c(g,e),b=m}}else if(m<r){const e=p(m);c(g,e),w(b,e[e.length-1]),b=m}else{const e=p(b);if(!e)throw new Error(`Bogus entry. Not in dictionary, ${b} / ${r}, position: ${u}`);c(g,e),g.push(e[e.length-1]),w(b,e[e.length-1]),b=m}r+1>=2**a&&(a===f?b=void 0:a++),m=d(y)}return new Uint8Array(g)}class u extends r["a"]{decodeBlock(e){return a(e,!1).buffer}}},b3f7:function(e,t,n){"use strict";function r(e,t){let n=e.length-t,r=0;do{for(let n=t;n>0;n--)e[r+t]+=e[r],r++;n-=t}while(n>0)}function o(e,t,n){let r=0,o=e.length;const i=o/n;while(o>t){for(let n=t;n>0;--n)e[r+t]+=e[r],++r;o-=t}const s=e.slice();for(let f=0;f<i;++f)for(let t=0;t<n;++t)e[n*f+t]=s[(n-t-1)*i+f]}function i(e,t,n,i,s,f){if(!t||1===t)return e;for(let r=0;r<s.length;++r){if(s[r]%8!==0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(s[r]!==s[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const l=s[0]/8,c=2===f?1:s.length;for(let a=0;a<i;++a){if(a*c*n*l>=e.byteLength)break;let i;if(2===t){switch(s[0]){case 8:i=new Uint8Array(e,a*c*n*l,c*n*l);break;case 16:i=new Uint16Array(e,a*c*n*l,c*n*l/2);break;case 32:i=new Uint32Array(e,a*c*n*l,c*n*l/4);break;default:throw new Error(`Predictor 2 not allowed with ${s[0]} bits per sample.`)}r(i,c,l)}else 3===t&&(i=new Uint8Array(e,a*c*n*l,c*n*l),o(i,c,l))}return e}n.d(t,"a",(function(){return s}));class s{async decode(e,t){const n=await this.decodeBlock(t),r=e.Predictor||1;if(1!==r){const t=!e.StripOffsets,o=t?e.TileWidth:e.ImageWidth,s=t?e.TileLength:e.RowsPerStrip||e.ImageLength;return i(n,r,o,s,e.BitsPerSample,e.PlanarConfiguration)}return n}}}}]);