-
Notifications
You must be signed in to change notification settings - Fork 89
/
demo_origin.js
1 lines (1 loc) · 45.2 KB
/
demo_origin.js
1
var _0x3efe4a=_0x5e2b;(function(_0x274f93,_0x13e88a){var _0x1ecfbc=_0x5e2b,_0x3bae38=_0x274f93();while(!![]){try{var _0x5167da=-parseInt(_0x1ecfbc(0x1b1))/0x1*(-parseInt(_0x1ecfbc(0x154))/0x2)+-parseInt(_0x1ecfbc(0x1a8))/0x3*(parseInt(_0x1ecfbc(0x1dc))/0x4)+parseInt(_0x1ecfbc(0x113))/0x5+parseInt(_0x1ecfbc(0x155))/0x6+parseInt(_0x1ecfbc(0x1c6))/0x7*(parseInt(_0x1ecfbc(0x19a))/0x8)+parseInt(_0x1ecfbc(0x14d))/0x9*(-parseInt(_0x1ecfbc(0x14f))/0xa)+-parseInt(_0x1ecfbc(0x159))/0xb*(parseInt(_0x1ecfbc(0x1a2))/0xc);if(_0x5167da===_0x13e88a)break;else _0x3bae38['push'](_0x3bae38['shift']());}catch(_0x572582){_0x3bae38['push'](_0x3bae38['shift']());}}}(_0x5d41,0xb680a));var isFirefox=typeof InstallTrigger!==_0x3efe4a(0x1d8),colors=['#ffffff',_0x3efe4a(0x144),_0x3efe4a(0x1d9),'#7c6322','#c17f0f','#6ab115','#f8d52a','#fc9b53',_0x3efe4a(0x130),_0x3efe4a(0x178),_0x3efe4a(0x119),_0x3efe4a(0x1cd),'#c8e225',_0x3efe4a(0x1ef),_0x3efe4a(0x1a1),'#8eacf8',_0x3efe4a(0x181),_0x3efe4a(0x1d3),'#e51e8d',_0x3efe4a(0x18e),_0x3efe4a(0x134),_0x3efe4a(0x174),_0x3efe4a(0x12b),_0x3efe4a(0x1b5),_0x3efe4a(0x1c2),_0x3efe4a(0x1f2),_0x3efe4a(0x1c3),_0x3efe4a(0x1f4),'#688365','#46a89c','#b7f2d1',_0x3efe4a(0x1f0)],labels=[_0x3efe4a(0x1b0),_0x3efe4a(0x1be),_0x3efe4a(0x19e),_0x3efe4a(0x173),'lbl-car_light_right','lbl-car_light_left',_0x3efe4a(0x1b4),_0x3efe4a(0x123),_0x3efe4a(0x1c0),_0x3efe4a(0x1e2),_0x3efe4a(0x1dd),_0x3efe4a(0x1de),_0x3efe4a(0x15c),_0x3efe4a(0x11d),_0x3efe4a(0x1f6),_0x3efe4a(0x143),_0x3efe4a(0x185),_0x3efe4a(0x1f8),_0x3efe4a(0x1fc),_0x3efe4a(0x1da),_0x3efe4a(0x15d),_0x3efe4a(0x1e0),_0x3efe4a(0x175),_0x3efe4a(0x196),_0x3efe4a(0x152),_0x3efe4a(0x183),'lbl-spoke_back',_0x3efe4a(0x1eb),'lbl-door_window_back',_0x3efe4a(0x1c9),_0x3efe4a(0x199),'lbl-windshield'],table_str=[_0x3efe4a(0x171)],cat_labels=['cat-car'],cat_sublabels=[[0x5f,0x71,0x80,0x90,0x97,0xab,0xaf,0xb1],[0x6f,0x7d,0x7e,0x88,0x8c,0x95,0x9a],[0x6a,0x78,0x7f,0x87,0x94,0x96,0x9b,0x9d,0x9f,0xa2,0xb2],[0x61,0x77,0x7c,0xa3,0xa9,0xb6]],x_init=0x0,y_init=0x0,current_cat_active=_0x3efe4a(0x1e6),current_cat_active_id=0x2,current_active=_0x3efe4a(0x1b0),current_subcat_active_id=0x7,current_active_id=0x0,sky_label_id=0x9d-0x1,sea_label_id=0x9b-0x1,current_color=colors[current_active_id],all_active_colour=[];function label_selection(){var _0x467d94=_0x3efe4a,_0x3386c0=document[_0x467d94(0x153)](_0x467d94(0x1ec)),_0x112a13=_0x3386c0[_0x467d94(0x12a)](_0x467d94(0x1a9));for(var _0x51ba45=0x0;_0x51ba45<_0x112a13[_0x467d94(0x172)];_0x51ba45++){console['log'](_0x112a13[_0x467d94(0x172)]),_0x112a13[_0x51ba45][_0x467d94(0x14e)](_0x467d94(0x1ce),function(){var _0x16835d=_0x467d94;console['log'](this['className']);var _0x2fec27=document[_0x16835d(0x153)]('palette');console['log'](cat_sublabels[current_cat_active_id][_0x16835d(0x172)]);var _0x1de221=0x0;for(_0x51ba45=0x0;_0x51ba45<cat_sublabels[current_cat_active_id][_0x16835d(0x172)];_0x51ba45++){tmp_id=cat_sublabels[current_cat_active_id][_0x51ba45]-0x1,str=labels[tmp_id],console[_0x16835d(0x1e9)](str),console[_0x16835d(0x1e9)](current_active),str==current_active&&(_0x1de221=0x1);}console[_0x16835d(0x1e9)](_0x1de221);if(_0x1de221){var _0x38a2f9=_0x2fec27['getElementsByClassName'](current_active);_0x38a2f9[0x0][_0x16835d(0x11b)]=_0x38a2f9[0x0]['className'][_0x16835d(0x17f)]('\x20lbl-active',''),_0x38a2f9[0x0][_0x16835d(0x124)][_0x16835d(0x148)]=_0x16835d(0x187),_0x38a2f9[0x0]['style']['color']='#202020';}this[_0x16835d(0x11b)]+='\x20lbl-active';for(var _0x1c0c02=0x0;_0x1c0c02<labels[_0x16835d(0x172)];_0x1c0c02++){this['className'][_0x16835d(0x176)](labels[_0x1c0c02])&&(this['style'][_0x16835d(0x148)]=colors[_0x1c0c02],this['style'][_0x16835d(0x19b)]='white',current_active=labels[_0x1c0c02],current_active_id=_0x1c0c02,current_color=colors[current_active_id],brush_color_context[_0x16835d(0x192)]=current_color,brush_color_context[_0x16835d(0x115)](0x0,0x0,BRUSH_COLOR_SIZE,BRUSH_COLOR_SIZE));};});}}label_selection();var header=document[_0x3efe4a(0x153)](_0x3efe4a(0x1c5)),btncat=header[_0x3efe4a(0x12a)](_0x3efe4a(0x1e1));for(var i=0x0;i<btncat['length'];i++){btncat[i][_0x3efe4a(0x14e)](_0x3efe4a(0x1ce),function(){var _0x2bdc51=_0x3efe4a,_0x2a810f=document[_0x2bdc51(0x153)](_0x2bdc51(0x1c5)),_0x4bfe07=_0x2a810f[_0x2bdc51(0x12a)](current_cat_active);_0x4bfe07[0x0][_0x2bdc51(0x11b)]=_0x4bfe07[0x0][_0x2bdc51(0x11b)][_0x2bdc51(0x17f)](_0x2bdc51(0x157),''),_0x4bfe07[0x0][_0x2bdc51(0x124)][_0x2bdc51(0x148)]=_0x2bdc51(0x187),_0x4bfe07[0x0][_0x2bdc51(0x124)]['color']=_0x2bdc51(0x163),this[_0x2bdc51(0x11b)]+='\x20catactive';for(var _0x51248a=0x0;_0x51248a<cat_labels[_0x2bdc51(0x172)];_0x51248a++){if(this[_0x2bdc51(0x11b)][_0x2bdc51(0x176)](cat_labels[_0x51248a])){this[_0x2bdc51(0x124)][_0x2bdc51(0x148)]='#606060',this[_0x2bdc51(0x124)]['color']='white',current_cat_active=cat_labels[_0x51248a],current_cat_active_id=_0x51248a;{$(_0x2bdc51(0x191))[_0x2bdc51(0x12d)](''),$('#palette')[_0x2bdc51(0x11f)](table_str[_0x51248a]),label_selection();}}};});}BRUSH_COLOR_SIZE=0x19;var brush_color_canvas=document[_0x3efe4a(0x153)](_0x3efe4a(0x132)),brush_color_context=brush_color_canvas[_0x3efe4a(0x1ba)]('2d'),rect={},drag=![];brush_color_context['canvas'][_0x3efe4a(0x195)]=BRUSH_COLOR_SIZE,brush_color_context[_0x3efe4a(0x1ea)][_0x3efe4a(0x1f9)]=BRUSH_COLOR_SIZE,brush_color_context[_0x3efe4a(0x192)]=colors[sky_label_id],brush_color_context[_0x3efe4a(0x115)](0x0,0x0,BRUSH_COLOR_SIZE,BRUSH_COLOR_SIZE);function getRandomInt(_0x4497db){var _0x2f2954=_0x3efe4a;return Math[_0x2f2954(0x1d0)](Math['random']()*Math[_0x2f2954(0x1d0)](_0x4497db));}var file_host='/static',nurl=0x3,this_moment=new Date()['toLocaleDateString'](),this_moment2=new Date()[_0x3efe4a(0x12c)](),random_number=getRandomInt(0x3b9aca00),global_fn=this_moment+','+this_moment2+'-'+random_number,style_name='random';onchange=_0x3efe4a(0x14a);function toggleCheckbox(){var _0x5ca5bb=_0x3efe4a;document[_0x5ca5bb(0x153)](_0x5ca5bb(0x1c1))[_0x5ca5bb(0x1df)]==0x0?document['getElementById'](_0x5ca5bb(0x1c1))[_0x5ca5bb(0x1df)]=0x1:document['getElementById'](_0x5ca5bb(0x1c1))[_0x5ca5bb(0x1df)]=0x0,console['log'](document[_0x5ca5bb(0x153)](_0x5ca5bb(0x1c1))['value']);}var slider=document[_0x3efe4a(0x153)](_0x3efe4a(0x164)),rangevalue=document['getElementById'](_0x3efe4a(0x12e));rangevalue['innerHTML']=slider['value'],slider[_0x3efe4a(0x128)]=function(){var _0x3b4858=_0x3efe4a;rangevalue['innerHTML']=this[_0x3b4858(0x1df)];};var img,upload_img,hdDown=![],fourkDown=![],lastEvent,mouseDown=![],mouseFirstMove=![],renderDown=![],newDown=![],brushDown=!![],recDown=![],eyedropperhDown=![];set_btn_active(_0x3efe4a(0x186));var brush_circle=!![],brush_square=![],brush_diamond=![];set_btn_active('brush_circle'),$(_0x3efe4a(0x136))[_0x3efe4a(0x1ce)](function(){var _0x57059c=_0x3efe4a;brush_circle==![]&&(brush_square&&(reset_btn_active('brush_square'),brush_square=![]),brush_diamond&&(reset_btn_active(_0x57059c(0x1aa)),brush_diamond=![]),brush_circle=!![],set_btn_active('brush_circle'));}),$('#brush_square')['click'](function(){var _0xe19b56=_0x3efe4a;brush_square==![]&&(brush_circle&&(reset_btn_active(_0xe19b56(0x15e)),brush_circle=![]),brush_diamond&&(reset_btn_active(_0xe19b56(0x1aa)),brush_diamond=![]),brush_square=!![],set_btn_active('brush_square'));}),$('#brush_diamond')[_0x3efe4a(0x1ce)](function(){var _0x1acb5e=_0x3efe4a;brush_diamond==![]&&(brush_circle&&(reset_btn_active(_0x1acb5e(0x15e)),brush_circle=![]),brush_square&&(reset_btn_active(_0x1acb5e(0x15b)),brush_square=![]),brush_diamond=!![],set_btn_active(_0x1acb5e(0x1aa)));});var fillDown=![],CANVAS_WIDTH=0x200,CANVAS_HEIGHT=0x180,INIT_GAP=0xc8,canvas=document[_0x3efe4a(0x153)](_0x3efe4a(0x162)),context=canvas[_0x3efe4a(0x1ba)]('2d'),rect={},drag=![];context[_0x3efe4a(0x1ea)]['width']=CANVAS_WIDTH,context[_0x3efe4a(0x1ea)][_0x3efe4a(0x1f9)]=CANVAS_HEIGHT;var roi_canvas=document[_0x3efe4a(0x153)]('roi_view'),roi_context=roi_canvas[_0x3efe4a(0x1ba)]('2d'),rect={},drag=![];roi_context[_0x3efe4a(0x1ea)][_0x3efe4a(0x195)]=CANVAS_WIDTH,roi_context[_0x3efe4a(0x1ea)][_0x3efe4a(0x1f9)]=CANVAS_HEIGHT;var temp_canvas=document['getElementById'](_0x3efe4a(0x140)),temp_context=temp_canvas[_0x3efe4a(0x1ba)]('2d'),rect={},drag=![];temp_context[_0x3efe4a(0x1ea)][_0x3efe4a(0x195)]=CANVAS_WIDTH,temp_context[_0x3efe4a(0x1ea)][_0x3efe4a(0x1f9)]=CANVAS_HEIGHT,roi_context[_0x3efe4a(0x192)]='#ffffff',roi_context['fillRect'](0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT);var curr_image_id='0';createDefaultImage();function createDefaultImage(){var _0x3cebe1=_0x3efe4a;img=new Image(),img['onload']=DefaultimageLoaded,img[_0x3cebe1(0x17c)]=file_host+_0x3cebe1(0x13e)+curr_image_id+_0x3cebe1(0x165),img[_0x3cebe1(0x151)](_0x3cebe1(0x1b6),_0x3cebe1(0x1a0));}function DefaultimageLoaded(){var _0x2fdf24=_0x3efe4a;context_output[_0x2fdf24(0x158)](0x0,0x0,canvas[_0x2fdf24(0x195)],canvas[_0x2fdf24(0x1f9)]),context_output['drawImage'](img,0x0,0x0,canvas[_0x2fdf24(0x195)],canvas['height']);var _0xcb763d=new Image();_0xcb763d['src']=file_host+_0x2fdf24(0x1ee)+curr_image_id+_0x2fdf24(0x1af),_0xcb763d[_0x2fdf24(0x161)]=function(){var _0x2b7f97=_0x2fdf24;context[_0x2b7f97(0x160)](_0xcb763d,0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT);};}var previous_canvas_image='',canvas_output=document['getElementById'](_0x3efe4a(0x1bd)),context_output=canvas_output['getContext']('2d'),rect={},drag=![];context_output[_0x3efe4a(0x1ea)]['width']=CANVAS_WIDTH,context_output[_0x3efe4a(0x1ea)][_0x3efe4a(0x1f9)]=CANVAS_HEIGHT;var custom_image_upload=![],custom_canvas=document[_0x3efe4a(0x153)](_0x3efe4a(0x1ca)),custom_context=custom_canvas[_0x3efe4a(0x1ba)]('2d'),rect={},drag=![];CANVAS_WIDTH_2K=0x200,CANVAS_HEIGHT_2K=0x200;function render(){var _0xa07998=_0x3efe4a,_0x1958bd=document[_0xa07998(0x153)](_0xa07998(0x1c1))['value'];_0x1958bd!=0x1?alert(_0xa07998(0x1bc)):($('#render')[_0xa07998(0x13b)](),$(_0xa07998(0x1fa))[_0xa07998(0x1fb)](),$('#download_identity_vector')[_0xa07998(0x13b)](),$['ajax']({'type':_0xa07998(0x17d),'url':_0xa07998(0x184),'contentType':_0xa07998(0x1fe),'data':JSON['stringify']({'imageBase64':canvas[_0xa07998(0x141)](),'roi':roi_canvas[_0xa07998(0x141)](),'name':global_fn,'image_id':curr_image_id,'roi_id':all_active_colour}),'success':function(_0x2f2021){var _0x1e0acc=_0xa07998;$(_0x1e0acc(0x11e))[_0x1e0acc(0x1fb)](),$(_0x1e0acc(0x1fa))[_0x1e0acc(0x13b)](),console['log'](_0x1e0acc(0x166)),obj=JSON[_0x1e0acc(0x18f)](_0x2f2021);var _0x560a9b=obj['sv_name'];curr_image_id=_0x1e0acc(0x168)+obj[_0x1e0acc(0x19d)],_0x30d377();function _0x30d377(){var _0x544c87=_0x1e0acc;img=new Image(),img[_0x544c87(0x161)]=_0x2b5db2,img[_0x544c87(0x17c)]=file_host+_0x544c87(0x16a)+_0x560a9b+_0x544c87(0x165),img[_0x544c87(0x151)](_0x544c87(0x1b6),_0x544c87(0x1a0));}function _0x2b5db2(){var _0x40f958=_0x1e0acc;context_output[_0x40f958(0x158)](0x0,0x0,canvas[_0x40f958(0x195)],canvas[_0x40f958(0x1f9)]),context_output[_0x40f958(0x160)](img,0x0,0x0,canvas[_0x40f958(0x195)],canvas[_0x40f958(0x1f9)]);var _0x558cb0=new Image();_0x558cb0[_0x40f958(0x17c)]=file_host+_0x40f958(0x16a)+_0x560a9b+_0x40f958(0x13a),_0x558cb0[_0x40f958(0x161)]=function(){var _0x19caee=_0x40f958;context[_0x19caee(0x160)](_0x558cb0,0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT);};}},'error':function(_0x55ebf1){var _0x43750b=_0xa07998;console[_0x43750b(0x1e9)]('error');}})['done'](function(_0x39981f){var _0x51f7ef=_0xa07998;$('#download_identity_vector')[_0x51f7ef(0x1fb)](),console[_0x51f7ef(0x1e9)](_0x51f7ef(0x1f7));}));}function draw_fill(_0x10ff30,_0x2203cd,_0x134a4b,_0x580e75,_0x56b6ff,_0x2fd2a8,_0x49489){var _0x1293e1=_0x3efe4a,_0x19b369=[[_0x2203cd,_0x134a4b]],_0x1a4e21=canvas[_0x1293e1(0x195)],_0x3e4023=canvas[_0x1293e1(0x1f9)],_0x2c2e0b=_0x10ff30[_0x1293e1(0x177)](0x0,0x0,_0x1a4e21,_0x3e4023);_0x290b1f=(_0x134a4b*_0x1a4e21+_0x2203cd)*0x4;var _0x2c22f5=_0x2c2e0b[_0x1293e1(0x14c)][_0x290b1f+0x0],_0x4889d9=_0x2c2e0b['data'][_0x290b1f+0x1],_0x3b3409=_0x2c2e0b[_0x1293e1(0x14c)][_0x290b1f+0x2],_0x1014b9=_0x2c2e0b[_0x1293e1(0x14c)][_0x290b1f+0x3];if(_0x580e75===_0x2c22f5&&_0x56b6ff===_0x4889d9&&_0x2fd2a8===_0x3b3409&&_0x49489===_0x1014b9)return;while(_0x19b369['length']){var _0x178a83,_0x2203cd,_0x134a4b,_0x290b1f,_0x148073,_0x698120;_0x178a83=_0x19b369[_0x1293e1(0x193)](),_0x2203cd=_0x178a83[0x0],_0x134a4b=_0x178a83[0x1],_0x290b1f=(_0x134a4b*_0x1a4e21+_0x2203cd)*0x4;while(_0x128b1b(_0x290b1f)){_0x134a4b--,_0x290b1f=(_0x134a4b*_0x1a4e21+_0x2203cd)*0x4;}_0x148073=![],_0x698120=![];while(!![]){_0x134a4b++,_0x290b1f=(_0x134a4b*_0x1a4e21+_0x2203cd)*0x4;if(!(_0x134a4b<_0x3e4023&&_0x128b1b(_0x290b1f)))break;_0x3e07c0(_0x290b1f);if(_0x2203cd>0x0){if(_0x128b1b(_0x290b1f-0x4))!_0x148073&&(_0x19b369[_0x1293e1(0x150)]([_0x2203cd-0x1,_0x134a4b]),_0x148073=!![]);else _0x148073&&(_0x148073=![]);}if(_0x2203cd<_0x1a4e21-0x1){if(_0x128b1b(_0x290b1f+0x4))!_0x698120&&(_0x19b369[_0x1293e1(0x150)]([_0x2203cd+0x1,_0x134a4b]),_0x698120=!![]);else _0x698120&&(_0x698120=![]);}_0x290b1f+=_0x1a4e21*0x4;}}_0x10ff30[_0x1293e1(0x1d5)](_0x2c2e0b,0x0,0x0);function _0x128b1b(_0x4c2806){var _0x3e60be=_0x1293e1;return _0x2c2e0b['data'][_0x4c2806+0x0]===_0x2c22f5&&_0x2c2e0b['data'][_0x4c2806+0x1]===_0x4889d9&&_0x2c2e0b[_0x3e60be(0x14c)][_0x4c2806+0x2]===_0x3b3409&&_0x2c2e0b[_0x3e60be(0x14c)][_0x4c2806+0x3]===_0x1014b9;}function _0x3e07c0(_0x2b1893){var _0x220111=_0x1293e1;_0x2c2e0b['data'][_0x2b1893+0x0]=_0x580e75,_0x2c2e0b['data'][_0x2b1893+0x1]=_0x56b6ff,_0x2c2e0b[_0x220111(0x14c)][_0x2b1893+0x2]=_0x2fd2a8,_0x2c2e0b[_0x220111(0x14c)][_0x2b1893+0x3]=_0x49489;}}function aliasedCircle(_0x160648,_0x356d65,_0x40687e,_0x1bbe4b){var _0x1c819c=_0x3efe4a,_0x2ef512=_0x1bbe4b,_0x3548da=0x0,_0x252804=0x0;_0x160648[_0x1c819c(0x115)](_0x356d65-_0x2ef512,_0x40687e,_0x1bbe4b<<0x1,0x1);while(_0x2ef512>_0x3548da){_0x252804-=--_0x2ef512-++_0x3548da;if(_0x252804<0x0)_0x252804+=_0x2ef512++;_0x160648[_0x1c819c(0x115)](_0x356d65-_0x3548da,_0x40687e-_0x2ef512,_0x3548da<<0x1,0x1),_0x160648[_0x1c819c(0x115)](_0x356d65-_0x2ef512,_0x40687e-_0x3548da,_0x2ef512<<0x1,0x1),_0x160648[_0x1c819c(0x115)](_0x356d65-_0x2ef512,_0x40687e+_0x3548da,_0x2ef512<<0x1,0x1),_0x160648['fillRect'](_0x356d65-_0x3548da,_0x40687e+_0x2ef512,_0x3548da<<0x1,0x1);}}function aliasedSquare(_0x24f79d,_0x23afac,_0x579dee,_0x152870){var _0x94c4d=_0x3efe4a;_0x24f79d[_0x94c4d(0x115)](_0x23afac-_0x152870,_0x579dee-_0x152870,0x2*_0x152870,0x2*_0x152870);}function aliasedBox(_0x4a1cc7,_0x18c6f9,_0x24ddfe,_0x50214d){var _0x2e5671=_0x3efe4a;_0x4a1cc7[_0x2e5671(0x158)](0x0,0x0,canvas[_0x2e5671(0x195)],canvas[_0x2e5671(0x1f9)]),_0x4a1cc7['drawImage'](upload_img,0x0,0x0,canvas['width'],canvas[_0x2e5671(0x1f9)]),_0x4a1cc7[_0x2e5671(0x17e)](x_init,y_init,_0x18c6f9-x_init,_0x24ddfe-y_init);}function aliasedDiamond(_0x572b75,_0xa7bb02,_0x3a6b83,_0x4634d5){var _0x21220b=_0x3efe4a,_0x29eb50=0x0;while(_0x29eb50<_0x4634d5){_0x572b75['fillRect'](_0xa7bb02-_0x29eb50,_0x3a6b83-(_0x4634d5-_0x29eb50),0x1,0x2*(_0x4634d5-_0x29eb50)+0x1),_0x572b75[_0x21220b(0x115)](_0xa7bb02+_0x29eb50,_0x3a6b83-(_0x4634d5-_0x29eb50),0x1,0x2*(_0x4634d5-_0x29eb50)+0x1),_0x29eb50+=0x1;}}$(_0x3efe4a(0x198))[_0x3efe4a(0x1ce)](function(){var _0x1986e2=_0x3efe4a;alert(_0x1986e2(0x131));}),$(_0x3efe4a(0x142))['click'](function(){alert('You\x20can\x20upload\x20a\x20landscape\x20image\x20and\x20use\x20its\x20segmentation\x20mask\x20as\x20the\x20starting\x20point\x20of\x20your\x20painting.\x20Accepting\x20format\x20JPG/JPEG/PNG');}),$(_0x3efe4a(0x1d6))[_0x3efe4a(0x1ce)](function(){alert('You\x20can\x20upload\x20a\x20landscape\x20image\x20and\x20use\x20its\x20style\x20as\x20the\x20style\x20of\x20your\x20output\x20image.\x20Image\x20format\x20JPG/JPEG/PNG');}),$(_0x3efe4a(0x11e))[_0x3efe4a(0x1ce)](function(){render();}),$(_0x3efe4a(0x1b2))[_0x3efe4a(0x1ce)](function(){var _0x3acba2=_0x3efe4a;console[_0x3acba2(0x1e9)](_0x3acba2(0x11c)),brushDown==![]&&(set_btn_active(_0x3acba2(0x11c)),reset_btn_active(_0x3acba2(0x1d2)),reset_btn_active(_0x3acba2(0x194)),reset_btn_active(_0x3acba2(0x186))),eyedropperhDown=![],renderDown=![],newDown=![],brushDown=![],fillDown=![],recDown=!![],init_box=!![],canvas[_0x3acba2(0x124)][_0x3acba2(0x1a3)]='crosshair';}),$(_0x3efe4a(0x1bb))['click'](function(){var _0x481f8e=_0x3efe4a;console[_0x481f8e(0x1e9)](_0x481f8e(0x186)),brushDown==![]&&(set_btn_active(_0x481f8e(0x186)),reset_btn_active(_0x481f8e(0x1d2)),reset_btn_active('eyedropper')),eyedropperhDown=![],renderDown=![],newDown=![],brushDown=!![],fillDown=![],recDown=![],canvas[_0x481f8e(0x124)][_0x481f8e(0x1a3)]=_0x481f8e(0x146);}),$(_0x3efe4a(0x112))[_0x3efe4a(0x1ce)](function(){var _0x30c9c1=_0x3efe4a;console[_0x30c9c1(0x1e9)]('fill'),fillDown==![]&&(set_btn_active(_0x30c9c1(0x1d2)),reset_btn_active(_0x30c9c1(0x186)),reset_btn_active('eyedropper')),eyedropperhDown=![],renderDown=![],newDown=![],brushDown=![],fillDown=!![],recDown=![],canvas[_0x30c9c1(0x124)]['cursor']=_0x30c9c1(0x197);}),$(_0x3efe4a(0x169))['click'](function(){var _0xf1d14e=_0x3efe4a;console[_0xf1d14e(0x1e9)](_0xf1d14e(0x194)),eyedropperhDown==![]&&(set_btn_active(_0xf1d14e(0x194)),reset_btn_active('brush'),reset_btn_active('fill')),eyedropperhDown=!![],renderDown=![],newDown=![],brushDown=![],recDown=![],fillDown=![],canvas[_0xf1d14e(0x124)][_0xf1d14e(0x1a3)]=_0xf1d14e(0x1d1);}),$('#new')[_0x3efe4a(0x1ce)](function(){var _0xcbdbff=_0x3efe4a;console['log'](_0xcbdbff(0x14b)),context[_0xcbdbff(0x192)]=colors[sky_label_id],context['fillRect'](0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT-INIT_GAP),context[_0xcbdbff(0x192)]=colors[sea_label_id],context['fillRect'](0x0,CANVAS_HEIGHT-INIT_GAP,CANVAS_WIDTH,CANVAS_HEIGHT);}),$(_0x3efe4a(0x116))[_0x3efe4a(0x1ce)](function(){var _0x407165=_0x3efe4a;console[_0x407165(0x1e9)]('undo'),previous_canvas_image!=''&&(context[_0x407165(0x1d5)](previous_canvas_image,0x0,0x0),previous_canvas_image='',set_btn_active(_0x407165(0x15f)));}),set_btn_active(_0x3efe4a(0x15f));function _0x5e2b(_0x14d1db,_0x3ae1a7){var _0x5d4183=_0x5d41();return _0x5e2b=function(_0x5e2bef,_0x2d1900){_0x5e2bef=_0x5e2bef-0x111;var _0x2aff32=_0x5d4183[_0x5e2bef];return _0x2aff32;},_0x5e2b(_0x14d1db,_0x3ae1a7);}function set_btn_active(_0x1334d0){var _0xe2cf3a=_0x3efe4a,_0x347899=document[_0xe2cf3a(0x153)](_0x1334d0);_0x347899[_0xe2cf3a(0x11b)]=_0x347899[_0xe2cf3a(0x11b)]+_0xe2cf3a(0x18d);}function _0x5d41(){var _0x4db603=['#example10','getElementsByClassName','#c2577d','getTime','html','rangevalue','ready','#dc934d','You\x20can\x20upload\x20your\x20previously\x20saved\x20segmentation\x20map\x20using\x20this\x20upload\x20button.\x20Image\x20format\x20PNG.','brush_color','href','#345354','FileReader','#brush_circle','editing_vector','fillDown','curr_editing_vector_steps','_mask.png','hide','x_init','split','/images/car_real/','error','upload_canvas','toDataURL','#info_real','lbl-logo','#eee566','editing_vector_steps','crosshair','round','background','/samples/sample_','toggleCheckbox(this)','new','data','800181HlMhyG','addEventListener','50wBeknD','push','setAttribute','lbl-wheelhub_back','getElementById','26uGorny','7885932cpkuOC','#example8','\x20cat-active','clearRect','19822QlwXxw','createElement','brush_square','lbl-hoods','lbl-taillight_left','brush_circle','undo','drawImage','onload','viewport','#202020','myRange','.jpg','success','mouseup','results_','#eyedropper','/results/','realfile','#download_identity_vector','ctrlKey','image/png','files','offsetY','<table>\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-background\x22>background</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-back_bumper\x22>back_bumper</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-bumper\x22>bumper</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-car_body\x22>car_body</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-car_light_right\x22>car_light_right</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-car_light_left\x22>car_light_left</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-door_back\x22>door_back</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-grilles\x22>grilles</button></th></tr>\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-back_handle\x22>back_handle</button></th></tr>\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-fronthandle\x22>fronthandle</button></th></tr>\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-hoods\x22>hoods</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-license_plate_front\x22>license_plate_front</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-licence_plate_back\x22>licence_plate_back</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-logo\x22>logo</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-mirror\x22>mirror</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-roof\x22>roof</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-running_boards\x22>running_boards</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-taillight_right\x22>taillight_right</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-taillight_left\x22>taillight_left</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-car_light_left\x22>car_light_left</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-back_wheel\x22>back_wheel</button></th></tr>\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-front_wheel\x22>front_wheel</button></th></tr>\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-trunks\x22>trunks</button></th></tr>\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-wheelhub_back\x22>wheelhub_back</button></th></tr>\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-wheelhub_front\x22>wheelhub_front</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-spoke_back\x22>spoke_back</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-spoke_front\x22>spoke_front</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-door_window_back\x22>door_window_back</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-back_windshield\x22>back_windshield</button></th></tr>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<tr><th><button\x20class=\x22btnclr\x20lbl-door_window_front\x22>door_window_front</button></th></tr>\x20<tr><th><button\x20class=\x22btnclr\x20lbl-windshield\x22>windshield</button></th></tr>\x20\x20\x20\x20</tr>\x20\x20\x20\x20</table>','length','lbl-car_body','#e53f6e','lbl-front_wheel','includes','getImageData','#635303','#example4','#example0','#example7','src','POST','strokeRect','replace','getBoundingClientRect','#997092','offsetX','lbl-wheelhub_front','/api/edit_from_mask','lbl-mirror','brush','inherit','/api/apply_current_editing_vector','#example9','Backup','abs','#vectorfile','_active','#73d083','parse','touchmove','#palette','fillStyle','pop','eyedropper','width','lbl-trunks','sw-resize','#info_segmap','lbl-door_window_front','10648pZAETE','color','brushDown','sv_name','lbl-bumper','Um,\x20couldn\x27t\x20find\x20the\x20imgfile\x20element.','Anonymous','#e905db','16644rxmStG','cursor','appendChild','Uploading\x20Done!\x20You\x20can\x20apply\x20current\x20editing\x20vector\x20now.\x20','#customBtn','clientY','3408MXMQjB','btnclr','brush_diamond','mousemove','name','/api/apply_editing_vector','body','.png','lbl-background','72518EkDPut','#rectangle','readAsDataURL','lbl-door_back','#e16012','crossOrigin','onkeyup','000000','result','getContext','#brush','Please\x20check\x20the\x20button\x20in\x20terms\x20and\x20conditions\x20section\x20before\x20starting\x20using\x20the\x20app.','output','lbl-back_bumper','recDown','lbl-door_front','myCheck','#498be2','#a9656f','ajax','category','7532EarRQX','eyedropperhDown','load\x20image','lbl-back_windshield','custom','y_init','#example1','#3fb618','click','function','floor','s-resize','fill','#2670fe','exec','putImageData','#info_style','Upload,\x20\x20','undefined','#000000','lbl-taillight_right','sample_','2872UIrmsM','lbl-back_handle','lbl-fronthandle','value','lbl-back_wheel','btncat','lbl-grilles','/results/current_editing_latent_cache.pickle','#example6','/upload_image','cat-car','touchend','mousedown','log','canvas','lbl-spoke_front','palette','curr_scale','/images/car_real/colorize_mask/','#e1b8a1','#48b8e2','#random','#ac8f10','mouseup\x20inside','#1f66d3','/upload_vector','lbl-licence_plate_back','sent','lbl-roof','height','#loading','show','lbl-running_boards','Invalid\x20color\x20component','application/json','left','#fill','4089425YbQjyI','upload_','fillRect','#undo','done','toString','#74748a','stringify','className','rectangle','lbl-license_plate_front','#render','append','top','touchstart','shiftKey','lbl-fender','style','Please\x20select\x20a\x20file\x20before\x20clicking\x20\x27Load\x27','/api/random_roll','scale','oninput'];_0x5d41=function(){return _0x4db603;};return _0x5d41();}function reset_btn_active(_0x3852f1){var _0x4a6b72=_0x3efe4a,_0x373dab=document[_0x4a6b72(0x153)](_0x3852f1);_0x373dab[_0x4a6b72(0x11b)]=_0x373dab[_0x4a6b72(0x11b)]['replace'](_0x4a6b72(0x18d),'');}function backup_canvas(){var _0x2ce3b9=_0x3efe4a;console[_0x2ce3b9(0x1e9)](_0x2ce3b9(0x18a)),previous_canvas_image=context['createImageData'](CANVAS_WIDTH,CANVAS_HEIGHT);var _0x524aca=context[_0x2ce3b9(0x177)](0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT);previous_canvas_image['data']['set'](_0x524aca['data']),reset_btn_active('undo');}$(canvas)['on'](_0x3efe4a(0x167),function(_0x554ad0){mouseDown=![],mouseFirstMove=![],console['log']('mouseup\x20inside');}),$(canvas)['on'](_0x3efe4a(0x1e8),function(_0x325031){var _0x16ba57=_0x3efe4a;lastEvent=_0x325031,mouseDown=!![];if(fillDown){backup_canvas();var _0x310c43=hexToRgb(current_color)['r'],_0x422e6b=hexToRgb(current_color)['g'],_0x5a803b=hexToRgb(current_color)['b'];draw_fill(context,_0x325031[_0x16ba57(0x182)],_0x325031[_0x16ba57(0x170)],_0x310c43,_0x422e6b,_0x5a803b,0xff);}else{if(eyedropperhDown)pick_color(_0x325031);else brushDown&&(console['log'](_0x16ba57(0x19c)),single_point_drawing(_0x325031));}}),$(canvas_output)['on'](_0x3efe4a(0x1e8),function(_0x13e32e){var _0x1e57f1=_0x3efe4a;lastEvent=_0x13e32e,mouseDown=!![],init_box&&(x_init=_0x13e32e[_0x1e57f1(0x182)],y_init=_0x13e32e['offsetY'],init_box=![]),console[_0x1e57f1(0x1e9)](_0x1e57f1(0x13c),x_init),console['log']('y_init',y_init),console[_0x1e57f1(0x1e9)](_0x1e57f1(0x1bf));}),$(canvas_output)['on'](_0x3efe4a(0x1ab),function(_0x293abb){var _0x203304=_0x3efe4a;lastEvent=_0x293abb,mouseDown&&(console[_0x203304(0x1e9)](_0x203304(0x13c),x_init),console[_0x203304(0x1e9)](_0x203304(0x1cb),y_init),rec_drawing(_0x293abb),console['log'](_0x203304(0x1ab)));}),$(canvas_output)['on'](_0x3efe4a(0x167),function(_0x51e40f){var _0x568adc=_0x3efe4a;mouseDown=![],mouseFirstMove=![],console[_0x568adc(0x1e9)](_0x568adc(0x1f3)),$(_0x568adc(0x16c))['hide'](),$('#render')[_0x568adc(0x13b)](),$(_0x568adc(0x1fa))[_0x568adc(0x1fb)](),$[_0x568adc(0x1c4)]({'type':_0x568adc(0x17d),'url':_0x568adc(0x1e5),'contentType':_0x568adc(0x1fe),'data':JSON['stringify']({'imageBase64':temp_canvas[_0x568adc(0x141)](),'image_id':curr_image_id,'crop_loc':[x_init,y_init,_0x51e40f['offsetX'],_0x51e40f[_0x568adc(0x170)]]}),'success':function(_0x20c8cf){var _0x3b4670=_0x568adc;$(_0x3b4670(0x11e))[_0x3b4670(0x1fb)](),$(_0x3b4670(0x1fa))['hide'](),$(_0x3b4670(0x1bb))[_0x3b4670(0x1fb)](),$(_0x3b4670(0x112))['show'](),$(_0x3b4670(0x169))[_0x3b4670(0x1fb)](),$('#undo')[_0x3b4670(0x1fb)](),$(_0x3b4670(0x1b2))[_0x3b4670(0x13b)](),console[_0x3b4670(0x1e9)](_0x3b4670(0x166)),obj=JSON[_0x3b4670(0x18f)](_0x20c8cf);var _0x1a8a8f=obj[_0x3b4670(0x19d)];curr_image_id=_0x3b4670(0x114)+obj[_0x3b4670(0x19d)],console['log'](_0x3b4670(0x1d7),curr_image_id),_0x318740();function _0x318740(){var _0x581d97=_0x3b4670;img=new Image(),img[_0x581d97(0x161)]=_0x2a141e,img[_0x581d97(0x17c)]=file_host+_0x581d97(0x16a)+_0x1a8a8f+_0x581d97(0x165),img['setAttribute'](_0x581d97(0x1b6),'Anonymous');}function _0x2a141e(){var _0x3766af=_0x3b4670;context_output['clearRect'](0x0,0x0,canvas[_0x3766af(0x195)],canvas[_0x3766af(0x1f9)]),context_output[_0x3766af(0x160)](img,0x0,0x0,canvas['width'],canvas[_0x3766af(0x1f9)]);var _0x2826e2=new Image();_0x2826e2[_0x3766af(0x17c)]=file_host+_0x3766af(0x16a)+_0x1a8a8f+'_mask.png',_0x2826e2[_0x3766af(0x161)]=function(){var _0x36645f=_0x3766af;context[_0x36645f(0x160)](_0x2826e2,0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT);};}},'error':function(_0x3e32a7){var _0x578fb3=_0x568adc;console[_0x578fb3(0x1e9)](_0x578fb3(0x13f));}})['done'](function(_0x5c6ba3){var _0x28d278=_0x568adc;console[_0x28d278(0x1e9)](_0x28d278(0x1f7));});});function hexToRgb(_0x6571){var _0x1ff986=_0x3efe4a,_0x359569=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i[_0x1ff986(0x1d4)](_0x6571);return _0x359569?{'r':parseInt(_0x359569[0x1],0x10),'g':parseInt(_0x359569[0x2],0x10),'b':parseInt(_0x359569[0x3],0x10)}:null;}function rgbToHex(_0x2172fc,_0x5e95e3,_0x1fe9d4){var _0x3aae53=_0x3efe4a;if(_0x2172fc>0xff||_0x5e95e3>0xff||_0x1fe9d4>0xff)throw _0x3aae53(0x1fd);return(_0x2172fc<<0x10|_0x5e95e3<<0x8|_0x1fe9d4)[_0x3aae53(0x118)](0x10);}function pick_color(_0x4eddfe){var _0x1ea07c=_0x3efe4a,_0x3219b4=context['getImageData'](_0x4eddfe[_0x1ea07c(0x182)],_0x4eddfe[_0x1ea07c(0x170)],0x1,0x1),_0xf9b27a='#'+(_0x1ea07c(0x1b8)+rgbToHex(_0x3219b4[_0x1ea07c(0x14c)][0x0],_0x3219b4['data'][0x1],_0x3219b4['data'][0x2]))['slice'](-0x6);current_color=_0xf9b27a,all_active_colour[_0x1ea07c(0x150)](_0xf9b27a),brush_color_context[_0x1ea07c(0x192)]=current_color,brush_color_context['fillRect'](0x0,0x0,BRUSH_COLOR_SIZE,BRUSH_COLOR_SIZE);}function rec_drawing(_0x4c035d){var _0x1f72ac=_0x3efe4a,_0x206de3=slider[_0x1f72ac(0x1df)]/0x2;context_output['fillStyle']=colors[0x0],aliasedBox(context_output,_0x4c035d['offsetX'],_0x4c035d['offsetY']),context_output[_0x1f72ac(0x1d2)]();}function single_point_drawing(_0x32a8d1){var _0x1ffaab=_0x3efe4a,_0x4087f9=slider[_0x1ffaab(0x1df)]/0x2;context[_0x1ffaab(0x192)]=current_color;if(brush_circle)aliasedCircle(context,_0x32a8d1['offsetX'],_0x32a8d1[_0x1ffaab(0x170)],_0x4087f9);else{if(brush_square)aliasedSquare(context,_0x32a8d1['offsetX'],_0x32a8d1['offsetY'],_0x4087f9);else brush_diamond&&aliasedDiamond(context,_0x32a8d1[_0x1ffaab(0x182)],_0x32a8d1[_0x1ffaab(0x170)],_0x4087f9);}context[_0x1ffaab(0x1d2)](),roi_context[_0x1ffaab(0x192)]='#000000';if(brush_circle)aliasedCircle(roi_context,_0x32a8d1[_0x1ffaab(0x182)],_0x32a8d1[_0x1ffaab(0x170)],_0x4087f9);else{if(brush_square)aliasedSquare(roi_context,_0x32a8d1[_0x1ffaab(0x182)],_0x32a8d1[_0x1ffaab(0x170)],_0x4087f9);else brush_diamond&&aliasedDiamond(roi_context,_0x32a8d1[_0x1ffaab(0x182)],_0x32a8d1['offsetY'],_0x4087f9);}roi_context['fill']();}function return_offset(_0x34e2a8,_0x207042){var _0x4e610e=_0x3efe4a;return{'offsetX':Math['round'](_0x34e2a8),'offsetY':Math[_0x4e610e(0x147)](_0x207042)};}function two_point_drawing(_0xbd5fb,_0x193d32){var _0x3a9af0=_0x3efe4a;dx=_0xbd5fb['offsetX']-_0x193d32['offsetX'],dy=_0xbd5fb[_0x3a9af0(0x170)]-_0x193d32['offsetY'];if(Math[_0x3a9af0(0x18b)](dx)>Math['abs'](dy)){if(dx>0x0){sh=dy/dx;for(i=Math[_0x3a9af0(0x147)](_0x193d32[_0x3a9af0(0x182)]);i<=Math[_0x3a9af0(0x147)](_0xbd5fb[_0x3a9af0(0x182)]);i++){nx=i,ny=Math[_0x3a9af0(0x1d0)](sh*(i-Math[_0x3a9af0(0x147)](_0x193d32[_0x3a9af0(0x182)]))+Math['round'](_0x193d32[_0x3a9af0(0x170)])),single_point_drawing(return_offset(nx,ny));}}else{sh=dy/dx;for(i=Math[_0x3a9af0(0x147)](_0xbd5fb[_0x3a9af0(0x182)]);i<=Math['round'](_0x193d32[_0x3a9af0(0x182)]);i++){nx=i,ny=Math[_0x3a9af0(0x1d0)](sh*(i-Math[_0x3a9af0(0x147)](_0xbd5fb['offsetX']))+Math[_0x3a9af0(0x147)](_0xbd5fb[_0x3a9af0(0x170)])),single_point_drawing(return_offset(nx,ny));}}}else{if(dy>0x0){sh=dx/dy;for(i=Math['round'](_0x193d32[_0x3a9af0(0x170)]);i<=Math[_0x3a9af0(0x147)](_0xbd5fb['offsetY']);i++){ny=i,nx=Math[_0x3a9af0(0x1d0)](sh*(i-Math[_0x3a9af0(0x147)](_0x193d32[_0x3a9af0(0x170)]))+Math[_0x3a9af0(0x147)](_0x193d32[_0x3a9af0(0x182)])),single_point_drawing(return_offset(nx,ny));}}else{sh=dx/dy;for(i=Math[_0x3a9af0(0x147)](_0xbd5fb[_0x3a9af0(0x170)]);i<=Math[_0x3a9af0(0x147)](_0x193d32[_0x3a9af0(0x170)]);i++){ny=i,nx=Math[_0x3a9af0(0x1d0)](sh*(i-Math[_0x3a9af0(0x147)](_0xbd5fb['offsetY']))+Math[_0x3a9af0(0x147)](_0xbd5fb['offsetX'])),single_point_drawing(return_offset(nx,ny));}}}}$(canvas)['on'](_0x3efe4a(0x1ab),function(_0xe0b29e){_0xe0b29e['buttons']==0x1&mouseDown&brushDown&&(mouseFirstMove==![]&&(mouseFirstMove=!![],backup_canvas()),isFirefox?single_point_drawing(_0xe0b29e):two_point_drawing(_0xe0b29e,lastEvent),lastEvent=_0xe0b29e);}),canvas[_0x3efe4a(0x14e)](_0x3efe4a(0x1e7),function(_0x3fcddc){mouseDown=![],mouseFirstMove=![];},![]),canvas[_0x3efe4a(0x14e)]('touchstart',function(_0x2bd369){var _0x46906d=_0x3efe4a;mousePos=getTouchPos(canvas,_0x2bd369),lastEvent=mousePos,mouseDown=!![],console[_0x46906d(0x1e9)](lastEvent);if(fillDown){console['log'](_0x46906d(0x138)),backup_canvas();var _0x3f933a=hexToRgb(current_color)['r'],_0x27d3eb=hexToRgb(current_color)['g'],_0x48b01b=hexToRgb(current_color)['b'];draw_fill(context,mousePos[_0x46906d(0x182)],mousePos[_0x46906d(0x170)],_0x3f933a,_0x27d3eb,_0x48b01b,0xff);}else{if(eyedropperhDown)console[_0x46906d(0x1e9)](_0x46906d(0x1c7)),pick_color(mousePos);else brushDown&&(console[_0x46906d(0x1e9)](_0x46906d(0x19c)),single_point_drawing(mousePos));}},![]),canvas[_0x3efe4a(0x14e)](_0x3efe4a(0x190),function(_0x1f8eb8){console['log']('touchmove'),mousePos=getTouchPos(canvas,_0x1f8eb8),mouseDown&brushDown&&(mouseFirstMove==![]&&(mouseFirstMove=!![],backup_canvas()),isFirefox?single_point_drawing(mousePos):two_point_drawing(mousePos,lastEvent),lastEvent=mousePos);},![]),document[_0x3efe4a(0x1ae)][_0x3efe4a(0x14e)](_0x3efe4a(0x121),function(_0x51eb){},![]),document['body'][_0x3efe4a(0x14e)](_0x3efe4a(0x1e7),function(_0x3eb10f){},![]),document['body'][_0x3efe4a(0x14e)](_0x3efe4a(0x190),function(_0x193a99){},![]);function getTouchPos(_0x546654,_0x39d8b3){var _0xcf2176=_0x3efe4a,_0x52859a=_0x546654[_0xcf2176(0x180)]();return{'offsetX':Math[_0xcf2176(0x147)](_0x39d8b3['touches'][0x0]['clientX']-_0x52859a[_0xcf2176(0x111)]),'offsetY':Math[_0xcf2176(0x147)](_0x39d8b3['touches'][0x0][_0xcf2176(0x1a7)]-_0x52859a[_0xcf2176(0x120)])};}download_segmap=function(_0x1fef58){var _0x8b6add=_0x3efe4a,_0x581bad=canvas[_0x8b6add(0x141)]('image/png');_0x1fef58[_0x8b6add(0x133)]=_0x581bad;},download_rendered=function(_0x24aa6f){var _0x2c5bd8=_0x3efe4a;$[_0x2c5bd8(0x1c4)]({'type':_0x2c5bd8(0x17d),'url':'/download_image','contentType':'application/json','data':JSON['stringify']({'imageBase64':canvas_output[_0x2c5bd8(0x141)](),'image_id':curr_image_id}),'success':function(_0x105725){var _0x28e7ac=_0x2c5bd8;obj=JSON[_0x28e7ac(0x18f)](_0x105725);var _0x56c0ec=obj[_0x28e7ac(0x19d)]+'_final';_0x48d432();function _0x48d432(){var _0xcf56a7=_0x28e7ac;img=new Image(),img[_0xcf56a7(0x161)]=_0xacfac9,img[_0xcf56a7(0x17c)]=file_host+'/results/'+_0x56c0ec+'.jpg',img[_0xcf56a7(0x151)]('crossOrigin',_0xcf56a7(0x1a0));}function _0xacfac9(){var _0x5da476=_0x28e7ac;context_output[_0x5da476(0x158)](0x0,0x0,canvas[_0x5da476(0x195)],canvas[_0x5da476(0x1f9)]),context_output[_0x5da476(0x160)](img,0x0,0x0,canvas[_0x5da476(0x195)],canvas[_0x5da476(0x1f9)]);}},'error':function(_0x599bc7){var _0x219491=_0x2c5bd8;console[_0x219491(0x1e9)](_0x219491(0x13f));}})[_0x2c5bd8(0x117)](function(_0x16ac4a){var _0x40af3b=_0x2c5bd8,_0x1d7248=canvas_output[_0x40af3b(0x141)](_0x40af3b(0x16e));_0x24aa6f[_0x40af3b(0x133)]=_0x1d7248,console['log'](_0x40af3b(0x1f7));});};function write(_0x36e7d3){var _0x191372=_0x3efe4a,_0x2d4f5d=document[_0x191372(0x15a)]('p');_0x2d4f5d['innerHTML']=_0x36e7d3,document[_0x191372(0x1ae)][_0x191372(0x1a4)](_0x2d4f5d);};function loadReal(){var _0x385147=_0x3efe4a;$(_0x385147(0x1bb))[_0x385147(0x13b)](),$(_0x385147(0x112))['hide'](),$('#eyedropper')['hide'](),$(_0x385147(0x116))[_0x385147(0x13b)](),$(_0x385147(0x1b2))[_0x385147(0x1fb)]();var _0x4cafa1,_0x461fe5;if(typeof window[_0x385147(0x135)]!==_0x385147(0x1cf)){write('The\x20file\x20API\x20isn\x27t\x20supported\x20on\x20this\x20browser\x20yet.');return;}_0x4cafa1=document[_0x385147(0x153)](_0x385147(0x16b));if(!_0x4cafa1)write(_0x385147(0x19f));else{if(!_0x4cafa1[_0x385147(0x16f)])write('This\x20browser\x20doesn\x27t\x20seem\x20to\x20support\x20the\x20`files`\x20property\x20of\x20file\x20inputs.');else!_0x4cafa1[_0x385147(0x16f)][0x0]?write(_0x385147(0x125)):(_0x461fe5=_0x4cafa1[_0x385147(0x16f)][0x0],fr=new FileReader(),fr['onload']=_0x4fa44b,fr[_0x385147(0x1b3)](_0x461fe5));}console[_0x385147(0x1e9)](_0x385147(0x1c8)),curr_image_id=_0x461fe5[_0x385147(0x1ac)][_0x385147(0x13d)]('.')[0x0],console[_0x385147(0x1e9)](curr_image_id);function _0x4fa44b(){var _0xb6c948=_0x385147;upload_img=new Image(),upload_img[_0xb6c948(0x161)]=_0x143c0b,upload_img[_0xb6c948(0x17c)]=fr[_0xb6c948(0x1b9)];}function _0x143c0b(){var _0x503f95=_0x385147;temp_context[_0x503f95(0x158)](0x0,0x0,canvas[_0x503f95(0x195)],canvas[_0x503f95(0x1f9)]),temp_context[_0x503f95(0x160)](upload_img,0x0,0x0,canvas[_0x503f95(0x195)],canvas[_0x503f95(0x1f9)]),context_output[_0x503f95(0x158)](0x0,0x0,canvas[_0x503f95(0x195)],canvas[_0x503f95(0x1f9)]),context_output[_0x503f95(0x160)](upload_img,0x0,0x0,canvas[_0x503f95(0x195)],canvas[_0x503f95(0x1f9)]),context_output[_0x503f95(0x160)](upload_img,0x0,0x0,canvas[_0x503f95(0x195)],canvas[_0x503f95(0x1f9)]);}}downloadCurrentEditVector=function(_0x40e3c2){var _0x21170d=_0x3efe4a;_0x40e3c2[_0x21170d(0x133)]=file_host+_0x21170d(0x1e3);};function applyCurrentEditVector(){var _0x50a9b5=_0x3efe4a,_0x54b8af=document[_0x50a9b5(0x153)](_0x50a9b5(0x1ed)),_0x337660=_0x54b8af[_0x50a9b5(0x1df)],_0x54b8af=document['getElementById'](_0x50a9b5(0x139)),_0x27c6f5=_0x54b8af[_0x50a9b5(0x1df)];$(_0x50a9b5(0x11e))[_0x50a9b5(0x13b)](),$(_0x50a9b5(0x16c))[_0x50a9b5(0x13b)](),$(_0x50a9b5(0x1fa))['show'](),$[_0x50a9b5(0x1c4)]({'type':'POST','url':_0x50a9b5(0x188),'contentType':_0x50a9b5(0x1fe),'data':JSON[_0x50a9b5(0x11a)]({'scale':_0x337660,'roi':roi_canvas[_0x50a9b5(0x141)](),'image_id':curr_image_id,'steps':_0x27c6f5}),'success':function(_0x3b7358){var _0x4feabf=_0x50a9b5;$(_0x4feabf(0x11e))[_0x4feabf(0x1fb)](),$(_0x4feabf(0x1fa))['hide'](),console[_0x4feabf(0x1e9)](_0x4feabf(0x166)),obj=JSON['parse'](_0x3b7358);var _0x3973b9=obj[_0x4feabf(0x19d)];curr_image_id=_0x4feabf(0x168)+obj[_0x4feabf(0x19d)],console[_0x4feabf(0x1e9)]('curr_image_id\x20'+curr_image_id),_0x23b5d9();function _0x23b5d9(){var _0x8216ab=_0x4feabf;img=new Image(),img[_0x8216ab(0x161)]=_0x14ce81,img[_0x8216ab(0x17c)]=file_host+_0x8216ab(0x16a)+_0x3973b9+_0x8216ab(0x165),img[_0x8216ab(0x151)]('crossOrigin',_0x8216ab(0x1a0));}function _0x14ce81(){var _0x1f95ab=_0x4feabf;context_output[_0x1f95ab(0x158)](0x0,0x0,canvas[_0x1f95ab(0x195)],canvas[_0x1f95ab(0x1f9)]),context_output['drawImage'](img,0x0,0x0,canvas[_0x1f95ab(0x195)],canvas['height']);var _0x338939=new Image();_0x338939['src']=file_host+_0x1f95ab(0x16a)+_0x3973b9+_0x1f95ab(0x13a),_0x338939[_0x1f95ab(0x161)]=function(){context['drawImage'](_0x338939,0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT);};}},'error':function(_0x1a05d8){var _0x2b6427=_0x50a9b5;console[_0x2b6427(0x1e9)](_0x2b6427(0x13f));}})[_0x50a9b5(0x117)](function(_0x44999b){var _0x6fd116=_0x50a9b5;console[_0x6fd116(0x1e9)](_0x6fd116(0x1f7)),$('#download_identity_vector')[_0x6fd116(0x1fb)]();});}function applyEditVector(){var _0x2cdf3a=_0x3efe4a,_0x4a341a=document[_0x2cdf3a(0x153)](_0x2cdf3a(0x137)),_0x30782d=_0x4a341a[_0x2cdf3a(0x1df)],_0x4a341a=document[_0x2cdf3a(0x153)](_0x2cdf3a(0x127)),_0x15e0cc=_0x4a341a[_0x2cdf3a(0x1df)],_0x4a341a=document[_0x2cdf3a(0x153)](_0x2cdf3a(0x145)),_0x4c8b62=_0x4a341a[_0x2cdf3a(0x1df)];$(_0x2cdf3a(0x11e))[_0x2cdf3a(0x13b)](),$(_0x2cdf3a(0x1fa))[_0x2cdf3a(0x1fb)](),$(_0x2cdf3a(0x16c))['hide'](),$[_0x2cdf3a(0x1c4)]({'type':_0x2cdf3a(0x17d),'url':_0x2cdf3a(0x1ad),'contentType':_0x2cdf3a(0x1fe),'data':JSON[_0x2cdf3a(0x11a)]({'editing_vector_id':_0x30782d,'scale':_0x15e0cc,'image_id':curr_image_id,'steps':_0x4c8b62}),'success':function(_0x18ac17){var _0x69950d=_0x2cdf3a;$('#render')[_0x69950d(0x1fb)](),$(_0x69950d(0x1fa))['hide'](),console[_0x69950d(0x1e9)](_0x69950d(0x166)),obj=JSON[_0x69950d(0x18f)](_0x18ac17);var _0x4ba1cd=obj[_0x69950d(0x19d)];curr_image_id=_0x69950d(0x168)+obj[_0x69950d(0x19d)],console['log']('curr_image_id\x20'+curr_image_id),_0x1491e7();function _0x1491e7(){var _0x2d83db=_0x69950d;img=new Image(),img['onload']=_0x4e6a4d,img[_0x2d83db(0x17c)]=file_host+'/results/'+_0x4ba1cd+_0x2d83db(0x165),img[_0x2d83db(0x151)]('crossOrigin','Anonymous');}function _0x4e6a4d(){var _0x1b03f2=_0x69950d;context_output[_0x1b03f2(0x158)](0x0,0x0,canvas[_0x1b03f2(0x195)],canvas[_0x1b03f2(0x1f9)]),context_output[_0x1b03f2(0x160)](img,0x0,0x0,canvas[_0x1b03f2(0x195)],canvas[_0x1b03f2(0x1f9)]);var _0x2676cb=new Image();_0x2676cb[_0x1b03f2(0x17c)]=file_host+_0x1b03f2(0x16a)+_0x4ba1cd+'_mask.png',_0x2676cb[_0x1b03f2(0x161)]=function(){var _0x40a750=_0x1b03f2;context[_0x40a750(0x160)](_0x2676cb,0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT);};}},'error':function(_0x8f1ccf){var _0x4af9cb=_0x2cdf3a;console[_0x4af9cb(0x1e9)](_0x4af9cb(0x13f));}})[_0x2cdf3a(0x117)](function(_0x46cf49){var _0xf6ec89=_0x2cdf3a;console[_0xf6ec89(0x1e9)](_0xf6ec89(0x1f7)),$(_0xf6ec89(0x16c))[_0xf6ec89(0x1fb)]();});}function loadVector(){var _0x470d17=_0x3efe4a,_0x531fd7=new FormData();_0x531fd7[_0x470d17(0x11f)]('file',$(_0x470d17(0x18c))[0x0][_0x470d17(0x16f)][0x0]),$[_0x470d17(0x1c4)]({'type':'POST','url':_0x470d17(0x1f5),'contentType':![],'data':_0x531fd7,'cache':![],'processData':![],'success':function(_0x4e6fc2){var _0x30dd35=_0x470d17;alert(_0x30dd35(0x1a5));},'error':function(_0x112ba2){var _0x36b399=_0x470d17;console[_0x36b399(0x1e9)](_0x36b399(0x13f));}})[_0x470d17(0x117)](function(_0x2ce98b){var _0x1554c1=_0x470d17;console[_0x1554c1(0x1e9)](_0x1554c1(0x1f7));});}$(_0x3efe4a(0x1a6))[_0x3efe4a(0x1ce)](function(){var _0x43c25c=_0x3efe4a;custom_image_upload&&(style_name='custom',console[_0x43c25c(0x1e9)](style_name)),render();}),$(_0x3efe4a(0x1f1))['click'](function(){var _0x62a7b6=_0x3efe4a;$('#render')[_0x62a7b6(0x13b)](),$(_0x62a7b6(0x1fa))[_0x62a7b6(0x1fb)](),$(_0x62a7b6(0x16c))['hide'](),$[_0x62a7b6(0x1c4)]({'type':'POST','url':_0x62a7b6(0x126),'contentType':_0x62a7b6(0x1fe),'data':JSON[_0x62a7b6(0x11a)]({}),'success':function(_0x468646){var _0x3ab8c3=_0x62a7b6;$(_0x3ab8c3(0x11e))[_0x3ab8c3(0x1fb)](),$('#loading')[_0x3ab8c3(0x13b)](),console[_0x3ab8c3(0x1e9)](_0x3ab8c3(0x166)),obj=JSON[_0x3ab8c3(0x18f)](_0x468646);var _0x4470d7=obj[_0x3ab8c3(0x19d)];curr_image_id=_0x3ab8c3(0x1db)+_0x4470d7,console[_0x3ab8c3(0x1e9)]('curr_image_id\x20'+curr_image_id),_0x1e0cd0();function _0x1e0cd0(){var _0x398ea6=_0x3ab8c3;img=new Image(),img[_0x398ea6(0x161)]=_0x56829c,img[_0x398ea6(0x17c)]=file_host+_0x398ea6(0x149)+_0x4470d7+_0x398ea6(0x165),img['setAttribute'](_0x398ea6(0x1b6),'Anonymous');}function _0x56829c(){var _0x5eb09a=_0x3ab8c3;context_output[_0x5eb09a(0x158)](0x0,0x0,canvas[_0x5eb09a(0x195)],canvas[_0x5eb09a(0x1f9)]),context_output['drawImage'](img,0x0,0x0,canvas[_0x5eb09a(0x195)],canvas[_0x5eb09a(0x1f9)]);var _0x33dba5=new Image();_0x33dba5[_0x5eb09a(0x17c)]=file_host+_0x5eb09a(0x149)+_0x4470d7+_0x5eb09a(0x13a),_0x33dba5[_0x5eb09a(0x161)]=function(){var _0x114176=_0x5eb09a;context[_0x114176(0x160)](_0x33dba5,0x0,0x0,CANVAS_WIDTH,CANVAS_HEIGHT);};}},'error':function(_0x30dcf1){var _0x16fac7=_0x62a7b6;console[_0x16fac7(0x1e9)](_0x16fac7(0x13f));}})[_0x62a7b6(0x117)](function(_0x563305){var _0x17dc8c=_0x62a7b6;console[_0x17dc8c(0x1e9)](_0x17dc8c(0x1f7));});}),$(_0x3efe4a(0x17a))[_0x3efe4a(0x1ce)](function(){var _0x19baf5=_0x3efe4a;curr_image_id='0',console[_0x19baf5(0x1e9)](curr_image_id),createDefaultImage();}),$(_0x3efe4a(0x1cc))['click'](function(){curr_image_id='1',console['log'](curr_image_id),createDefaultImage();}),$('#example2')[_0x3efe4a(0x1ce)](function(){var _0x5bb1e2=_0x3efe4a;curr_image_id='2',console[_0x5bb1e2(0x1e9)](curr_image_id),createDefaultImage();}),$('#example3')[_0x3efe4a(0x1ce)](function(){var _0x52f52e=_0x3efe4a;curr_image_id='3',console[_0x52f52e(0x1e9)](curr_image_id),createDefaultImage();}),$(_0x3efe4a(0x179))[_0x3efe4a(0x1ce)](function(){var _0x9e5870=_0x3efe4a;curr_image_id='4',console[_0x9e5870(0x1e9)](curr_image_id),createDefaultImage();}),$('#example5')[_0x3efe4a(0x1ce)](function(){curr_image_id='5',console['log'](curr_image_id),createDefaultImage();}),$(_0x3efe4a(0x1e4))[_0x3efe4a(0x1ce)](function(){curr_image_id='6',console['log'](curr_image_id),createDefaultImage();}),$(_0x3efe4a(0x17b))[_0x3efe4a(0x1ce)](function(){var _0x559c72=_0x3efe4a;curr_image_id='7',console[_0x559c72(0x1e9)](curr_image_id),createDefaultImage();}),$(_0x3efe4a(0x156))[_0x3efe4a(0x1ce)](function(){var _0x112dc2=_0x3efe4a;curr_image_id='8',console[_0x112dc2(0x1e9)](curr_image_id),createDefaultImage();}),$(_0x3efe4a(0x189))['click'](function(){curr_image_id='9',console['log'](curr_image_id),createDefaultImage();}),$(_0x3efe4a(0x129))['click'](function(){var _0xde0b05=_0x3efe4a;curr_image_id='10',console[_0xde0b05(0x1e9)](curr_image_id),createDefaultImage();}),document[_0x3efe4a(0x1b7)]=function(_0x41ef42){var _0x596cd4=_0x3efe4a;if(_0x41ef42[_0x596cd4(0x16d)]&&_0x41ef42['shiftKey']&&_0x41ef42['which']==0x42)$(document)[_0x596cd4(0x12f)](function(){var _0x54dff1=_0x596cd4;document[_0x54dff1(0x153)](_0x54dff1(0x186))['click']();});else{if(_0x41ef42['ctrlKey']&&_0x41ef42[_0x596cd4(0x122)]&&_0x41ef42['which']==0x46)$(document)[_0x596cd4(0x12f)](function(){var _0x38397a=_0x596cd4;document[_0x38397a(0x153)](_0x38397a(0x1d2))[_0x38397a(0x1ce)]();});else _0x41ef42[_0x596cd4(0x16d)]&&_0x41ef42['which']==0x5a&&$(document)['ready'](function(){var _0x5327c9=_0x596cd4;document['getElementById'](_0x5327c9(0x15f))[_0x5327c9(0x1ce)]();});}};