PageSourceSearch

https://www.diffulpump.com/js/canvas.min.js

js diffulpump.com collected 2026-10-04 02:33:41 UTC 3,411 bytes, 1 lines download raw bytes

1"use strict";function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var _slicedToArray=function(){function n(n,t){var r=[],u=!0,f=!1,e=undefined,i,o;try{for(i=n[Symbol.iterator]();!(u=(o=i.next()).done);u=!0)if(r.push(o.value),t&&r.length===t)break}catch(s){f=!0;e=s}finally{try{!u&&i["return"]&&i["return"]()}finally{if(f)throw e;}}return r}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),_createClass=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),Create=function(){function n(t,i){_classCallCheck(this,n);this.width=t;this.height=i}return _createClass(n,[{key:"canvas",value:function(){var n=document.createElement("canvas");return n.width=this.width,n.height=this.height,n}}]),n}(),Draw=function(){function n(t){_classCallCheck(this,n);this.canvas=t}return _createClass(n,[{key:"drawColoredRectangle",value:function(n,t,i){var r=this.canvas.getContext("2d");r.fillStyle=n;r.fillRect(t.x,t.y,i.width,i.height)}},{key:"drawImage",value:function(n,t,i,r,u){var f=this.canvas.getContext("2d");r==undefined&&u==undefined?f.drawImage(n,t.x,t.y,i.width,i.height):f.drawImage(n,t.x,t.y,i.width,i.height,r.x,r.y,u.width,u.height)}}]),n}(),Sources=function(){function n(){_classCallCheck(this,n)}return _createClass(n,[{key:"load",value:function(n){return new Promise(function(t,i){var r=new Image;r.crossOrigin="anonymous";r.src=n;r.onload=function(){return t({src:r.src,width:r.width,height:r.height,source:r})};r.onerror=i})}}]),n}(),Color=function(){function n(){_classCallCheck(this,n)}return _createClass(n,[{key:"rgbToHsl",value:function(n,t,i){var f;n/=255;t/=255;i/=255;var r=Math.max(n,t,i),e=Math.min(n,t,i),u,o,s=(r+e)/2;if(r===e)u=o=0;else{f=r-e;o=s>.5?f/(2-r-e):f/(r+e);switch(r){case n:u=(t-i)/f+(t<i?6:0);break;case t:u=(i-n)/f+2;break;case i:u=(n-t)/f+4}u/=6}return[u,o,s]}},{key:"hslToRgb",value:function(n,t,i){var u,f,e;if(t===0)u=f=e=i;else{var o=function(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n},r=i<.5?i*(1+t):i+t-i*t,s=2*i-r;u=o(s,r,n+1/3);f=o(s,r,n);e=o(s,r,n-1/3)}return[Math.round(u*255),Math.round(f*255),Math.round(e*255)]}},{key:"rgbToHex",value:function(n){var t=n.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/),r=parseInt(t[1]),u=parseInt(t[2]),f=parseInt(t[3]),i=function(n){return Math.max(0,Math.min(255,n))};return"#"+(16777216+(i(r)<<16)+(i(u)<<8)+i(f)).toString(16).slice(1).toLowerCase()}}]),n}(),Tint=function(){function n(t){_classCallCheck(this,n);this.img=t}return _createClass(n,[{key:"convert",value:function(n,t,i){var l=this.img.width,a=this.img.height,k=new Create(l,a),v=k.canvas(),f=v.getContext("2d"),e,u,o,r,y,c;for(f.drawImage(this.img,0,0),e=f.getImageData(0,0,l,a),u=e.data,n/=360,t/=100,i/=100,o=new Color,r=0;r<u.length;r+=4)if(y=u[r+3],y!==0){var d=u[r],g=u[r+1],nt=u[r+2],tt=o.rgbToHsl(d,g,nt),s=_slicedToArray(tt,3),p=s[0],w=s[1],b=s[2];p=n;w*=t;b*=i;var it=o.hslToRgb(p,w,b),h=_slicedToArray(it,3),rt=h[0],ut=h[1],ft=h[2];u[r]=rt;u[r+1]=ut;u[r+2]=ft}return f.putImageData(e,0,0),c=new Image,c.src=v.toDataURL(),c}}]),n}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.