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cAAgB,SAAW,GACpD,OAAO,IAAI,EAAiB,KAAM,EACpC,EAGA,EAAO,gBAAkB,EAExB,CAvJL,CAuJQ","file":"/gh/amplydevelopment/etherfuse-assets@6018500a126743f843ec6d9f70f3adef71452715/pixel-lib.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /gh/amplydevelopment/etherfuse-assets@6018500a126743f843ec6d9f70f3adef71452715/pixel-lib.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n * Close Pixelate v2.0.00 beta\n * http://desandro.com/resources/close-pixelate/\n * \n * Developed by\n * - David DeSandro  http://desandro.com\n * - John Schulz  http://twitter.com/jfsiii\n * \n * Licensed under MIT license\n */\n\n/*jshint asi: true, browser: true, eqeqeq: true, forin: false, immed: false, newcap: true, noempty: true, strict: true, undef: true */\n\n( function( window, undefined ) {\n\n    //\n    'use strict';\n    \n    // util vars\n    var TWO_PI = Math.PI * 2\n    var QUARTER_PI = Math.PI * 0.25\n    \n    // utility functions\n    function isArray( obj ) {\n      return Object.prototype.toString.call( obj ) === \"[object Array]\"\n    }\n    \n    function isObject( obj ) {\n      return Object.prototype.toString.call( obj ) === \"[object Object]\"\n    }\n    \n    var console = window.console\n    \n    // check for canvas support\n    var canvas = document.createElement('canvas')\n    var isCanvasSupported = canvas.getContext && canvas.getContext('2d')\n    \n    // don't proceed if canvas is no supported\n    if ( !isCanvasSupported ) {\n      return\n    }\n    \n    \n    function ClosePixelation( img, options ) {\n      this.img = img\n      // creat canvas\n      var canvas = this.canvas = document.createElement('canvas')\n      this.ctx = canvas.getContext('2d',{willReadFrequently:true})\n      // copy attributes from img to canvas\n      canvas.className = img.className\n      canvas.id = img.id\n    \n      this.render( options )\n    \n      // replace image with canvas\n      img.parentNode.replaceChild( canvas, img )\n    \n    }\n    \n    ClosePixelation.prototype.render = function( options ) {\n      this.options = options\n      // set size\n      var w = this.width = this.canvas.width = this.img.width\n      var h = this.height = this.canvas.height = this.img.height\n      // draw image on canvas\n      this.ctx.drawImage( this.img, 0, 0 )\n      // get imageData\n    \n      try {\n        this.imgData = this.ctx.getImageData( 0, 0, w, h ).data\n      } catch ( error ) {\n        if ( console ) {\n          console.error( error )\n        }\n        return\n      }\n    \n      this.ctx.clearRect( 0, 0, w, h )\n    \n      for ( var i=0, len = options.length; i < len; i++ ) {\n        this.renderClosePixels( options[i] )\n      }\n    \n    }\n    \n    ClosePixelation.prototype.renderClosePixels = function( opts ) {\n      var w = this.width\n      var h = this.height\n      var ctx = this.ctx\n      var imgData = this.imgData\n    \n      // option defaults\n      var res = opts.resolution || 16\n      var size = opts.size || res\n      var alpha = opts.alpha || 1\n      var offset = opts.offset || 0\n      var offsetX = 0\n      var offsetY = 0\n      var cols = w / res + 1\n      var rows = h / res + 1\n      var halfSize = size / 2\n      var diamondSize = size / Math.SQRT2\n      var halfDiamondSize = diamondSize / 2\n    \n      if ( isObject( offset ) ){ \n        offsetX = offset.x || 0\n        offsetY = offset.y || 0\n      } else if ( isArray( offset) ){\n        offsetX = offset[0] || 0\n        offsetY = offset[1] || 0\n      } else {\n        offsetX = offsetY = offset\n      }\n    \n      var row, col, x, y, pixelY, pixelX, pixelIndex, red, green, blue, pixelAlpha\n    \n      for ( row = 0; row < rows; row++ ) {\n        y = ( row - 0.5 ) * res + offsetY\n        // normalize y so shapes around edges get color\n        pixelY = Math.max( Math.min( y, h-1), 0)\n    \n        for ( col = 0; col < cols; col++ ) {\n          x = ( col - 0.5 ) * res + offsetX\n          // normalize y so shapes around edges get color\n          pixelX = Math.max( Math.min( x, w-1), 0)\n          pixelIndex = ( pixelX + pixelY * w ) * 4\n          red   = imgData[ pixelIndex + 0 ]\n          green = imgData[ pixelIndex + 1 ]\n          blue  = imgData[ pixelIndex + 2 ]\n          pixelAlpha = alpha * ( imgData[ pixelIndex + 3 ] / 255)\n    \n          ctx.fillStyle = 'rgba(' + red +','+ green +','+ blue +','+ pixelAlpha + ')'\n    \n          switch ( opts.shape ) {\n            case 'circle' :\n              ctx.beginPath()\n                ctx.arc ( x, y, halfSize, 0, TWO_PI, true )\n                ctx.fill()\n              ctx.closePath()\n              break\n            case 'diamond' :\n              ctx.save()\n                ctx.translate( x, y )\n                ctx.rotate( QUARTER_PI )\n                ctx.fillRect( -halfDiamondSize, -halfDiamondSize, diamondSize, diamondSize )\n              ctx.restore()\n              break\n            default :\n              // square\n              ctx.fillRect( x - halfSize, y - halfSize, size, size )\n          } // switch\n        } // col\n      } // row\n    \n    }\n    \n    // enable img.closePixelate\n    HTMLImageElement.prototype.closePixelate = function ( options ) {\n      return new ClosePixelation( this, options )\n    }\n    \n    // put in global namespace\n    window.ClosePixelation = ClosePixelation\n    \n    })( window );"]}