/*! For license information please see dll.LearnImagePixelPicker.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[68],{873:function(e,a,t){"use strict";t.r(a);var n=t(14),c=t.n(n),l=t(12),r=t.n(l),d=t(10),o=t.n(d),i=t(15),s=t.n(i),u=t(16),m=t.n(u),g=t(8),f=t.n(g),h=t(7),v=t.n(h),p=t(0),y=t.n(p),E=t(969),w=t(66),I=t(958),b=t(2716),k=t.n(b),x=t(2721),D=t.n(x),S=t(2723),C=t.n(S),G=t(103),z=t.n(G),B=t(140),R=t(197),M=t(191);function _(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f()(e);if(a){var c=f()(this).constructor;t=Reflect.construct(n,arguments,c)}else t=n.apply(this,arguments);return m()(this,t)}}var L=function(e){s()(t,e);var a=_(t);function t(e){var n;return c()(this,t),n=a.call(this,e),v()(o()(n),"invert",(function(){for(var e=0;e<n.data.length;e+=4)n.data[e]=255-n.data[e],n.data[e+1]=255-n.data[e+1],n.data[e+2]=255-n.data[e+2];n.ctx.putImageData(n.imageData,0,0)})),v()(o()(n),"grayscale",(function(){for(var e=0;e<n.data.length;e+=4){var a=(n.data[e]+n.data[e+1]+n.data[e+2])/3;n.data[e]=a,n.data[e+1]=a,n.data[e+2]=a}n.ctx.putImageData(n.imageData,0,0),n.setState({clickedGrayscale:!0})})),v()(o()(n),"drawImage",(function(e){var a,t=new Image,c=document.getElementById("picker");switch(c.addEventListener("mousemove",n.handleMouseMove),n.canvas=c,n.ctx=c.getContext("2d"),t.onload=function(){n.ctx.drawImage(t,0,0),n.imageData=n.ctx.getImageData(0,0,c.width,c.height),n.data=n.imageData.data},e){case"Landscape":default:a=k()();break;case"Boats":a=D()();break;case"Airplane":a=C()()}t.src="data:image/jpeg;base64,".concat(a.toString("base64"));var l=document.getElementById("zoom").getContext("2d");l.imageSmoothingEnabled=!1,l.mozImageSmoothingEnabled=!1,l.webkitImageSmoothingEnabled=!1,l.msImageSmoothingEnabled=!1,n.zoomctx=l,n.setState({selectedData:!0,clickedGrayscale:!1})})),v()(o()(n),"handleMouseMove",(function(e){var a=e.layerX,t=e.layerY,c=n.ctx.getImageData(a,t,1,1).data,l="rgba("+c[0]+", "+c[1]+", "+c[2]+", "+c[3]/255+")",r=document.getElementById("color");r.style.background=l,r.textContent=l,n.zoomctx.drawImage(n.canvas,z()(a-5),z()(t-5),10,10,0,0,200,200)})),n.state={clickedGrayscale:!1,selectedData:!1},n}return r()(t,[{key:"render",value:function(){return y.a.createElement(B.default,null,y.a.createElement("div",null,y.a.createElement(M.default,{options:["Landscape","Boats","Airplane"],onChange:this.drawImage}),this.state.selectedData?y.a.createElement("span",null,y.a.createElement(R.default,{inline:!0,disabled:this.state.clickedGrayscale,defaultValue:this.state.clickedGrayscale,legend:"Grayscale",onChange:this.grayscale}),y.a.createElement(R.default,{inline:!0,legend:"Invert",onChange:this.invert})):null),y.a.createElement(E.default,null,y.a.createElement(I.default,null,y.a.createElement(w.default,{md:8},y.a.createElement("canvas",{width:"600",height:"400",id:"picker"})),y.a.createElement(w.default,{md:3},y.a.createElement("div",{id:"color",style:{width:"250px",height:"50px",color:"red"}}),y.a.createElement("canvas",{id:"zoom",width:"250",height:"200"})))))}}]),t}(p.Component);a.default=L}}]);