diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor.appcache.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor.appcache.xml new file mode 100644 index 0000000000000000000000000000000000000000..88a51ca2862d406e0ecb660b20082aa43bdf2ff4 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor.appcache.xml @@ -0,0 +1,380 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + content_md5 + + + + + + default_reference + gadget_image_editor.appcache + + + description + + + + + + id + gadget_image_editor.appcache + + + language + + + + + + portal_type + Web Manifest + + + text_content + CACHE MANIFEST\r\n +CACHE:\r\n +rsvp.js\r\n +renderjs.js\r\n +jiodev.js\r\n +gadget_image_editor.js\r\n +gadget_image_editor.html/renderjs.js\r\n +gadget_image_editor.html/rsvp.js\r\n +gadget_image_editor.html/miniPaint/config.js\r\n +gadget_image_editor.html/miniPaint/img/colorwheel.png\r\n +gadget_image_editor.html/miniPaint/img/favicon.png\r\n +gadget_image_editor.html/miniPaint/img/logo.png\r\n +gadget_image_editor.html/miniPaint/img/preview.jpg\r\n +gadget_image_editor.html/miniPaint/img/sprites.png\r\n +gadget_image_editor.html/miniPaint/js/draw_tools.js\r\n +gadget_image_editor.html/miniPaint/js/edit.js\r\n +gadget_image_editor.html/miniPaint/js/effects.js\r\n +gadget_image_editor.html/miniPaint/js/elements.js\r\n +gadget_image_editor.html/miniPaint/js/events.js\r\n +gadget_image_editor.html/miniPaint/js/file.js\r\n +gadget_image_editor.html/miniPaint/js/gui.js\r\n +gadget_image_editor.html/miniPaint/js/help.js\r\n +gadget_image_editor.html/miniPaint/js/image.js\r\n +gadget_image_editor.html/miniPaint/js/layers.js\r\n +gadget_image_editor.html/miniPaint/js/main.js\r\n +gadget_image_editor.html/miniPaint/js/tools.js\r\n +gadget_image_editor.html/miniPaint/languages/de.js\r\n +gadget_image_editor.html/miniPaint/languages/empty.js\r\n +gadget_image_editor.html/miniPaint/languages/es.js\r\n +gadget_image_editor.html/miniPaint/languages/fr.js\r\n +gadget_image_editor.html/miniPaint/languages/it.js\r\n +gadget_image_editor.html/miniPaint/languages/ja.js\r\n +gadget_image_editor.html/miniPaint/languages/ko.js\r\n +gadget_image_editor.html/miniPaint/languages/lt.js\r\n +gadget_image_editor.html/miniPaint/languages/pt.js\r\n +gadget_image_editor.html/miniPaint/languages/ru.js\r\n +gadget_image_editor.html/miniPaint/languages/tr.js\r\n +gadget_image_editor.html/miniPaint/languages/zh.js\r\n +gadget_image_editor.html/miniPaint/libs/helpers.js\r\n +gadget_image_editor.html/miniPaint/libs/popup.js\r\n +gadget_image_editor.html/miniPaint/libs/sift.js\r\n +gadget_image_editor.html/miniPaint/libs/vintage.js\r\n +gadget_image_editor.html/miniPaint/styles/styles.css\r\n +gadget_image_editor.html/miniPaint/vendor/exif/exif.js\r\n +gadget_image_editor.html/miniPaint/vendor/exif/exif.min.js\r\n +gadget_image_editor.html/miniPaint/vendor/file-saver/FileSaver.min.js\r\n +gadget_image_editor.html/miniPaint/vendor/file-saver/canvas-toBlob.js\r\n +gadget_image_editor.html/miniPaint/vendor/glfx/glfx.js\r\n +gadget_image_editor.html/miniPaint/vendor/harmony/harmony.js\r\n +gadget_image_editor.html/miniPaint/vendor/harmony/harmony.min.js\r\n +gadget_image_editor.html/miniPaint/vendor/hermite-resize/hermite.js\r\n +gadget_image_editor.html/miniPaint/vendor/hqx/hqx.js\r\n +gadget_image_editor.html/miniPaint/vendor/hqx/hqx.min.js\r\n +gadget_image_editor.html/miniPaint/vendor/imagefilters/imagefilters.js\r\n +gadget_image_editor.html/miniPaint/vendor/imagefilters/imagefilters.min.js\r\n +gadget_image_editor.html/miniPaint/vendor/jquery/jquery-migrate.js\r\n +gadget_image_editor.html/miniPaint/vendor/jquery/jquery.js \r\n +gadget_image_editor.html/miniPaint/vendor/menu/menu.js \r\n +gadget_image_editor.html/miniPaint/vendor/menu/menu.min.js\r\n +gadget_image_editor.html/miniPaint/vendor/translate/jquery.translate.js\r\n +gadget_image_editor.html/miniPaint/vendor/translate/jquery.translate.min.js\r\n +NETWORK:\r\n +* + + + title + Image Editor Gadget AppCache + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1479134025.22 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.17991.46421.38161 + + + state + current + + + time + + + + + + + + + + + 1479134016.35 + UTC + + + + + + + + + + + + + + + + + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + empty + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1479133901.09 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_html.html b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_html.html new file mode 100644 index 0000000000000000000000000000000000000000..d800e23022ffbbbe948f29198004842dfa1b866f --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_html.html @@ -0,0 +1,339 @@ + + + + + + Image Editor Gadget + + + + + + + + + + + +
+ +
+
Your browser doesn't support canvas.
+
+ + + +
+
+
+
+ +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_html.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_html.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ba2dd02f40e59cf928105046e792b16950584bd --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_html.xml @@ -0,0 +1,326 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + content_md5 + + + + + + content_type + text/html + + + default_reference + gadget_image_editor.html + + + description + + + + + + id + gadget_image_editor_html + + + language + + + + + + portal_type + Web Page + + + short_title + + + + + + title + Image Editor Gadget + + + version + 001 + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1478190070.48 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.17995.46417.23432 + + + state + current + + + time + + + + + + + + + + + 1479134142.77 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1478187623.4 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_js.js new file mode 100644 index 0000000000000000000000000000000000000000..7389acb61c6a4281df79726690cfa59811855a25 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_js.js @@ -0,0 +1,55 @@ +/*global window, rJS, CKEDITOR*/ +/*jslint nomen: true, maxlen:80, indent:2*/ +(function (rJS, RSVP) { + "use strict"; + + rJS(window) + .ready(function (g) { + g.props = {}; + }) + .ready(function (g) { + return g.getElement() + .push(function (element) { + var textarea = element.querySelector('textarea'); + g.props.element = element; + g.props.blob_defer = RSVP.defer(); + }); + }) + .declareAcquiredMethod("submitContent", "triggerSubmit") + .declareMethod('render', function (options) { + this.props.key = options.key || "text_content"; + return new RSVP.Queue() + .push(function() { + if (options.value.split('data:')[1] === '') { + return ''; + } + return jIO.util.dataURItoBlob(options.value); + }) + .push(function(blob) { + if (!blob) { + return {}; + blob = new Blob([''], {type: 'image/png'}); + } + blob.name = options.name; + FILE.open_handler({target:{files:[blob]}}); + return {}; + }) + }) + + .declareMethod('getContent', function () { + var result = {}, + gadget = this; + + return new RSVP.Queue() + .push(function() { + return FILE.save({name: gadget.props.key, type:'BLOB'}); + }) + .push(function(blob) { + return jIO.util.readBlobAsDataURL(blob); + }) + .push(function(datauri) { + return datauri.target.result; + }); + }); + +}(rJS, RSVP)); \ No newline at end of file diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_js.xml new file mode 100644 index 0000000000000000000000000000000000000000..f3b6f67d56f6e04fb05aae45a9d7ba6d02cd0cd9 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_image_editor_js.xml @@ -0,0 +1,320 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + content_md5 + + + + + + default_reference + gadget_image_editor.js + + + description + + + + + + id + gadget_image_editor_js + + + language + en + + + portal_type + Web Script + + + short_title + + + + + + title + Image Editor Gadget JS + + + version + 001 + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1478192007.47 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.9067.17808.36590 + + + state + current + + + time + + + + + + + + + + + 1478598436.82 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1478191519.17 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_application_panel_html.html b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_application_panel_html.html index 63773a4e03904c262e0279997df77dbb852f7036..3295163c3d2fd0ac5bf742d27b4c4896e43f3477 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_application_panel_html.html +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_application_panel_html.html @@ -37,7 +37,7 @@ diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_application_panel_html.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_application_panel_html.xml index b6c378145a8fc6d28d0f42a629692ae0090301c8..9fba7f187eb7b9c8503218399da6c765600ffcc7 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_application_panel_html.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_application_panel_html.xml @@ -269,7 +269,7 @@ serial - 954.2922.61218.8379 + 955.10506.10902.40072 state @@ -287,7 +287,7 @@ - 1474450659.36 + 1478684772.2 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_image_editor_router_html.html b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_image_editor_router_html.html new file mode 100644 index 0000000000000000000000000000000000000000..9db2f6407a6e4cb7c59ce8a9bfe6717dd14ebba0 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_image_editor_router_html.html @@ -0,0 +1,23 @@ + + + + + + OfficeJS Router Gadget + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_image_editor_router_html.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_image_editor_router_html.xml new file mode 100644 index 0000000000000000000000000000000000000000..bf460d770930b23e72c2b1a37eb9353a576563e1 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_image_editor_router_html.xml @@ -0,0 +1,359 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + categories + + + contributor/person_module/1 + + + + + content_md5 + + + + + + content_type + text/html + + + creators + + + cedric.le.ninivin + + + + + default_reference + gadget_officejs_image_editor_router.html + + + description + + + + + + id + gadget_officejs_image_editor_router_html + + + language + en + + + modification_date + + + + + + + + + + + 1455284352.21 + UTC + + + + + + + portal_type + Web Page + + + short_title + + + + + + title + OfficeJS Image Editor router Gadget + + + version + 001 + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1478181344.58 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.2110.8737.31897 + + + state + current + + + time + + + + + + + + + + + 1478181274.8 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1478179009.02 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_html.html b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_html.html new file mode 100644 index 0000000000000000000000000000000000000000..1415217961a1236ce02ed01351be9228d692e981 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_html.html @@ -0,0 +1,58 @@ + + + + + + + OfficeJS Jio Web Page View + + + + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_html.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_html.xml new file mode 100644 index 0000000000000000000000000000000000000000..6c2a1dc313031d82ed031def9c4213a4131777db --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_html.xml @@ -0,0 +1,363 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + categories + + + contributor/person_module/1 + + + + + content_md5 + + + + + + content_type + text/html + + + creators + + + cedric.le.ninivin + + + + + default_reference + gadget_officejs_jio_image_view.html + + + description + + + + + + id + gadget_officejs_jio_image_view_html + + + language + + + + + + modification_date + + + + + + + + + + + 1455284351.31 + UTC + + + + + + + portal_type + Web Page + + + short_title + + + + + + title + OfficeJS Jio Image View + + + version + + + + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1478183369.05 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.9413.14205.29422 + + + state + current + + + time + + + + + + + + + + + 1478619238.52 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1478182718.57 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_js.js new file mode 100644 index 0000000000000000000000000000000000000000..b2aa976d7382a8828f7ab4197b6c9dbc6e6559b0 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_js.js @@ -0,0 +1,233 @@ +/*globals window, rJS, Handlebars, RSVP, loopEventListener, console, URL*/ +/*jslint indent: 2, nomen: true, maxlen: 80*/ +(function (window, RSVP, rJS, Handlebars, loopEventListener, URL) { + "use strict"; + + function saveContent(gadget, submit_event) { + var i, + doc = gadget.options.doc, + now = new Date(), + blob; + doc.parent_relative_url = "image_module"; + doc.portal_type = "Image"; + doc.modification_date = now.toISOString(); + for (i = 0; i < submit_event.target.length; i += 1) { + // XXX Should check input type instead + if (submit_event.target[i].name) { + doc[submit_event.target[i].name] = submit_event.target[i].value; + } + } + + return RSVP.Queue() + .push(function () { + return gadget.getDeclaredGadget("my_text_content"); + }) + .push(function (text_content_gadget) { + return text_content_gadget.getContent(); + }) + .push(function (dataURI) { + return jIO.util.dataURItoBlob(dataURI); + }) + .push(function(blob) { + console.log(gadget.options.jio_key); + return RSVP.all([ + gadget.put(gadget.options.jio_key, doc), + gadget.putAttachment(gadget.options.jio_key, "data", blob) + ]); + }); + } + + function maximize(gadget) { + var iframe = gadget.props.element.querySelector('iframe'), + iframe_class_string = iframe.getAttribute('class') || "", + class_name = "ui-content-maximize", + class_index = iframe_class_string.indexOf(class_name); + if (class_index === -1) { + iframe_class_string += ' ' + class_name; + iframe.setAttribute('style', ''); + iframe.setAttribute('class', iframe_class_string); + return; + } + iframe_class_string = iframe_class_string.substring(0, class_index) + + iframe_class_string.substring(class_index + class_name.length); + iframe.setAttribute('style', 'width:100%; border: 0 none; height: 600px'); + iframe.setAttribute('class', iframe_class_string); + return; + } + + var gadget_klass = rJS(window), + source = gadget_klass.__template_element + .querySelector(".view-web-page-template") + .innerHTML, + template = Handlebars.compile(source); + + + gadget_klass + .ready(function (g) { + g.props = {}; + g.options = null; + return g.getElement() + .push(function (element) { + g.props.element = element; + g.props.deferred = RSVP.defer(); + }); + }) + + .declareAcquiredMethod("updateHeader", "updateHeader") + .declareAcquiredMethod("get", "jio_get") + .declareAcquiredMethod("translateHtml", "translateHtml") + .declareAcquiredMethod("put", "jio_put") + .declareAcquiredMethod("putAttachment", "jio_putAttachment") + .declareAcquiredMethod("getAttachment", "jio_getAttachment") + .declareAcquiredMethod("redirect", "redirect") + + .allowPublicAcquisition('triggerMaximize', function () { + var gadget = this; + return RSVP.Queue() + .push(function () { + return maximize(gadget); + }) + .fail(function (e) { + console.log(e); + }); + }) + + .allowPublicAcquisition('triggerSubmit', function (option) { + if (option[0] === "maximize" || option === "maximize") { + var gadget = this; + return RSVP.Queue() + .push(function () { + return maximize(gadget); + }); + } + return this.props.element.querySelector('button').click(); + }) + + .declareMethod('triggerSubmit', function (option) { + if (option[0] === "maximize" || option === "maximize") { + var gadget = this; + return RSVP.Queue() + .push(function () { + return maximize(gadget); + }); + } + return this.props.element.querySelector('button').click(); + }) + + .declareMethod("render", function (options) { + var gadget = this; + gadget.options = options; + gadget.options.doc.title = gadget.options.doc.title || ""; + return new RSVP.Queue() + .push(function () { + return gadget.translateHtml(template(options.doc)); + }) + .push(function (html) { + gadget.props.element.innerHTML = html; + return gadget.updateHeader({ + title: options.doc.title + " | Image", + save_action: true, + maximize_action: true, + maximized: gadget.options.doc.title !== "" + }); + }) + .push(function() { + return gadget.getAttachment(gadget.options.jio_key, "data"); + }) + .push( + function (blob_result) { + gadget.props.blob = blob_result; + return gadget.props.deferred.resolve(); + }, function (error) { + if (error.status_code === 404) { + gadget.props.blob = new Blob([''], {type: 'image/png'}); + return gadget.props.deferred.resolve(); + } + throw new Error(error); + }); + }) + + ///////////////////////////////////////// + // Render text content gadget + ///////////////////////////////////////// + .declareService(function () { + var gadget = this, + image_content_gadget; + + return new RSVP.Queue() + .push(function () { + return gadget.props.deferred.promise; + }) + .push(function () { + return gadget.declareGadget( + "rjsunsafe/gadget_image_editor.html", + { + scope: "my_text_content", + sandbox: "iframe", + element: gadget.props.element.querySelector(".document-content") + } + ); + }) + .push(function (image_gadget) { + image_content_gadget = image_gadget; + var iframe = gadget.props.element.querySelector('iframe'); + iframe.setAttribute( + 'style', + 'width:100%; border: 0 none; height: 600px' + ); + return jIO.util.readBlobAsDataURL(gadget.props.blob); + }) + .push(function (f) { + return image_content_gadget.render({ + "key": 'text_content', + "value": f.target.result, + "name": gadget.options.jio_key + }); + }) + .push(function () { + if (gadget.options.doc.title !== "") { + return gadget.triggerSubmit("maximize"); + } + }) + .push(undefined, function (error) { + var display_error_element; + if (error === "Timed out after 5000 ms") { + display_error_element = + gadget.props.element.querySelector( + "form div.ui-field-contain fieldset" + ); + display_error_element.innerHTML = + '



'; + display_error_element.querySelector('p').textContent = + "TIMEOUT: The editor gadget is taking too long to load but is" + + " currently being cached, please wait for the page to load" + + " (check your browser loading icon) and then refresh."; + } else { + throw error; + } + }); + }) + + ///////////////////////////////////////// + // Form submit + ///////////////////////////////////////// + .declareService(function () { + var gadget = this; + + return new RSVP.Queue() + .push(function () { + return gadget.props.deferred.promise; + }) + .push(function () { + return loopEventListener( + gadget.props.element.querySelector('form'), + 'submit', + true, + function (event) { + return saveContent(gadget, event); + } + ); + }); + }); + +}(window, RSVP, rJS, Handlebars, loopEventListener, URL)); \ No newline at end of file diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_js.xml new file mode 100644 index 0000000000000000000000000000000000000000..c4a6c52a392acd7932a9d5c787fcdcd573adcf76 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_image_view_js.xml @@ -0,0 +1,359 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + categories + + + contributor/person_module/1 + + + + + content_md5 + + + + + + creators + + + cedric.le.ninivin + + + + + default_reference + gadget_officejs_jio_image_view.js + + + description + + + + + + id + gadget_officejs_jio_image_view_js + + + language + + + + + + modification_date + + + + + + + + + + + 1455284351.35 + UTC + + + + + + + portal_type + Web Script + + + short_title + + + + + + title + OfficeJS Jio Image View JS + + + version + + + + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1478182661.35 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.7635.24631.25992 + + + state + current + + + time + + + + + + + + + + + 1478598415.13 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1478182534.38 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_document_list_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_document_list_js.js index aa45a3717f840348f4b594ae4cb92d98acb22150..84b0e1fb5505571a7fbfb9d2d1d5cd12efb84df1 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_document_list_js.js +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_document_list_js.js @@ -112,6 +112,14 @@ } }); }); + }) + .declareService(function() { + var gadget = this; + return new RSVP.Queue() + .push(function() { + var search_bar = gadget.props.element.querySelector('.ui-input-text input'); + $(search_bar).select().focus(); + }); }); }(window, RSVP, rJS)); \ No newline at end of file diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_document_list_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_document_list_js.xml index 38b1358212a07f8ca76c55d00c016b9ed49e3623..b0924c81be5a5ed9d588bafce9c78119769c4e33 100644 --- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_document_list_js.xml +++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_document_list_js.xml @@ -249,7 +249,7 @@
actor - supercedriclen + zope comment @@ -263,7 +263,7 @@ serial - 951.28163.54980.41130 + 955.10498.23035.57378 state @@ -281,7 +281,7 @@ - 1464188897.32 + 1478684301.49 UTC diff --git a/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor.xml b/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor.xml new file mode 100644 index 0000000000000000000000000000000000000000..b178eaa317a5a06a6d3de37cf199131ab9729586 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor.xml @@ -0,0 +1,630 @@ + + + + + + + + + + _Add_portal_content_Permission + + + Assignor + Manager + + + + + _Add_portal_folders_Permission + + + Assignor + Manager + + + + + _Copy_or_Move_Permission + + + Assignor + Manager + + + + + _Delete_objects_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + Owner + + + + + __before_publishing_traverse__ + + + + + + + + + + _defined_in_class + 1 + + + _hookname + __before_publishing_traverse__ + + + _list + + + AAAAAAAAAAI= + + + + + _prior + + + + + + + + + + + __before_traverse__ + + + + + + 99 + ERP5 Web Site/officejs_image_editor + + + + AAAAAAAAAAI= + + + + + + + _count + + AAAAAAAAAAM= + + + + _identity_criterion + + AAAAAAAAAAQ= + + + + _local_properties + + + + + id + frontpage_gadget_url + + + type + string + + + + + id + configuration_frontpage_gadget_url + + + type + string + + + + + id + configuration_application_title + + + type + string + + + + + id + configuration_hateoas_url + + + type + string + + + + + id + configuration_view_action_category + + + type + string + + + + + id + configuration_default_view_action_reference + + + type + string + + + + + id + configuration_panel_gadget_url + + + type + string + + + + + id + configuration_router_gadget_url + + + type + string + + + + + id + configuration_jio_gadget_url + + + type + string + + + + + id + configuration_translation_gadget_url + + + type + string + + + + + id + configuration_manifest_url + + + type + string + + + + + id + configuration_header_gadget_url + + + type + string + + + + + id + configuration_content_security_policy + + + type + string + + + + + id + configuration_x_frame_options + + + type + string + + + + + + + _mt_index + + AAAAAAAAAAU= + + + + _range_criterion + + AAAAAAAAAAY= + + + + _tree + + AAAAAAAAAAc= + + + + available_language + + + en + + + + + categories + + + aggregate/web_page_module/rjs_gadget_erp5_html + caching_policy/must-revalidate + + + + + configuration_application_title + Image Editor + + + configuration_content_security_policy + default-src \'none\'; img-src \'self\' data:; media-src \'self\' blob:; connect-src \'self\' https://localhost:5000 mail.tiolive.com data: *.host.vifib.net *.node.vifib.com *.erp5.net; script-src \'self\' \'unsafe-eval\'; font-src netdna.bootstrapcdn.com; style-src \'self\' netdna.bootstrapcdn.com \'unsafe-inline\' data:; frame-src \'self\' data: *.app.officejs.com + + + configuration_default_view_action_reference + + + + + + configuration_frontpage_gadget_url + + + + + + configuration_hateoas_url + hateoas/ + + + configuration_header_gadget_url + gadget_officejs_header.html + + + configuration_jio_gadget_url + gadget_officejs_jio.html + + + configuration_manifest_url + gadget_officejs.appcache + + + configuration_panel_gadget_url + gadget_officejs_application_panel.html + + + configuration_router_gadget_url + gadget_officejs_image_editor_router.html + + + configuration_translation_gadget_url + gadget_translation.html + + + configuration_view_action_category + + + + + + configuration_x_frame_options + SAMEORIGIN + + + container_layout + WebSection_renderDefaultPageAsGadget + + + content_layout + WebSection_renderDefaultPageAsGadget + + + custom_render_method_id + WebSection_renderDefaultPageAsGadget + + + description + + + + + + frontpage_gadget_url + gadget_woelfel_pt_frontpage.html + + + id + officejs_image_editor + + + layout_configuration_form_id + WebSection_viewRenderJSPreference + + + portal_type + Web Site + + + short_title + + + + + + skin_selection_name + RJS + + + static_language_selection + 0 + + + title + Office JS Image Editor + + + visible + 1 + + + workflow_history + + AAAAAAAAAAg= + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + data + + + + + + + + + + + + + + + + + + + + + + + data + + + + + + + + + + + + + + + + + + + + + + + data + + + + category_publication_workflow + + AAAAAAAAAAk= + + + + edit_workflow + + AAAAAAAAAAo= + + + + + + + + + + + + + + + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1478178617.7 + UTC + + + + + + + validation_state + embedded + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.2071.12987.25651 + + + state + current + + + time + + + + + + + + + + + 1478178954.77 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor/hateoas.xml b/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor/hateoas.xml new file mode 100644 index 0000000000000000000000000000000000000000..55199c53dcc3e5798edda5815c1545715cdf22d1 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor/hateoas.xml @@ -0,0 +1,491 @@ + + + + + + + + + + _Add_portal_content_Permission + + + Assignor + Manager + + + + + _Add_portal_folders_Permission + + + Assignor + Manager + + + + + _Copy_or_Move_Permission + + + Assignor + Manager + + + + + _Delete_objects_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + Owner + + + + + __before_publishing_traverse__ + + + + + + + + + + _defined_in_class + 1 + + + _hookname + __before_publishing_traverse__ + + + _list + + + AAAAAAAAAAI= + + + + + _prior + + + + + + + + + + + __before_traverse__ + + + + + + 99 + ERP5 Web Section/hateoas + + + + AAAAAAAAAAI= + + + + + + + __translation_dict + + + + + + _identity_criterion + + AAAAAAAAAAM= + + + + _local_properties + + + + + id + default_view_action_reference + + + type + string + + + + + id + view_action_category + + + type + string + + + + + id + frontpage_gadget + + + type + string + + + + + id + frontpage_gadget_url + + + type + string + + + + + id + configuration_frontpage_gadget_url + + + type + string + + + + + id + configuration_application_title + + + type + string + + + + + id + configuration_content_security_policy + + + type + string + + + + + + + _range_criterion + + AAAAAAAAAAQ= + + + + categories + + + caching_policy/hateoas + + + + + configuration_application_title + + + + + + configuration_content_security_policy + + + + + + configuration_frontpage_gadget_url + + + + + + container_layout + ERP5Document_getHateoas + + + content_layout + ERP5Document_getHateoas + + + custom_render_method_id + ERP5Document_getHateoas + + + default_view_action_reference + view + + + description + + + + + + empty_criterion_valid + 0 + + + frontpage_gadget + gadget_woelfel_pt_frontpage.html + + + frontpage_gadget_url + gadget_woelfel_pt_frontpage.html + + + id + hateoas + + + layout_configuration_form_id + + + + + + portal_type + Web Section + + + short_title + + + + + + skin_selection_name + HalRestricted + + + title + Restricted Hateoas + + + view_action_category + object_view + + + visible + 1 + + + workflow_history + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + + + data + + + + + + + + + + + + + + + data + + + + + + + + + + + + + + + data + + + + category_publication_workflow + + AAAAAAAAAAY= + + + + edit_workflow + + AAAAAAAAAAc= + + + + + + + + + + + + + + + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1478178617.73 + UTC + + + + + + + validation_state + embedded + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.2070.19535.2099 + + + state + current + + + time + + + + + + + + + + + 1478178649.5 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor/rjsunsafe.xml b/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor/rjsunsafe.xml new file mode 100644 index 0000000000000000000000000000000000000000..8289d921fb7e6a85d1ca4f96f1d2122814bc9d23 --- /dev/null +++ b/bt5/erp5_officejs/PathTemplateItem/web_site_module/officejs_image_editor/rjsunsafe.xml @@ -0,0 +1,362 @@ + + + + + + + + + + _Add_portal_content_Permission + + + Assignor + Manager + + + + + _Add_portal_folders_Permission + + + Assignor + Manager + + + + + _Copy_or_Move_Permission + + + Assignor + Manager + + + + + _Delete_objects_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + Owner + + + + + __before_publishing_traverse__ + + + + + + + + + + _defined_in_class + 1 + + + _hookname + __before_publishing_traverse__ + + + _list + + + AAAAAAAAAAI= + + + + + _prior + + + + + + + + + + + __before_traverse__ + + + + + + 99 + ERP5 Web Section/rjsunsafe + + + + AAAAAAAAAAI= + + + + + + + __translation_dict + + + + + + _identity_criterion + + AAAAAAAAAAM= + + + + _range_criterion + + AAAAAAAAAAQ= + + + + categories + + + caching_policy/must-revalidate + + + + + description + + + + + + empty_criterion_valid + 0 + + + id + rjsunsafe + + + portal_type + Web Section + + + short_title + + + + + + skin_selection_name + RJSUnsafe + + + title + RJS Unsafe + + + visible + 0 + + + workflow_history + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + + + data + + + + + + + + + + + + + + + data + + + + + + + + + + + + + + + data + + + + category_publication_workflow + + AAAAAAAAAAY= + + + + edit_workflow + + AAAAAAAAAAc= + + + + + + + + + + + + + + + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1478178617.74 + UTC + + + + + + + validation_state + embedded + + + + + + + + + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 955.2070.19535.2099 + + + state + current + + + time + + + + + + + + + + + 1478178649.5 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint.xml new file mode 100644 index 0000000000000000000000000000000000000000..8e9e53802f64a2abdde8864f0fdddbf067ca522d --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + miniPaint + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/config.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/config.js.js new file mode 100644 index 0000000000000000000000000000000000000000..c279784f1c5b6d9e745dc24a3e74b72fd330ed8c --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/config.js.js @@ -0,0 +1,42 @@ +/** + * main config file + * + * @author ViliusL + */ + +//canvas layers +var canvas_back = document.getElementById("canvas_back").getContext("2d"); //layer for grid/transparency +var canvas_front = document.getElementById("canvas_front").getContext("2d"); //tmp layer +var canvas_grid = document.getElementById("canvas_grid").getContext("2d"); //grid layer +var canvas_preview = document.getElementById("canvas_preview").getContext("2d"); //mini preview + +//global settings +var VERSION = '3.2'; +var WIDTH; //canvas midth +var HEIGHT; //canvas height +var COLOR = '#0000ff'; //active color +var ALPHA = 255; //active color alpha +var LANG = 'en'; //active language + +var DRAW_TOOLS_CONFIG = [ + {name: 'select_tool', title: 'Select object tool', icon: ['sprites.png', 0+7, 2], attributes: {} }, + {name: 'select_square', title: 'Select area tool', icon: ['sprites.png', -50+4, 5], attributes: {} }, + {name: 'magic_wand', title: 'Magic Wand Tool', icon: ['sprites.png', -150+1, -50+2], attributes: {power: 40, anti_aliasing: true} }, + {name: 'erase', title: 'Erase', icon: ['sprites.png', -100+3, 4], attributes: {size: 30, circle: true, strict: true} }, + {name: 'fill', title: 'Fill', icon: ['sprites.png', -150+3, 3], attributes: {power: 0, anti_aliasing: false} }, + {name: 'pick_color', title: 'Pick Color', icon: ['sprites.png', -200+3, 3], attributes: {} }, + {name: 'pencil', title: 'Pencil', icon: ['sprites.png', -250+3, 3], attributes: {} }, + {name: 'line', title: 'Draw line', icon: ['sprites.png', -300+3, 3], attributes: {size: 1, type_values: ['Simple', 'Multi-line', 'Arrow', 'Curve'] } }, + {name: 'letters', title: 'Draw letters', icon: ['sprites.png', -350+3, 4], attributes: {} }, + {name: 'draw_square', title: 'Draw rectangle', icon: ['sprites.png', -400+3, 5], attributes: {fill: false, square: false} }, + {name: 'draw_circle', title: 'Draw circle', icon: ['sprites.png', -450+3, 5], attributes: {fill: false, circle: false} }, + {name: 'brush', title: 'Brush', icon: ['sprites.png', -500+6, 3], attributes: {type: 'Brush', type_values: ['Brush', 'BezierCurve', 'Chrome', 'Fur', 'Grouped', 'Shaded', 'Sketchy'], size: 10, anti_aliasing: false }, on_update: 'update_brush', }, + {name: 'blur_tool', title: 'Blur tool', icon: ['sprites.png', -250+5, -50+2], attributes: {size: 30, power: 1} }, + {name: 'sharpen_tool', title: 'Sharpen tool', icon: ['sprites.png', -300+5, -50+2], attributes: {size: 30 } }, + {name: 'burn_dodge_tool', title: 'Burn/Dodge tool', icon: ['sprites.png', -500+3, -50+4], attributes: {burn: true, size: 30, power: 50} }, + {name: 'desaturate_tool', title: 'Desaturate', icon: ['sprites.png', -550+3, -00+4], attributes: {size: 50, anti_aliasing: true} }, + {name: 'bulge_pinch_tool',title: 'Bulge/Pinch tool', icon: ['sprites.png', -450+3, -100+3], attributes: {size: 50, radius: 80, bulge:true} }, + {name: 'clone_tool', title: 'Clone tool', icon: ['sprites.png', -350+4, -50+3], attributes: {size: 30, anti_aliasing: true} }, + {name: 'gradient_tool', title: 'Gradient', icon: ['sprites.png', -400+3, -50+4], attributes: {radial: false, power: 50} }, + {name: 'crop_tool', title: 'Crop', icon: ['sprites.png', -450+2, -50+2], attributes: { } }, +]; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/config.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/config.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..f6b51ce9bf73e3e75eae365001c1aad3680bf49e --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/config.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + config.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img.xml new file mode 100644 index 0000000000000000000000000000000000000000..92bd6db7cd427b9d7bbf894553731bf6f0ca808d --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + img + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/colorwheel.png.png b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/colorwheel.png.png new file mode 100644 index 0000000000000000000000000000000000000000..bb4acd2315e28a1e72116fdc925554dde4dd60eb Binary files /dev/null and b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/colorwheel.png.png differ diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/colorwheel.png.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/colorwheel.png.xml new file mode 100644 index 0000000000000000000000000000000000000000..962158774832137f5d8da4276b422fd142392cdd --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/colorwheel.png.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + colorwheel.png + + + content_type + image/png + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/favicon.png.png b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/favicon.png.png new file mode 100644 index 0000000000000000000000000000000000000000..1cdf1958ec31c8ae582bb177daffc6d66e90d204 Binary files /dev/null and b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/favicon.png.png differ diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/favicon.png.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/favicon.png.xml new file mode 100644 index 0000000000000000000000000000000000000000..0e15ff092315e1838e442d6f400f24fe7f050f80 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/favicon.png.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + favicon.png + + + content_type + image/png + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/logo.png.png b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/logo.png.png new file mode 100644 index 0000000000000000000000000000000000000000..c93d189d38e8e853ed6548408279994b7d88f845 Binary files /dev/null and b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/logo.png.png differ diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/logo.png.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/logo.png.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe018ae308df84c6e8420cbf5ad622d042deaea6 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/logo.png.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + logo.png + + + content_type + image/png + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/preview.jpg.jpg b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/preview.jpg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2eed2af3b5b785b29dec7fa0f97dae07340ee454 Binary files /dev/null and b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/preview.jpg.jpg differ diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/preview.jpg.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/preview.jpg.xml new file mode 100644 index 0000000000000000000000000000000000000000..f069b77e785569eb069f31dd27f18686f4e49be1 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/preview.jpg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + preview.jpg + + + content_type + image/jpeg + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/right.png.png b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/right.png.png new file mode 100644 index 0000000000000000000000000000000000000000..59c3766a73932feef0ca3b9fc6f3dd036805e97f Binary files /dev/null and b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/right.png.png differ diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/right.png.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/right.png.xml new file mode 100644 index 0000000000000000000000000000000000000000..e8be7a32714044d417cefffe93d667bb3f105cc2 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/right.png.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + right.png + + + content_type + image/png + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/sprites.png.png b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/sprites.png.png new file mode 100644 index 0000000000000000000000000000000000000000..8ef360db06d47503fe846ce885cf08262d263596 Binary files /dev/null and b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/sprites.png.png differ diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/sprites.png.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/sprites.png.xml new file mode 100644 index 0000000000000000000000000000000000000000..15d70320c2175ab2962549991d112da81d441c19 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/img/sprites.png.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + sprites.png + + + content_type + image/png + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js.xml new file mode 100644 index 0000000000000000000000000000000000000000..2b3798ee4afb97e5383879f37cc6da1ac095e6f7 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + js + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/draw_tools.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/draw_tools.js.js new file mode 100644 index 0000000000000000000000000000000000000000..567ca7a7273e4a4d6a073543062563f1a265e427 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/draw_tools.js.js @@ -0,0 +1,1674 @@ +/* global MAIN, HELPER, LAYER, EDIT, POP, GUI, EVENTS, IMAGE, EL, fx, ImageFilters, sketchy_brush, shaded_brush, chrome_brush, BezierCurveBrush */ +/* global WIDTH, HEIGHT, COLOR, canvas_active, canvas_front */ + +var DRAW = new DRAW_TOOLS_CLASS(); + +/** + * manages draw tools + * + * @author ViliusL + */ +function DRAW_TOOLS_CLASS() { + + /** + * user action for selected area + */ + this.select_square_action = ''; + + /** + * previous line coordinates [x, y] + */ + this.last_line = []; + + /** + * user selected area config - array(x, y, width, height) + */ + this.select_data = false; + + /** + * currently used tool + */ + this.active_tool = 'select_tool'; + + /** + * line points data for curved line + */ + var curve_points = []; + + /** + * image data for cloning tool + */ + var clone_data = false; + + /** + * fx library object + */ + var fx_filter = false; + + //credits to Victor Haydin + this.toolFiller = function (context, W, H, x, y, color_to, sensitivity, anti_aliasing) { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + var img_tmp = canvas_front.getImageData(0, 0, W, H); + var imgData_tmp = img_tmp.data; + + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var k = ((y * (img.width * 4)) + (x * 4)); + var dx = [0, -1, +1, 0]; + var dy = [-1, 0, 0, +1]; + var color_from = { + r: imgData[k + 0], + g: imgData[k + 1], + b: imgData[k + 2], + a: imgData[k + 3] + }; + if (color_from.r == color_to.r && color_from.g == color_to.g && color_from.b == color_to.b && color_from.a == color_to.a) { + return false; + } + var stack = []; + stack.push([x, y]); + while (stack.length > 0) { + var curPoint = stack.pop(); + for (var i = 0; i < 4; i++) { + var nextPointX = curPoint[0] + dx[i]; + var nextPointY = curPoint[1] + dy[i]; + if (nextPointX < 0 || nextPointY < 0 || nextPointX >= W || nextPointY >= H) + continue; + var k = (nextPointY * W + nextPointX) * 4; + if (imgData_tmp[k + 3] != 0) + continue; //already parsed + + //check + if (Math.abs(imgData[k + 0] - color_from.r) <= sensitivity && + Math.abs(imgData[k + 1] - color_from.g) <= sensitivity && + Math.abs(imgData[k + 2] - color_from.b) <= sensitivity && + Math.abs(imgData[k + 3] - color_from.a) <= sensitivity) { + + //fill pixel + imgData_tmp[k] = color_to.r; //r + imgData_tmp[k + 1] = color_to.g; //g + imgData_tmp[k + 2] = color_to.b; //b + imgData_tmp[k + 3] = color_to.a; //a + + stack.push([nextPointX, nextPointY]); + } + } + } + canvas_front.putImageData(img_tmp, 0, 0); + if (anti_aliasing == true) { + context.shadowColor = "rgba(" + color_to.r + ", " + color_to.g + ", " + color_to.b + ", " + color_to.a / 255 + ")"; + context.shadowBlur = 5; + } + context.drawImage(document.getElementById("canvas_front"), 0, 0); + //reset + context.shadowBlur = 0; + }; + + this.tool_magic_wand = function (context, W, H, x, y, sensitivity, anti_aliasing) { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + + canvas_front.rect(0, 0, WIDTH, HEIGHT); + canvas_front.fillStyle = "rgba(255, 255, 255, 0)"; + canvas_front.fill(); + + var img_tmp = canvas_front.getImageData(0, 0, W, H); + var imgData_tmp = img_tmp.data; + + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var k = ((y * (img.width * 4)) + (x * 4)); + var dx = [0, -1, +1, 0]; + var dy = [-1, 0, 0, +1]; + var color_to = { + r: 255, + g: 255, + b: 255, + a: 255 + }; + var color_from = { + r: imgData[k + 0], + g: imgData[k + 1], + b: imgData[k + 2], + a: imgData[k + 3] + }; + if (color_from.r == color_to.r && + color_from.g == color_to.g && + color_from.b == color_to.b && + color_from.a == 0) { + return false; + } + var stack = []; + stack.push([x, y]); + while (stack.length > 0) { + var curPoint = stack.pop(); + for (var i = 0; i < 4; i++) { + var nextPointX = curPoint[0] + dx[i]; + var nextPointY = curPoint[1] + dy[i]; + if (nextPointX < 0 || nextPointY < 0 || nextPointX >= W || nextPointY >= H) + continue; + var k = (nextPointY * W + nextPointX) * 4; + if (imgData_tmp[k + 3] != 0) + continue; //already parsed + + if (Math.abs(imgData[k] - color_from.r) <= sensitivity + && Math.abs(imgData[k + 1] - color_from.g) <= sensitivity + && Math.abs(imgData[k + 2] - color_from.b) <= sensitivity + && Math.abs(imgData[k + 3] - color_from.a) <= sensitivity) { + imgData_tmp[k] = color_to.r; //r + imgData_tmp[k + 1] = color_to.g; //g + imgData_tmp[k + 2] = color_to.b; //b + imgData_tmp[k + 3] = color_to.a; //a + + stack.push([nextPointX, nextPointY]); + } + } + } + //destination-out + blur = anti-aliasing + if (anti_aliasing == true) + img_tmp = ImageFilters.StackBlur(img_tmp, 2); + canvas_front.putImageData(img_tmp, 0, 0); + context.globalCompositeOperation = "destination-out"; + context.drawImage(document.getElementById("canvas_front"), 0, 0); + //reset + context.shadowBlur = 0; + context.globalCompositeOperation = 'source-over'; + }; + + //type = click, right_click, drag, move, release + this.select_tool = function (type, mouse, event) { + if (mouse == undefined) + return false; + if (mouse.valid == false) + return true; + if (mouse.click_valid == false) + return true; + if (event != undefined && event.target.id == "canvas_preview") + return true; + var active_layer_obj = document.getElementById(LAYER.layers[LAYER.layer_active].name); + + if (type == 'drag') { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + + if(active_layer_obj.style.visibility != 'hidden'){ + //hide active layer + active_layer_obj.style.visibility = 'hidden'; + } + + if(EVENTS.ctrl_pressed == true){ + //ctrl is pressed + var xx = mouse.x; + var yy = mouse.y; + if (Math.abs(mouse.click_x - mouse.x) < Math.abs(mouse.click_y - mouse.y)) + xx = mouse.click_x; + else + yy = mouse.click_y; + canvas_front.drawImage(canvas_active(true), xx - mouse.click_x, yy - mouse.click_y); + } + else{ + canvas_front.drawImage(canvas_active(true), mouse.x - mouse.click_x, mouse.y - mouse.click_y); + } + } + else if (type == 'release') { + //show active layer + active_layer_obj.style.visibility = 'visible'; + + if (mouse.valid == false || mouse.click_x === false){ + return false; + } + if (mouse.x - mouse.click_x == 0 && mouse.y - mouse.click_y == 0){ + return false; + } + EDIT.save_state(); + var tmp = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + if(EVENTS.ctrl_pressed == true){ + //ctrl is pressed + var xx = mouse.x; + var yy = mouse.y; + if (Math.abs(mouse.click_x - mouse.x) < Math.abs(mouse.click_y - mouse.y)) + xx = mouse.click_x; + else + yy = mouse.click_y; + canvas_active().putImageData(tmp, xx - mouse.click_x, yy - mouse.click_y); + } + else{ + canvas_active().putImageData(tmp, mouse.x - mouse.click_x, mouse.y - mouse.click_y); + } + } + }; + this.magic_wand = function (type, mouse, event) { + if (mouse.valid == false) + return true; + if (type == 'click') { + EDIT.save_state(); + this.tool_magic_wand(canvas_active(), WIDTH, HEIGHT, mouse.x, mouse.y, GUI.action_data().attributes.power, GUI.action_data().attributes.anti_aliasing); + } + }; + this.erase = function (type, mouse, event) { + if (mouse.valid == false) + return true; + var strict = GUI.action_data().attributes.strict; + var size = GUI.action_data().attributes.size; + var is_circle = GUI.action_data().attributes.circle; + + var strict_element = document.getElementById('strict'); + if(is_circle == false){ + //hide strict controlls + if(strict_element != undefined) + strict_element.style.display = 'none'; + } + else{ + //show strict controlls + if(strict_element != undefined) + strict_element.style.display = 'block'; + } + + if (type == 'click') { + EDIT.save_state(); + + canvas_active().beginPath(); + canvas_active().lineWidth = size; + canvas_active().lineCap = 'round'; + canvas_active().lineJoin = 'round'; + if (ALPHA < 255) + canvas_active().strokeStyle = "rgba(255, 255, 255, " + ALPHA / 255 / 10 + ")"; + else + canvas_active().strokeStyle = "rgba(255, 255, 255, 1)"; + + if (is_circle == false) { + //rectangle + canvas_active().save(); + canvas_active().globalCompositeOperation = 'destination-out'; + canvas_active().fillStyle = "rgba(255, 255, 255, " + ALPHA / 255 + ")"; + canvas_active().fillRect(mouse.x - Math.ceil(size / 2) + 1, mouse.y - Math.ceil(size / 2) + 1, size, size); + canvas_active().restore(); + } + else { + //circle + canvas_active().save(); + + if (strict == false) { + var radgrad = canvas_active().createRadialGradient( + mouse.x, mouse.y, size / 8, + mouse.x, mouse.y, size / 2); + radgrad.addColorStop(0, "rgba(255, 255, 255, " + ALPHA / 255 + ")"); + radgrad.addColorStop(1, "rgba(255, 255, 255, 0)"); + } + + //set Composite + canvas_active().globalCompositeOperation = 'destination-out'; + if (strict == true) + canvas_active().fillStyle = "rgba(255, 255, 255, " + ALPHA / 255 + ")"; + else + canvas_active().fillStyle = radgrad; + canvas_active().beginPath(); + canvas_active().arc(mouse.x, mouse.y, size / 2, 0, Math.PI * 2, true); + canvas_active().fill(); + canvas_active().restore(); + } + } + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + canvas_active().save(); + + if (strict == false && is_circle == true) { + var radgrad = canvas_active().createRadialGradient( + mouse.x, mouse.y, size / 10, + mouse.x, mouse.y, size / 2); + if (ALPHA < 255) + radgrad.addColorStop(0, "rgba(255, 255, 255, " + ALPHA / 255 / 10 + ")"); + else + radgrad.addColorStop(0, "rgba(255, 255, 255, 1)"); + radgrad.addColorStop(1, "rgba(255, 255, 255, 0)"); + canvas_active().strokeStyle = radgrad; + } + + canvas_active().save(); + canvas_active().globalCompositeOperation = 'destination-out'; + + canvas_active().beginPath(); + canvas_active().moveTo(mouse.last_x, mouse.last_y); + canvas_active().lineTo(mouse.x, mouse.y); + canvas_active().stroke(); + + canvas_active().restore(); + + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + if (is_circle == false) { + canvas_front.lineWidth = 1; + EL.rectangle_dashed(canvas_front, mouse.x - Math.ceil(size / 2) + 1, mouse.y - Math.ceil(size / 2) + 1, mouse.x + Math.floor(size / 2), mouse.y + Math.floor(size / 2), 1, '#000000'); + } + else { + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + } + else if (type == 'move') { + var size1 = Math.floor((size) / 2); + var size2 = Math.floor((size) / 2); + if (size % 2 == 0) + size2--; + else { + size1--; + } + + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + if (is_circle == false) { + canvas_front.lineWidth = 1; + EL.rectangle_dashed(canvas_front, mouse.x - Math.ceil(size / 2) + 1, mouse.y - Math.ceil(size / 2) + 1, mouse.x + Math.floor(size / 2), mouse.y + Math.floor(size / 2), 1, '#000000'); + } + else { + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + } + }; + this.fill = function (type, mouse, event) { + if (mouse.valid == false) + return true; + if (type == 'click') { + EDIT.save_state(); + var color_to = HELPER.hex2rgb(COLOR); + color_to.a = ALPHA; + DRAW.toolFiller(canvas_active(), WIDTH, HEIGHT, mouse.x, mouse.y, color_to, GUI.action_data().attributes.power, GUI.action_data().attributes.anti_aliasing); + } + }; + this.pick_color = function (type, mouse, event) { + if (mouse.valid == false) + return true; + if (type == 'click') { + var c = canvas_active().getImageData(mouse.x, mouse.y, 1, 1).data; + COLOR = "#" + ("000000" + HELPER.rgbToHex(c[0], c[1], c[2])).slice(-6); + + //set alpha + ALPHA = c[3]; + document.getElementById("rgb_a").value = ALPHA; + + GUI.sync_colors(); + } + }; + this.pencil = function (type, mouse, event) { + if (mouse.valid == false) + return true; + var color_rgb = HELPER.hex2rgb(COLOR); + if (type == 'click') { + EDIT.save_state(); + } + else if (type == 'drag') { + //why no simple lines? this way turns off aliasing + if (mouse.last_x != false && mouse.last_y != false) { + //saving + dist_x = mouse.last_x - mouse.x; + dist_y = mouse.last_y - mouse.y; + distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y)); + radiance = Math.atan2(dist_y, dist_x); + for (var i = 0; i < distance; i++) { + x_tmp = mouse.x + Math.cos(radiance) * i; + y_tmp = mouse.y + Math.sin(radiance) * i; + + x_tmp = Math.round(x_tmp); + y_tmp = Math.round(y_tmp); + var my_color = HELPER.hex2rgb(COLOR); + canvas_active().fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().fillRect(x_tmp, y_tmp, 1, 1); + } + } + } + else if (type == 'release') { + canvas_active().fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().fillRect(mouse.x, mouse.y, 1, 1); + } + }; + this.line = function (type, mouse, event) { + if (mouse.click_valid == false) + return false; + var color_rgb = HELPER.hex2rgb(COLOR); + + //horizontal/vertical only + var xx = mouse.x; + var yy = mouse.y; + var from_x = mouse.click_x; + var from_y = mouse.click_y; + var attribute_type = GUI.action_data().attributes.type; + + if (type == 'move') { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_front.lineWidth = GUI.action_data().attributes.size; + + if (attribute_type == 'Curve') { + //curve + if (curve_points.length == 2) { + canvas_front.beginPath(); + canvas_front.moveTo(curve_points[0][0] + 0.5, curve_points[0][1] + 0.5); + canvas_front.quadraticCurveTo(mouse.x + 0.5, mouse.y + 0.5, curve_points[1][0], curve_points[1][1]); + canvas_front.stroke(); + } + } + } + else if (type == 'drag') { + document.body.style.cursor = "crosshair"; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.beginPath(); + canvas_front.strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_front.lineWidth = GUI.action_data().attributes.size; + if (attribute_type == 'Multi-line' && this.last_line[0] != undefined) { + from_x = this.last_line[0]; + from_y = this.last_line[1]; + } + if (EVENTS.ctrl_pressed == true) { + if (Math.abs(from_x - mouse.x) < Math.abs(from_y - mouse.y)) + xx = from_x; + else + yy = from_y; + } + + //arrow + if (attribute_type == 'Arrow') { + var headlen = GUI.action_data().attributes.size * 5; + if (headlen < 15) + headlen = 15; + EL.arrow(canvas_front, from_x + 0.5, from_y + 0.5, xx + 0.5, yy + 0.5, headlen); + } + //line + else { + canvas_front.moveTo(from_x + 0.5, from_y + 0.5); + canvas_front.lineTo(xx + 0.5, yy + 0.5); + canvas_front.stroke(); + } + } + else if (type == 'click') { + //curve + if (attribute_type == 'Curve') { + EDIT.save_state(); + + canvas_active().beginPath(); + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = GUI.action_data().attributes.size; + if (EVENTS.ctrl_pressed == true) { + if (Math.abs(from_x - mouse.x) < Math.abs(from_y - mouse.y)) + xx = from_x; + else + yy = from_y; + } + if (curve_points.length == 2) { + canvas_active().beginPath(); + canvas_active().moveTo(curve_points[0][0] + 0.5, curve_points[0][1] + 0.5); + canvas_active().quadraticCurveTo(xx + 0.5, yy + 0.5, curve_points[1][0], curve_points[1][1]); + canvas_active().stroke(); + curve_points = []; + } + } + } + else if (type == 'release') { + document.body.style.cursor = "auto"; + if (mouse.x - mouse.click_x == 0 && mouse.y - mouse.click_y == 0 && attribute_type != 'Multi-line') + return false; + + EDIT.save_state(); + + canvas_active().beginPath(); + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = GUI.action_data().attributes.size; + if (attribute_type == 'Multi-line' && this.last_line[0] != undefined) { + from_x = DRAW.last_line[0]; + from_y = DRAW.last_line[1]; + } + if (EVENTS.ctrl_pressed == true) { + if (Math.abs(from_x - mouse.x) < Math.abs(from_y - mouse.y)) + xx = from_x; + else + yy = from_y; + } + //arrow + if (attribute_type == 'Arrow') { + var headlen = GUI.action_data().attributes.size * 5; + if (headlen < 15) + headlen = 15; + EL.arrow(canvas_active(), from_x + 0.5, from_y + 0.5, xx + 0.5, yy + 0.5, headlen); + this.last_line[0] = xx; + this.last_line[1] = yy; + } + //curve + else if (attribute_type == 'Curve') { + if (curve_points.length == 0 && (mouse.click_x != mouse.x || mouse.click_y != mouse.y)) { + curve_points.push([mouse.click_x, mouse.click_y]); + curve_points.push([xx, yy]); + } + else if (curve_points.length == 2) + curve_points = []; + } + //line + else { + EL.line(canvas_active(), from_x, from_y, xx, yy); + this.last_line[0] = xx; + this.last_line[1] = yy; + } + } + }; + this.letters = function (type, mouse, event) { + var _this = this; + if (mouse.valid == false) + return true; + var xx = mouse.x; + var yy = mouse.y; + if (type == 'click') { + POP.add({name: "text", title: "Text:", value: "", type: 'textarea'}); + POP.add({name: "size", title: "Size:", value: 20, range: [2, 1000], step: 2}); + POP.add({name: "color", title: "Color:", value: "#000000", type: "color"}); + POP.add({name: "style", title: "Font style:", values: ["Normal", "Italic", "Bold", "Bold Italic"], type: 'select'}); + POP.add({name: "family", title: "Font family:", values: ["Arial", "Courier", "Impact", "Helvetica", "monospace", "Times New Roman", "Verdana"], type: 'select'}); + POP.add({name: "size_3d", title: "3D size:", value: 0, range: [0, 200]}); + POP.add({name: "pos_3d", title: "3D position:", values: ["Top-left", "Top-right", "Bottom-left", "Bottom-right"], type: 'select'}); + POP.add({name: "shadow", title: "Shadow:", values: ["No", "Yes"]}); + POP.add({name: "shadow_blur", title: "Shadow blur:", value: 6, range: [1, 20]}); + POP.add({name: "shadow_color", title: "Shadow color:", value: "#000000", type: "color"}); + POP.add({name: "fill_style", title: "Fill style:", values: ["Fill", "Stroke", "Both"], type: 'select'}); + POP.add({name: "stroke_size", title: "Stroke size:", value: 1, range: [1, 100]}); + POP.preview_in_main = true; + POP.show( + 'Text', + function (user_response) { + EDIT.save_state(); + var trim_details = IMAGE.trim_info(canvas_active(true)); + if (trim_details.empty == false) { + LAYER.layer_add(); + } + text = user_response.text.split("\n"); + for (var i in text) { + user_response.text = text[i]; + var yyy = yy + i * (parseInt(user_response.size) + 2); + _this.letters_render(canvas_active(), xx, yyy, user_response); + } + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + }, + function (user_response) { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + text = user_response.text.split("\n"); + for (var i in text) { + user_response.text = text[i]; + var yyy = yy + i * (parseInt(user_response.size) + 2); + _this.letters_render(canvas_front, xx, yyy, user_response); + } + } + ); + } + }; + this.letters_render = function (canvas, xx, yy, user_response) { + var text = user_response.text; + var size = parseInt(user_response.size); + var color = user_response.color; + var dpth = parseInt(user_response.size_3d); + var pos_3d = user_response.pos_3d; + var shadow = user_response.shadow; + var shadow_blur = parseInt(user_response.shadow_blur); + var shadow_color = user_response.shadow_color; + var font = user_response.family; + var font_style = user_response.style; + var fill_style = user_response.fill_style; + var stroke_size = user_response.stroke_size; + var dx; + var dy; + if (pos_3d == "Top-left") { + dx = -1; + dy = -1; + } + else if (pos_3d == "Top-right") { + dx = 1; + dy = -1; + } + else if (pos_3d == "Bottom-left") { + dx = -1; + dy = 1; + } + else if (pos_3d == "Bottom-right") { + dx = 1; + dy = 1; + } + + var color_rgb = HELPER.hex2rgb(color); + canvas.fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas.font = font_style + " " + size + "px " + font; + var letters_height = HELPER.font_pixel_to_height(size); + + //shadow + if (shadow == 'Yes') { + canvas.save(); + canvas.shadowColor = shadow_color; + canvas.shadowBlur = shadow_blur; + canvas.shadowOffsetX = dx; + canvas.shadowOffsetY = dy; + canvas.fillText(text, xx + dx * (dpth - 1), yy + letters_height + dy * (dpth - 1)); + canvas.restore(); + } + + //3d + if (dpth > 0) { + canvas.fillStyle = HELPER.darkenColor(COLOR, -30); + //canvas.fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + for (cnt = 0; cnt < dpth; cnt++) + canvas.fillText(text, xx + dx * cnt, yy + letters_height + dy * cnt); + //color_rgb = HELPER.hex2rgb(COLOR); + } + + //main text + canvas.fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas.strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas.lineWidth = stroke_size; + if (fill_style == 'Fill' || fill_style == 'Both') + canvas.fillText(text, xx, yy + letters_height); + if (fill_style == 'Stroke' || fill_style == 'Both') + canvas.strokeText(text, xx, yy + letters_height); + + GUI.zoom(); + }; + this.draw_square = function (type, mouse, event) { + if (mouse.click_valid == false) + return true; + var color_rgb = HELPER.hex2rgb(COLOR); + var fill = GUI.action_data().attributes.fill; + var width = mouse.x - mouse.click_x; + var height = mouse.y - mouse.click_y; + + if (type == 'drag') { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_front.strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_front.lineWidth = 1; + + if (GUI.action_data().attributes.square == true) + EL.square(canvas_front, mouse.click_x, mouse.click_y, width, height, fill); + else + EL.rectangle(canvas_front, mouse.click_x, mouse.click_y, width, height, fill); + } + else if (type == 'release') { + if(mouse.x == mouse.click_x && mouse.y == mouse.click_y) + return false; + EDIT.save_state(); + + canvas_active().fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = 1; + + if (GUI.action_data().attributes.square == true) + EL.square(canvas_active(), mouse.click_x, mouse.click_y, width, height, fill); + else + EL.rectangle(canvas_active(), mouse.click_x, mouse.click_y, width, height, fill); + } + }; + this.draw_circle = function (type, mouse, event) { + if (mouse.click_valid == false) + return true; + var color_rgb = HELPER.hex2rgb(COLOR); + if (type == 'drag') { + dist_x = mouse.x - mouse.click_x; + dist_y = mouse.y - mouse.click_y; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + if (GUI.action_data().attributes.circle == true) + dist_x = dist_y = Math.min(dist_x, dist_y); + if (GUI.action_data().attributes.fill == true) + EL.ellipse_by_center(canvas_front, mouse.click_x, mouse.click_y, dist_x * 2, dist_y * 2, "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")", true); + else + EL.ellipse_by_center(canvas_front, mouse.click_x, mouse.click_y, dist_x * 2, dist_y * 2, "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"); + } + else if (type == 'release') { + dist_x = mouse.x - mouse.click_x; + dist_y = mouse.y - mouse.click_y; + if(dist_x == 0 && dist_y == 0) + return false; + EDIT.save_state(); + if (GUI.action_data().attributes.circle == true) + dist_x = dist_y = Math.min(dist_x, dist_y); + canvas_active().lineWidth = 1; + if (GUI.action_data().attributes.fill == true) + EL.ellipse_by_center(canvas_active(), mouse.click_x, mouse.click_y, dist_x * 2, dist_y * 2, "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")", true); + else + EL.ellipse_by_center(canvas_active(), mouse.click_x, mouse.click_y, dist_x * 2, dist_y * 2, "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"); + } + }; + this.update_brush = function () { + document.getElementById('anti_aliasing').style.display = ''; + if (GUI.action_data().attributes.type != 'Brush') + document.getElementById('anti_aliasing').style.display = 'none'; + }; + this.desaturate_tool = function (type, mouse, event) { + if (mouse.valid == false) + return true; + var size = GUI.action_data().attributes.size; + var xx = mouse.x - size / 2; + var yy = mouse.y - size / 2; + if (xx < 0) + xx = 0; + if (yy < 0) + yy = 0; + + if (type == 'click') { + EDIT.save_state(); + var imageData = canvas_active().getImageData(xx, yy, size, size); + var filtered = ImageFilters.GrayScale(imageData); //add effect + EL.image_round(canvas_active(), mouse.x, mouse.y, size, filtered, document.getElementById("canvas_front"), GUI.action_data().attributes.anti_aliasing); + } + else if (type == 'drag') { + var imageData = canvas_active().getImageData(xx, yy, size, size); + var filtered = ImageFilters.GrayScale(imageData); //add effect + EL.image_round(canvas_active(), mouse.x, mouse.y, size, filtered, document.getElementById("canvas_front"), GUI.action_data().attributes.anti_aliasing); + } + if (type == 'move' || type == 'drag') { + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + }; + this.brush = function (type, mouse, event) { + if (mouse.valid == false) + return true; + var brush_type = GUI.action_data().attributes.type; + var color_rgb = HELPER.hex2rgb(COLOR); + var size = GUI.action_data().attributes.size; + var original_size = GUI.action_data().attributes.size; + + if (type == 'click') + EDIT.save_state(); + + if (brush_type == 'Brush') { + if (type == 'click') { + //init settings + canvas_active().beginPath(); + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = GUI.action_data().attributes.size; + canvas_active().lineCap = 'round'; + canvas_active().lineJoin = 'round'; + + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + if (ALPHA < 255) { + canvas_front.beginPath(); + canvas_front.strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_front.lineWidth = GUI.action_data().attributes.size; + canvas_front.lineCap = 'round'; + canvas_front.lineJoin = 'round'; + } + + /*canvas_front.beginPath(); + canvas_front.arc(mouse.x, mouse.y, GUI.action_data().attributes.size / 2, 0, 2 * Math.PI, false); + canvas_front.fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_front.fill();*/ + + //blur + canvas_active().shadowBlur = 0; + if (GUI.action_data().attributes.anti_aliasing == true) { + canvas_active().shadowColor = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().shadowBlur = Math.round(GUI.action_data().attributes.size); + } + } + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + + //detect line size + var max_speed = 20; + var power = 0.7; //max 1, how much speed reduce size, 1 means reduce to 0 + + var new_size = original_size - original_size / max_speed * mouse.speed_average * power; + new_size = Math.max(new_size, original_size/4); + new_size = Math.round(new_size); + canvas_front.lineWidth = new_size; + canvas_active().lineWidth = new_size; + + if (ALPHA == 255) + canvas_active().beginPath(); + canvas_active().moveTo(mouse.last_x, mouse.last_y); + canvas_active().lineTo(mouse.x, mouse.y); + if (ALPHA == 255) + canvas_active().stroke(); + + //now draw preview + if (ALPHA < 255) { + canvas_front.beginPath(); + //clean from last line + canvas_front.globalCompositeOperation = "destination-out"; + canvas_front.strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", 1)"; + canvas_front.moveTo(mouse.last_x, mouse.last_y); + canvas_front.lineTo(mouse.x, mouse.y); + canvas_front.stroke(); + //reset + canvas_front.strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_front.globalCompositeOperation = "source-over"; + //draw new line segment + canvas_front.moveTo(mouse.last_x, mouse.last_y); + canvas_front.lineTo(mouse.x, mouse.y); + canvas_front.stroke(); + } + } + else if (type == 'release') { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + //paint everything + canvas_active().stroke(); + + //if mouse was not moved + if (mouse.click_x == mouse.x && mouse.click_y == mouse.y) { + canvas_active().beginPath(); + canvas_active().arc(mouse.x, mouse.y, GUI.action_data().attributes.size / 2, 0, 2 * Math.PI, false); + canvas_active().fillStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().fill(); + } + canvas_active().shadowBlur = 0; + } + else if (type == 'move') { + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + } + else if (brush_type == 'BezierCurve') { + if (type == 'click') + BezierCurveBrush.startCurve(mouse.x, mouse.y); + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + var color_rgb = HELPER.hex2rgb(COLOR); + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = 0.5; + + BezierCurveBrush.draw(canvas_active(), color_rgb, mouse.x, mouse.y, GUI.action_data().attributes.size); + } + } + else if (brush_type == 'Chrome') { + if (type == 'click') { + chrome_brush.init(canvas_active()); + chrome_brush.strokeStart(mouse.x, mouse.y); + } + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + var color_rgb = HELPER.hex2rgb(COLOR); + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = 1; + + chrome_brush.stroke(color_rgb, mouse.x, mouse.y, GUI.action_data().attributes.size); + } + } + else if (brush_type == 'Fur') { + if (type == 'click') { + points = new Array(); + prevMouseX = mouse.x; + prevMouseY = mouse.y; + count = 0; + } + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + var color_rgb = HELPER.hex2rgb(COLOR); + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", 0.1)"; + canvas_active().lineWidth = 1; + + f = mouse.x; + c = mouse.y; + var e, b, a, g; + points.push([f, c]); + canvas_active().beginPath(); + canvas_active().moveTo(prevMouseX, prevMouseY); + canvas_active().lineTo(f, c); + canvas_active().stroke(); + for (e = 0; e < points.length; e++) { + b = points[e][0] - points[count][0]; + a = points[e][1] - points[count][1]; + g = b * b + a * a; + var g_size = Math.round(400 * GUI.action_data().attributes.size); + if (g < g_size && Math.random() > g / g_size) { + canvas_active().beginPath(); + canvas_active().moveTo(f + (b * 0.5), c + (a * 0.5)); + canvas_active().lineTo(f - (b * 0.5), c - (a * 0.5)); + canvas_active().stroke(); + } + } + prevMouseX = f; + prevMouseY = c; + count++; + } + } + else if (brush_type == 'Grouped') { + groups_n = GUI.action_data().attributes.size; + gsize = 10; + random_power = 5; + + if (type == 'click') { + chrome_brush.init(canvas_active()); + chrome_brush.strokeStart(mouse.x, mouse.y); + groups = []; + + for (var g = 0; g < groups_n; g++) { + groups[g] = {}; + groups[g].x = HELPER.getRandomInt(-gsize, gsize); + groups[g].y = HELPER.getRandomInt(-gsize, gsize); + } + } + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = 0.5; + + for (var g in groups) { + canvas_active().beginPath(); + canvas_active().moveTo(mouse.last_x + groups[g].x, mouse.last_y + groups[g].y); + + //randomize here + groups[g].x += HELPER.getRandomInt(-random_power, random_power); + groups[g].y += HELPER.getRandomInt(-random_power, random_power); + if (groups[g].x < -gsize) + groups[g].x = -gsize + random_power; + if (groups[g].y < -gsize) + groups[g].y = -gsize + random_power; + if (groups[g].x > gsize) + groups[g].x = gsize - random_power; + if (groups[g].y > gsize) + groups[g].y = gsize - random_power; + + canvas_active().lineTo(mouse.x + groups[g].x, mouse.y + groups[g].y); + canvas_active().stroke(); + } + } + } + else if (brush_type == 'Shaded') { + if (type == 'click') { + shaded_brush.init(canvas_active()); + shaded_brush.strokeStart(mouse.x, mouse.y); + } + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + var color_rgb = HELPER.hex2rgb(COLOR); + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = 1; + + shaded_brush.stroke(color_rgb, mouse.x, mouse.y, GUI.action_data().attributes.size); + } + } + else if (brush_type == 'Sketchy') { + if (type == 'click') { + sketchy_brush.init(canvas_active()); + sketchy_brush.strokeStart(mouse.x, mouse.y); + } + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + var color_rgb = HELPER.hex2rgb(COLOR); + canvas_active().strokeStyle = "rgba(" + color_rgb.r + ", " + color_rgb.g + ", " + color_rgb.b + ", " + ALPHA / 255 + ")"; + canvas_active().lineWidth = 1; + + sketchy_brush.stroke(color_rgb, mouse.x, mouse.y, GUI.action_data().attributes.size); + } + } + }; + this.gradient_tool = function (type, mouse, event) { + if (mouse != undefined && mouse.valid == false && type != 'init') + return true; + var power = GUI.action_data().attributes.power; + if (power > 99) + power = 99; + + if (type == 'init') { + POP.add({name: "param1", title: "Color #1:", value: '#000000', type: 'color'}); + POP.add({name: "param2", title: "Transparency #1:", value: '255', range: [0, 255]}); + POP.add({name: "param3", title: "Color #2:", value: '#ffffff', type: 'color'}); + POP.add({name: "param4", title: "Transparency #2:", value: '255', range: [0, 255]}); + POP.show( + 'Text', + function (user_response) { + color1 = HELPER.hex2rgb(user_response.param1); + color1.a = parseInt(user_response.param2); + + color2 = HELPER.hex2rgb(user_response.param3); + color2.a = parseInt(user_response.param4); + } + ); + } + else if (type == 'drag') { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + + if (GUI.action_data().attributes.radial == false) { + //linear + canvas_front.rect(0, 0, WIDTH, HEIGHT); + + var grd = canvas_front.createLinearGradient( + mouse.click_x, mouse.click_y, + mouse.x, mouse.y); + + grd.addColorStop(0, "rgba(" + color1.r + ", " + color1.g + ", " + color1.b + ", " + color1.a / 255 + ")"); + grd.addColorStop(1, "rgba(" + color2.r + ", " + color2.g + ", " + color2.b + ", " + color2.a / 255 + ")"); + canvas_front.fillStyle = grd; + canvas_front.fill(); + } + else { + //radial + var dist_x = mouse.click_x - mouse.x; + var dist_y = mouse.click_y - mouse.y; + var distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y)); + var radgrad = canvas_front.createRadialGradient( + mouse.click_x, mouse.click_y, distance * power / 100, + mouse.click_x, mouse.click_y, distance); + radgrad.addColorStop(0, "rgba(" + color1.r + ", " + color1.g + ", " + color1.b + ", " + color1.a / 255 + ")"); + radgrad.addColorStop(1, "rgba(" + color2.r + ", " + color2.g + ", " + color2.b + ", " + color2.a / 255 + ")"); + + canvas_front.fillStyle = radgrad; + canvas_front.fillRect(0, 0, WIDTH, HEIGHT); + } + //draw line + canvas_front.beginPath(); + canvas_front.strokeStyle = "#ff0000"; + canvas_front.lineWidth = 1; + var xx = mouse.x; + var yy = mouse.y; + canvas_front.moveTo(mouse.click_x + 0.5, mouse.click_y + 0.5); + canvas_front.lineTo(xx + 0.5, yy + 0.5); + canvas_front.stroke(); + } + else if (type == 'release') { + EDIT.save_state(); + if (GUI.action_data().attributes.radial == false) { + //linear + canvas_active().rect(0, 0, WIDTH, HEIGHT); + var grd = canvas_active().createLinearGradient( + mouse.click_x, mouse.click_y, + mouse.x, mouse.y); + + grd.addColorStop(0, "rgba(" + color1.r + ", " + color1.g + ", " + color1.b + ", " + color1.a / 255 + ")"); + grd.addColorStop(1, "rgba(" + color2.r + ", " + color2.g + ", " + color2.b + ", " + color2.a / 255 + ")"); + canvas_active().fillStyle = grd; + canvas_active().fill(); + } + else { + //radial + var dist_x = mouse.click_x - mouse.x; + var dist_y = mouse.click_y - mouse.y; + var distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y)); + var radgrad = canvas_active().createRadialGradient( + mouse.click_x, mouse.click_y, distance * power / 100, + mouse.click_x, mouse.click_y, distance); + radgrad.addColorStop(0, "rgba(" + color1.r + ", " + color1.g + ", " + color1.b + ", " + color1.a / 255 + ")"); + radgrad.addColorStop(1, "rgba(" + color2.r + ", " + color2.g + ", " + color2.b + ", " + color2.a / 255 + ")"); + + canvas_active().fillStyle = radgrad; + canvas_active().fillRect(0, 0, WIDTH, HEIGHT); + } + } + }; + this.blur_tool = function (type, mouse, event) { + if (mouse.valid == false) + return true; + var size = GUI.action_data().attributes.size; + var size_half = Math.round(size / 2); + var xx = mouse.x - size / 2; + var yy = mouse.y - size / 2; + if (xx < 0) + xx = 0; + if (yy < 0) + yy = 0; + if (type == 'click') { + EDIT.save_state(); + var param1 = GUI.action_data().attributes.power; + var imageData = canvas_active().getImageData(xx, yy, size, size); + var filtered = ImageFilters.StackBlur(imageData, param1); //add effect + EL.image_round(canvas_active(), mouse.x, mouse.y, size, filtered, document.getElementById("canvas_front")); + + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + else if (type == 'drag') { + var param1 = GUI.action_data().attributes.power; + var imageData = canvas_active().getImageData(xx, yy, size, size); + var filtered = ImageFilters.StackBlur(imageData, param1); //add effect + EL.image_round(canvas_active(), mouse.x, mouse.y, size, filtered, document.getElementById("canvas_front")); + + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + else if (type == 'move') { + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + }; + this.sharpen_tool = function (type, mouse, event) { + if (mouse.valid == false) + return true; + var size = GUI.action_data().attributes.size; + var param1 = 0.5; + var xx = mouse.x - size / 2; + var yy = mouse.y - size / 2; + if (xx < 0) + xx = 0; + if (yy < 0) + yy = 0; + + if (type == 'click') { + EDIT.save_state(); + var imageData = canvas_active().getImageData(xx, yy, size, size); + var filtered = ImageFilters.Sharpen(imageData, param1); //add effect + EL.image_round(canvas_active(), mouse.x, mouse.y, size, filtered, document.getElementById("canvas_front")); + + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + else if (type == 'drag') { + var imageData = canvas_active().getImageData(xx, yy, size, size); + var filtered = ImageFilters.Sharpen(imageData, param1); //add effect + EL.image_round(canvas_active(), mouse.x, mouse.y, size, filtered, document.getElementById("canvas_front")); + + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + else if (type == 'move') { + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + }; + this.burn_dodge_tool = function (type, mouse, event) { + if (mouse.valid == false) + return true; + var size = GUI.action_data().attributes.size; + var power = GUI.action_data().attributes.power * 2.5; + + canvas_active().save(); + if (type == 'click') { + EDIT.save_state(); + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.save(); + EVENTS.clear_front_on_release = false; + + //init settings + canvas_active().beginPath(); + canvas_active().lineWidth = GUI.action_data().attributes.size; + canvas_active().lineCap = 'round'; + canvas_active().lineJoin = 'round'; + + canvas_front.beginPath(); + if (GUI.action_data().attributes.burn == true) + canvas_front.strokeStyle = "rgba(0, 0, 0, " + power / 255 + ")"; + else + canvas_front.strokeStyle = "rgba(255, 255, 255, " + power / 255 + ")"; + canvas_front.lineWidth = GUI.action_data().attributes.size; + canvas_front.lineCap = 'round'; + canvas_front.lineJoin = 'round'; + } + else if (type == 'drag' && mouse.last_x != false && mouse.last_y != false) { + //now draw preview + canvas_front.beginPath(); + //clean from last line + canvas_front.globalCompositeOperation = "destination-out"; + canvas_front.moveTo(mouse.last_x, mouse.last_y); + canvas_front.lineTo(mouse.x, mouse.y); + canvas_front.stroke(); + //reset + canvas_front.globalCompositeOperation = "source-over"; + //draw new line segment + canvas_front.moveTo(mouse.last_x, mouse.last_y); + canvas_front.lineTo(mouse.x, mouse.y); + canvas_front.stroke(); + } + else if (type == 'release') { + canvas_active().globalCompositeOperation = "soft-light"; + canvas_active().drawImage(document.getElementById("canvas_front"), 0, 0); + canvas_active().globalCompositeOperation = "source-over"; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EVENTS.clear_front_on_release = true; + + //if mouse was not moved + if (mouse.click_x == mouse.x && mouse.click_y == mouse.y) { + canvas_active().globalCompositeOperation = "soft-light"; + canvas_active().beginPath(); + canvas_active().arc(mouse.x, mouse.y, GUI.action_data().attributes.size / 2, 0, 2 * Math.PI, false); + if (GUI.action_data().attributes.burn == true) { + canvas_active().fillStyle = "rgba(0, 0, 0, " + power / 255 + ")"; + } + else { + canvas_active().fillStyle = "rgba(255, 255, 255, " + power / 255 + ")"; + } + canvas_active().fill(); + canvas_active().globalCompositeOperation = "source-over"; + } + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.restore(); + } + else if (type == 'move' && EVENTS.isDrag == false) { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + canvas_active().restore(); + }; + this.crop_tool = function (type, mouse, event) { + if (mouse.click_valid == false) + return true; + + if (type == 'drag') { + if (mouse.x < 0) + mouse.x = 0; + if (mouse.y < 0) + mouse.y = 0; + if (mouse.x >= WIDTH) + mouse.x = WIDTH; + if (mouse.y >= HEIGHT) + mouse.y = HEIGHT; + if (mouse.click_x >= WIDTH) + mouse.click_x = WIDTH; + if (mouse.click_y >= HEIGHT) + mouse.click_y = HEIGHT; + if (this.select_square_action == '') { + document.body.style.cursor = "crosshair"; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.fillStyle = "rgba(0, 255, 0, 0.3)"; + canvas_front.fillRect(mouse.click_x, mouse.click_y, mouse.x - mouse.click_x, mouse.y - mouse.click_y); + } + } + else if (type == 'move' && this.select_data != false) { + if (EVENTS.isDrag == true) + return true; + canvas_front.lineWidth = 1; + border_size = 5; + this.select_square_action = ''; + + if (this.select_square_action == '' + && mouse.x > this.select_data.x && mouse.y > this.select_data.y + && mouse.x < this.select_data.x + this.select_data.w && mouse.y < this.select_data.y + this.select_data.h) { + this.select_square_action = 'move'; + document.body.style.cursor = 'pointer'; + } + if (this.select_square_action == '' && mouse.valid == true) + document.body.style.cursor = "auto"; + } + else if (type == 'release') { + if (mouse.x < 0) + mouse.x = 0; + if (mouse.y < 0) + mouse.y = 0; + if (mouse.x >= WIDTH) + mouse.x = WIDTH; + if (mouse.y >= HEIGHT) + mouse.y = HEIGHT; + if (mouse.click_x >= WIDTH) + mouse.click_x = WIDTH; + if (mouse.click_y >= HEIGHT) + mouse.click_y = HEIGHT; + + if (this.select_square_action == '') { + if (mouse.x != mouse.click_x && mouse.y != mouse.click_y) { + this.select_data = { + x: Math.min(mouse.x, mouse.click_x), + y: Math.min(mouse.y, mouse.click_y), + w: Math.abs(mouse.x - mouse.click_x), + h: Math.abs(mouse.y - mouse.click_y) + }; + } + } + GUI.draw_selected_area(true); + + LAYER.update_info_block(); + } + else if (type == 'click' && this.select_data != false) { + document.body.style.cursor = "auto"; + if (mouse.x > this.select_data.x && mouse.y > this.select_data.y + && mouse.x < this.select_data.x + this.select_data.w && mouse.y < this.select_data.y + this.select_data.h) { + EDIT.save_state(); + for (var i in LAYER.layers) { + var layer = document.getElementById(LAYER.layers[i].name).getContext("2d"); + + var tmp = layer.getImageData(this.select_data.x, this.select_data.y, this.select_data.w, this.select_data.h); + layer.clearRect(0, 0, WIDTH, HEIGHT); + layer.putImageData(tmp, 0, 0); + } + + //resize + EDIT.save_state(); + WIDTH = this.select_data.w; + HEIGHT = this.select_data.h; + LAYER.set_canvas_size(); + + EDIT.edit_clear(); + } + } + }; + this.clone_tool = function (type, mouse, event) { + if (mouse.valid == false) + return true; + var size = GUI.action_data().attributes.size; + var size_half = Math.round(size / 2); + + if (type == 'click') { + EDIT.save_state(); + + if (clone_data === false) { + POP.add({html: 'Source is empty, right click on image first.'}); + POP.show('Error', ''); + } + else { + //draw rounded image + EL.image_round(canvas_active(), mouse.x, mouse.y, size, clone_data, document.getElementById("canvas_front"), GUI.action_data().attributes.anti_aliasing); + } + } + else if (type == 'right_click') { + //save clone source + clone_data = document.createElement("canvas"); + clone_data.width = size; + clone_data.height = size; + var xx = mouse.x - size_half; + var yy = mouse.y - size_half; + if (xx < 0) + xx = 0; + if (yy < 0) + yy = 0; + clone_data.getContext("2d").drawImage(canvas_active(true), xx, yy, size, size, 0, 0, size, size); + return false; + } + else if (type == 'drag') { + if (event.which == 3) + return true; + if (clone_data === false) + return false; //no source + + //draw rounded image + EL.image_round(canvas_active(), mouse.x, mouse.y, size, clone_data, document.getElementById("canvas_front"), GUI.action_data().attributes.anti_aliasing); + } + else if (type == 'move') { + //show size + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EL.circle(canvas_front, mouse.x, mouse.y, size); + } + }; + this.select_square = function (type, mouse, event) { + if (mouse.click_valid == false) + return true; + if (type == 'drag') { + if (mouse.x < 0) + mouse.x = 0; + if (mouse.y < 0) + mouse.y = 0; + if (mouse.x >= WIDTH) + mouse.x = WIDTH; + if (mouse.y >= HEIGHT) + mouse.y = HEIGHT; + if (mouse.click_x >= WIDTH) + mouse.click_x = WIDTH; + if (mouse.click_y >= HEIGHT) + mouse.click_y = HEIGHT; + if (this.select_square_action == '') { + //user still selecting area + document.body.style.cursor = "crosshair"; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.fillStyle = "rgba(0, 255, 0, 0.3)"; + canvas_front.fillRect(mouse.click_x, mouse.click_y, mouse.x - mouse.click_x, mouse.y - mouse.click_y); + } + else { + //drag + if (this.select_square_action == 'move') { + //move + try { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.drawImage(canvas_active(true), + this.select_data.x, this.select_data.y, this.select_data.w, this.select_data.h, + mouse.x - mouse.click_x + this.select_data.x, + mouse.y - mouse.click_y + this.select_data.y, + this.select_data.w, + this.select_data.h); + canvas_front.restore(); + } + catch (err) { + console.log("Error: " + err.message); + } + } + else { + //resize + var s_x = this.select_data.x; + var s_y = this.select_data.y; + var d_x = this.select_data.w; + var d_y = this.select_data.h; + if (this.select_square_action == 'resize-left') { + s_x += mouse.x - mouse.click_x; + d_x -= mouse.x - mouse.click_x; + } + else if (this.select_square_action == 'resize-right') + d_x += mouse.x - mouse.click_x; + else if (this.select_square_action == 'resize-top') { + s_y += mouse.y - mouse.click_y; + d_y -= mouse.y - mouse.click_y; + } + else if (this.select_square_action == 'resize-bottom') + d_y += mouse.y - mouse.click_y; + else if (this.select_square_action == 'resize-1') { + s_x += mouse.x - mouse.click_x; + s_y += mouse.y - mouse.click_y; + d_x -= mouse.x - mouse.click_x; + d_y -= mouse.y - mouse.click_y; + } + else if (this.select_square_action == 'resize-2') { + d_x += mouse.x - mouse.click_x; + s_y += mouse.y - mouse.click_y; + d_y -= mouse.y - mouse.click_y; + } + else if (this.select_square_action == 'resize-3') { + d_x += mouse.x - mouse.click_x; + d_y += mouse.y - mouse.click_y; + } + else if (this.select_square_action == 'resize-4') { + s_x += mouse.x - mouse.click_x; + d_x -= mouse.x - mouse.click_x; + d_y += mouse.y - mouse.click_y; + } + var s_x = Math.max(s_x, 0); + var s_y = Math.max(s_y, 0); + var d_x = Math.max(d_x, 0); + var d_y = Math.max(d_y, 0); + + canvas_front.save(); + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + + canvas_front.mozImageSmoothingEnabled = false; + canvas_front.webkitImageSmoothingEnabled = false; + canvas_front.msImageSmoothingEnabled = false; + canvas_front.ImageSmoothingEnabled = false; + + canvas_front.drawImage(canvas_active(true), + this.select_data.x, this.select_data.y, this.select_data.w, this.select_data.h, + s_x, s_y, d_x, d_y); + canvas_front.restore(); + } + } + } + else if (type == 'move' && this.select_data != false) { + if (EVENTS.isDrag == true) + return true; + canvas_front.lineWidth = 1; + border_size = 5; + this.select_square_action = ''; + var sr_size = Math.ceil(EVENTS.sr_size / GUI.ZOOM * 100); + + //left + if (this.check_mouse_pos(this.select_data.x, this.select_data.y + this.select_data.h / 2, sr_size, mouse.x, mouse.y) == true) { + document.body.style.cursor = "w-resize"; + this.select_square_action = 'resize-left'; + } + //top + else if (this.check_mouse_pos(this.select_data.x + this.select_data.w / 2, this.select_data.y, sr_size, mouse.x, mouse.y) == true) { + document.body.style.cursor = "n-resize"; + this.select_square_action = 'resize-top'; + } + //right + else if (this.check_mouse_pos(this.select_data.x + this.select_data.w - sr_size, this.select_data.y + this.select_data.h / 2, sr_size, mouse.x, mouse.y) == true) { + document.body.style.cursor = "w-resize"; + this.select_square_action = 'resize-right'; + } + //bottom + else if (this.check_mouse_pos(this.select_data.x + this.select_data.w / 2, this.select_data.y + this.select_data.h - sr_size, sr_size, mouse.x, mouse.y) == true) { + document.body.style.cursor = "n-resize"; + this.select_square_action = 'resize-bottom'; + } + + //corner 1 + if (this.check_mouse_pos(this.select_data.x, this.select_data.y, sr_size, mouse.x, mouse.y) == true) { + document.body.style.cursor = "nw-resize"; + this.select_square_action = 'resize-1'; + } + //corner 2 + else if (this.check_mouse_pos(this.select_data.x + this.select_data.w - sr_size, this.select_data.y, sr_size, mouse.x, mouse.y) == true) { + document.body.style.cursor = "ne-resize"; + this.select_square_action = 'resize-2'; + } + //corner 3 + else if (this.check_mouse_pos(this.select_data.x + this.select_data.w - sr_size, this.select_data.y + this.select_data.h - sr_size, sr_size, mouse.x, mouse.y) == true) { + document.body.style.cursor = "nw-resize"; + this.select_square_action = 'resize-3'; + } + //corner 4 + else if (this.check_mouse_pos(this.select_data.x, this.select_data.y + this.select_data.h - sr_size, sr_size, mouse.x, mouse.y) == true) { + document.body.style.cursor = "ne-resize"; + this.select_square_action = 'resize-4'; + } + + if (this.select_square_action == '' + && mouse.x > this.select_data.x && mouse.y > this.select_data.y + && mouse.x < this.select_data.x + this.select_data.w && mouse.y < this.select_data.y + this.select_data.h) { + this.select_square_action = 'move'; + document.body.style.cursor = "move"; + } + if (this.select_square_action == '' && mouse.valid == true) + document.body.style.cursor = "auto"; + } + else if (type == 'release') { + if (mouse.x < 0) + mouse.x = 0; + if (mouse.y < 0) + mouse.y = 0; + if (mouse.x >= WIDTH) + mouse.x = WIDTH; + if (mouse.y >= HEIGHT) + mouse.y = HEIGHT; + if (mouse.click_x >= WIDTH) + mouse.click_x = WIDTH; + if (mouse.click_y >= HEIGHT) + mouse.click_y = HEIGHT; + + if (this.select_square_action == '') { + if (mouse.x != mouse.click_x && mouse.y != mouse.click_y) { + this.select_data = { + x: Math.min(mouse.x, mouse.click_x), + y: Math.min(mouse.y, mouse.click_y), + w: Math.abs(mouse.x - mouse.click_x), + h: Math.abs(mouse.y - mouse.click_y) + }; + } + } + else { + if (mouse.x - mouse.click_x == 0 && mouse.y - mouse.click_y == 0) + return false; + EDIT.save_state(); + + if (this.select_square_action == 'move') { + //move selected area + if (this.select_data != false) { + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.drawImage(canvas_active(true), 0, 0); + canvas_active().clearRect(this.select_data.x, this.select_data.y, this.select_data.w, this.select_data.h); + canvas_active().drawImage( + document.getElementById("canvas_front"), + this.select_data.x, this.select_data.y, + this.select_data.w, this.select_data.h, + mouse.x - mouse.click_x + this.select_data.x, mouse.y - mouse.click_y + this.select_data.y, + this.select_data.w, this.select_data.h); + + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + } + this.select_data.x += mouse.x - mouse.click_x; + this.select_data.y += mouse.y - mouse.click_y; + } + else { + //resize selected area + var s_x = this.select_data.x; + var s_y = this.select_data.y; + var d_x = this.select_data.w; + var d_y = this.select_data.h; + + if (this.select_square_action == 'resize-left') { + s_x += mouse.x - mouse.click_x; + d_x -= mouse.x - mouse.click_x; + } + else if (this.select_square_action == 'resize-right') + d_x += mouse.x - mouse.click_x; + else if (this.select_square_action == 'resize-top') { + s_y += mouse.y - mouse.click_y; + d_y -= mouse.y - mouse.click_y; + } + else if (this.select_square_action == 'resize-bottom') + d_y += mouse.y - mouse.click_y; + else if (this.select_square_action == 'resize-1') { + s_x += mouse.x - mouse.click_x; + s_y += mouse.y - mouse.click_y; + d_x -= mouse.x - mouse.click_x; + d_y -= mouse.y - mouse.click_y; + } + else if (this.select_square_action == 'resize-2') { + d_x += mouse.x - mouse.click_x; + s_y += mouse.y - mouse.click_y; + d_y -= mouse.y - mouse.click_y; + } + else if (this.select_square_action == 'resize-3') { + d_x += mouse.x - mouse.click_x; + d_y += mouse.y - mouse.click_y; + } + else if (this.select_square_action == 'resize-4') { + s_x += mouse.x - mouse.click_x; + d_x -= mouse.x - mouse.click_x; + d_y += mouse.y - mouse.click_y; + } + var s_x = Math.max(s_x, 0); + var s_y = Math.max(s_y, 0); + var d_x = Math.max(d_x, 0); + var d_y = Math.max(d_y, 0); + + var tempCanvas = document.createElement("canvas"); + var tempCtx = tempCanvas.getContext("2d"); + tempCanvas.width = Math.max(d_x, this.select_data.w); + tempCanvas.height = Math.max(d_y, this.select_data.h); + tempCtx.drawImage(canvas_active(true), this.select_data.x, this.select_data.y, this.select_data.w, this.select_data.h, 0, 0, this.select_data.w, this.select_data.h); + + canvas_active().clearRect(s_x, s_y, d_x, d_y); + canvas_active().drawImage(tempCanvas, 0, 0, this.select_data.w, this.select_data.h, s_x, s_y, d_x, d_y); + + this.select_data.x = s_x; + this.select_data.y = s_y; + this.select_data.w = d_x; + this.select_data.h = d_y; + } + } + GUI.draw_selected_area(); + LAYER.update_info_block(); + } + }; + + this.check_mouse_pos = function (x, y, size, mouse_x, mouse_y) { + if (mouse_x > x - Math.round(size) && mouse_x < x + Math.round(size)) + if (mouse_y > y - Math.round(size) && mouse_y < y + Math.round(size)) + return true; + return false; + }; + + this.bulge_pinch_tool = function (type, mouse, event) { + if (mouse.valid == false) + return true; + + //make sure FX lib loaded + if(fx_filter == false){ + fx_filter = fx.canvas(); + } + + var strength = GUI.action_data().attributes.size / 100; + if(strength > 1) + strength = 1; + var radius = GUI.action_data().attributes.radius; + var bulge = GUI.action_data().attributes.bulge; + if(bulge == false) + strength = -1 * strength; + + if (type == 'click') { + EDIT.save_state(); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).bulgePinch(mouse.x, mouse.y, radius, strength).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + GUI.zoom(); + } + if (type == 'move') { + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).bulgePinch(mouse.x, mouse.y, radius, strength).update(); //effect + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.drawImage(fx_filter, 0, 0); + } + }; +} \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/draw_tools.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/draw_tools.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..efd90760387bcacb9ff96ae2a19a7b89369549d1 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/draw_tools.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + draw_tools.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/edit.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/edit.js.js new file mode 100644 index 0000000000000000000000000000000000000000..c5be41ace2149a2bf90fb6310dd2635bec792ce6 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/edit.js.js @@ -0,0 +1,187 @@ +/* global MAIN, POP, LAYER, DRAW, GUI */ +/* global WIDTH, HEIGHT, canvas_active, canvas_front */ + +var EDIT = new EDIT_CLASS(); + +/** + * manages edit actions + * + * @author ViliusL + */ +function EDIT_CLASS() { + + /** + * used to store internal copied objects data + */ + var PASTE_DATA = false; + + /** + * latest 3 saved states of all layers for undo + */ + var layers_archive = [{}, {}, {}]; + + /** + * on undo, current data index in layers_archive array + */ + var undo_level = 0; + + //undo + this.edit_undo = function () { + this.undo(); + }; + + //cut + this.edit_cut = function () { + this.save_state(); + if (DRAW.select_data != false) { + this.copy_to_clipboard(); + canvas_active().clearRect(DRAW.select_data.x, DRAW.select_data.y, DRAW.select_data.w, DRAW.select_data.h); + DRAW.select_data = false; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + } + }; + + //copy + this.edit_copy = function () { + if (DRAW.select_data != false) { + this.copy_to_clipboard(); + } + }; + + //paste + this.edit_paste = function () { + this.save_state(); + this.paste('menu'); + }; + + //select all + this.edit_select = function () { + DRAW.select_data = { + x: 0, + y: 0, + w: WIDTH, + h: HEIGHT + }; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + GUI.draw_selected_area(); + }; + + //clear selection + this.edit_clear = function () { + DRAW.select_data = false; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + DRAW.select_square_action = ''; + }; + + this.copy_to_clipboard = function () { + PASTE_DATA = false; + PASTE_DATA = document.createElement("canvas"); + PASTE_DATA.width = DRAW.select_data.w; + PASTE_DATA.height = DRAW.select_data.h; + PASTE_DATA.getContext("2d").drawImage(canvas_active(true), DRAW.select_data.x, DRAW.select_data.y, DRAW.select_data.w, DRAW.select_data.h, 0, 0, DRAW.select_data.w, DRAW.select_data.h); + }; + + this.paste = function (type) { + if (PASTE_DATA == false) { + if (type == 'menu') { + POP.add({title: "Error:", value: 'Empty data'}); + POP.add({title: "Notice:", value: 'To paste from clipboard, use Ctrl-V.'}); + POP.show('Notice', ''); + } + return false; + } + + tmp = new Array(); + var new_name = LAYER.generate_layer_name(); + LAYER.create_canvas(new_name); + LAYER.layers.unshift({name: new_name, title: new_name, visible: true}); + LAYER.layer_active = 0; + canvas_active().drawImage(PASTE_DATA, 0, 0); + LAYER.layer_renew(); + EDIT.edit_clear(); + }; + + this.save_state = function () { + undo_level = 0; + j = 0; + + //move previous + layers_archive[2] = layers_archive[1]; + layers_archive[1] = layers_archive[0]; + + //save last state + layers_archive[j] = {}; + layers_archive[j].width = WIDTH; + layers_archive[j].height = HEIGHT; + + //layers + layers_archive[j].layers = []; + for(var i = LAYER.layers.length-1; i >=0; i--){ + var layer = { + name: LAYER.layers[i].name, + title: LAYER.layers[i].title, + visible: 1, + opacity: LAYER.layers[i].opacity, + }; + if (LAYER.layers[i].visible == false) + layer.visible = 0; + layers_archive[j].layers.push(layer); + } + + + layers_archive[j].data = {}; + for (var i in LAYER.layers) { + layers_archive[j].data[LAYER.layers[i].name] = document.createElement('canvas'); + layers_archive[j].data[LAYER.layers[i].name].width = WIDTH; + layers_archive[j].data[LAYER.layers[i].name].height = HEIGHT; + layers_archive[j].data[LAYER.layers[i].name].getContext('2d').drawImage(document.getElementById(LAYER.layers[i].name), 0, 0); + } + }; + //supports 3 levels undo system - more levels requires more memory + this.undo = function () { + if (layers_archive.length == 0){ + //not saved yet + return false; + } + j = undo_level; + undo_level++; + if (layers_archive[j] == undefined || layers_archive[j].width == undefined){ + //no such data + return false; + } + + LAYER.remove_all_layers(); + + if (WIDTH != layers_archive[j].width || HEIGHT != layers_archive[j].height) { + WIDTH = layers_archive[j].width; + HEIGHT = layers_archive[j].height; + LAYER.set_canvas_size(true); + } + + //add layers + for(var i in layers_archive[j].layers){ + var layer = layers_archive[j].layers[i]; + var name = layer.name; + var title = layer.title; + var visible = parseInt(layer.visible); + var opacity = parseInt(layer.opacity); + + LAYER.layer_add(name); + //update attributes + LAYER.layers[LAYER.layer_active].title = title; + if (visible == 0) + LAYER.layer_visibility(LAYER.layer_active); + LAYER.layers[LAYER.layer_active].opacity = opacity; + } + LAYER.layer_renew(); + + //undo + for (var i = LAYER.layers.length-1; i >= 0; i--) { + //restore data + document.getElementById(LAYER.layers[i].name).getContext("2d").clearRect(0, 0, WIDTH, HEIGHT); + document.getElementById(LAYER.layers[i].name).getContext("2d").drawImage(layers_archive[j].data[LAYER.layers[i].name], 0, 0); + } + + GUI.zoom(); + }; +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/edit.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/edit.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..3e23735b480617f213ac270191fba5fd1f053c98 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/edit.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + edit.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/effects.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/effects.js.js new file mode 100644 index 0000000000000000000000000000000000000000..729bdeef67d3487bef241e5fe497beb30d03ddd5 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/effects.js.js @@ -0,0 +1,1125 @@ +/* global POP, MAIN, VINTAGE, ImageFilters, fx_filter, VINTAGE, fx, HELPER, EVENTS, EDIT, GUI */ +/* global WIDTH, HEIGHT, canvas_active, canvas_front */ + +var EFFECTS = new EFFECTS_CLASS(); + +/** + * manages effects + * + * @author ViliusL + */ +function EFFECTS_CLASS() { + + this.FILTERS_LIST = [ + {title: 'Black and White', name: 'effects_bw' }, + {title: 'Blur-Box', name: 'effects_BoxBlur' }, + {title: 'Blur-Gaussian', name: 'effects_GaussianBlur' }, + {title: 'Blur-Stack', name: 'effects_StackBlur' }, + {title: 'Blur-Zoom', name: 'effects_zoomblur' }, + {title: 'Bulge/Pinch', name: 'effects_bulge_pinch' }, + {title: 'Colorize', name: 'effects_colorize' }, + {title: 'Denoise', name: 'effects_denoise' }, + {title: 'Desaturate', name: 'effects_Desaturate' }, + {title: 'Dither', name: 'effects_Dither' }, + {title: 'Dot Screen', name: 'effects_dot_screen' }, + {title: 'Edge', name: 'effects_Edge' }, + {title: 'Emboss', name: 'effects_Emboss' }, + {title: 'Enrich', name: 'effects_Enrich' }, + {title: 'Grains', name: 'effects_Grains' }, + {title: 'Heatmap', name: 'effects_heatmap' }, + {title: 'JPG Compression', name: 'effects_jpg_vintage' }, + {title: 'Mosaic', name: 'effects_Mosaic' }, + {title: 'Oil', name: 'effects_Oil' }, + {title: 'Sepia', name: 'effects_Sepia' }, + {title: 'Sharpen', name: 'effects_Sharpen' }, + {title: 'Solarize', name: 'effects_Solarize' }, + {title: 'Tilt Shift', name: 'effects_tilt_shift' }, + {title: 'Vignette', name: 'effects_vignette' }, + {title: 'Vibrance', name: 'effects_vibrance' }, + {title: 'Vintage', name: 'effects_vintage' }, + ]; + + var fx_filter = false; + + this.load_fx = function (){ + //load FX lib + if(fx_filter == false){ + fx_filter = fx.canvas(); + } + }; + + this.effects_bw = function () { + var default_level = this.thresholding('otsu', canvas_active(), WIDTH, HEIGHT, true); + POP.add({name: "param1", title: "Level:", value: default_level, range: [0, 255]}); + POP.add({name: "param2", title: "Dithering:", values: ['No', 'Yes'], onchange: "EFFECTS.effects_bw_onchange()"}); + POP.effects = true; + POP.show('Black and White', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + var param2 = false; + if (user_response.param2 == 'Yes') + param2 = true; + + EFFECTS.effect_bw(canvas_active(), WIDTH, HEIGHT, param1, param2); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var param2 = false; + if (user_response.param2 == 'Yes') + param2 = true; + + EFFECTS.effect_bw(canvas_preview, w, h, param1, param2); + } + ); + }; + + this.effects_bw_onchange = function () { + var levels = document.getElementById("pop_data_param1"); + var dithering_no = document.getElementById("pop_data_param2_poptmp0"); + var dithering_yes = document.getElementById("pop_data_param2_poptmp1"); + + if (dithering_no.checked == true) + levels.disabled = false; + else if (dithering_yes.checked == true) + levels.disabled = true; + + POP.view(); + }; + + this.effects_BoxBlur = function () { + POP.add({name: "param1", title: "H Radius:", value: "3", range: [1, 20]}); + POP.add({name: "param2", title: "V Radius:", value: "3", range: [1, 20]}); + POP.add({name: "param3", title: "Quality:", value: "2", range: [1, 10]}); + POP.effects = true; + POP.show('Blur-Box', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var param3 = parseInt(user_response.param3); + + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.BoxBlur(imageData, param1, param2, param3); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var param3 = parseInt(user_response.param3); + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.BoxBlur(imageData, param1, param2, param3); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_GaussianBlur = function () { + POP.add({name: "param1", title: "Strength:", value: "2", range: [1, 4], step: 0.1}); + POP.effects = true; + POP.show('Blur-Gaussian', + function (user_response) { + EDIT.save_state(); + var param1 = parseFloat(user_response.param1); + + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.GaussianBlur(imageData, param1); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseFloat(user_response.param1); + + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.GaussianBlur(imageData, param1); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_StackBlur = function () { + POP.add({name: "param1", title: "Radius:", value: "6", range: [1, 40]}); + POP.effects = true; + POP.show('Blur-Stack', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.StackBlur(imageData, param1); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.StackBlur(imageData, param1); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_zoomblur = function () { + this.load_fx(); + + POP.add({name: "param1", title: "Strength:", value: "0.3", range: [0, 1], step: 0.01}); + POP.add({name: "param2", title: "Center x:", value: Math.round(WIDTH / 2), range: [0, WIDTH]}); + POP.add({name: "param3", title: "Center y:", value: Math.round(HEIGHT / 2), range: [0, HEIGHT]}); + POP.effects = true; + POP.show('Blur-Zoom', + function (user_response) { + EDIT.save_state(); + var param1 = parseFloat(user_response.param1); + var param2 = parseInt(user_response.param2); + var param3 = parseInt(user_response.param3); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).zoomBlur(param2, param3, param1).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseFloat(user_response.param1); + var param2 = parseInt(user_response.param2); + var param3 = parseInt(user_response.param3); + + //recalc param by size + param2 = param2 / WIDTH * w; + param3 = param3 / HEIGHT * h; + + var texture = fx_filter.texture(canvas_preview.getImageData(0, 0, w, h)); + fx_filter.draw(texture).zoomBlur(param2, param3, param1).update(); //effect + canvas_preview.drawImage(fx_filter, 0, 0); + + //draw circle + canvas_preview.beginPath(); + canvas_preview.strokeStyle = "#ff0000"; + canvas_preview.lineWidth = 1; + canvas_preview.beginPath(); + canvas_preview.arc(param2, param3, 5, 0, Math.PI * 2, true); + canvas_preview.stroke(); + } + ); + }; + + this.effects_bulge_pinch = function () { + this.load_fx(); + + POP.add({name: "param1", title: "Strength:", value: 1, range: [-1, 1], step: 0.1}); + var default_value = Math.min(WIDTH, HEIGHT); + default_value = Math.round(default_value / 2); + POP.add({name: "param2", title: "Radius:", value: default_value, range: [0, 600]}); + POP.effects = true; + POP.show('Bulge/Pinch', + function (user_response) { + EDIT.save_state(); + var param1 = parseFloat(user_response.param1); + var param2 = parseInt(user_response.param2); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).bulgePinch(Math.round(WIDTH / 2), Math.round(HEIGHT / 2), param2, param1).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseFloat(user_response.param1); + var param2 = parseInt(user_response.param2); + + //recalc param by size + param2 = param2 / Math.min(WIDTH, HEIGHT) * Math.min(w, h); + + var texture = fx_filter.texture(canvas_preview.getImageData(0, 0, w, h)); + fx_filter.draw(texture).bulgePinch(Math.round(w / 2), Math.round(h / 2), param2, param1).update(); //effect + canvas_preview.drawImage(fx_filter, 0, 0); + } + ); + }; + + this.effects_colorize = function () { + var _this = this; + var colorize_data; + + POP.add({name: "param1", title: "Power:", value: "3", range: [1, 10]}); + POP.add({name: "param2", title: "Limit:", value: "30", range: [10, 200]}); + POP.preview_in_main = true; + POP.effects = true; + POP.show('Auto colorize', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + + _this.colorize(canvas_active(), WIDTH, HEIGHT, param1, param2, colorize_data); + GUI.zoom(); + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + }, + function (user_response) { + POP.preview_in_main = true; + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + + colorize_data = _this.colorize(false, WIDTH, HEIGHT, param1, param2, true); + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.drawImage(canvas_active(true), 0, 0); + _this.colorize(canvas_front, WIDTH, HEIGHT, param1, param2, colorize_data); + } + ); + }; + + this.effects_denoise = function () { + this.load_fx(); + + POP.add({name: "param1", title: "Exponent:", value: "20", range: [0, 50]}); + POP.effects = true; + POP.show('Denoise', + function (user_response) { + EDIT.save_state(); + var param1 = parseFloat(user_response.param1); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).denoise(param1).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseFloat(user_response.param1); + + var texture = fx_filter.texture(canvas_preview.getImageData(0, 0, w, h)); + fx_filter.draw(texture).denoise(param1).update(); //effect + canvas_preview.drawImage(fx_filter, 0, 0); + } + ); + }; + + this.effects_Desaturate = function () { + POP.effects = true; + POP.show('Desaturate', + function (user_response) { + EDIT.save_state(); + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Desaturate(imageData); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Desaturate(imageData); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_Dither = function () { + POP.add({name: "param1", title: "Levels:", value: "8", range: [2, 32]}); + POP.effects = true; + POP.show('Dither', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Dither(imageData, param1); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Dither(imageData, param1); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_dot_screen = function () { + this.load_fx(); + + POP.add({name: "param2", title: "Size:", value: "3", range: [1, 20]}); + POP.effects = true; + POP.show('Dot Screen', + function (user_response) { + EDIT.save_state(); + var param2 = parseInt(user_response.param2); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).dotScreen(Math.round(WIDTH / 2), Math.round(HEIGHT / 2), 0, param2).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param2 = parseInt(user_response.param2); + + var texture = fx_filter.texture(canvas_preview.getImageData(0, 0, w, h)); + fx_filter.draw(texture).dotScreen(Math.round(w / 2), Math.round(h / 2), 0, param2).update(); //effect + canvas_preview.drawImage(fx_filter, 0, 0); + } + ); + }; + + this.effects_Edge = function () { + POP.effects = true; + POP.show('Edge', + function (user_response) { + EDIT.save_state(); + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Edge(imageData); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Edge(imageData); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_Emboss = function () { + POP.effects = true; + POP.show('Emboss', + function (user_response) { + EDIT.save_state(); + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Emboss(imageData); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Emboss(imageData); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_Enrich = function () { + POP.effects = true; + POP.show('Enrich', + function (user_response) { + EDIT.save_state(); + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Enrich(imageData); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Enrich(imageData); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_Grains = function () { + var _this = this; + POP.effects = true; + POP.add({name: "param1", title: "Level:", value: "30", range: [0, 50]}); + POP.show('Grains', + function (user_response) { + var param1 = parseInt(user_response.param1); + EDIT.save_state(); + _this.grains_effect(canvas_active(), WIDTH, HEIGHT, param1); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + _this.grains_effect(canvas_preview, w, h, param1); + } + ); + }; + + this.effects_heatmap = function () { + var _this = this; + POP.effects = true; + POP.show('Heatmap', + function (user_response) { + EDIT.save_state(); + _this.heatmap_effect(canvas_active(), WIDTH, HEIGHT); + }, + function (user_response, canvas_preview, w, h) { + _this.heatmap_effect(canvas_preview, w, h); + } + ); + }; + + //ages photo saving it to jpg many times + this.effects_jpg_vintage = function () { + POP.add({name: "param1", title: "Quality:", value: 80, range: [1, 100]}); + POP.effects = true; + POP.show('JPG Compression', + function (user_response) { + EDIT.save_state(); + var quality = parseInt(user_response.param1); + if (quality > 100 || quality < 1 || isNaN(quality) == true) + quality = 80; + quality = quality / 100; + var data = canvas_active(true).toDataURL('image/jpeg', quality); + var img = new Image; + img.onload = function () { + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(img, 0, 0); + }; + img.src = data; + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var quality = parseInt(user_response.param1); + if (quality > 100 || quality < 1 || isNaN(quality) == true) + quality = 80; + quality = quality / 100; + var element = document.getElementById("pop_post"); + var data = element.toDataURL('image/jpeg', quality); + var img = new Image; + img.onload = function () { + canvas_preview.clearRect(0, 0, w, h); + canvas_preview.drawImage(img, 0, 0); + }; + img.src = data; + } + ); + }; + + this.effects_Mosaic = function () { + POP.add({name: "param1", title: "Size:", value: "10", range: [1, 100]}); + POP.effects = true; + POP.show('Mosaic', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Mosaic(imageData, param1); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Mosaic(imageData, param1); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_Oil = function () { + POP.add({name: "param1", title: "Range:", value: "2", range: [1, 5]}); + POP.add({name: "param2", title: "Levels:", value: "32", range: [1, 256]}); + POP.effects = true; + POP.show('Oil', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Oil(imageData, param1, param2); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Oil(imageData, param1, param2); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_perspective = function () { + this.load_fx(); + + POP.add({name: "param1", title: "X1:", value: WIDTH / 4, range: [0, WIDTH]}); + POP.add({name: "param2", title: "Y1:", value: HEIGHT / 4, range: [0, HEIGHT]}); + POP.add({name: "param3", title: "X2:", value: WIDTH * 3 / 4, range: [0, WIDTH]}); + POP.add({name: "param4", title: "Y2:", value: HEIGHT / 4, range: [0, HEIGHT]}); + POP.add({name: "param5", title: "X3:", value: WIDTH * 3 / 4, range: [0, WIDTH]}); + POP.add({name: "param6", title: "Y3:", value: HEIGHT * 3 / 4, range: [0, HEIGHT]}); + POP.add({name: "param7", title: "X4:", value: WIDTH / 4, range: [0, WIDTH]}); + POP.add({name: "param8", title: "Y4:", value: HEIGHT * 3 / 4, range: [0, HEIGHT]}); + POP.preview_in_main = true; + POP.effects = true; + POP.show('Perspective', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var param3 = parseInt(user_response.param3); + var param4 = parseInt(user_response.param4); + var param5 = parseInt(user_response.param5); + var param6 = parseInt(user_response.param6); + var param7 = parseInt(user_response.param7); + var param8 = parseInt(user_response.param8); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).perspective([WIDTH / 4, HEIGHT / 4, WIDTH * 3 / 4, HEIGHT / 4, WIDTH * 3 / 4, HEIGHT * 3 / 4, WIDTH / 4, HEIGHT * 3 / 4], [param1, param2, param3, param4, param5, param6, param7, param8]).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + GUI.zoom(); + }, + function (user_response) { + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var param3 = parseInt(user_response.param3); + var param4 = parseInt(user_response.param4); + var param5 = parseInt(user_response.param5); + var param6 = parseInt(user_response.param6); + var param7 = parseInt(user_response.param7); + var param8 = parseInt(user_response.param8); + + canvas_front.rect(0, 0, WIDTH, HEIGHT); + canvas_front.fillStyle = "#ffffff"; + canvas_front.fill(); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).perspective([WIDTH / 4, HEIGHT / 4, WIDTH * 3 / 4, HEIGHT / 4, WIDTH * 3 / 4, HEIGHT * 3 / 4, WIDTH / 4, HEIGHT * 3 / 4], [param1, param2, param3, param4, param5, param6, param7, param8]).update(); //effect + canvas_front.drawImage(fx_filter, 0, 0); + + pers_square(param1, param2); + pers_square(param3, param4); + pers_square(param5, param6); + pers_square(param7, param8); + } + ); + + function pers_square(x, y) { + canvas_front.beginPath(); + canvas_front.rect(x - round(EVENTS.sr_size / 2), y - round(EVENTS.sr_size / 2), EVENTS.sr_size, EVENTS.sr_size); + canvas_front.fillStyle = "#0000c8"; + canvas_front.fill(); + } + }; + + this.effects_Sepia = function () { + POP.effects = true; + POP.show('Sepia', + function (user_response) { + EDIT.save_state(); + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Sepia(imageData); //add effect + canvas_active().putImageData(filtered, 0, 0); + }, + function (user_response, canvas_preview, w, h) { + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Sepia(imageData); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_Sharpen = function () { + POP.add({name: "param1", title: "Factor:", value: "3", range: [1, 10], step: 0.1}); + POP.effects = true; + POP.show('Sharpen', + function (user_response) { + EDIT.save_state(); + var param1 = parseFloat(user_response.param1); + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Sharpen(imageData, param1); //add effect + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseFloat(user_response.param1); + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Sharpen(imageData, param1); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_Solarize = function () { + POP.effects = true; + POP.show('Solarize', + function (user_response) { + EDIT.save_state(); + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Solarize(imageData); //add effect + canvas_active().putImageData(filtered, 0, 0); + }, + function (user_response, canvas_preview, w, h) { + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Solarize(imageData); //add effect + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + this.effects_tilt_shift = function () { + this.load_fx(); + + //extra + POP.add({name: "param7", title: "Saturation:", value: "3", range: [0, 100]}); + POP.add({name: "param8", title: "Sharpen:", value: "1", range: [1, 10]}); + //main + POP.add({name: "param1", title: "Blur Radius:", value: "15", range: [0, 50]}); + POP.add({name: "param2", title: "Gradient Radius:", value: "200", range: [0, 400]}); + //startX, startY, endX, endY + POP.add({name: "param3", title: "X start:", value: "0", range: [0, WIDTH]}); + POP.add({name: "param4", title: "Y start:", value: Math.round(HEIGHT / 2), range: [0, HEIGHT]}); + POP.add({name: "param5", title: "X end:", value: WIDTH, range: [0, WIDTH]}); + POP.add({name: "param6", title: "Y end:", value: Math.round(HEIGHT / 2), range: [0, HEIGHT]}); + POP.effects = true; + POP.show('Tilt Shift', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var param3 = parseInt(user_response.param3); + var param4 = parseInt(user_response.param4); + var param5 = parseInt(user_response.param5); + var param6 = parseInt(user_response.param6); + var param7 = parseInt(user_response.param7); + var param8 = parseInt(user_response.param8); + + //main effect + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).tiltShift(param3, param4, param5, param6, param1, param2).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + + //saturation + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.HSLAdjustment(imageData, 0, param7, 0); + canvas_active().putImageData(filtered, 0, 0); + + //sharpen + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Sharpen(imageData, param8); + canvas_active().putImageData(filtered, 0, 0); + + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var param3 = parseInt(user_response.param3); + var param4 = parseInt(user_response.param4); + var param5 = parseInt(user_response.param5); + var param6 = parseInt(user_response.param6); + var param7 = parseInt(user_response.param7); + var param8 = parseInt(user_response.param8); + + //recalc param by size + var param3 = param3 / WIDTH * w; + var param4 = param4 / HEIGHT * h; + var param5 = param5 / WIDTH * w; + var param6 = param6 / HEIGHT * h; + + //main effect + var texture = fx_filter.texture(canvas_preview.getImageData(0, 0, w, h)); + fx_filter.draw(texture).tiltShift(param3, param4, param5, param6, param1, param2).update(); //effect + canvas_preview.drawImage(fx_filter, 0, 0); + + //saturation + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.HSLAdjustment(imageData, 0, param7, 0); + canvas_preview.putImageData(filtered, 0, 0); + + //sharpen + var imageData = canvas_preview.getImageData(0, 0, w, h); + var filtered = ImageFilters.Sharpen(imageData, param8); + canvas_preview.putImageData(filtered, 0, 0); + + //draw line + canvas_preview.beginPath(); + canvas_preview.strokeStyle = "#ff0000"; + canvas_preview.lineWidth = 1; + canvas_preview.moveTo(param3 + 0.5, param4 + 0.5); + canvas_preview.lineTo(param5 + 0.5, param6 + 0.5); + canvas_preview.stroke(); + } + ); + }; + + this.effects_vignette = function () { + this.load_fx(); + + POP.add({name: "param1", title: "Size:", value: "0.5", range: [0, 1], step: 0.01}); + POP.add({name: "param2", title: "Amount:", value: "0.5", range: [0, 1], step: 0.01}); + POP.effects = true; + POP.show('Vignette', + function (user_response) { + EDIT.save_state(); + var param1 = parseFloat(user_response.param1); + var param2 = parseFloat(user_response.param2); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).vignette(param1, param2).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseFloat(user_response.param1); + var param2 = parseFloat(user_response.param2); + + var texture = fx_filter.texture(canvas_preview.getImageData(0, 0, w, h)); + fx_filter.draw(texture).vignette(param1, param2).update(); //effect + canvas_preview.drawImage(fx_filter, 0, 0); + } + ); + }; + this.effects_vibrance = function () { + this.load_fx(); + + POP.add({name: "level", title: "Level:", value: "0.5", range: [-1, 1], step: 0.01}); + POP.effects = true; + POP.show('Vignette', + function (user_response) { + EDIT.save_state(); + var level = parseFloat(user_response.level); + + var texture = fx_filter.texture(canvas_active(true)); + fx_filter.draw(texture).vibrance(level).update(); //effect + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().drawImage(fx_filter, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var level = parseFloat(user_response.level); + + var texture = fx_filter.texture(canvas_preview.getImageData(0, 0, w, h)); + fx_filter.draw(texture).vibrance(level).update(); //effect + canvas_preview.drawImage(fx_filter, 0, 0); + } + ); + }; + + this.effects_vintage = function () { + POP.add({name: "red_offset", title: "Color adjust:", value: "70", range: [0, 200]}); + POP.add({name: "contrast", title: "Contrast:", value: "15", range: [0, 50]}); + POP.add({name: "blur", title: "Blur:", value: "0", range: [0, 2], step: 0.1}); + POP.add({name: "light_leak", title: "Light leak:", value: "90", range: [0, 150]}); + POP.add({name: "de_saturation", title: "Desaturation:", value: "40", range: [0, 100]}); + POP.add({name: "exposure", title: "Exposure level:", value: "80", range: [0, 150]}); + POP.add({name: "grains", title: "Grains level:", value: "20", range: [0, 50]}); + POP.add({name: "big_grains", title: "Big grains level:", value: "20", range: [0, 50]}); + POP.add({name: "vignette1", title: "Vignette size:", value: "0.3", range: [0, 0.5], step: 0.01}); + POP.add({name: "vignette2", title: "Vignette amount:", value: "0.5", range: [0, 0.7], step: 0.01}); + POP.add({name: "dust_level", title: "Dusts level:", value: "70", range: [0, 100]}); + POP.effects = true; + POP.show('Vintage', + function (user_response) { + EDIT.save_state(); + var red_offset = parseInt(user_response.red_offset); + var contrast = parseInt(user_response.contrast); + var blur = parseFloat(user_response.blur); + var light_leak = parseInt(user_response.light_leak); + var de_saturation = parseInt(user_response.de_saturation); + var exposure = parseInt(user_response.exposure); + var grains = parseInt(user_response.grains); + var big_grains = parseInt(user_response.big_grains); + var vignette1 = parseFloat(user_response.vignette1); + var vignette2 = parseFloat(user_response.vignette2); + var dust_level = parseInt(user_response.dust_level); + + VINTAGE.adjust_color(canvas_active(), WIDTH, HEIGHT, red_offset); + VINTAGE.lower_contrast(canvas_active(), WIDTH, HEIGHT, contrast); + VINTAGE.blur(canvas_active(), WIDTH, HEIGHT, blur); + VINTAGE.light_leak(canvas_active(), WIDTH, HEIGHT, light_leak); + VINTAGE.chemicals(canvas_active(), WIDTH, HEIGHT, de_saturation); + VINTAGE.exposure(canvas_active(), WIDTH, HEIGHT, exposure); + VINTAGE.grains(canvas_active(), WIDTH, HEIGHT, grains); + VINTAGE.grains_big(canvas_active(), WIDTH, HEIGHT, big_grains); + VINTAGE.optics(canvas_active(), WIDTH, HEIGHT, vignette1, vignette2); + VINTAGE.dusts(canvas_active(), WIDTH, HEIGHT, dust_level); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var red_offset = parseInt(user_response.red_offset); + var contrast = parseInt(user_response.contrast); + var blur = parseFloat(user_response.blur); + var light_leak = parseInt(user_response.light_leak); + var de_saturation = parseInt(user_response.de_saturation); + var exposure = parseInt(user_response.exposure); + var grains = parseInt(user_response.grains); + var big_grains = parseInt(user_response.big_grains); + var vignette1 = parseFloat(user_response.vignette1); + var vignette2 = parseFloat(user_response.vignette2); + var dust_level = parseInt(user_response.dust_level); + + VINTAGE.adjust_color(canvas_preview, w, h, red_offset); + VINTAGE.lower_contrast(canvas_preview, w, h, contrast); + VINTAGE.blur(canvas_preview, w, h, blur); + VINTAGE.light_leak(canvas_preview, w, h, light_leak); + VINTAGE.chemicals(canvas_preview, w, h, de_saturation); + VINTAGE.exposure(canvas_preview, w, h, exposure); + VINTAGE.grains(canvas_preview, w, h, grains); + VINTAGE.grains_big(canvas_preview, w, h, big_grains); + VINTAGE.optics(canvas_preview, w, h, vignette1, vignette2); + VINTAGE.dusts(canvas_preview, w, h, dust_level); + } + ); + }; + + this.effect_bw = function (context, W, H, level, dithering) { + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var grey, c, quant_error, m; + if (dithering !== true) { + //no differing + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + grey = Math.round(0.2126 * imgData[i] + 0.7152 * imgData[i + 1] + 0.0722 * imgData[i + 2]); + if (grey <= level) + c = 0; + else + c = 255; + imgData[i] = c; + imgData[i + 1] = c; + imgData[i + 2] = c; + } + } + else { + //Floyd–Steinberg dithering + canvas_front.clearRect(0, 0, W, H); //temp canvas for storing pixel data shifts + var img2 = canvas_front.getImageData(0, 0, W, H); + var imgData2 = img2.data; + for (var j = 0; j < H; j++) { + for (var i = 0; i < W; i++) { + var k = ((j * (W * 4)) + (i * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + + grey = Math.round(0.2126 * imgData[k] + 0.7152 * imgData[k + 1] + 0.0722 * imgData[k + 2]); + grey = grey + imgData2[k]; //add data shft from previous iterations + c = Math.floor(grey / 256); + if (c == 1) + c = 255; + imgData[k] = c; + imgData[k + 1] = c; + imgData[k + 2] = c; + quant_error = grey - c; + if (i + 1 < W) { + m = k + 4; + imgData2[m] += Math.round(quant_error * 7 / 16); + } + if (i - 1 > 0 && j + 1 < H) { + m = k - 4 + W * 4; + imgData2[m] += Math.round(quant_error * 3 / 16); + } + if (j + 1 < H) { + m = k + W * 4; + imgData2[m] += Math.round(quant_error * 5 / 16); + } + if (i + 1 < W && j + 1 < H) { + m = k + 4 + W * 4; + imgData2[m] += Math.round(quant_error * 1 / 16); + } + } + } + } + context.putImageData(img, 0, 0); + }; + + //converts greyscale images to colored + this.colorize = function (context, W, H, rand_power, max_gap, manual_colors) { + if (manual_colors == undefined || manual_colors === true) { + var colors = []; + for (var x = 0; x < 3; x++) { + colors[x] = []; + var pre = HELPER.getRandomInt(-1 * rand_power, rand_power); + for (var i = 0; i <= 255; i++) { + colors[x][i] = HELPER.getRandomInt(pre - rand_power, pre + rand_power); + + if (colors[x][i] < -1 * max_gap) + colors[x][i] += 10; + else if (colors[x][i] > max_gap) + colors[x][i] -= 10; + + pre = colors[x][i]; + } + } + if (manual_colors === true) + return colors; + } + else { + var colors = manual_colors; + } + + var img = context.getImageData(0, 0, W, H); + + //colorize + var imgData = img.data; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + for (var c = 0; c < 3; c++) { + var x = i + c; + imgData[x] += colors[c][imgData[x]]; + if (imgData[x] > 255) + imgData[x] = 255; + if (imgData[x] < 0) + imgData[x] = 0; + } + } + context.putImageData(img, 0, 0); + return false; + }; + + this.heatmap_effect = function (context, W, H) { + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var grey, RGB; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + grey = Math.round(0.2126 * imgData[i] + 0.7152 * imgData[i + 1] + 0.0722 * imgData[i + 2]); + RGB = this.color2heat(grey); + imgData[i] = RGB.R; + imgData[i + 1] = RGB.G; + imgData[i + 2] = RGB.B; + } + context.putImageData(img, 0, 0); + }; + + this.color2heat = function (value) { + var RGB = {R: 0, G: 0, B: 0}; + value = value / 255; + if (0 <= value && value <= 1 / 8) { + RGB.R = 0; + RGB.G = 0; + RGB.B = 4 * value + .5; // .5 - 1 // b = 1/2 + } + else if (1 / 8 < value && value <= 3 / 8) { + RGB.R = 0; + RGB.G = 4 * value - .5; // 0 - 1 // b = - 1/2 + RGB.B = 1; // small fix + } + else if (3 / 8 < value && value <= 5 / 8) { + RGB.R = 4 * value - 1.5; // 0 - 1 // b = - 3/2 + RGB.G = 1; + RGB.B = -4 * value + 2.5; // 1 - 0 // b = 5/2 + } + else if (5 / 8 < value && value <= 7 / 8) { + RGB.R = 1; + RGB.G = -4 * value + 3.5; // 1 - 0 // b = 7/2 + RGB.B = 0; + } + else if (7 / 8 < value && value <= 1) { + RGB.R = -4 * value + 4.5; // 1 - .5 // b = 9/2 + RGB.G = 0; + RGB.B = 0; + } + else { + // should never happen - value > 1 + RGB.R = .5; + RGB.G = 0; + RGB.B = 0; + } + // scale for hex conversion + RGB.R *= 255; + RGB.G *= 255; + RGB.B *= 255; + + RGB.R = Math.round(RGB.R); + RGB.G = Math.round(RGB.G); + RGB.B = Math.round(RGB.B); + + return RGB; + }; + + //method = otsu + this.thresholding = function (method, ctx, W, H, only_level) { + var img = ctx.getImageData(0, 0, W, H); + var imgData = img.data; + var hist_data = []; + var grey; + for (var i = 0; i <= 255; i++) + hist_data[i] = 0; + for (var i = 0; i < imgData.length; i += 4) { + grey = Math.round(0.2126 * imgData[i] + 0.7152 * imgData[i + 1] + 0.0722 * imgData[i + 2]); + hist_data[grey]++; + } + var level; + if (method == 'otsu') + level = this.otsu(hist_data, W * H); + else + alert('ERROR: unknown method in EFFECTS.thresholding().'); + if (only_level === true) + return level; + var c; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + grey = Math.round(0.2126 * imgData[i] + 0.7152 * imgData[i + 1] + 0.0722 * imgData[i + 2]); + if (grey < level) + c = 0; + else + c = 255; + imgData[i] = c; + imgData[i + 1] = c; + imgData[i + 2] = c; + } + ctx.putImageData(img, 0, 0); + }; + + //http://en.wikipedia.org/wiki/Otsu%27s_Method + this.otsu = function (histogram, total) { + var sum = 0; + for (var i = 1; i < 256; ++i) + sum += i * histogram[i]; + var mB, mF, between; + var sumB = 0; + var wB = 0; + var wF = 0; + var max = 0; + var threshold = 0; + for (var i = 0; i < 256; ++i) { + wB += histogram[i]; + if (wB == 0) + continue; + wF = total - wB; + if (wF == 0) + break; + sumB += i * histogram[i]; + mB = sumB / wB; + mF = (sum - sumB) / wF; + between = wB * wF * Math.pow(mB - mF, 2); + if (between > max) { + max = between; + threshold = i; + } + } + return threshold; + }; + + this.grains_effect = function (context, W, H, level) { + if (level == 0) + return context; + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + for (var j = 0; j < H; j++) { + for (var i = 0; i < W; i++) { + var x = (i + j * W) * 4; + if (imgData[x + 3] == 0) + continue; //transparent + //increase it's lightness + var delta = HELPER.getRandomInt(0, level); + if (delta == 0) + continue; + + if (imgData[x] - delta < 0) + imgData[x] = -(imgData[x] - delta); + else + imgData[x] = imgData[x] - delta; + if (imgData[x + 1] - delta < 0) + imgData[x + 1] = -(imgData[x + 1] - delta); + else + imgData[x + 1] = imgData[x + 1] - delta; + if (imgData[x + 2] - delta < 0) + imgData[x + 2] = -(imgData[x + 2] - delta); + else + imgData[x + 2] = imgData[x + 2] - delta; + } + } + context.putImageData(img, 0, 0); + }; +} \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/effects.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/effects.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..253caf94e36bfff87563122cf5ef738a2fa3e878 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/effects.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + effects.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/elements.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/elements.js.js new file mode 100644 index 0000000000000000000000000000000000000000..f503acdd4466b18b50106680feaeb4c755c2f17f --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/elements.js.js @@ -0,0 +1,289 @@ +/* global WIDTH, HEIGHT */ + +var EL = new ELEMENTS_CLASS(); + +/** + * class that draw simple elements + * + * @author ViliusL + */ +function ELEMENTS_CLASS() { + + //draw lines + this.line = function(ctx, from_x, from_y, to_x, to_y, size){ + ctx.beginPath(); + if(size != undefined) + ctx.lineWidth = size; + ctx.moveTo(from_x + 0.5, from_y + 0.5); + ctx.lineTo(to_x + 0.5, to_y + 0.5); + ctx.stroke(); + }; + + //draws rectangle + this.rectangle = function (ctx, x, y, width, height, fill, stroke) { + x = x + 0.5; + y = y + 0.5; + if (typeof stroke == "undefined") + stroke = true; + if(fill == false && stroke == undefined) + stroke = true; + + ctx.beginPath(); + ctx.moveTo(x, y); + ctx.lineTo(x + width, y); + ctx.quadraticCurveTo(x + width, y, x + width, y); + ctx.lineTo(x + width, y + height); + ctx.quadraticCurveTo(x + width, y + height, x + width, y + height); + ctx.lineTo(x, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height); + ctx.lineTo(x, y); + ctx.quadraticCurveTo(x, y, x, y); + ctx.closePath(); + if (stroke) { + ctx.stroke(); + } + if (fill) { + ctx.fill(); + } + }; + + //draws square + this.square = function (ctx, x, y, width, height, fill, stroke) { + x = x + 0.5; + y = y + 0.5; + if (typeof stroke == "undefined") + stroke = true; + if(fill == false && stroke == undefined) + stroke = true; + + if (Math.abs(width) < Math.abs(height)){ + if(width > 0) + width = Math.abs(height); + else + width = -Math.abs(height); + } + else{ + if(height > 0) + height = Math.abs(width); + else + height = -Math.abs(width); + } + + ctx.beginPath(); + ctx.moveTo(x, y); + ctx.lineTo(x + width, y); + ctx.quadraticCurveTo(x + width, y, x + width, y); + ctx.lineTo(x + width, y + height); + ctx.quadraticCurveTo(x + width, y + height, x + width, y + height); + ctx.lineTo(x, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height); + ctx.lineTo(x, y); + ctx.quadraticCurveTo(x, y, x, y); + ctx.closePath(); + if (stroke) { + ctx.stroke(); + } + if (fill) { + ctx.fill(); + } + }; + + this.circle = function (ctx, x, y, size, color) { + ctx.lineWidth = 1; + if(color != undefined) + ctx.strokeStyle = color; + else + ctx.strokeStyle = "#000000"; + + ctx.beginPath(); + ctx.arc(x, y, size / 2, 0, Math.PI * 2, true); + ctx.stroke(); + }; + + this.ellipse_by_center = function (ctx, cx, cy, w, h, color, fill) { + this.ellipse(ctx, cx - w / 2.0, cy - h / 2.0, w, h, color, fill); + }; + + this.ellipse = function (ctx, x, y, w, h, color, fill) { + var kappa = .5522848, + ox = (w / 2) * kappa, // control point offset horizontal + oy = (h / 2) * kappa, // control point offset vertical + xe = x + w, // x-end + ye = y + h, // y-end + xm = x + w / 2, // x-middle + ym = y + h / 2; // y-middle + + ctx.beginPath(); + ctx.moveTo(x, ym); + ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); + ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); + ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); + ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); + ctx.closePath(); + ctx.fillStyle = color; + ctx.strokeStyle = color; + if (fill == undefined) + ctx.stroke(); + else + ctx.fill(); + }; + + this.arrow = function (context, fromx, fromy, tox, toy, headlen) { + if (headlen == undefined) + headlen = 10; // length of head in pixels + var dx = tox - fromx; + var dy = toy - fromy; + var angle = Math.atan2(dy, dx); + context.beginPath(); + context.moveTo(fromx, fromy); + context.lineTo(tox, toy); + context.stroke(); + context.beginPath(); + context.moveTo(tox - headlen * Math.cos(angle - Math.PI / 6), toy - headlen * Math.sin(angle - Math.PI / 6)); + context.lineTo(tox, toy); + context.lineTo(tox - headlen * Math.cos(angle + Math.PI / 6), toy - headlen * Math.sin(angle + Math.PI / 6)); + context.stroke(); + }; + + //dashed objects + this.rectangle_dashed = function (canvas, x1, y1, x2, y2, dashLen, color) { + this.line_dashed(canvas, x1, y1, x2, y1, dashLen, color); + this.line_dashed(canvas, x2, y1, x2, y2, dashLen, color); + this.line_dashed(canvas, x2, y2, x1, y2, dashLen, color); + this.line_dashed(canvas, x1, y2, x1, y1, dashLen, color); + }; + + this.line_dashed = function (canvas, x1, y1, x2, y2, dashLen, color) { + x1 = x1 + 0.5; + y1 = y1 + 0.5; + x2 = x2 + 0.5; + y2 = y2 + 0.5; + if (color != undefined) + canvas.strokeStyle = color; + else + canvas.strokeStyle = "#000000"; + if (dashLen == undefined) + dashLen = 4; + canvas.beginPath(); + canvas.moveTo(x1, y1); + var dX = x2 - x1; + var dY = y2 - y1; + var dashes = Math.floor(Math.sqrt(dX * dX + dY * dY) / dashLen); + var dashX = dX / dashes; + var dashY = dY / dashes; + var q = 0; + while (q++ < dashes) { + x1 += dashX; + y1 += dashY; + canvas[q % 2 == 0 ? 'moveTo' : 'lineTo'](x1, y1); + } + canvas[q % 2 == 0 ? 'moveTo' : 'lineTo'](x2, y2); + canvas.stroke(); + canvas.closePath(); + }; + + this.image_round = function (canvas, mouse_x, mouse_y, size, img_data, canvas_tmp, anti_aliasing) { + var size_half = Math.round(size / 2); + var ctx_tmp = canvas_tmp.getContext("2d"); + var xx = mouse_x - size_half; + var yy = mouse_y - size_half; + if (xx < 0) + xx = 0; + if (yy < 0) + yy = 0; + + ctx_tmp.clearRect(0, 0, WIDTH, HEIGHT); + ctx_tmp.save(); + //draw main data + try { + ctx_tmp.drawImage(img_data, mouse_x - size_half, mouse_y - size_half, size, size); + } + catch (err) { + try { + ctx_tmp.putImageData(img_data, xx, yy); + } + catch (err) { + console.log("Error: " + err.message); + } + } + ctx_tmp.globalCompositeOperation = 'destination-in'; + + //create form + ctx_tmp.fillStyle = '#ffffff'; + if (anti_aliasing == true) { + var gradient = ctx_tmp.createRadialGradient(mouse_x, mouse_y, 0, mouse_x, mouse_y, size_half); + gradient.addColorStop(0, '#ffffff'); + gradient.addColorStop(0.8, '#ffffff'); + gradient.addColorStop(1, 'rgba(255,255,255,0'); + ctx_tmp.fillStyle = gradient; + } + ctx_tmp.beginPath(); + ctx_tmp.arc(mouse_x, mouse_y, size_half, 0, 2 * Math.PI, true); + ctx_tmp.fill(); + //draw final data + if (xx + size > WIDTH) + size = WIDTH - xx; + if (yy + size > HEIGHT) + size = HEIGHT - yy; + canvas.drawImage(canvas_tmp, xx, yy, size, size, xx, yy, size, size); + //reset + ctx_tmp.restore(); + ctx_tmp.clearRect(0, 0, WIDTH, HEIGHT); + }; +} + +//http://www.script-tutorials.com/html5-canvas-custom-brush1/ +var BezierCurveBrush = { + // inner variables + iPrevX: 0, + iPrevY: 0, + points: null, + // initialization function + init: function () { + }, + startCurve: function (x, y) { + this.iPrevX = x; + this.iPrevY = y; + this.points = new Array(); + }, + getPoint: function (iLength, a) { + var index = a.length - iLength, i; + for (i = index; i < a.length; i++) { + if (a[i]) { + return a[i]; + } + } + }, + draw: function (ctx, color_rgb, x, y, size) { + if (Math.abs(this.iPrevX - x) > 5 || Math.abs(this.iPrevY - y) > 5) { + this.points.push([x, y]); + + // draw main path stroke + ctx.beginPath(); + ctx.moveTo(this.iPrevX, this.iPrevY); + ctx.lineTo(x, y); + + ctx.lineWidth = size; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + ctx.strokeStyle = 'rgba(' + color_rgb.r + ', ' + color_rgb.g + ', ' + color_rgb.b + ', 0.9)'; + ctx.stroke(); + ctx.closePath(); + + // draw extra strokes + ctx.lineWidth = 1; + ctx.strokeStyle = 'rgba(' + color_rgb.r + ', ' + color_rgb.g + ', ' + color_rgb.b + ', 0.2)'; + ctx.beginPath(); + var iStartPoint = this.getPoint(25, this.points); + var iFirstPoint = this.getPoint(1, this.points); + var iSecondPoint = this.getPoint(5, this.points); + ctx.moveTo(iStartPoint[0], iStartPoint[1]); + ctx.bezierCurveTo(iFirstPoint[0], iFirstPoint[1], iSecondPoint[0], iSecondPoint[1], x, y); + ctx.stroke(); + ctx.closePath(); + + this.iPrevX = x; + this.iPrevY = y; + } + } +}; \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/elements.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/elements.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..e326431b1861ed6bbd5f5f98f4066d332b2b0117 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/elements.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + elements.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/events.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/events.js.js new file mode 100644 index 0000000000000000000000000000000000000000..eca317d9a2e898e996cb4b461b7a0c7aaadc5ee7 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/events.js.js @@ -0,0 +1,809 @@ +/* global FILE, EDIT, HELPER, POP, MAIN, EVENTS, LAYER, IMAGE, GUI, DRAW, EL */ +/* global canvas_active, canvas_front, WIDTH, HEIGHT, EXIF */ + +var EVENTS = new EVENTS_CLASS(); + +//keyboard handlers +document.onkeydown = function(e) { return EVENTS.on_keyboard_action(e); }; +document.onkeyup = function(e) {return EVENTS.on_keyboardup_action(e); }; +//mouse +window.ondrop = function(e) { EVENTS.upload_drop(e); }; //drop +window.ondragover = function(e) { e.preventDefault(); }; +window.onresize = function(e){ EVENTS.on_resize(); }; //window resize +document.onmousedown = EVENTS.mouse_click; //mouse click +document.onmousemove = EVENTS.mouse_move; //mouse move +document.onmouseup = EVENTS.mouse_release; //mouse resease +document.addEventListener("mousewheel", EVENTS.mouse_wheel_handler, false); //mouse scroll +document.addEventListener("DOMMouseScroll", EVENTS.mouse_wheel_handler, false); //mouse scroll +document.oncontextmenu = function (e) { return EVENTS.mouse_right_click(e); }; //mouse right click +document.getElementById('color_hex').onkeyup = function (e) { GUI.set_color_manual(e); }; //on main color type +document.getElementById('color_hex').onpaste = function (e) { GUI.set_color_manual(e); }; // on paste in main color input + +//windows touch +document.addEventListener('MSPointerDown', EVENTS.mouse_click, false); +document.addEventListener('MSPointerMove', EVENTS.mouse_move, false); +document.addEventListener('MSPointerUp', EVENTS.mouse_release, false); + +//touch and drag +document.addEventListener("touchstart", EVENTS.mouse_click, false); +document.addEventListener("touchend", EVENTS.mouse_release, false); +document.addEventListener("touchmove", EVENTS.mouse_move, false); +//document.addEventListener("touchcancel", handleCancel, false); + +/** + * all events handling + * + * @author ViliusL + */ +function EVENTS_CLASS() { + + /** + * mouse data, like positions, clicks + */ + this.mouse = {}; + + /** + * if user is holding ctrl + */ + this.ctrl_pressed = false; + + /** + * if user is holding command key + */ + this.command_pressed = false; + + /** + * if use is holding shift + */ + this.shift_pressed = false; //16 + + /** + * if use is draging + */ + this.isDrag = false; + + /** + * selected area resize rect. size (controlls, where you can resize area) + */ + this.sr_size = 8; + + /** + * if false, font canvas is not cleared on mouse release + */ + this.clear_front_on_release = true; + + /** + * if canvas size was not changed - autosize possible + */ + var autosize = true; + + /** + * mouse click positions + */ + var mouse_click_pos = [false, false]; + + /** + * last mouse move position + */ + var mouse_move_last = [false, false]; + + /** + * main canvas resize action + */ + var resize_all = false; + + /** + * if mouse was click on canvas + */ + var mouse_click_valid = false; + + /** + * mouse click position of popup drag start + */ + var last_pop_click = [0, 0]; + + /** + * popup position for dragable ability + */ + var popup_pos = [0, 0]; + + /** + * if popup is dragged + */ + var popup_dragable = false; + + var mouse_average_speed = 0; + + //keyboard actions + this.on_keyboard_action = function (event) { + k = event.keyCode; //console.log(k); + + if (k != 27) { + //we can not touch these events! + if (POP != undefined && POP.active == true){ + //dialog active + return true; + } + if (document.activeElement.type == 'text' || document.activeElement.type == 'number'){ + //text input selected + return true; + } + } + + //ctrl + if (event.ctrlKey == true) { + EVENTS.ctrl_pressed = true; + } + //command + if(event.metaKey == true){ + EVENTS.command_pressed = true; + EVENTS.ctrl_pressed = true; + } + + //F9 + if (k == 120) { + FILE.file_quicksave(); + } + + //F10 + if (k == 121) { + FILE.file_quickload(); + } + + //up + if (k == 38) { + if (DRAW.active_tool == 'select_tool') { + EDIT.save_state(); + LAYER.layer_move_active(0, -1); + GUI.zoom(); + return false; + } + } + //down + else if (k == 40) { + if (DRAW.active_tool == 'select_tool') { + EDIT.save_state(); + LAYER.layer_move_active(0, 1); + GUI.zoom(); + return false; + } + } + //right + else if (k == 39) { + if (DRAW.active_tool == 'select_tool') { + EDIT.save_state(); + LAYER.layer_move_active(1, 0); + GUI.zoom(); + return false; + } + } + //left + else if (k == 37) { + if (DRAW.active_tool == 'select_tool') { + EDIT.save_state(); + LAYER.layer_move_active(-1, 0); + GUI.zoom(); + return false; + } + } + //esc + else if (k == 27) { + if (POP != undefined && POP.active == true) + POP.hide(); + DRAW.last_line = []; + + DRAW.curve_points = []; + if (DRAW.select_data != false) { + EDIT.edit_clear(); + } + } + //z - undo + else if (k == 90) { + //undo + if (EVENTS.ctrl_pressed == true){ + EDIT.undo(); + } + } + //t - trim + else if (k == 84) { + EDIT.save_state(); + IMAGE.trim(); + } + //s - save + else if (k == 83) { + if (POP != undefined) + FILE.save_dialog(event); + } + //l - rotate left + else if (k == 76) { + EDIT.save_state(); + IMAGE.rotate_resize_doc(270, WIDTH, HEIGHT); + IMAGE.rotate_layer({angle: 270}, canvas_active(), WIDTH, HEIGHT); + } + //r - resize + else if (k == 82) + IMAGE.resize_box(); + //grid + else if (k == 71) { + if (GUI.grid == false) + GUI.grid = true; + else + GUI.grid = false; + GUI.draw_grid(); + } + //del + else if (k == 46) { + if (DRAW.select_data != false) { + EDIT.save_state(); + canvas_active().clearRect(DRAW.select_data.x, DRAW.select_data.y, DRAW.select_data.w, DRAW.select_data.h); + DRAW.select_data = false; + DRAW.select_square_action = ''; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + } + } + //shift + else if (k == 16){ + EVENTS.shift_pressed = true; + } + //d + else if (k == 68) { + call_menu(LAYER, 'layer_duplicate'); + } + //a + else if (k == 65) { + if (EVENTS.ctrl_pressed == true) { + DRAW.select_data = { + x: 0, + y: 0, + w: WIDTH, + h: HEIGHT + }; + GUI.draw_selected_area(); + return false; + } + } + //v + else if (k == 86) { + EDIT.save_state(); + if (EVENTS.ctrl_pressed == true) + EDIT.paste(); + } + //f - fix images + else if (k == 70) { + EDIT.save_state(); + IMAGE.auto_adjust(canvas_active(), WIDTH, HEIGHT); + } + //h - histogram + else if (k == 72) { + IMAGE.histogram(); + } + //minus + else if (k == 109){ + GUI.zoom(-1); + } + //plus + else if (k == 107){ + GUI.zoom(+1); + } + //n - new layer + else if (k == 78){ + EDIT.save_state(); + LAYER.layer_add(); + } + + GUI.zoom(); + return true; + }; + //keyboard release + this.on_keyboardup_action = function (event) { + k = event.keyCode; + //shift + if (k == 16) + EVENTS.shift_pressed = false; + //ctrl + else if (event.ctrlKey == false && EVENTS.ctrl_pressed == true) { + EVENTS.ctrl_pressed = false; + } + //command + else if(event.metaKey == false && EVENTS.command_pressed == true){ + EVENTS.command_pressed = false; + EVENTS.ctrl_pressed = false; + } + }; + // mouse_x, mouse_y, event.pageX, event.pageY + this.get_mouse_position = function (event) { + if(event.changedTouches){ + //using touch events + event = event.changedTouches[0]; + } + var valid = true; + var abs_x = event.pageX; + var abs_y = event.pageY; + + var bodyRect = document.body.getBoundingClientRect(); + var canvas_el = document.getElementById('canvas_front').getBoundingClientRect(); + var canvas_offset_x = canvas_el.left - bodyRect.left; + var canvas_offset_y = canvas_el.top - bodyRect.top; + + var mouse_x = event.pageX - canvas_offset_x; + var mouse_y = event.pageY - canvas_offset_y; + + if (event.target.id != "canvas_front") { + //outside canvas + valid = false; + } + + if (event.target.id == "canvas_preview") { + //in preview area - relative pos + var canvas_preview_el = document.getElementById('canvas_preview').getBoundingClientRect(); + var canvas_preview_el_x = canvas_preview_el.left - bodyRect.left; + var canvas_preview_el_y = canvas_preview_el.top - bodyRect.top; + + mouse_x = event.pageX - canvas_preview_el_x; + mouse_y = event.pageY - canvas_preview_el_y; + } + + if (event.target.id != "canvas_preview" && GUI.ZOOM != 100) { + //we are in zoom mode - recalculate + mouse_x = Math.floor(mouse_x / GUI.ZOOM * 100); + mouse_y = Math.floor(mouse_y / GUI.ZOOM * 100); + } + + //save + EVENTS.mouse = { + x: mouse_x, + y: mouse_y, + click_x: mouse_click_pos[0], + click_y: mouse_click_pos[1], + last_x: mouse_move_last[0], + last_y: mouse_move_last[1], + valid: valid, + click_valid: mouse_click_valid, + abs_x: abs_x, + abs_y: abs_y, + }; + }; + //mouse right click + this.mouse_right_click = function (event) { + if (POP != undefined && POP.active == true) + return true; + + EVENTS.get_mouse_position(event); + + if(EVENTS.mouse.x != EVENTS.mouse.click_x && EVENTS.mouse.y != EVENTS.mouse.click_y){ + //disable long click on mobile + event.preventDefault(); + event.stopPropagation(); + return false; + } + + mouse_click_pos[0] = EVENTS.mouse.x; + mouse_click_pos[1] = EVENTS.mouse.y; + + for (var i in DRAW) { + if (i == DRAW.active_tool) { + return DRAW[i]('right_click', EVENTS.mouse, event); + break; + } + } + }; + //mouse click + this.mouse_click = function (event) { + EVENTS.isDrag = true; + if (POP != undefined && POP.active == true) { + EVENTS.get_mouse_position(event); + last_pop_click[0] = EVENTS.mouse.abs_x; + last_pop_click[1] = EVENTS.mouse.abs_y; + popup = document.getElementById('popup'); + popup_pos[0] = parseInt(popup.style.top); + popup_pos[1] = parseInt(popup.style.left); + + if (event.target.id == "popup_drag") + popup_dragable = true; + else + popup_dragable = false; + return true; + } + + //reset avg speed + mouse_average_speed = 0; + + EVENTS.get_mouse_position(event); + mouse_click_pos[0] = EVENTS.mouse.x; + mouse_click_pos[1] = EVENTS.mouse.y; + if (event.which == 3){ + return true; + } + if (EVENTS.mouse.valid == false) + mouse_click_valid = false; + else + mouse_click_valid = true; + + //check tools functions + for (var i in DRAW) { + if (i == DRAW.active_tool) { + DRAW[i]('click', EVENTS.mouse, event); + break; + } + } + + if (event.target.id == "canvas_preview") + EVENTS.calc_preview_by_mouse(EVENTS.mouse.x, EVENTS.mouse.y); + + //main window resize + resize_all = false; + if (GUI.ZOOM == 100) { + if (event.target.id == "resize-w") + resize_all = "w"; + else if (event.target.id == "resize-h") + resize_all = "h"; + else if (event.target.id == "resize-wh") + resize_all = "wh"; + } + }; + //mouse move + this.mouse_move = function (event) { + if (POP != undefined && POP.active == true) { + //drag popup + if (EVENTS.isDrag == true && popup_dragable == true) { + EVENTS.get_mouse_position(event); + popup = document.getElementById('popup'); + popup.style.top = (popup_pos[0] + EVENTS.mouse.abs_y - last_pop_click[1]) + 'px'; + popup.style.left = (popup_pos[1] + EVENTS.mouse.abs_x - last_pop_click[0]) + 'px'; + } + return true; + } + EVENTS.get_mouse_position(event); + if (event.target.id == "canvas_preview" && EVENTS.isDrag == true) + EVENTS.calc_preview_by_mouse(EVENTS.mouse.x, EVENTS.mouse.y); + LAYER.update_info_block(); + + //main window resize + if (GUI.ZOOM == 100) { + if (event.target.id == "resize-w") + document.body.style.cursor = "w-resize"; + else if (event.target.id == "resize-h") + document.body.style.cursor = "n-resize"; + else if (event.target.id == "resize-wh") + document.body.style.cursor = "nw-resize"; + else + document.body.style.cursor = "auto"; + if (resize_all != false && EVENTS.isDrag == true) { + document.body.style.cursor = "auto"; + if (resize_all == "w") { + new_w = EVENTS.mouse.x; + new_h = HEIGHT; + } + else if (resize_all == "h") { + new_w = WIDTH; + new_h = EVENTS.mouse.y; + } + else if (resize_all == "wh") { + new_w = EVENTS.mouse.x; + new_h = EVENTS.mouse.y; + } + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + canvas_front.lineWidth = 1; + canvas_front.fillStyle = "#ff0000"; + EL.rectangle_dashed(canvas_front, 0, 0, new_w - 1, new_h - 1); + event.preventDefault(); + HELPER.remove_selection(); + return false; + } + } + + //calc average speed + var avg_speed_max = 20; + var avg_speed_changing_power = 2; + + var dx = Math.abs(EVENTS.mouse.x - EVENTS.mouse.last_x); + var dy = Math.abs(EVENTS.mouse.y - EVENTS.mouse.last_y); + var delta = Math.sqrt(dx*dx + dy*dy); + if(delta > avg_speed_max/2) + mouse_average_speed += avg_speed_changing_power; + else + mouse_average_speed -= avg_speed_changing_power; + mouse_average_speed = Math.max(0, mouse_average_speed); //min 0 + mouse_average_speed = Math.min(avg_speed_max, mouse_average_speed); //max 30 + EVENTS.mouse.speed_average = mouse_average_speed; + + //check tools functions + if (EVENTS.isDrag === false) { + for (i in DRAW) { + if (i == DRAW.active_tool) { + DRAW[i]('move', EVENTS.mouse, event); + break; + } + } + } + + if (EVENTS.isDrag === false) + return false; //only drag now + + //check tools functions + for (var i in DRAW) { + if (i == DRAW.active_tool) { + DRAW[i]('drag', EVENTS.mouse, event); + break; + } + } + + if (DRAW.active_tool != 'select_square') + DRAW.select_square_action = ''; + + mouse_move_last[0] = EVENTS.mouse.x; + mouse_move_last[1] = EVENTS.mouse.y; + }; + //release mouse click + this.mouse_release = function (event) { + EVENTS.isDrag = false; + if (POP != undefined && POP.active == true) + return true; + EVENTS.get_mouse_position(event); + mouse_move_last[0] = false; + mouse_move_last[1] = false; + + if (DRAW.select_square_action == '' && EVENTS.mouse.valid == true) + DRAW.select_data = false; + + //check tools functions + if (EVENTS.clear_front_on_release == true) + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + GUI.draw_selected_area(); + for (var i in DRAW) { + if (i == DRAW.active_tool) { + DRAW[i]('release', EVENTS.mouse, event); + break; + } + } + + //main window resize + if (resize_all != false && GUI.ZOOM == 100 && EVENTS.mouse.x > 0 && EVENTS.mouse.y > 0) { + EDIT.save_state(); + EVENTS.autosize = false; + document.body.style.cursor = "auto"; + if (resize_all == "w") + WIDTH = EVENTS.mouse.x; + else if (resize_all == "h") + HEIGHT = EVENTS.mouse.y; + else if (resize_all == "wh") { + WIDTH = EVENTS.mouse.x; + HEIGHT = EVENTS.mouse.y; + } + LAYER.set_canvas_size(); + GUI.zoom(); + } + resize_all = false; + GUI.zoom(); + }; + //upload drop zone + this.upload_drop = function (e) { + e.preventDefault(); + + EDIT.save_state(); + FILE.open_handler(e); + }; + this.mouse_wheel_handler = function (e) { //return true; + e.preventDefault(); + //zoom + if (EVENTS.ctrl_pressed == true) { + var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail))); + if(delta > 0) + GUI.zoom(+1, true); + else + GUI.zoom(-1, true); + + return false; + } + }; + this.scroll_window = function() { + var canvas_wrapper = document.querySelector('#canvas_wrapper'); + var visible_w = canvas_wrapper.clientWidth / GUI.ZOOM * 100; + var visible_h = canvas_wrapper.clientHeight / GUI.ZOOM * 100; + + if(this.mouse.valid == true){ + GUI.zoom_center = [this.mouse.x/WIDTH*100, this.mouse.y/HEIGHT*100]; + } + + //scroll to - convert center % coordinates to top/left px, and translate to current zoom + if(this.mouse.valid == true){ + //using exact position + xx = (GUI.zoom_center[0] * WIDTH / 100 - visible_w * GUI.zoom_center[0]/100) * GUI.ZOOM / 100; + yy = (GUI.zoom_center[1] * HEIGHT / 100 - visible_h * GUI.zoom_center[1]/100) * GUI.ZOOM / 100; + } + else{ + //using center + xx = (GUI.zoom_center[0] * WIDTH / 100 - visible_w / 2) * GUI.ZOOM / 100; + yy = (GUI.zoom_center[1] * HEIGHT / 100 - visible_h / 2) * GUI.ZOOM / 100; + } + + canvas_wrapper.scrollLeft = xx; + canvas_wrapper.scrollTop = yy; + + }; + this.calc_preview_by_mouse = function (mouse_x, mouse_y) { + GUI.zoom_center[0] = mouse_x / GUI.PREVIEW_SIZE.w * 100; + GUI.zoom_center[1] = mouse_y / GUI.PREVIEW_SIZE.h * 100; + + GUI.zoom(undefined, true); + return true; + }; + this.on_resize = function(){ + GUI.redraw_preview(); + + //recalc popup position + var dim = HELPER.get_dimensions(); + popup = document.getElementById('popup'); + popup.style.top = 150 + 'px'; + popup.style.left = Math.round(dim[0] / 2) + 'px'; + + document.querySelector('#sidebar_left').classList.remove("active"); + document.querySelector('#sidebar_right').classList.remove("active"); + }; +} + +function call_menu(class_name, function_name, parameter) { + //close menu + var menu = document.querySelector('#main_menu .selected'); + if(menu != undefined){ + menu.click(); + } + GUI.last_menu = function_name; + + //exec + class_name[function_name](parameter); + + GUI.zoom(); +} + +//=== Clipboard ================================================================ + +var CLIPBOARD = new CLIPBOARD_CLASS('', false); + +/** + * image pasting into canvas + * + * @param {string} canvas_id - canvas id + * @param {boolean} autoresize - if canvas will be resized + */ +function CLIPBOARD_CLASS(canvas_id, autoresize) { + var _self = this; + if (canvas_id != ''){ + var canvas = document.getElementById(canvas_id); + var ctx = document.getElementById(canvas_id).getContext("2d"); + } + var ctrl_pressed = false; + var command_pressed = false; + var reading_dom = false; + var text_top = 15; + var pasteCatcher; + var paste_mode; + + //handlers + document.addEventListener('keydown', function (e) { + _self.on_keyboard_action(e); + }, false); //firefox fix + document.addEventListener('keyup', function (e) { + _self.on_keyboardup_action(e); + }, false); //firefox fix + document.addEventListener('paste', function (e) { + _self.paste_auto(e); + }, false); //official paste handler + + //constructor - prepare + this.init = function () { + //if using auto + if (window.Clipboard) + return true; + + pasteCatcher = document.createElement("div"); + pasteCatcher.setAttribute("id", "paste_ff"); + pasteCatcher.setAttribute("contenteditable", ""); + pasteCatcher.style.cssText = 'opacity:0;position:fixed;top:0px;left:0px;'; + pasteCatcher.style.marginLeft = "-20px"; + pasteCatcher.style.width = "10px"; + document.body.appendChild(pasteCatcher); + + // create an observer instance + var observer = new MutationObserver(function(mutations) { + mutations.forEach(function(mutation) { + if (paste_mode == 'auto' || ctrl_pressed == false || mutation.type != 'childList') + return true; + + //if paste handle failed - capture pasted object manually + if(mutation.addedNodes.length == 1) { + if (mutation.addedNodes[0].src != undefined) { + //image + _self.paste_createImage(mutation.addedNodes[0].src); + } + //register cleanup after some time. + setTimeout(function () { + pasteCatcher.innerHTML = ''; + }, 20); + } + }); + }); + var target = document.getElementById('paste_ff'); + var config = { attributes: true, childList: true, characterData: true }; + observer.observe(target, config); + }(); + //default paste action + this.paste_auto = function (e) { + paste_mode = ''; + pasteCatcher.innerHTML = ''; + var plain_text_used = false; + if (e.clipboardData) { + var items = e.clipboardData.items; + if (items) { + paste_mode = 'auto'; + //access data directly + for (var i = 0; i < items.length; i++) { + if (items[i].type.indexOf("image") !== -1) { + //image + var blob = items[i].getAsFile(); + var URLObj = window.URL || window.webkitURL; + var source = URLObj.createObjectURL(blob); + this.paste_createImage(source); + } + } + e.preventDefault(); + } + else { + //wait for DOMSubtreeModified event + //https://bugzilla.mozilla.org/show_bug.cgi?id=891247 + } + } + }; + //on keyboard press + this.on_keyboard_action = function (event) { + if (POP.active == true) + return true; + k = event.keyCode; + //ctrl + if (k == 17 || event.metaKey || event.ctrlKey) { + if (ctrl_pressed == false) + ctrl_pressed = true; + } + //v + if (k == 86) { + if (document.activeElement != undefined && document.activeElement.type == 'text') { + //let user paste into some input + return false; + } + + if (ctrl_pressed == true && !window.Clipboard) + pasteCatcher.focus(); + } + }; + //on kaybord release + this.on_keyboardup_action = function (event) { + //ctrl + if (event.ctrlKey == false && ctrl_pressed == true) { + ctrl_pressed = false; + } + //command + else if(event.metaKey == false && command_pressed == true){ + command_pressed = false; + ctrl_pressed = false; + } + }; + //draw image + this.paste_createImage = function (source) { + var pastedImage = new Image(); + pastedImage.onload = function () { + if(canvas_id != ''){ + if(autoresize == true){ + //resize + canvas.width = pastedImage.width; + canvas.height = pastedImage.height; + } + else{ + //clear canvas + ctx.clearRect(0, 0, canvas.width, canvas.height); + } + } + LAYER.layer_add('Paste', source); + }; + pastedImage.src = source; + }; +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/events.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/events.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..9c155a97ebda25e7b6636b1f9033c045ccc788eb --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/events.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + events.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/file.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/file.js.js new file mode 100644 index 0000000000000000000000000000000000000000..04f335beda2e593248f4fb64f10215f7302d8cc6 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/file.js.js @@ -0,0 +1,495 @@ +/* global MAIN, POP, LAYER, EXIF, HELPER, IMAGE, GUI, EDIT, DRAW */ +/* global SAVE_TYPES */ + +var FILE = new FILE_CLASS(); + +/** + * manages files actions + * + * @author ViliusL + */ +function FILE_CLASS() { + + /** + * file info: exif, general data + */ + this.file_info = { + general: [], + exif: [], + }; + + /** + * default name used for saving file + */ + this.SAVE_NAME = 'example'; //default save name + + /** + * save types config + */ + this.SAVE_TYPES = [ + "PNG - Portable Network Graphics", //default + "JPG - JPG/JPEG Format", //autodetect on photos where png useless? + "JSON - Full layers data", //aka PSD + "BMP - Windows Bitmap", //firefox only, useless? + "WEBP - Weppy File Format", //chrome only + ]; + //new + this.file_new = function () { + var w = WIDTH; + var h = HEIGHT; + var resolutions = ['Custom']; + for(var i in GUI.common_dimensions){ + resolutions.push(GUI.common_dimensions[i][0]+'x'+GUI.common_dimensions[i][1]+' - '+GUI.common_dimensions[i][2]); + } + + var save_resolution_cookie = HELPER.getCookie('save_resolution'); + if(save_resolution_cookie == '') + save_resolution = 'No'; + else{ + save_resolution = 'Yes'; + var last_resolution = JSON.parse(save_resolution_cookie); + w = parseInt(last_resolution[0]); + h = parseInt(last_resolution[1]); + } + + POP.add({name: "width", title: "Width:", value: w}); + POP.add({name: "height", title: "Height:", value: h}); + POP.add({name: "resolution", title: "Resolution:", values: resolutions}); + POP.add({name: "transparency", title: "Transparent:", values: ['Yes', 'No']}); + POP.add({name: "save_resolution", title: "Save resolution:", value: save_resolution, values: ['Yes', 'No']}); + POP.show( + 'New file...', + function (response) { + var width = parseInt(response.width); + var height = parseInt(response.height); + var resolution = response.resolution; + var save_resolution = response.save_resolution; + + if(resolution != 'Custom'){ + var dim = resolution.split(" "); + dim = dim[0].split("x"); + width = dim[0]; + height = dim[1]; + } + if (response.transparency == 'Yes') + GUI.TRANSPARENCY = true; + else + GUI.TRANSPARENCY = false; + + GUI.ZOOM = 100; + WIDTH = width; + HEIGHT = height; + MAIN.init(); + + if(save_resolution == 'No') + save_resolution = ''; + else { + save_resolution = JSON.stringify([WIDTH, HEIGHT]); + } + HELPER.setCookie('save_resolution', save_resolution); + } + ); + }; + + //open + this.file_open = function () { + EDIT.save_state(); + this.open(); + }; + + //save + this.file_save = function () { + this.save_dialog(); + }; + + //print + this.file_print = function () { + window.print(); + }; + + this.open = function () { + var self = this; + + document.getElementById("tmp").innerHTML = ''; + var a = document.createElement('input'); + a.setAttribute("id", "file_open"); + a.type = 'file'; + a.multiple = 'multiple '; + document.getElementById("tmp").appendChild(a); + document.getElementById('file_open').addEventListener('change', function (e) { + self.open_handler(e); + }, false); + + //force click + document.querySelector('#file_open').click(); + }; + + this.open_handler = function (e) { + var files = e.target.files; + var self = this; + if(files == undefined){ + //drag and drop + files = e.dataTransfer.files; + } + + for (var i = 0, f; i < files.length; i++) { + f = files[i]; + if (!f.type.match('image.*') && !f.name.match('.json')){ + console.log('Wrong file type, must be image or json.'); + continue; + } + if (files.length == 1) + this.SAVE_NAME = f.name.split('.')[f.name.split('.').length - 2]; + + var FR = new FileReader(); + FR.file = files[i]; + + FR.onload = function (event) { + if (this.file.type.match('image.*')) { + //image + LAYER.layer_add(this.file.name, event.target.result, this.file.type); + self.save_file_info(this.file); + } + else { + //json + var responce = self.load_json(event.target.result); + if (responce === true) + return false; + } + }; + if (f.type == "text/plain") + FR.readAsText(f); + else if (f.name.match('.json')) + FR.readAsText(f); + else + FR.readAsDataURL(f); + } + }; + + this.save_dialog = function (e) { + //find default format + var save_default = this.SAVE_TYPES[0]; //png + if (HELPER.getCookie('save_default') == 'jpg') + save_default = this.SAVE_TYPES[1]; //jpg + + POP.add({name: "name", title: "File name:", value: this.SAVE_NAME}); + POP.add({name: "type", title: "Save as type:", values: this.SAVE_TYPES, value: save_default}); + POP.add({name: "quality", title: "Quality (jpeg):", value: 90, range: [1, 100]}); + POP.add({name: "layers", title: "Save layers:", values: ['All', 'Selected']}); + POP.add({name: "trim", title: "Trim:", values: ['No', 'Yes']}); + POP.show('Save as', [FILE, 'save']); + document.getElementById("pop_data_name").select(); + if (e != undefined) + e.preventDefault(); + }; + + this.save = function (user_response) { + fname = user_response.name; + var tempCanvas = document.createElement("canvas"); + var tempCtx = tempCanvas.getContext("2d"); + tempCanvas.width = WIDTH; + tempCanvas.height = HEIGHT; + + //save choosen type + var save_default = this.SAVE_TYPES[0]; //png + if (HELPER.getCookie('save_default') == 'jpg') + save_default = this.SAVE_TYPES[1]; //jpg + if (user_response.type != save_default && user_response.type == this.SAVE_TYPES[0]) + HELPER.setCookie('save_default', 'png'); + else if (user_response.type != save_default && user_response.type == this.SAVE_TYPES[1]) + HELPER.setCookie('save_default', 'jpg'); + + //detect type + var parts = user_response.type.split(" "); + user_response.type = parts[0]; + + if (HELPER.strpos(fname, '.png') !== false) + user_response.type = 'PNG'; + else if (HELPER.strpos(fname, '.jpg') !== false) + user_response.type = 'JPG'; + else if (HELPER.strpos(fname, '.json') !== false) + user_response.type = 'JSON'; + else if (HELPER.strpos(fname, '.bmp') !== false) + user_response.type = 'BMP'; + else if (HELPER.strpos(fname, '.webp') !== false) + user_response.type = 'WEBP'; + + //handle transparency + if (GUI.TRANSPARENCY == false || user_response.type == 'JPG') { + tempCtx.beginPath(); + tempCtx.rect(0, 0, WIDTH, HEIGHT); + tempCtx.fillStyle = "#ffffff"; + tempCtx.fill(); + } + + //take data + for(var i = LAYER.layers.length-1; i >=0; i--){ + if (LAYER.layers[i].visible == false) + continue; + if (user_response.layers == 'Selected' && user_response.type != 'JSON' && i != LAYER.layer_active) + continue; + tempCtx.drawImage(document.getElementById(LAYER.layers[i].name), 0, 0, WIDTH, HEIGHT); + } + + if (user_response.trim == 'Yes' && user_response.type != 'JSON') { + //trim + var trim_info = IMAGE.trim_info(tempCanvas); + tmp_data = tempCtx.getImageData(0, 0, WIDTH, HEIGHT); + tempCtx.clearRect(0, 0, WIDTH, HEIGHT); + tempCanvas.width = WIDTH - trim_info.right - trim_info.left; + tempCanvas.height = HEIGHT - trim_info.bottom - trim_info.top; + tempCtx.putImageData(tmp_data, -trim_info.left, -trim_info.top); + } + + if (user_response.type == 'PNG') { + //png - default format + if (HELPER.strpos(fname, '.png') == false) + fname = fname + ".png"; + + tempCanvas.toBlob(function(blob) { + saveAs(blob, fname); + }); + } + else if (user_response.type == 'JPG') { + //jpg + if (HELPER.strpos(fname, '.jpg') == false) + fname = fname + ".jpg"; + + var quality = parseInt(user_response.quality); + if (quality > 100 || quality < 1 || isNaN(quality) == true) + quality = 90; + quality = quality / 100; + + tempCanvas.toBlob(function (blob) { + saveAs(blob, fname); + }, "image/jpeg", quality); + } + else if (user_response.type == 'WEBP') { + //WEBP - new format for chrome only + if (HELPER.strpos(fname, '.webp') == false) + fname = fname + ".webp"; + var data_header = "image/webp"; + + //check support + if(this.check_format_support(tempCanvas, data_header) == false) + return false; + + tempCanvas.toBlob(function (blob) { + saveAs(blob, fname); + }, data_header); + } + else if (user_response.type == 'BMP') { + //bmp + if (HELPER.strpos(fname, '.webp') == false) + fname = fname + ".webp"; + var data_header = "image/bmp"; + + //check support + if(this.check_format_support(tempCanvas, data_header) == false) + return false; + + tempCanvas.toBlob(function (blob) { + saveAs(blob, fname); + }, data_header); + } + else if (user_response.type == 'JSON') { + //json - full data with layers + if (HELPER.strpos(fname, '.json') == false) + fname = fname + ".json"; + + var data_json = this.export_as_json(); + + var blob = new Blob([data_json], {type: "text/plain"}); + //var data = window.URL.createObjectURL(blob); //html5 + saveAs(blob, fname); + } else if (user_response.type == 'BLOB') { + var deferred = RSVP.defer(); + + tempCanvas.toBlob(function(blob) { + return deferred.resolve(blob); + }); + + return deferred.promise; + } + }; + + this.check_format_support = function(canvas, data_header){ + var data = canvas.toDataURL(data_header); + var actualType = data.replace(/^data:([^;]*).*/, '$1'); + + if (data_header != actualType && data_header != "text/plain") { + //error - no support + POP.add({title: "Error:", value: 'Your browser does not support this format.'}); + POP.show('Sorry', ''); + delete data; + return false; + } + delete data; + return true; + }; + + this.save_cleanup = function (a) { + a.textContent = 'Downloaded'; + setTimeout(function () { + a.href = ''; + var element = document.getElementById("save_data"); + element.parentNode.removeChild(element); + }, 1500); + }; + + this.save_file_info = function (object) { + this.file_info = { + general: [], + exif: [], + }; + //exif data + EXIF.getData(object, function() { + FILE.file_info.exif = this.exifdata; + }); + + //general + if(object.name != undefined) + FILE.file_info.general.Name = object.name; + if(object.size != undefined) + FILE.file_info.general.Size = HELPER.number_format(object.size/1000, 2)+' KB'; + if(object.type != undefined) + FILE.file_info.general.Type = object.type; + if(object.lastModified != undefined) + FILE.file_info.general['Last modified'] = '___'+new Date(object.lastModified); + }; + + this.export_as_json = function(){ + var export_data = {}; + + //basic info + export_data.info = { + width: WIDTH, + height: HEIGHT, + }; + + //layers + export_data.layers = []; + for(var i = LAYER.layers.length-1; i >=0; i--){ + var layer = { + name:LAYER.layers[i].name, + title:LAYER.layers[i].title, + visible: 1, + opacity: LAYER.layers[i].opacity, + }; + if (LAYER.layers[i].visible == false) + layer.visible = 0; + export_data.layers.push(layer); + } + + //image data + export_data.image_data = []; + for(var i = LAYER.layers.length-1; i >=0; i--){ + var data_tmp = document.getElementById(LAYER.layers[i].name).toDataURL("image/png"); + export_data.image_data.push({name: LAYER.layers[i].name, data: data_tmp}); + } + + var data_json = JSON.stringify(export_data, null, 6); + delete export_data; + + return data_json; + }; + + this.load_json = function (data) { + var json = JSON.parse(data); + + //init new file + GUI.ZOOM = 100; + MAIN.init(); + + LAYER.remove_all_layers(); + + //set attributes + WIDTH = parseInt(json.info.width); + HEIGHT = parseInt(json.info.height); + LAYER.set_canvas_size(); + + //add layers + for(var i in json.layers){ + var layer = json.layers[i]; + var name = layer.name.replace(/[^0-9a-zA-Z-_\. ]/g, ""); + var title = layer.title; + var visible = parseInt(layer.visible); + var opacity = parseInt(layer.opacity); + + LAYER.layer_add(name); + //update attributes + LAYER.layers[LAYER.layer_active].title = title; + if (visible == 0) + LAYER.layer_visibility(LAYER.layer_active); + LAYER.layers[LAYER.layer_active].opacity = opacity; + } + LAYER.layer_renew(); + + for(var i in json.image_data){ + var layer = json.image_data[i]; + var name = layer.name.replace(/[^0-9a-zA-Z-_\. ]/g, ""); + var data = layer.data; + + var img = new Image(); + img.onload = (function(name, value){ + return function(){ + document.getElementById(name).getContext('2d').drawImage(value, 0, 0); + + LAYER.layer_renew(); + GUI.zoom(); + }; + })(name, img); + img.src = data; + } + }; + + this.file_quicksave = function(){ + //save image data + var data_json = this.export_as_json(); + if(data_json.length > 5000000){ + POP.add({html: 'Sorry, image is too big, max 5 MB.'}); + POP.show('Error', ''); + return false; + } + localStorage.setItem('quicksave_data', data_json); + + //save settings + settings = { + color: COLOR, + active_tool: DRAW.active_tool, + zoom: GUI.ZOOM, + }; + settings = JSON.stringify(settings); + localStorage.setItem('quicksave_settings', settings); + }; + + this.file_quickload = function(){ + //load image data + var json = localStorage.getItem('quicksave_data'); + if(json == '' || json == null){ + //nothing was found + return false; + } + this.load_json(json); + GUI.zoom_auto(true); + + //load settings + var settings = localStorage.getItem('quicksave_settings'); + if(settings == '' || settings == null){ + //nothing was found + return false; + } + settings = JSON.parse(settings); + + //load color + COLOR = settings.color; + GUI.sync_colors(); + + //load active tool + GUI.action(settings.active_tool); + + //load zoom + GUI.zoom(settings.zoom, false); + }; + +} \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/file.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/file.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..100b4fc3ed64dbada58c7273cd4bb1c0359cef5e --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/file.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + file.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/gui.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/gui.js.js new file mode 100644 index 0000000000000000000000000000000000000000..18f9295b1ce5fdd79a32f1c1cfef6cd7f7c6c83b --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/gui.js.js @@ -0,0 +1,739 @@ +/* global EVENTS, HELPER, POP, DRAW, LAYER, EL, HELP, LANG */ +/* global WIDTH, HEIGHT, canvas_front, DRAW_TOOLS_CONFIG, canvas_grid, canvas_preview */ + +var GUI = new GUI_CLASS(); + +/** + * manages grapchic interface functionality: left/right sidebar actions + * + * @author ViliusL + */ +function GUI_CLASS() { + + /** + * preview mini window size on right sidebar + */ + this.PREVIEW_SIZE = {w: 148, h: 100}; + + /** + * last used menu id + */ + this.last_menu = ''; + + /** + * grid dimnesions config + */ + this.grid_size = [50, 50]; + + /** + * if grid is visible + */ + this.grid = false; + + /** + * true if using transparecy, false if using white background + */ + this.TRANSPARENCY = true; + + /** + * zoom level, original - 100%, can vary from 10% to 1000% + */ + this.ZOOM = 100; + + /** + * visible part center coordinates, when zoomed in + */ + this.zoom_center = [50, 50]; + + /** + * common image dimensions + */ + this.common_dimensions = [ + [640,480, '480p'], + [800,600, 'SVGA'], + [1024,768, 'XGA'], + [1280,720, 'hdtv, 720p'], + [1600,1200, 'UXGA'], + [1920,1080, 'Full HD, 1080p'], + [3840,2160, '4K UHD'], + [7680,4320, '8K UHD'], + ]; + + /** + * last color copy + */ + var COLOR_copy; + + this.draw_helpers = function () { + //left menu + var html = ''; + for (var i in DRAW_TOOLS_CONFIG) { + html += '' + "\n"; + } + html += '
' + "\n"; + } + document.getElementById("all_colors").innerHTML = html; + }; + + this.autodetect_dimensions = function(){ + var canvas_wrapper = document.querySelector('#canvas_wrapper'); + var page_w = canvas_wrapper.clientWidth; + var page_h = canvas_wrapper.clientHeight; + var auto_size = false; + + var save_resolution_cookie = HELPER.getCookie('save_resolution'); + if(save_resolution_cookie != ''){ + //load last saved resolution + save_resolution = 'Yes'; + var last_resolution = JSON.parse(save_resolution_cookie); + WIDTH = parseInt(last_resolution[0]); + HEIGHT = parseInt(last_resolution[1]); + } + else{ + //use largest possible + for(var i = this.common_dimensions.length-1; i >= 0; i--){ + if(this.common_dimensions[i][0] >page_w || this.common_dimensions[i][1] > page_h){ + //browser size is too small + continue; + } + WIDTH = this.common_dimensions[i][0]; + HEIGHT = this.common_dimensions[i][1]; + auto_size = true; + break; + } + + if(auto_size == false) { + //screen size is smaller then 400x300 + WIDTH = page_w - 5; + HEIGHT = page_h - 10; + if(page_w < 585){ + HEIGHT = HEIGHT - 15; + } + } + } + }; + + this.draw_background = function (canvas, W, H, gap, force) { + if (this.TRANSPARENCY == false && force == undefined) { + canvas.beginPath(); + canvas.rect(0, 0, W, H); + canvas.fillStyle = "#ffffff"; + canvas.fill(); + return false; + } + if (gap == undefined) + gap = 10; + var fill = true; + for (var i = 0; i < W; i = i + gap) { + if (i % (gap * 2) == 0) + fill = true; + else + fill = false; + for (var j = 0; j < H; j = j + gap) { + if (fill == true) { + canvas.fillStyle = '#eeeeee'; + canvas.fillRect(i, j, gap, gap); + fill = false; + } + else + fill = true; + } + } + }; + + this.draw_grid = function (gap_x, gap_y) { + if (this.grid == false) { + document.getElementById("canvas_grid").style.display = 'none'; + return false; + } + else { + document.getElementById("canvas_grid").style.display = ''; + canvas_grid.clearRect(0, 0, WIDTH, HEIGHT); + } + + //size + if (gap_x != undefined && gap_y != undefined) + this.grid_size = [gap_x, gap_y]; + else { + gap_x = this.grid_size[0]; + gap_y = this.grid_size[1]; + } + gap_x = parseInt(gap_x); + gap_y = parseInt(gap_y); + if (gap_x < 2) + gap_x = 2; + if (gap_y < 2) + gap_y = 2; + for (var i = gap_x; i < WIDTH; i = i + gap_x) { + if (gap_x == 0) + break; + if (i % (gap_x * 5) == 0) //main lines + canvas_grid.strokeStyle = '#222222'; + else { + EL.line_dashed(canvas_grid, i, 0, i, HEIGHT, 3, '#888888'); + continue; + } + canvas_grid.beginPath(); + canvas_grid.moveTo(0.5 + i, 0); + canvas_grid.lineTo(0.5 + i, HEIGHT); + canvas_grid.stroke(); + } + for (var i = gap_y; i < HEIGHT; i = i + gap_y) { + if (gap_y == 0) + break; + if (i % (gap_y * 5) == 0) //main lines + canvas_grid.strokeStyle = '#222222'; + else { + EL.line_dashed(canvas_grid, 0, i, WIDTH, i, 3, '#888888'); + continue; + } + canvas_grid.beginPath(); + canvas_grid.moveTo(0, 0.5 + i); + canvas_grid.lineTo(WIDTH, 0.5 + i); + canvas_grid.stroke(); + } + }; + this.redraw_preview = function () { + canvas_preview.beginPath(); + canvas_preview.rect(0, 0, GUI.PREVIEW_SIZE.w, GUI.PREVIEW_SIZE.h); + canvas_preview.fillStyle = "#ffffff"; + canvas_preview.fill(); + this.draw_background(canvas_preview, GUI.PREVIEW_SIZE.w, GUI.PREVIEW_SIZE.h, 5); + + //redraw preview area + canvas_preview.save(); + canvas_preview.scale(GUI.PREVIEW_SIZE.w / WIDTH, GUI.PREVIEW_SIZE.h / HEIGHT); + for(var i = LAYER.layers.length-1; i >=0; i--){ + if (LAYER.layers[i].visible == false) + continue; + canvas_preview.drawImage(document.getElementById(LAYER.layers[i].name), 0, 0, WIDTH, HEIGHT); + } + canvas_preview.restore(); + + //active zone + var canvas_wrapper = document.querySelector('#canvas_wrapper'); + var visible_w = canvas_wrapper.clientWidth / GUI.ZOOM * 100; + var visible_h = canvas_wrapper.clientHeight / GUI.ZOOM * 100; + + var mini_rect_w = GUI.PREVIEW_SIZE.w * visible_w / WIDTH; + var mini_rect_h = GUI.PREVIEW_SIZE.h * visible_h / HEIGHT; + + //xx = (GUI.zoom_center[0] * WIDTH / 100 - visible_w*GUI.zoom_center[0]/100) * GUI.ZOOM / 100; + if(EVENTS.mouse.valid == true){ + //using exact position + mini_rect_x = GUI.zoom_center[0] * GUI.PREVIEW_SIZE.w / 100 - mini_rect_w * GUI.zoom_center[0] / 100; + mini_rect_y = GUI.zoom_center[1] * GUI.PREVIEW_SIZE.h / 100 - mini_rect_h * GUI.zoom_center[1] / 100; + } + else{ + //using center + mini_rect_x = GUI.zoom_center[0] * GUI.PREVIEW_SIZE.w / 100 - mini_rect_w / 2; + mini_rect_y = GUI.zoom_center[1] * GUI.PREVIEW_SIZE.h / 100 - mini_rect_h / 2; + } + + //validate + mini_rect_x = Math.max(0, mini_rect_x); + mini_rect_y = Math.max(0, mini_rect_y); + mini_rect_w = Math.min(GUI.PREVIEW_SIZE.w-1, mini_rect_w); + mini_rect_h = Math.min(GUI.PREVIEW_SIZE.h-1, mini_rect_h); + if (mini_rect_x + mini_rect_w > GUI.PREVIEW_SIZE.w) + mini_rect_x = GUI.PREVIEW_SIZE.w - mini_rect_w ; + if (mini_rect_y + mini_rect_h > GUI.PREVIEW_SIZE.h) + mini_rect_y = GUI.PREVIEW_SIZE.h - mini_rect_h; + + if(mini_rect_x == 0 && mini_rect_y == 0 && mini_rect_w == GUI.PREVIEW_SIZE.w -1 && mini_rect_h == GUI.PREVIEW_SIZE.h -1){ + //everything is visible + return false; + } + + //draw selected area in preview canvas + canvas_preview.lineWidth = 1; + canvas_preview.beginPath(); + canvas_preview.rect(Math.round(mini_rect_x) + 0.5, Math.round(mini_rect_y) + 0.5, mini_rect_w, mini_rect_h); + canvas_preview.fillStyle = "rgba(0, 255, 0, 0.3)"; + canvas_preview.strokeStyle = "#00ff00"; + canvas_preview.fill(); + canvas_preview.stroke(); + return true; + }; + this.zoom = function (recalc, scroll) { + if (recalc != undefined) { + //zoom-in or zoom-out + if (recalc == 1 || recalc == -1) { + var step = 100; + if (this.ZOOM <= 110 && recalc < 0){ + step = 10; + } + if (this.ZOOM <= 90 && recalc > 0){ + step = 10; + } + this.ZOOM = this.ZOOM + recalc * step; + if (this.ZOOM > 100 && this.ZOOM < 200){ + this.ZOOM = 100; + } + } + else { + //zoom using exact value + this.ZOOM = parseInt(recalc); + } + this.ZOOM = Math.max(this.ZOOM, 10); + GUI.redraw_preview(); + } + document.getElementById("zoom_nr").value = this.ZOOM+'%'; + document.getElementById("zoom_range").value = this.ZOOM; + + //change scale and repaint + document.getElementById('canvas_back').style.width = Math.round(WIDTH * this.ZOOM / 100) + "px"; + document.getElementById('canvas_back').style.height = Math.round(HEIGHT * this.ZOOM / 100) + "px"; + for (var i in LAYER.layers) { + document.getElementById(LAYER.layers[i].name).style.width = Math.round(WIDTH * this.ZOOM / 100) + "px"; + document.getElementById(LAYER.layers[i].name).style.height = Math.round(HEIGHT * this.ZOOM / 100) + "px"; + } + document.getElementById('canvas_front').style.width = Math.round(WIDTH * this.ZOOM / 100) + "px"; + document.getElementById('canvas_front').style.height = Math.round(HEIGHT * this.ZOOM / 100) + "px"; + + document.getElementById('canvas_grid').style.width = Math.round(WIDTH * this.ZOOM / 100) + "px"; + document.getElementById('canvas_grid').style.height = Math.round(HEIGHT * this.ZOOM / 100) + "px"; + + //check main resize corners + if (this.ZOOM != 100) { + document.getElementById('resize-w').style.display = "none"; + document.getElementById('resize-h').style.display = "none"; + document.getElementById('resize-wh').style.display = "none"; + } + else { + document.getElementById('resize-w').style.display = "block"; + document.getElementById('resize-h').style.display = "block"; + document.getElementById('resize-wh').style.display = "block"; + } + + if (scroll != undefined){ + EVENTS.scroll_window(); + } + this.redraw_preview(); + return true; + }; + + this.zoom_auto = function(only_increase){ + var canvas_wrapper = document.querySelector('#canvas_wrapper'); + var page_w = canvas_wrapper.clientWidth; + var page_h = canvas_wrapper.clientHeight; + + var best_width = page_w / WIDTH * 100; + var best_height = page_h / HEIGHT * 100; + var best_zoom = Math.floor(Math.min(best_width, best_height)); + if(only_increase != undefined && best_zoom > 100){ + return false; + } + this.zoom(Math.min(best_width, best_height), true); + }; + + this.update_attribute = function (object, next_value) { + var max_value = 500; + for (var k in this.action_data().attributes) { + if (k != object.id) + continue; + if (this.action_data().attributes[k] === true || this.action_data().attributes[k] === false) { + //true / false + var value; + if (next_value == 0) + value = true; + else + value = false; + //save + this.action_data().attributes[k] = value; + this.show_action_attributes(); + } + else if (typeof this.action_data().attributes[k] == 'object') { + //select + + var selected = object.options[object.selectedIndex]; + var value = selected.getAttribute('data-value'); + + var key = k.replace("_values", ""); + this.action_data().attributes[key] = value; + } + else if (this.action_data().attributes[k][0] == '#') { + //color + var key = k.replace("_values", ""); + this.action_data().attributes[key] = object.value; + } + else { + //numbers + if (next_value != undefined) { + if (next_value > 0) { + if (parseInt(this.action_data().attributes[k]) == 0) + object.value = 1; + else if (parseInt(this.action_data().attributes[k]) == 1) + object.value = 5; + else if (parseInt(this.action_data().attributes[k]) == 5) + object.value = 10; + else + object.value = parseInt(this.action_data().attributes[k]) + next_value; + } + else if (next_value < 0) { + if (parseInt(this.action_data().attributes[k]) == 1) + object.value = 0; + else if (parseInt(this.action_data().attributes[k]) <= 5) + object.value = 1; + else if (parseInt(this.action_data().attributes[k]) <= 10) + object.value = 5; + else if (parseInt(this.action_data().attributes[k]) <= 20) + object.value = 10; + else + object.value = parseInt(this.action_data().attributes[k]) + next_value; + } + + if (object.value < 0) + object.value = 0; + if (object.value > max_value) + object.value = max_value; + } + else { + if (object.value.length == 0) + return false; + object.value = parseInt(object.value); + object.value = Math.abs(object.value); + if (object.value == 0 || isNaN(object.value) || value > max_value) + object.value = this.action_data().attributes[k]; + } + if (k == 'power' && object.value > 100) + object.value = 100; + + //save + this.action_data().attributes[k] = object.value; + + document.getElementById(k).value = object.value; + } + if (this.action_data().on_update != undefined){ + DRAW[this.action_data().on_update](object.value); + } + } + + //custom + if(DRAW.active_tool == 'erase'){ + var strict = this.action_data().attributes.strict; + var is_circle = GUI.action_data().attributes.circle; + + if(is_circle == false){ + //hide strict controlls + document.getElementById('strict').style.display = 'none'; + } + else{ + //show strict controlls + document.getElementById('strict').style.display = 'block'; + } + } + }; + + this.action = function (key) { + DRAW[key]('init', {valid: true}); + if (DRAW.active_tool == key) + return false; + + //change + if (DRAW.active_tool != '') + document.getElementById(DRAW.active_tool).className = ""; + DRAW.active_tool = key; + document.getElementById(key).className = "active trn"; + this.show_action_attributes(); + + return false; + }; + + this.action_data = function () { + for (var i in DRAW_TOOLS_CONFIG) { + if (DRAW_TOOLS_CONFIG[i].name == DRAW.active_tool) + return DRAW_TOOLS_CONFIG[i]; + } + }; + + /** + * used strings: + * "Fill", "Square", "Circle", "Radial", "Anti aliasing", "Circle", "Strict", "Burn" + */ + this.show_action_attributes = function () { + html = ''; + var step = 10; + for (var k in this.action_data().attributes) { + var title = k[0].toUpperCase() + k.slice(1); + title = title.replace("_", " "); + if (this.action_data().attributes[k + "_values"] != undefined) + continue; + if (this.action_data().attributes[k] === true || this.action_data().attributes[k] === false) { + //true / false + if (this.action_data().attributes[k] == true) + html += '
' + title + '
'; + else + html += '
' + title + '
'; + } + else if (typeof GUI.action_data().attributes[k] == 'object') { + //drop down select + html += ''; + } + else if (GUI.action_data().attributes[k][0] == '#') { + //color + html += ''; //table for 100% width + html += ''; + html += ''; + html += ''; + html += ''; + html += '
' + title + ':
'; + } + else { + //numbers + html += '
'; + html += ''; //table for 100% width + html += ''; + html += ''; + html += ''; + html += ''; + html += '
' + title + ':
'; + html += '
+
'; + html += '
-
'; + html += '
'; + } + } + document.getElementById("action_attributes").innerHTML = html; + + //retranslate + HELP.help_translate(LANG); + }; + + this.set_color = function (object) { + if (HELPER.chech_input_color_support('main_color') == true && object.id == 'main_color') + COLOR = object.value; + else + COLOR = HELPER.rgb2hex_all(object.style.backgroundColor); + COLOR_copy = COLOR; + + if (HELPER.chech_input_color_support('main_color') == true) + document.getElementById("main_color").value = COLOR; //supported + else + document.getElementById("main_color_alt").style.backgroundColor = COLOR; //not supported + + document.getElementById("color_hex").value = COLOR; + var colors = HELPER.hex2rgb(COLOR); + document.getElementById("rgb_r").value = colors.r; + document.getElementById("rgb_g").value = colors.g; + document.getElementById("rgb_b").value = colors.b; + }; + + this.set_color_manual = function (event) { + var object = event.target; + if (object.value.length == 6 && object.value[0] != '#') { + COLOR = '#' + object.value; + this.sync_colors(); + } + if (object.value.length == 7) { + COLOR = object.value; + this.sync_colors(); + } + else if (object.value.length > 7) + object.value = COLOR; + }; + + this.set_color_rgb = function (object, c) { + var colors = HELPER.hex2rgb(COLOR); + if (object.value.length > 3) { + object.value = colors[c]; + } + else if (object.value.length > 0) { + value = object.value; + value = parseInt(value); + if (isNaN(value) || value != object.value || value > 255 || value < 0) { + object.value = colors[c]; + return false; + } + COLOR = "#" + ("000000" + HELPER.rgbToHex(document.getElementById("rgb_r").value, document.getElementById("rgb_g").value, document.getElementById("rgb_b").value)).slice(-6); + ALPHA = document.getElementById("rgb_a").value; + document.getElementById("rgb_a").value = ALPHA; + this.sync_colors(); + } + }; + + this.sync_colors = function () { + document.getElementById("color_hex").value = COLOR; + + if (HELPER.chech_input_color_support('main_color') == true) + document.getElementById("main_color").value = COLOR; //supported + else + document.getElementById("main_color_alt").style.backgroundColor = COLOR; //not supported + + var colors = HELPER.hex2rgb(COLOR); + document.getElementById("rgb_r").value = colors.r; + document.getElementById("rgb_g").value = colors.g; + document.getElementById("rgb_b").value = colors.b; + }; + + this.toggle_color_select = function () { + if (POP.active == false) { + POP.add({ + title: 'Color:', + function: function () { + COLOR_copy = COLOR; + var html = ''; + html += ''; + html += ''; + html += ' '; + html += ' '; + html += ' '; + html += ''; + html += ''; + html += ' '; + html += ' '; + html += ' '; + html += ''; + html += '
Luminosity:0
Alpha:' + ALPHA + '
'; + return html; + } + }); + POP.show( + 'Select color', + undefined, + undefined, + this.toggle_color_select_onload + ); + } + else{ + POP.hide(); + } + }; + + this.change_lum = function (lumi) { + lumi = parseInt(lumi); + var c3 = HELPER.hex2rgb(COLOR_copy); + c3.r += lumi; + c3.g += lumi; + c3.b += lumi; + + if (c3.r < 0) + c3.r = 0; + if (c3.g < 0) + c3.g = 0; + if (c3.b < 0) + c3.b = 0; + if (c3.r > 255) + c3.r = 255; + if (c3.g > 255) + c3.g = 255; + if (c3.b > 255) + c3.b = 255; + + COLOR = "#" + ("000000" + HELPER.rgbToHex(c3.r, c3.g, c3.b)).slice(-6); + this.sync_colors(); + }; + + this.change_alpha = function (value) { + ALPHA = parseInt(value); + document.getElementById("rgb_a").value = ALPHA; + }; + + this.toggle_color_select_onload = function () { + var img = new Image(); + img.onload = function () { + document.getElementById("c_all").getContext("2d").drawImage(img, 0, 0); + document.getElementById("c_all").onmousedown = function (event) { + if (event.offsetX) { + mouse_x = event.offsetX; + mouse_y = event.offsetY; + } + else if (event.layerX) { + mouse_x = event.layerX; + mouse_y = event.layerY; + } + var c = document.getElementById("c_all").getContext("2d").getImageData(mouse_x, mouse_y, 1, 1).data; + COLOR = "#" + ("000000" + HELPER.rgbToHex(c[0], c[1], c[2])).slice(-6); + this.sync_colors(); + COLOR_copy = COLOR; + document.getElementById("lum_ranger").value = 0; + }; + }; + img.src = 'img/colorwheel.png'; + }; + + this.draw_selected_area = function (no_resize) { + if (DRAW.select_data == false) + return false; + //draw area + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + var x = DRAW.select_data.x; + var y = DRAW.select_data.y; + var w = DRAW.select_data.w; + var h = DRAW.select_data.h; + if (this.ZOOM != 100) { + x = Math.round(x); + y = Math.round(y); + w = Math.round(w); + h = Math.round(h); + } + + //fill + canvas_front.fillStyle = "rgba(0, 255, 0, 0.3)"; + canvas_front.fillRect(x, y, w, h); + if (this.ZOOM <= 100) { + //borders + canvas_front.strokeStyle = "rgba(0, 255, 0, 1)"; + canvas_front.lineWidth = 1; + canvas_front.strokeRect(x + 0.5, y + 0.5, w, h); + } + if (no_resize == true) + return true; + + //draw carners + square(x, y, 0, 0); + square(x + w, y, -1, 0); + square(x, y + h, 0, -1); + square(x + w, y + h, -1, -1); + + //draw centers + square(x + w / 2, y, 0, 0); + square(x, y + h / 2, 0, 0); + square(x + w / 2, y + h, 0, -1); + square(x + w, y + h / 2, -1, 0); + + function square(x, y, mx, my) { + var sr_size = Math.ceil(EVENTS.sr_size / GUI.ZOOM * 100); + x = Math.round(x); + y = Math.round(y); + canvas_front.beginPath(); + canvas_front.rect(x + mx * Math.round(sr_size), y + my * Math.round(sr_size), sr_size, sr_size); + canvas_front.fillStyle = "#0000ff"; + canvas_front.fill(); + } + }; + + this.toggle = function(query){ + document.querySelector(query).classList.toggle("active"); + }; +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/gui.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/gui.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..73810cc0a523ad2133eb46efc1bc7f3ff2c7496d --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/gui.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + gui.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/help.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/help.js.js new file mode 100644 index 0000000000000000000000000000000000000000..b4ce42026be1733541784887279bcb9e9b0261a7 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/help.js.js @@ -0,0 +1,66 @@ +/* global POP, HELPER */ +/* global VERSION */ + +var HELP = new HELP_CLASS(); + +/** + * manages help actions + * + * @author ViliusL + */ +function HELP_CLASS() { + + //shortcuts + this.help_shortcuts = function () { + POP.add({title: "F9", value: 'Quick save'}); + POP.add({title: "F10", value: 'Quick load'}); + POP.add({title: "S", value: 'Save'}); + POP.add({title: "T", value: 'Trim'}); + POP.add({title: "D", value: 'Duplicate layer'}); + POP.add({title: "Del", value: 'Delete selection'}); + POP.add({title: "F", value: 'Auto adjust colors'}); + POP.add({title: "G", value: 'Grid on/off'}); + POP.add({title: "L", value: 'Rotate left'}); + POP.add({title: "N", value: 'New layer'}); + POP.add({title: "R", value: 'Resize'}); + POP.add({title: "-", value: 'Zoom out'}); + POP.add({title: "+", value: 'Zoom in'}); + POP.add({title: "CTRL + Z", value: 'Undo'}); + POP.add({title: "CTRL + A", value: 'Select all'}); + POP.add({title: "CTRL + V", value: 'Paste'}); + POP.add({title: "Arrow keys", value: 'Move active layer'}); + POP.show('Keyboard Shortcuts', ''); + }; + //about + this.help_about = function () { + var email = 'www.viliusl@gmail.com'; + POP.add({title: "Name:", value: "miniPaint " + VERSION}); + POP.add({title: "Description:", value: 'Online image editor'}); + POP.add({title: "Author:", value: 'ViliusL'}); + POP.add({title: "Email:", html: '
' + email + ''}); + POP.add({title: "GitHub:", html: 'github.com/viliusle/miniPaint'}); + POP.show('About', ''); + }; + + //change language + this.help_translate = function (lang_code) { + + //default English emty translator + var dict_en = {}; + + //save cookie + if(lang_code != undefined && lang_code != LANG){ + HELPER.setCookie('language', lang_code); + } + + var dictionary_data = "dict_"+lang_code; + if(window[dictionary_data] != undefined || lang_code == 'en'){ + //translate + $('body').translate({lang: lang_code, t: window[dictionary_data]}); + LANG = lang_code; + } + else{ + console.log('Translate error, can not find dictionary: '+dictionary_data); + } + }; +} \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/help.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/help.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..6a7cd295b36a7391c65c2a596109af668158fe44 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/help.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + help.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/image.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/image.js.js new file mode 100644 index 0000000000000000000000000000000000000000..9b2ee2d3a18646dfe9b24f15284dd60ed8e8a4cf --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/image.js.js @@ -0,0 +1,1073 @@ +/* global MAIN, EVENTS, LAYER, POP, HELPER, TOOLS, DRAW, GUI, EDIT, FILE */ +/* global canvas_active, ImageFilters, WIDTH, HEIGHT, canvas_active, canvas_front */ + +var IMAGE = new IMAGE_CLASS(); + +/** + * manages image actions + * + * @author ViliusL + */ +function IMAGE_CLASS() { + + //information + this.image_information = function () { + var colors = this.unique_colors_count(canvas_active(true)); + colors = HELPER.number_format(colors, 0); + var pixels = WIDTH*HEIGHT; + pixels = HELPER.number_format(pixels, 0); + + POP.add({title: "Width:", value: WIDTH}); + POP.add({title: "Height:", value: HEIGHT}); + POP.add({title: "Pixels:", value: pixels}); + POP.add({title: "Unique colors:", value: colors}); + + //show general data + for (var i in FILE.file_info.general){ + POP.add({title: i + ":", value: FILE.file_info.general[i]}); + } + + //show exif data + var n = 0; + for (var i in FILE.file_info.exif){ + if(i == 'undefined') + continue; + if(n == 0) + POP.add({title: "==== EXIF ====", value: ''}); + POP.add({title: i + ":", value: FILE.file_info.exif[i]}); + n++; + } + + POP.show('Information', ''); + }; + + //size + this.image_size = function () { + POP.add({name: "width", title: "Width:", value: WIDTH, placeholder: WIDTH}); + POP.add({name: "height", title: "Height:", value: HEIGHT, placeholder: HEIGHT}); + POP.show('Attributes', [IMAGE, 'resize_custom']); + }; + + //trim + this.image_trim = function () { + EDIT.save_state(); + this.trim(); + }; + + //crop + this.image_crop = function () { + EDIT.save_state(); + if (DRAW.select_data == false) { + POP.add({html: 'Select area first'}); + POP.show('Error', ''); + } + else { + for (var i in LAYER.layers) { + var layer = document.getElementById(LAYER.layers[i].name).getContext("2d"); + + var tmp = layer.getImageData(DRAW.select_data.x, DRAW.select_data.y, DRAW.select_data.w, DRAW.select_data.h); + layer.clearRect(0, 0, WIDTH, HEIGHT); + layer.putImageData(tmp, 0, 0); + } + + //resize + EDIT.save_state(); + WIDTH = DRAW.select_data.w; + HEIGHT = DRAW.select_data.h; + LAYER.set_canvas_size(); + + DRAW.select_data = false; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + } + }; + + //resize + this.image_resize = function () { + this.resize_box(); + }; + + //rotate left + this.image_rotate_left = function () { + EDIT.save_state(); + this.rotate_resize_doc(270, WIDTH, HEIGHT); + this.rotate_layer({angle: 270}, canvas_active(), WIDTH, HEIGHT); + }; + + //rotate right + this.image_rotate_right = function () { + EDIT.save_state(); + this.rotate_resize_doc(90, WIDTH, HEIGHT); + this.rotate_layer({angle: 90}, canvas_active(), WIDTH, HEIGHT); + }; + + //rotate + this.image_rotate = function () { + POP.add({name: "angle", title: "Enter angle (0-360):", value: 0, range: [0, 360]}); + POP.add({name: "mode", title: "Area:", values: ['All', 'Visible']}); + POP.show( + 'Rotate', + function (response) { + EDIT.save_state(); + if(response.mode == 'All') + IMAGE.rotate_resize_doc(response.angle, WIDTH, HEIGHT); + IMAGE.rotate_layer(response, canvas_active(), WIDTH, HEIGHT); + }, + function (response, canvas_preview, w, h) { + IMAGE.rotate_layer(response, canvas_preview, w, h); + } + ); + }; + + //vertical flip + this.image_vflip = function () { + EDIT.save_state(); + var tempCanvas = document.createElement("canvas"); + var tempCtx = tempCanvas.getContext("2d"); + tempCanvas.width = WIDTH; + tempCanvas.height = HEIGHT; + tempCtx.drawImage(canvas_active(true), 0, 0, WIDTH, HEIGHT); + //flip + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().save(); + canvas_active().scale(-1, 1); + canvas_active().drawImage(tempCanvas, -WIDTH, 0); + canvas_active().restore(); + }; + + //horizontal flip + this.image_hflip = function () { + EDIT.save_state(); + var tempCanvas = document.createElement("canvas"); + var tempCtx = tempCanvas.getContext("2d"); + tempCanvas.width = WIDTH; + tempCanvas.height = HEIGHT; + tempCtx.drawImage(canvas_active(true), 0, 0, WIDTH, HEIGHT); + //flip + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().save(); + canvas_active().scale(1, -1); + canvas_active().drawImage(tempCanvas, 0, -HEIGHT); + canvas_active().restore(); + }; + + //color corrections + this.image_colors = function () { + POP.add({name: "param1", title: "Brightness:", value: "0", range: [-100, 100]}); + POP.add({name: "param2", title: "Contrast:", value: "0", range: [-100, 100]}); + POP.add({}); + POP.add({name: "param_red", title: "Red channel:", value: "0", range: [-255, 255]}); + POP.add({name: "param_green", title: "Green channel:", value: "0", range: [-255, 255]}); + POP.add({name: "param_blue", title: "Blue channel:", value: "0", range: [-255, 255]}); + POP.add({}); + POP.add({name: "param_h", title: "Hue:", value: "0", range: [-180, 180]}); + POP.add({name: "param_s", title: "Saturation:", value: "0", range: [-100, 100]}); + POP.add({name: "param_l", title: "Luminance:", value: "0", range: [-100, 100]}); + + POP.show( + 'Color corrections', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var param_red = parseInt(user_response.param_red); + var param_green = parseInt(user_response.param_green); + var param_blue = parseInt(user_response.param_blue); + var param_h = parseInt(user_response.param_h); + var param_s = parseInt(user_response.param_s); + var param_l = parseInt(user_response.param_l); + + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + //Brightness/Contrast + var filtered = ImageFilters.BrightnessContrastPhotoshop(imageData, param1, param2); + //RGB corrections + var filtered = ImageFilters.ColorTransformFilter(filtered, 1, 1, 1, 1, param_red, param_green, param_blue, 1); + //hue/saturation/luminance + var filtered = ImageFilters.HSLAdjustment(filtered, param_h, param_s, param_l); + canvas_active().putImageData(filtered, 0, 0); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + var param_red = parseInt(user_response.param_red); + var param_green = parseInt(user_response.param_green); + var param_blue = parseInt(user_response.param_blue); + var param_h = parseInt(user_response.param_h); + var param_s = parseInt(user_response.param_s); + var param_l = parseInt(user_response.param_l); + + var imageData = canvas_preview.getImageData(0, 0, w, h); + //Brightness/Contrast + var filtered = ImageFilters.BrightnessContrastPhotoshop(imageData, param1, param2); //add effect + //RGB corrections + var filtered = ImageFilters.ColorTransformFilter(filtered, 1, 1, 1, 1, param_red, param_green, param_blue, 1); + //hue/saturation/luminance + var filtered = ImageFilters.HSLAdjustment(filtered, param_h, param_s, param_l); + canvas_preview.putImageData(filtered, 0, 0); + } + ); + }; + + //auto adjust colors + this.image_auto_adjust = function () { + EDIT.save_state(); + this.auto_adjust(canvas_active(), WIDTH, HEIGHT); + }; + + //convert to grayscale + this.image_GrayScale = function () { + EDIT.save_state(); + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.GrayScale(imageData); //add effect + canvas_active().putImageData(filtered, 0, 0); + }; + + //enchance colors + this.image_decrease_colors = function () { + POP.add({name: "param1", title: "Colors:", value: "10", range: [1, 256]}); + POP.add({name: "param3", title: "Greyscale:", values: ["No", "Yes"], }); + POP.show( + 'Decrease colors', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + if (user_response.param3 == 'Yes') + param3 = true; + else + param3 = false; + + IMAGE.decrease_colors(canvas_active(true), canvas_active(true), WIDTH, HEIGHT, param1, param3); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + if (user_response.param3 == 'Yes') + param3 = true; + else + param3 = false; + + IMAGE.decrease_colors(canvas_active(true), document.getElementById("pop_post"), w, h, param1, param3); + } + ); + }; + + //negative + this.image_negative = function () { + EDIT.save_state(); + if (DRAW.select_data == false) + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + else + var imageData = canvas_active().getImageData(DRAW.select_data.x, DRAW.select_data.y, DRAW.select_data.w, DRAW.select_data.h); + var pixels = imageData.data; + for (var i = 0; i < pixels.length; i += 4) { + pixels[i] = 255 - pixels[i]; // red + pixels[i + 1] = 255 - pixels[i + 1]; // green + pixels[i + 2] = 255 - pixels[i + 2]; // blue + } + //save + if (DRAW.select_data == false) + canvas_active().putImageData(imageData, 0, 0); + else + canvas_active().putImageData(imageData, DRAW.select_data.x, DRAW.select_data.y); + }; + + //grid + this.image_grid = function () { + POP.add({name: "visible", title: "Visible:", value: "Yes", values: ["Yes", "No"]}); + POP.add({name: "gap_x", title: "Horizontal gap:", value: GUI.grid_size[0]}); + POP.add({name: "gap_y", title: "Vertical gap:", value: GUI.grid_size[1]}); + POP.show( + 'Grid', + function (response) { + if (response.visible == "Yes") { + GUI.grid = true; + gap_x = response.gap_x; + gap_y = response.gap_y; + GUI.draw_grid(gap_x, gap_y); + } + else { + GUI.grid = false; + GUI.draw_grid(); + } + } + ); + }; + + //histogram + this.image_histogram = function () { + this.histogram(); + }; + + this.resize_custom = function (user_response) { + EDIT.save_state(); + EVENTS.autosize = false; + if (user_response.width != WIDTH || user_response.height != HEIGHT) { + WIDTH = user_response.width; + HEIGHT = user_response.height; + LAYER.set_canvas_size(); + } + }; + + //prepare rotation - increase doc dimensions if needed + this.rotate_resize_doc = function (angle, w, h) { + var o = angle * Math.PI / 180; + var new_x = w * Math.abs(Math.cos(o)) + h * Math.abs(Math.sin(o)); + var new_y = w * Math.abs(Math.sin(o)) + h * Math.abs(Math.cos(o)); + new_x = Math.ceil(Math.round(new_x * 1000) / 1000); + new_y = Math.ceil(Math.round(new_y * 1000) / 1000); + + if (WIDTH != new_x || HEIGHT != new_y) { + EDIT.save_state(); + var dx = 0; + var dy = 0; + if (new_x > WIDTH) { + dx = Math.ceil(new_x - WIDTH) / 2; + WIDTH = new_x; + } + if (new_y > HEIGHT) { + dy = Math.ceil(new_y - HEIGHT) / 2; + HEIGHT = new_y; + } + LAYER.set_canvas_size(); + + var tmp = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().putImageData(tmp, dx, dy); + } + }; + + //rotate layer + this.rotate_layer = function (user_response, canvas, w, h) { + var TO_RADIANS = Math.PI / 180; + angle = user_response.angle; + mode = user_response.mode; + + var area_x = 0; + var area_y = 0; + var area_w = w; + var area_h = h; + + var dx = 0; + var dy = 0; + + if(mode == 'Visible'){ + //rotate only visible part + + var trim_info = this.trim_info(canvas.canvas); + area_x = trim_info.left; + area_y = trim_info.top; + area_w = w - trim_info.left - trim_info.right; + area_h = h - trim_info.top - trim_info.bottom; + + //calc how much dimensions will increase + var o = angle * Math.PI / 180; + var new_x = area_w * Math.abs(Math.cos(o)) + area_h * Math.abs(Math.sin(o)); + var new_y = area_w * Math.abs(Math.sin(o)) + area_h * Math.abs(Math.cos(o)); + new_x = Math.ceil(Math.round(new_x * 1000) / 1000); + new_y = Math.ceil(Math.round(new_y * 1000) / 1000); + if(new_x > area_w || new_y > area_h){ + if (new_x > area_w) { + dx = Math.ceil(new_x - area_w) / 2; + if(area_x > dx) + dx = 0; + } + if (new_y > area_h) { + dy = Math.ceil(new_y - area_h) / 2; + if(area_y > dy) + dy = 0; + } + if (w == WIDTH && h == HEIGHT){ + var tmp = canvas.getImageData(0, 0, w, h); + canvas.clearRect(0, 0, w, h); + canvas.putImageData(tmp, dx, dy); + } + } + + //recalc + var trim_info = this.trim_info(canvas.canvas); + area_x = trim_info.left; + area_y = trim_info.top; + area_w = w - trim_info.left - trim_info.right; + area_h = h - trim_info.top - trim_info.bottom; + } + + var tempCanvas = document.createElement("canvas"); + var tempCtx = tempCanvas.getContext("2d"); + tempCanvas.width = area_w; + tempCanvas.height = area_h; + var imageData = canvas.getImageData(area_x, area_y, area_w, area_h); + tempCtx.putImageData(imageData, 0, 0); + + //rotate + canvas.clearRect(area_x, area_y, area_w, area_h); + canvas.save(); + canvas.translate(area_x + Math.round(area_w / 2), area_y + Math.round(area_h / 2)); + canvas.rotate(angle * TO_RADIANS); + canvas.drawImage(tempCanvas, -Math.round(area_w / 2), -Math.round(area_h / 2)); + canvas.restore(); + if (w == WIDTH && h == HEIGHT){ + //if main canvas + GUI.zoom(); + } + }; + + this.resize_box = function () { + POP.add({name: "width", title: "Width (pixels):", value: '', placeholder: WIDTH}); + POP.add({name: "height", title: "Height (pixels):", value: '', placeholder: HEIGHT}); + POP.add({name: "width_percent", title: "Width (%):", value: '', placeholder: 100}); + POP.add({name: "height_percent", title: "Height (%):", value: '', placeholder: 100}); + POP.add({name: "mode", title: "Mode:", values: ["Resample - Hermite", "Basic", "HQX"]}); + POP.add({name: "preblur", title: "Pre-Blur:", values: ["Yes", "No"], value: "No"}); + POP.add({name: "sharpen", title: "Sharpen:", values: ["Yes", "No"], value: "No"}); + POP.show('Resize', [IMAGE, "resize_layer"]); + }; + + this.resize_layer = function (user_response) { + EDIT.save_state(); + var width = parseInt(user_response.width); + var height = parseInt(user_response.height); + var width_100 = parseInt(user_response.width_percent); + var height_100 = parseInt(user_response.height_percent); + var preblur = user_response.preblur; + var sharpen = user_response.sharpen; + if (isNaN(width) && isNaN(height) && isNaN(width_100) && isNaN(height_100)) + return false; + if (width == WIDTH && height == HEIGHT) + return false; + + //if dimension with percent provided + if (isNaN(width) && isNaN(height)) { + if (isNaN(width_100) == false) { + width = Math.round(WIDTH * width_100 / 100); + } + if (isNaN(height_100) == false) { + height = Math.round(HEIGHT * height_100 / 100); + } + } + + //if only 1 dimension was provided + if (isNaN(width) || isNaN(height)) { + var ratio = WIDTH/HEIGHT; + if (isNaN(width)) + width = Math.round(height * ratio); + if (isNaN(height)) + height = Math.round(width / ratio); + } + + //anti-artifacting? + if (preblur == 'Yes') { + var ratio_w = WIDTH / width; + var ratio_h = HEIGHT / height; + var ratio_avg = Math.max(ratio_w, ratio_h); + var power = ratio_avg * 0.3; + if (power > 0.6) { + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.GaussianBlur(imageData, power); //add effect + canvas_active().putImageData(filtered, 0, 0); + } + } + + //validate + if (user_response.mode == "Resample - Hermite" && (width > WIDTH || height > HEIGHT)){ + //scalling up - Hermite not supported + user_response.mode = "Resize"; + } + if (user_response.mode == "HQX" && (width < WIDTH && height < HEIGHT)){ + //scalling down - HQX not supported + user_response.mode = "Resample - Hermite"; + } + + var resize_type; + if (user_response.mode == "Resample - Hermite") { + //Hermite resample - max quality + resize_type = 'Hermite'; + + var HERMITE = new Hermite_class(); + HERMITE.resample_single(canvas_active(true), width, height); + + if (GUI.last_menu != 'layer_resize') { + WIDTH = width; + HEIGHT = height; + if (WIDTH < 1) + WIDTH = 1; + if (HEIGHT < 1) + HEIGHT = 1; + LAYER.set_canvas_size(); + } + GUI.zoom(); + } + else if(user_response.mode == "HQX") { + //HQX - 2, 3, 4 scale only, but amazing quality if there are only few colors + resize_type = 'HQX'; + + //find correct dimensions + var multiply = Math.max(width/WIDTH, height/HEIGHT); + multiply = Math.round(multiply); + if(multiply < 2) + multiply = 2; + if(multiply > 4) + multiply = 4; + + var image_data_resized = hqx(canvas_active(true), multiply); + + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + WIDTH = WIDTH * multiply; + HEIGHT = HEIGHT * multiply; + LAYER.set_canvas_size(); + canvas_active().putImageData(image_data_resized, 0, 0 ); + GUI.zoom(); + } + else { + //simple resize - max speed + resize_type = 'Default'; + tmp_data = document.createElement("canvas"); + tmp_data.width = WIDTH; + tmp_data.height = HEIGHT; + tmp_data.getContext("2d").drawImage(canvas_active(true), 0, 0); + + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + WIDTH = width; + HEIGHT = height; + LAYER.set_canvas_size(); + canvas_active().drawImage(tmp_data, 0, 0, width, height); + GUI.zoom(); + } + + //sharpen after? + if (sharpen == 'Yes') { + var imageData = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var filtered = ImageFilters.Sharpen(imageData, 1); //add effect + canvas_active().putImageData(filtered, 0, 0); + } + }; + + /** + * get canvas painted are coords + * + * @param {HtmlElement} canvas + * @param {boolean} trim_white + */ + this.trim_info = function (canvas, trim_white) { + var top = 0; + var left = 0; + var bottom = 0; + var right = 0; + var img = canvas.getContext("2d").getImageData(0, 0, canvas.width, canvas.height); + var imgData = img.data; + var empty = false; + if(trim_white == undefined) + trim_white = true; + //check top + main1: + for (var y = 0; y < img.height; y++) { + for (var x = 0; x < img.width; x++) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + if (trim_white == true && imgData[k] == 255 && imgData[k + 1] == 255 && imgData[k + 2] == 255) + continue; //white + break main1; + } + top++; + } + //check left + main2: + for (var x = 0; x < img.width; x++) { + for (var y = 0; y < img.height; y++) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + if (trim_white == true && imgData[k] == 255 && imgData[k + 1] == 255 && imgData[k + 2] == 255) + continue; //white + break main2; + } + left++; + } + //check bottom + main3: + for (var y = img.height - 1; y >= 0; y--) { + for (var x = img.width - 1; x >= 0; x--) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + if (trim_white == true && imgData[k] == 255 && imgData[k + 1] == 255 && imgData[k + 2] == 255) + continue; //white + break main3; + } + bottom++; + } + //check right + main4: + for (var x = img.width - 1; x >= 0; x--) { + for (var y = img.height - 1; y >= 0; y--) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + if (trim_white == true && imgData[k] == 255 && imgData[k + 1] == 255 && imgData[k + 2] == 255) + continue; //white + break main4; + } + right++; + } + + if(top == canvas.height && left == canvas.width){ + //canvas is empty + empty = true; + } + + return { + top: top, + left: left, + bottom: bottom, + right: right, + empty: empty, + }; + }; + + this.trim = function (layer, no_resize, include_white) { + var all_top = HEIGHT; + var all_left = WIDTH; + var all_bottom = HEIGHT; + var all_right = WIDTH; + for (var i in LAYER.layers) { + if (layer != undefined && LAYER.layers[i].name != layer) + continue; + + var top = 0; + var left = 0; + var bottom = 0; + var right = 0; + var img = document.getElementById(LAYER.layers[i].name).getContext("2d").getImageData(0, 0, WIDTH, HEIGHT); + var imgData = img.data; + //check top + main1: + for (var y = 0; y < img.height; y++) { + for (var x = 0; x < img.width; x++) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + if (include_white !== true && imgData[k] == 255 && imgData[k + 1] == 255 && imgData[k + 2] == 255) + continue; //white + break main1; + } + top++; + } + //check left + main2: + for (var x = 0; x < img.width; x++) { + for (var y = 0; y < img.height; y++) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + if (include_white !== true && imgData[k] == 255 && imgData[k + 1] == 255 && imgData[k + 2] == 255) + continue; //white + break main2; + } + left++; + } + //check bottom + main3: + for (var y = img.height - 1; y >= 0; y--) { + for (var x = img.width - 1; x >= 0; x--) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + if (include_white !== true && imgData[k] == 255 && imgData[k + 1] == 255 && imgData[k + 2] == 255) + continue; //white + break main3; + } + bottom++; + } + //check right + main4: + for (var x = img.width - 1; x >= 0; x--) { + for (var y = img.height - 1; y >= 0; y--) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + if (include_white !== true && imgData[k] == 255 && imgData[k + 1] == 255 && imgData[k + 2] == 255) + continue; //white + break main4; + } + right++; + } + all_top = Math.min(all_top, top); + all_left = Math.min(all_left, left); + all_bottom = Math.min(all_bottom, bottom); + all_right = Math.min(all_right, right); + } + //move to top-left corner + for (var i in LAYER.layers) { + if (layer != undefined && LAYER.layers[i].name != layer) + continue; + + tmp_data = document.getElementById(LAYER.layers[i].name).getContext("2d").getImageData(0, 0, WIDTH, HEIGHT); + document.getElementById(LAYER.layers[i].name).getContext("2d").clearRect(0, 0, WIDTH, HEIGHT); + document.getElementById(LAYER.layers[i].name).getContext("2d").putImageData(tmp_data, -all_left, -all_top); + var canvas_name = LAYER.layers[i].name; + } + //resize + if (no_resize != undefined) + return false; + if (layer != undefined) { + var W = Math.round(WIDTH - all_left - all_right); + var H = Math.round(HEIGHT - all_top - all_bottom); + + var imageData = document.getElementById(layer).getContext("2d").getImageData(0, 0, W, H); + document.getElementById(layer).width = W; + document.getElementById(layer).height = H; + document.getElementById(layer).getContext("2d").clearRect(0, 0, W, H); + document.getElementById(layer).getContext("2d").putImageData(imageData, 0, 0); + + return { + top: all_top, + left: all_left, + bottom: all_bottom, + right: all_right + }; + } + else { + WIDTH = WIDTH - all_left - all_right; + HEIGHT = HEIGHT - all_top - all_bottom; + if (WIDTH < 1) + WIDTH = 1; + if (HEIGHT < 1) + HEIGHT = 1; + LAYER.set_canvas_size(); + } + LAYER.update_info_block(); + }; + + this.decrease_colors = function (canvas_source, canvas_destination, W, H, colors, greyscale) { + var context = canvas_destination.getContext("2d"); + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var palette = []; + + //collect top colors + var block_size = 10; + var ctx = canvas_front; //use temp canvas + ctx.clearRect(0, 0, W, H); + ctx.drawImage(canvas_source, 0, 0, Math.ceil(canvas_source.width / block_size), Math.ceil(canvas_source.height / block_size)); //simple resize + var img_p = ctx.getImageData(0, 0, Math.ceil(canvas_source.width / block_size), Math.ceil(canvas_source.height / block_size)); + var imgData_p = img_p.data; + ctx.clearRect(0, 0, W, H); + + for (var i = 0; i < imgData_p.length; i += 4) { + if (imgData_p[i + 3] == 0) + continue; //transparent + var grey = Math.round(0.2126 * imgData_p[i] + 0.7152 * imgData_p[i + 1] + 0.0722 * imgData_p[i + 2]); + palette.push([imgData_p[i], imgData_p[i + 1], imgData_p[i + 2], grey]); + } + + //calculate weights + var grey_palette = []; + for (var i = 0; i < 256; i++) + grey_palette[i] = 0; + for (var i = 0; i < palette.length; i++) + grey_palette[palette[i][3]]++; + + //remove similar colors + for (var max = 10 * 3; max < 100 * 3; max = max + 10 * 3) { + if (palette.length <= colors) + break; + for (var i = 0; i < palette.length; i++) { + if (palette.length <= colors) + break; + var valid = true; + for (var j = 0; j < palette.length; j++) { + if (palette.length <= colors) + break; + if (i == j) + continue; + if (Math.abs(palette[i][0] - palette[j][0]) + Math.abs(palette[i][1] - palette[j][1]) + Math.abs(palette[i][2] - palette[j][2]) < max) { + if (grey_palette[palette[i][3]] > grey_palette[palette[j][3]]) { + //remove color + palette.splice(j, 1); + j--; + } + else { + valid = false; + break; + } + } + } + //remove color + if (valid == false) { + palette.splice(i, 1); + i--; + } + } + } + palette = palette.slice(0, colors); + + //change + var p_n = palette.length; + for (var j = 0; j < H; j++) { + for (var i = 0; i < W; i++) { + var k = ((j * (W * 4)) + (i * 4)); + if (imgData[k + 3] == 0) + continue; //transparent + + //find closest color + var index1 = 0; + var min = 999999; + var diff1; + for (var m = 0; m < p_n; m++) { + var diff = Math.abs(palette[m][0] - imgData[k]) + Math.abs(palette[m][1] - imgData[k + 1]) + Math.abs(palette[m][2] - imgData[k + 2]); + if (diff < min) { + min = diff; + index1 = m; + diff1 = diff; + } + } + + imgData[k] = palette[index1][0]; + imgData[k + 1] = palette[index1][1]; + imgData[k + 2] = palette[index1][2]; + + if (greyscale == true) { + var mid = Math.round(0.2126 * imgData[k] + 0.7152 * imgData[k + 1] + 0.0722 * imgData[k + 2]); + imgData[k] = mid; + imgData[k + 1] = mid; + imgData[k + 2] = mid; + } + } + } + canvas_destination.getContext("2d").putImageData(img, 0, 0); + }; + + //fixing white and black color balance + this.auto_adjust = function (context, W, H) { + //settings + var white = 240; //white color min + var black = 30; //black color max + var target_white = 1; //how much % white colors should take + var target_black = 0.5; //how much % black colors should take + var modify = 1.1; //color modify strength + var cycles_count = 10; //how much iteration to change colors + + document.body.style.cursor = "wait"; + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var n = 0; //pixels count without transparent + + //make sure we have white + var n_valid = 0; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + if ((imgData[i] + imgData[i + 1] + imgData[i + 2]) / 3 > white) + n_valid++; + n++; + } + target = target_white; + var n_fix_white = 0; + var done = false; + for (var j = 0; j < cycles_count; j++) { + if (n_valid * 100 / n >= target) + done = true; + if (done == true) + break; + n_fix_white++; + + //adjust + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + for (var c = 0; c < 3; c++) { + var x = i + c; + if (imgData[x] < 10) + continue; + //increase white + imgData[x] *= modify; + imgData[x] = Math.round(imgData[x]); + if (imgData[x] > 255) + imgData[x] = 255; + } + } + + //recheck + n_valid = 0; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + if ((imgData[i] + imgData[i + 1] + imgData[i + 2]) / 3 > white) + n_valid++; + } + } + + //make sure we have black + n_valid = 0; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + if ((imgData[i] + imgData[i + 1] + imgData[i + 2]) / 3 < black) + n_valid++; + } + target = target_black; + var n_fix_black = 0; + var done = false; + for (var j = 0; j < cycles_count; j++) { + if (n_valid * 100 / n >= target) + done = true; + if (done == true) + break; + n_fix_black++; + + //adjust + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + for (var c = 0; c < 3; c++) { + var x = i + c; + if (imgData[x] > 240) + continue; + //increase black + imgData[x] -= (255 - imgData[x]) * modify - (255 - imgData[x]); + imgData[x] = Math.round(imgData[x]); + } + } + + //recheck + n_valid = 0; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + if ((imgData[i] + imgData[i + 1] + imgData[i + 2]) / 3 < black) + n_valid++; + } + } + + //save + context.putImageData(img, 0, 0); + document.body.style.cursor = "auto"; + //log('Iterations: brighten='+n_fix_white+", darken="+n_fix_black); + }; + + this.histogram = function () { + POP.add({name: "param1", title: "Channel:", values: ["Gray", "Red", "Green", "Blue"], onchange: "IMAGE.histogram_onload()"}); + POP.add({title: 'Histogram:', function: function () { + var html = ''; + return html; + }}); + POP.add({title: "Total pixels:", value: ""}); + POP.add({title: "Average:", value: ""}); + POP.show( + 'Histogram', + undefined, + undefined, + this.histogram_onload + ); + }; + + this.histogram_onload = function () { + var img = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var imgData = img.data; + var channel_grey = document.getElementById("pop_data_param1_poptmp0"); + var channel_r = document.getElementById("pop_data_param1_poptmp1"); + var channel_g = document.getElementById("pop_data_param1_poptmp2"); + var channel_b = document.getElementById("pop_data_param1_poptmp3"); + + if (channel_grey.checked == true) + channel = 0; + else if (channel_r.checked == true) + channel = 1; + else if (channel_g.checked == true) + channel = 2; + else if (channel_b.checked == true) + channel = 3; + + var hist_data = [ [], [], [], [] ]; //grey, red, green, blue + var total = imgData.length / 4; + var sum = 0; + var grey; + + for (var i = 0; i < imgData.length; i += 4) { + //collect grey + grey = Math.round((imgData[i] + imgData[i + 1] + imgData[i + 2]) / 3); + sum = sum + imgData[i] + imgData[i + 1] + imgData[i + 2]; + if(hist_data[0][grey] == undefined) + hist_data[0][grey] = 1; + else + hist_data[0][grey]++; + + //collect colors + for(var c = 0; c < 3; c++) { + if(c+1 != channel) + continue; + if(hist_data[c+1][imgData[i+c]] == undefined) + hist_data[c+1][imgData[i+c]] = 1; + else + hist_data[c+1][imgData[i+c]]++; + } + } + + var c = document.getElementById("c_h").getContext("2d"); + c.rect(0, 0, 256, 100); + c.fillStyle = "#ffffff"; + c.fill(); + var opacity = 1; + + //draw histogram + for(var h in hist_data) { + for (var i = 0; i <= 255; i++) { + if(h != channel) + continue; + if (hist_data[h][i] == 0) + continue; + c.beginPath(); + + if(h == 0) + c.strokeStyle = "rgba(64, 64, 64, "+opacity*2+")"; + else if(h == 1) + c.strokeStyle = "rgba(255, 0, 0, "+opacity+")"; + else if(h == 2) + c.strokeStyle = "rgba(0, 255, 0, "+opacity+")"; + else if(h == 3) + c.strokeStyle = "rgba(0, 0, 255, "+opacity+")"; + + c.lineWidth = 1; + c.moveTo(i + 0.5, 100 + 0.5); + c.lineTo(i + 0.5, 100 - Math.round(hist_data[h][i] * 255 * 100 / total / 6) + 0.5); + c.stroke(); + } + } + + document.getElementById("pop_data_totalpixel").innerHTML = HELPER.number_format(total, 0); + if (total > 0) + average = Math.round(sum * 10 / total / 3) / 10; + else + average = '-'; + document.getElementById("pop_data_average").innerHTML = average; + }; + + this.unique_colors_count = function (canvas) { + var img = canvas.getContext("2d").getImageData(0, 0, canvas.width, canvas.height); + var imgData = img.data; + var colors = []; + var n = 0; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + var key = imgData[i] + "." + imgData[i + 1] + "." + imgData[i + 2]; + if (colors[key] == undefined) { + colors[key] = 1; + n++; + } + } + return n; + }; + this.zoom_in = function() { + GUI.zoom(+1, true); + }; + this.zoom_out = function() { + GUI.zoom(-1, true); + }; + this.zoom_original = function() { + GUI.zoom(100, true); + }; + this.zoom_auto = function() { + GUI.zoom_auto(); + }; +} \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/image.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/image.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ba8c17a0984e49d84091ab997d1d59a607a202b --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/image.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + image.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/layers.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/layers.js.js new file mode 100644 index 0000000000000000000000000000000000000000..1c5989b617bdbd79bb3a7b2f53b16b1deee21f3c --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/layers.js.js @@ -0,0 +1,729 @@ +/* global HELPER, POP, MAIN, EVENTS, LAYER, IMAGE, DRAW, EDIT, GUI */ +/* global WIDTH, HEIGHT, canvas_front, canvas_back */ + +var LAYER = new LAYER_CLASS(); + +/** + * layers class - manages layers + * + * @author ViliusL + */ +function LAYER_CLASS() { + + /** + * active layer index + */ + this.layer_active = 0; + + /** + * data layers array + */ + this.layers = []; + + /** + * latest layer index + */ + var layer_max_index = 0; + + //new layer + this.layer_new = function () { + EDIT.save_state(); + this.layer_add(); + }; + + //removes all layers + this.remove_all_layers = function(){ + //delete old layers + for (var i = LAYER.layers.length-1; i >= 0; i--) { + LAYER.layer_remove(i, true); + } + layer_max_index = 0; + this.layer_renew(); + }; + + //generate name for new layer + this.generate_layer_name = function(prefix){ + if(prefix == undefined) + prefix = 'Layer'; + + return prefix + ' #' + (layer_max_index); + }; + + //create layer + this.layer_add = function (name, data) { + layer_max_index++; + + //save selected area + var copy = false; + var last_layer = LAYER.layer_active; + if (DRAW.select_data != false && data == undefined) { + copy = document.createElement("canvas"); + copy.width = DRAW.select_data.w; + copy.height = DRAW.select_data.h; + copy.getContext("2d").drawImage(canvas_active(true), DRAW.select_data.x, DRAW.select_data.y, DRAW.select_data.w, DRAW.select_data.h, 0, 0, DRAW.select_data.w, DRAW.select_data.h); + } + + if (data == undefined) { + //empty layer + if (name == undefined) { + name = this.generate_layer_name(); + } + var new_layer = []; + new_layer.name = name; + new_layer.title = name; + new_layer.visible = true; + new_layer.opacity = 1; + LAYER.create_canvas(name); + this.layers.unshift(new_layer); + + //add selected data + if (DRAW.select_data != false) { + //copy user selected data to new layer + canvas_active().drawImage(copy, 0, 0); + + //clear selection + DRAW.select_data = false; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + + //switch back to old layer + LAYER.layer_active = last_layer; + } + } + else { + var img = new Image(); + if (data.substring(0, 4) == 'http') + img.crossOrigin = "Anonymous"; //data from other domain - turn on CORS + var _this = this; + + img.onload = function () { + //check size + var need_resize = false; + if (img.width > WIDTH || img.height > HEIGHT) { + if (img.width > WIDTH) + WIDTH = img.width; + if (img.height > HEIGHT) + HEIGHT = img.height; + LAYER.set_canvas_size(); + need_resize = true; + } + //remove initial empty layer + if (_this.layers.length == 1 && EVENTS.autosize == true) { + var trim_info = IMAGE.trim_info(document.getElementById(_this.layers[0].name)); + if (trim_info.empty == true) { + _this.layer_remove(0, true); + WIDTH = img.width; + HEIGHT = img.height; + LAYER.set_canvas_size(false); + } + } + + for (var i in _this.layers) { + if (_this.layers[i].name == name) { + name = _this.generate_layer_name(name); + } + } + LAYER.create_canvas(name); + _this.layers.unshift({ + name: name, + title: name, + visible: true, + opacity: 1 + }); + LAYER.layer_active = 0; + + document.getElementById(name).getContext("2d").globalAlpha = 1; + document.getElementById(name).getContext('2d').drawImage(img, 0, 0); + LAYER.layer_renew(); + if(_this.layers.length == 1 || need_resize == true) { + GUI.zoom_auto(true); + } + GUI.redraw_preview(); + }; + img.onerror = function (ex) { + POP.add({html: 'The image could not be loaded.

'}); + if (data.substring(0, 4) == 'http') + POP.add({title: "Reason:", value: 'Cross-origin resource sharing (CORS) not supported. Try to save image first.'}); + POP.show('Error', '.'); + }; + img.src = data; + } + LAYER.layer_active = 0; + document.getElementById(this.layers[LAYER.layer_active].name).getContext("2d").globalAlpha = 1; + this.layer_renew(); + }; + + this.layer_remove = function (i, force) { + if (this.layers.length == 1 && force == undefined){ + //only 1 layer left + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + return false; + } + element = document.getElementById(this.layers[i].name); + element.getContext("2d").clearRect(0, 0, WIDTH, HEIGHT); + element.parentNode.removeChild(element); + + this.layers.splice(i, 1); + if (LAYER.layer_active == i) + LAYER.layer_active = Math.max(0, LAYER.layer_active-1); + this.layer_renew(); + GUI.redraw_preview(); + }; + + //duplicate + this.layer_duplicate = function () { + EDIT.save_state(); + if (DRAW.select_data != false) { + //selection + EDIT.copy_to_clipboard(); + DRAW.select_data = false; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + EDIT.paste('menu'); + LAYER.layer_active = 0; + LAYER.layer_renew(); + } + else { + layer_max_index++; + //copy all layer + tmp_data = document.createElement("canvas"); + tmp_data.width = WIDTH; + tmp_data.height = HEIGHT; + tmp_data.getContext("2d").drawImage(canvas_active(true), 0, 0); + + //create + var new_name = this.generate_layer_name(); + LAYER.create_canvas(new_name); + this.layers.unshift({name: new_name, title: new_name, visible: true}); + this.layer_active = 0; + canvas_active().drawImage(tmp_data, 0, 0); + LAYER.layer_renew(); + } + }; + + //show / hide + this.layer_show_hide = function () { + LAYER.layer_visibility(LAYER.layer_active); + }; + + //crop + this.layer_crop = function () { + EDIT.save_state(); + if (DRAW.select_data == false) { + POP.add({html: 'Select area first'}); + POP.show('Error', ''); + } + else { + var layer = LAYER.canvas_active(); + + var tmp = layer.getImageData(DRAW.select_data.x, DRAW.select_data.y, DRAW.select_data.w, DRAW.select_data.h); + layer.clearRect(0, 0, WIDTH, HEIGHT); + layer.putImageData(tmp, 0, 0); + + DRAW.select_data = false; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + } + }; + + //delete + this.layer_delete = function () { + EDIT.save_state(); + LAYER.layer_remove(LAYER.layer_active); + }; + + //move up + this.layer_move_up = function () { + EDIT.save_state(); + LAYER.move_layer('up'); + }; + + //move down + this.layer_move_down = function () { + EDIT.save_state(); + LAYER.move_layer('down'); + }; + + //opacity + this.layer_opacity = function () { + LAYER.set_alpha(); + }; + + //rename + this.layer_rename = function () { + var _this = this; + POP.add({name: "param1", title: "Name:", value: this.layers[LAYER.layer_active].title}); + POP.show('Rename layer', + function (user_response) { + EDIT.save_state(); + var param1 = user_response.param1; + + _this.layers[LAYER.layer_active].title = param1; + LAYER.layer_renew(); + } + ); + }; + + //trim + this.layer_trim = function () { + EDIT.save_state(); + IMAGE.trim(this.layers[LAYER.layer_active].name, true); + }; + + //resize + this.layer_resize = function () { + IMAGE.resize_box(); + }; + + //clear + this.layer_clear = function () { + EDIT.save_state(); + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + }; + + //show differences + this.layer_differences = function () { + if (parseInt(LAYER.layer_active) + 1 >= this.layers.length) { + POP.add({html: 'This can not be last layer'}); + POP.show('Error', ''); + return false; + } + + POP.add({name: "param1", title: "Sensitivity:", value: "0", range: [0, 255]}); + POP.show( + 'Differences', + function (response) { + var param1 = parseInt(response.param1); + LAYER.calc_differences(param1); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + LAYER.calc_differences(param1, canvas_preview, w, h); + } + ); + }; + + //merge + this.layer_merge_down = function () { + var compositions = ["source-over", "source-in", "source-out", "source-atop", + "destination-over", "destination-in", "destination-out", "destination-atop", + "lighter", "darker", "copy", "xor"]; + + var blend_modes = ["normal", "multiply", "screen", "overlay", "darken", "lighten", + "color-dodge", "color-burn", "hard-light", "soft-light", "difference", + "exclusion", "hue", "saturation", "color", "luminosity"]; + + if (LAYER.layer_active + 1 >= this.layers.length) { + POP.add({html: 'This can not be last layer.'}); + POP.show('Error', ''); + return false; + } + POP.add({name: "param1", title: "Composition:", values: compositions}); + POP.add({name: "param2", title: "Blend:", values: blend_modes}); + POP.add({name: "param3", title: "Mode:", values: ["Composite", "Blend"]}); + POP.show( + 'Merge', + function (response) { + var param1 = response.param1; + var param2 = response.param2; + var param3 = response.param3; + + EDIT.save_state(); + + //copy + var tmp_data = document.createElement("canvas"); + tmp_data.width = WIDTH; + tmp_data.height = HEIGHT; + tmp_data.getContext("2d").drawImage(LAYER.canvas_active(true), 0, 0); + + //paste + LAYER.canvas_active().save(); + LAYER.canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + LAYER.canvas_active().drawImage(document.getElementById(LAYER.layers[LAYER.layer_active + 1].name), 0, 0); + + if (param3 == "Composite") + LAYER.canvas_active().globalCompositeOperation = param1; + else + LAYER.canvas_active().globalCompositeOperation = param2; + LAYER.canvas_active().drawImage(tmp_data, 0, 0); + LAYER.canvas_active().restore(); + + //remove next layer + LAYER.layer_remove(LAYER.layer_active + 1); + LAYER.layer_renew(); + }, + function (response, canvas_preview, w, h) { + var param1 = response.param1; + var param2 = response.param2; + var param3 = response.param3; + + //paste + canvas_preview.save(); + canvas_preview.clearRect(0, 0, w, h); + LAYER.layer_active++; + canvas_preview.drawImage(LAYER.canvas_active(true), 0, 0, WIDTH, HEIGHT, 0, 0, w, h); + LAYER.layer_active--; + + if (param3 == "Composite") + canvas_preview.globalCompositeOperation = param1; + else + canvas_preview.globalCompositeOperation = param2; + canvas_preview.drawImage(LAYER.canvas_active(true), 0, 0, WIDTH, HEIGHT, 0, 0, w, h); + canvas_preview.restore(); + } + ); + }; + + //flatten all + this.layer_flatten = function () { + EDIT.save_state(); + if (this.layers.length == 1) + return false; + LAYER.layer_active = 0; + tmp_data = document.createElement("canvas"); + tmp_data.width = WIDTH; + tmp_data.height = HEIGHT; + for (var i = this.layers.length-2; i >= 0; i--) { + //copy + LAYER.layer_active = i; + tmp_data.getContext("2d").clearRect(0, 0, WIDTH, HEIGHT); + tmp_data.getContext("2d").drawImage(canvas_active(true), 0, 0); + + //paste + LAYER.layer_active = this.layers.length-1; + canvas_active().drawImage(tmp_data, 0, 0); + } + + //delete layers + for (var i = this.layers.length-2; i >= 0; i--) { + LAYER.layer_active = i; + LAYER.layer_remove(LAYER.layer_active); + } + LAYER.layer_renew(); + }; + + this.create_canvas = function (canvas_id) { + var new_canvas = document.createElement('canvas'); + new_canvas.setAttribute('id', canvas_id); + + document.getElementById('canvas_more').appendChild(new_canvas); + new_canvas.width = WIDTH; + new_canvas.height = HEIGHT; + + new_canvas.getContext("2d").mozImageSmoothingEnabled = false; + new_canvas.getContext("2d").webkitImageSmoothingEnabled = false; + new_canvas.getContext("2d").msImageSmoothingEnabled = false; + new_canvas.getContext("2d").imageSmoothingEnabled = false; + + //sync zoom + new_canvas.style.width = Math.round(WIDTH * GUI.ZOOM / 100) + "px"; + new_canvas.style.height = Math.round(HEIGHT * GUI.ZOOM / 100) + "px"; + }; + this.move_layer = function (direction) { + if (this.layers.length < 2) + return false; + + var layer_from = this.layers[this.layer_active]; + var parent = document.getElementById('canvas_more'); + var content = document.getElementById(this.layers[this.layer_active].name); + + if (direction == 'up') { + if (this.layer_active == 0) + return false; + var layer_to = this.layers[this.layer_active - 1]; + + if(this.layer_active != 1) + parent.insertBefore(content, document.getElementById(this.layers[this.layer_active-2].name)); + else + parent.insertBefore(content, null); + + this.layer_active--; + } + else if(direction == 'down') { + if (this.layer_active == this.layers.length-1) + return false; + + parent.insertBefore(content, document.getElementById(this.layers[this.layer_active+1].name)); + + this.layer_active++; + } + //switch attribures + var layer_to = this.layers[this.layer_active]; + for(var i in layer_to){ + var tmp = layer_to[i]; + layer_to[i] = layer_from[i]; + layer_from[i] = tmp; + } + + this.layer_renew(); + GUI.zoom(); + return true; + }; + this.layer_visibility = function (i) { + if (this.layers[i].visible == true) { + this.layers[i].visible = false; + document.getElementById(this.layers[i].name).style.visibility = 'hidden'; + document.getElementById('layer_' + i).src = "img/yes-grey.png"; + } + else { + this.layers[i].visible = true; + document.getElementById(this.layers[i].name).style.visibility = 'visible'; + document.getElementById('layer_' + i).src = "img/yes.png"; + } + this.layer_renew(); + GUI.redraw_preview(); + }; + + this.layer_move_active = function (x, y) { + var distance = 10; + if (EVENTS.ctrl_pressed == true) + distance = 50; + if (EVENTS.shift_pressed == true) + distance = 1; + + //move + dx = x * distance; + dy = y * distance; + var tmp = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + canvas_active().putImageData(tmp, dx, dy); + }; + this.select_layer = function (i) { + if (LAYER.layer_active != i) { + LAYER.layer_active = parseInt(i); //select + this.layer_renew(); + } + LAYER.shake(i); + }; + this.layer_renew = function () { + var html = ''; + for (var i in this.layers) { + //create + if (LAYER.layer_active == i) + html += '
'; + else + html += '
'; + var title = this.layers[i].title; + html += '' + HELPER.escapeHtml(title) + ''; + html += ''; + //hide + if (this.layers[i].visible == true) + html += ''; + else + html += ''; + + html += '
'; + //show + document.getElementById('layers').innerHTML = html; + } + if(this.layers.length == 0) + document.getElementById('layers').innerHTML = ''; + }; + this.shake = function (i, nr) { + var step = 3; + var n = 10; + + if (nr == undefined) { + //begin + nr = 0; + canvas_front.drawImage(canvas_active(true), 0, 0); + } + var dx = step * (nr % 2); + if (dx == 0) + dx = -step; + + var element = document.getElementById('canvas_front'); + element.style.marginLeft = dx + "px"; + if (nr < n) + setTimeout(function () { + LAYER.shake(i, nr + 1); + }, 15); + else { + //finish shaking + element.style.marginLeft = "0px"; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + } + }; + this.update_info_block = function () { + //show size + document.getElementById('mouse_info_size').innerHTML = WIDTH + "x" + HEIGHT; + + //show mouse position + var x = 0; + var y = 0; + if (EVENTS.mouse != undefined) { + x = EVENTS.mouse.x; + y = EVENTS.mouse.y; + } + if(EVENTS.mouse.valid == true){ + document.getElementById('mouse_info_mouse').innerHTML = x + "x" + y; + } + else{ + //mouse is not inside canvas + document.getElementById('mouse_info_mouse').innerHTML = ''; + } + + //show selected area info + if (DRAW.select_data != false) { + document.getElementById('mouse_info_xy').innerHTML = DRAW.select_data.x + ", " + DRAW.select_data.y; + document.getElementById('mouse_info_area').innerHTML = DRAW.select_data.w + ", " + DRAW.select_data.h; + + document.getElementById('mouse_info_selected').style.display = 'block'; + } + else{ + document.getElementById('mouse_info_xy').innerHTML = ''; + document.getElementById('mouse_info_area').innerHTML = ''; + document.getElementById('mouse_info_selected').style.display = 'none'; + } + }; + this.set_canvas_size = function (repaint) { + var ratio = WIDTH/HEIGHT; + var W = Math.round(WIDTH); + var H = Math.round(W / ratio); + + this.resize_canvas("canvas_back"); + GUI.draw_background(canvas_back, WIDTH, HEIGHT); + this.resize_canvas("canvas_front", false); + this.resize_canvas("canvas_grid", true); + for (var i in this.layers) { + if (repaint === false) + this.resize_canvas(this.layers[i].name, false); + else + this.resize_canvas(this.layers[i].name, true); + } + + GUI.draw_grid(); + + document.getElementById('resize-w').style.marginLeft = W + "px"; + document.getElementById('resize-w').style.marginTop = Math.round(H / 2) + "px"; + document.getElementById('resize-h').style.marginLeft = Math.round(W / 2) + "px"; + document.getElementById('resize-h').style.marginTop = H + "px"; + document.getElementById('resize-wh').style.marginLeft = W + "px"; + document.getElementById('resize-wh').style.marginTop = H + "px"; + + this.update_info_block(); + GUI.redraw_preview(); + GUI.zoom(); + }; + this.resize_canvas = function (canvas_name, repaint) { + var ratio = WIDTH/HEIGHT; + var W = Math.round(WIDTH); + var H = Math.round(W / ratio); + var canvas = document.getElementById(canvas_name); + var ctx = canvas.getContext("2d"); + + if (repaint == false) { + canvas.width = W; + canvas.height = H; + } + else { + //save + var buffer = document.createElement('canvas'); + buffer.width = WIDTH; + buffer.height = HEIGHT; + buffer.getContext('2d').drawImage(canvas, 0, 0); + + canvas.width = W; + canvas.height = H; + + //restore + ctx.drawImage(buffer, 0, 0); + } + }; + this.set_alpha = function () { + var _this = this; + if (this.layers[LAYER.layer_active].opacity == undefined) + this.layers[LAYER.layer_active].opacity = 1; + POP.add({name: "param1", title: "Alpha:", value: this.layers[LAYER.layer_active].opacity, range: [0, 1], step: 0.01}); + POP.show( + 'Opacity', + function (user_response) { + var param1 = parseFloat(user_response.param1); + _this.layers[LAYER.layer_active].opacity = param1; + canvas_active().globalAlpha = param1; + + var img = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var imgData = img.data; + var new_alpha = 255 * param1; + if (new_alpha < 10) + new_alpha = 10; + canvas_active().clearRect(0, 0, WIDTH, HEIGHT); + for (var y = 0; y < img.height; y++) { + for (var x = 0; x < img.width; x++) { + var k = ((y * (img.width * 4)) + (x * 4)); + if (imgData[k + 3] > 0) + imgData[k + 3] = new_alpha; + } + } + canvas_active().putImageData(img, 0, 0); + + GUI.zoom(); + } + ); + }; + this.canvas_active = function (base) { + if (base == undefined) + return document.getElementById(LAYER.layers[LAYER.layer_active].name).getContext("2d"); + else + return document.getElementById(LAYER.layers[LAYER.layer_active].name); + }; + + this.calc_differences = function (sensitivity, canvas_preview, w, h) { + vlayer_active = parseInt(LAYER.layer_active); + //first layer + var img1 = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + var imgData1 = img1.data; + + //second layer + var context2 = document.getElementById(this.layers[vlayer_active + 1].name).getContext("2d"); + var img2 = context2.getImageData(0, 0, WIDTH, HEIGHT); + var imgData2 = img2.data; + + //result layer + if (canvas_preview == undefined) { + //add differences layer + LAYER.layer_add(); + canvas_active().rect(0, 0, WIDTH, HEIGHT); + canvas_active().fillStyle = "#ffffff"; + canvas_active().fill(); + var img3 = canvas_active().getImageData(0, 0, WIDTH, HEIGHT); + } + else { + //work on preview layer + var canvas_tmp = document.createElement("canvas"); + canvas_tmp.width = WIDTH; + canvas_tmp.height = HEIGHT; + var img3 = canvas_tmp.getContext("2d").getImageData(0, 0, WIDTH, HEIGHT); + } + var imgData3 = img3.data; + for (var xx = 0; xx < WIDTH; xx++) { + for (var yy = 0; yy < HEIGHT; yy++) { + var x = (xx + yy * WIDTH) * 4; + if (Math.abs(imgData1[x] - imgData2[x]) > sensitivity + || Math.abs(imgData1[x + 1] - imgData2[x + 1]) > sensitivity + || Math.abs(imgData1[x + 2] - imgData2[x + 2]) > sensitivity + || Math.abs(imgData1[x + 3] - imgData2[x + 3]) > sensitivity) { + imgData3[x] = 255; + imgData3[x + 1] = 0; + imgData3[x + 2] = 0; + imgData3[x + 3] = 255; + } + } + } + if (canvas_preview == undefined) + canvas_active().putImageData(img3, 0, 0); + else { + canvas_tmp.getContext("2d").rect(0, 0, WIDTH, HEIGHT); + canvas_tmp.getContext("2d").fillStyle = "#ffffff"; + canvas_tmp.getContext("2d").fill(); + canvas_tmp.getContext("2d").putImageData(img3, 0, 0); + canvas_preview.clearRect(0, 0, w, h); + + canvas_preview.save(); + canvas_preview.scale(w / WIDTH, h / HEIGHT); + canvas_preview.drawImage(canvas_tmp, 0, 0); + canvas_preview.restore(); + } + }; +} + +function canvas_active(base) { + return LAYER.canvas_active(base); +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/layers.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/layers.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..2c21e33cf8bd20da73a33e087cd34dcd64d21167 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/layers.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + layers.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/main.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/main.js.js new file mode 100644 index 0000000000000000000000000000000000000000..b135e4c658534b712767508b8fecbba9f83b7ddd --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/main.js.js @@ -0,0 +1,57 @@ +/* global HELPER, EVENTS, LAYER, POP, FILE, GUI, HELP, DRAW */ +/* global WIDTH, HEIGHT, canvas_back, canvas_grid, COLOR, ALPHA */ + +var MAIN = new MAIN_CLASS(); +document.onload = MAIN.init(true); + +/** + * main class - initialize app + * + * @author ViliusL + */ +function MAIN_CLASS() { + this.init = function (first_load) { + if (first_load === true) { + GUI.draw_helpers(); + GUI.autodetect_dimensions(); + POP.height_mini = Math.round(POP.width_mini * HEIGHT / WIDTH); + } + EVENTS.autosize = true; + FILE.file_info = { + general: [], + exif: [], + }; + DRAW.select_data = false; + + LAYER.remove_all_layers(); + LAYER.layers = []; + LAYER.layer_add(); + LAYER.set_canvas_size(); + GUI.draw_background(canvas_back, WIDTH, HEIGHT); + document.getElementById("canvas_preview").width = GUI.PREVIEW_SIZE.w; + document.getElementById("canvas_preview").height = GUI.PREVIEW_SIZE.h; + var color_rgb = HELPER.hex2rgb(COLOR); + document.getElementById("rgb_r").value = color_rgb.r; + document.getElementById("rgb_g").value = color_rgb.g; + document.getElementById("rgb_b").value = color_rgb.b; + document.getElementById("rgb_a").value = ALPHA; + GUI.redraw_preview(); + + //detect color support + if (HELPER.chech_input_color_support('main_color') == true) + document.getElementById("main_color").value = COLOR; //supported + else { + //not supported + document.getElementById("main_color").style.display = 'none'; + document.getElementById("main_color_alt").style.display = ''; + document.getElementById("main_color_alt").style.backgroundColor = COLOR; + } + canvas_grid.globalAlpha = 0.8; + + //init translation + var lang_cookie = HELPER.getCookie('language'); + if(lang_cookie != '') + LANG = lang_cookie.replace(/([^a-z]+)/gi, ''); + HELP.help_translate(LANG); + }; +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/main.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/main.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..2f5e2c2fe57d31a102aac50403621f2d43e76870 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/main.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + main.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/tools.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/tools.js.js new file mode 100644 index 0000000000000000000000000000000000000000..10eda1dc75aaa9e61068f68fdd712b921c17c585 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/tools.js.js @@ -0,0 +1,366 @@ +/* global POP, MAIN, SIFT, LAYER, IMAGE, EVENTS, HELPER, EDIT, GUI, EL */ +/* global WIDTH, HEIGHT, COLOR, canvas_active */ + +var TOOLS = new TOOLS_CLASS(); + +/** + * manages various tools + * + * @author ViliusL + */ +function TOOLS_CLASS() { + + //sprites + this.tools_sprites = function () { + POP.add({name: "param1", title: "Gap:", value: "50", values: ["0", "10", "50", "100"]}); + POP.add({name: "param2", title: "Width:", value: WIDTH}); + POP.show('Sprites', function (response) { + EDIT.save_state(); + var param1 = parseInt(response.param1); + var sprite_width = parseInt(response.param2); + TOOLS.generate_sprites(param1, sprite_width); + }); + }; + + //show keypoints + this.tools_keypoints = function () { + SIFT.generate_keypoints(canvas_active(true), true); + }; + + //create panorama + this.tools_panorama = function () { + SIFT.panorama(); + }; + + //extract alpha channel + this.tools_color2alpha = function () { + POP.add({name: "param1", title: "Color:", value: COLOR, type: 'color'}); + POP.show( + 'Color to alpha', + function (user_response) { + EDIT.save_state(); + var param1 = user_response.param1; + TOOLS.convert_color_to_alpha(canvas_active(), WIDTH, HEIGHT, param1); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = user_response.param1; + TOOLS.convert_color_to_alpha(canvas_preview, w, h, param1); + } + ); + }; + + //expands colors + this.tools_color_zoom = function () { + POP.add({name: "param1", title: "Zoom:", value: "2", range: [2, 20], }); + POP.add({name: "param2", title: "Center:", value: "128", range: [0, 255]}); + POP.show( + 'Color Zoom', + function (user_response) { + EDIT.save_state(); + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + + TOOLS.color_zoom(canvas_active(), WIDTH, HEIGHT, param1, param2); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param1 = parseInt(user_response.param1); + var param2 = parseInt(user_response.param2); + + TOOLS.color_zoom(canvas_preview, w, h, param1, param2); + } + ); + }; + + //recover alpha channel values + this.tools_restore_alpha = function () { + POP.add({name: "param", title: "Level:", value: "128", range: [0, 255]}); + POP.show( + 'Recover alpha', + function (user_response) { + EDIT.save_state(); + var param = parseInt(user_response.param); + + TOOLS.recover_alpha(canvas_active(), WIDTH, HEIGHT, param); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var param = parseInt(user_response.param); + + TOOLS.recover_alpha(canvas_preview, w, h, param); + } + ); + }; + + //adds borders + this.tools_borders = function () { + POP.add({name: "color", title: "Color:", value: COLOR, type: 'color'}); + POP.add({name: "shadow", title: "Shadow:", values: ["No", "Yes"]}); + POP.add({name: "size", title: "Size:", value: "5", range: [1, 100]}); + POP.show( + 'Borders', + function (user_response) { + EDIT.save_state(); + var color = user_response.color; + var size = Math.round(WIDTH / 100 * user_response.size); + var shadow = false; + if(user_response.shadow == 'Yes') + shadow = true; + + TOOLS.add_borders(canvas_active(), WIDTH, HEIGHT, color, size, shadow); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var color = user_response.color; + var size = Math.round(w / 100 * user_response.size); + var shadow = false; + if(user_response.shadow == 'Yes') + shadow = true; + + TOOLS.add_borders(canvas_preview, w, h, color, size, shadow); + } + ); + }; + + this.generate_sprites = function (gap, sprite_width) { + if (LAYER.layers.length == 1) + return false; + EDIT.save_state(); + LAYER.layer_add(); + var xx = 0; + var yy = 0; + var max_height = 0; + var tmp = document.createElement("canvas"); + tmp.setAttribute('id', "tmp_canvas"); + tmp.width = sprite_width; + tmp.height = HEIGHT; + var W = sprite_width; + var H = HEIGHT; + + //prepare width + WIDTH = sprite_width; + LAYER.set_canvas_size(); + + for(var i = LAYER.layers.length-1; i >=0; i--){ + if (i == LAYER.layer_active) + continue; //end + if (LAYER.layers[i].visible == false) + continue; + + tmp.getContext("2d").clearRect(0, 0, W, H); + tmp.getContext("2d").drawImage(document.getElementById(LAYER.layers[i].name), 0, 0); + + var trim_details = IMAGE.trim_info(tmp, false); //trim + if (WIDTH == trim_details.left) + continue; //empty layer + var width = W - trim_details.left - trim_details.right; + var height = H - trim_details.top - trim_details.bottom; + + if (xx + width > sprite_width) { + xx = 0; + yy += max_height; + max_height = 0; + } + if (yy % gap > 0 && gap > 0) + yy = yy - yy % gap + gap; + if (yy + height > HEIGHT) { + EVENTS.autosize = false; + HEIGHT = yy + height; + LAYER.set_canvas_size(); + } + + canvas_active().drawImage(tmp, trim_details.left, trim_details.top, width, height, xx, yy, width, height); + xx += width; + if (gap > 0) + xx = xx - xx % gap + gap; + + if (height > max_height) + max_height = height; + if (xx > sprite_width) { + xx = 0; + yy += max_height; + max_height = 0; + } + } + + //remove other layers + for(var i = LAYER.layers.length-1; i >= 0; i--) { + if (i == LAYER.layer_active) + continue; + LAYER.layer_remove(i, true); + } + LAYER.layer_renew(); + }; + + this.convert_color_to_alpha = function (context, W, H, color) { + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var back_color = HELPER.hex2rgb(color); + + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + + //calculate difference from requested color, and change alpha + var diff = Math.abs(imgData[i] - back_color.r) + Math.abs(imgData[i + 1] - back_color.g) + Math.abs(imgData[i + 2] - back_color.b) / 3; + imgData[i + 3] = Math.round(diff); + + //combining 2 layers in future will change colors, so make changes to get same colors in final image + //color_result = color_1 * (alpha_1 / 255) * (1 - A2 / 255) + color_2 * (alpha_2 / 255) + //color_2 = (color_result - color_1 * (alpha_1 / 255) * (1 - A2 / 255)) / (alpha_2 / 255) + imgData[i] = Math.ceil((imgData[i] - back_color.r * (1 - imgData[i + 3] / 255)) / (imgData[i + 3] / 255)); + imgData[i + 1] = Math.ceil((imgData[i + 1] - back_color.g * (1 - imgData[i + 3] / 255)) / (imgData[i + 3] / 255)); + imgData[i + 2] = Math.ceil((imgData[i + 2] - back_color.b * (1 - imgData[i + 3] / 255)) / (imgData[i + 3] / 255)); + } + context.putImageData(img, 0, 0); + }; + + this.color_zoom = function (context, W, H, zoom, center) { + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var grey; + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + + grey = Math.round(0.2126 * imgData[i] + 0.7152 * imgData[i + 1] + 0.0722 * imgData[i + 2]); + + for (var j = 0; j < 3; j++) { + var k = i + j; + if (grey > center) + imgData[k] += (imgData[k] - center) * zoom; + else if (grey < center) + imgData[k] -= (center - imgData[k]) * zoom; + if (imgData[k] < 0) + imgData[k] = 0; + if (imgData[k] > 255) + imgData[k] = 255; + } + } + context.putImageData(img, 0, 0); + }; + + this.recover_alpha = function (context, W, H, level) { + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var tmp; + level = parseInt(level); + for (var i = 0; i < imgData.length; i += 4) { + tmp = imgData[i + 3] + level; + if (tmp > 255) + tmp = 255; + imgData[i + 3] = tmp; + } + context.putImageData(img, 0, 0); + }; + + this.add_borders = function (context, W, H, color, size, shadow) { + context.save(); + if(shadow == true){ + //with shadow + context.beginPath(); + context.lineWidth = size; + context.strokeStyle = 'green'; + context.shadowColor = color; + context.shadowBlur = size/2; + context.rect(-size/2, -size/2, W+size, H+size); + context.stroke(); + context.stroke(); + context.stroke(); + context.stroke(); + context.stroke(); + } + else{ + context.strokeStyle = color; + context.lineWidth = size; + EL.rectangle(context, 0, 0, W-1, H-1, false, true); + } + context.restore(); + }; + + this.tools_replace_color = function(){ + POP.add({name: "target", title: "Target:", value: COLOR, type: 'color'}); + POP.add({name: "repalcement", title: "Replacement:", value: '#ff0000', type: 'color'}); + POP.add({name: "power", title: "Power:", value: "20", range: [0, 255]}); + POP.add({name: "alpha", title: "Alpha:", value: "255", range: [0, 255]}); + POP.add({name: "mode", title: "Mode:", values: ['Advanced', 'Simple']}); + POP.show( + 'Replace color', + function (user_response) { + EDIT.save_state(); + var target = user_response.target; + var repalcement = user_response.repalcement; + var power = user_response.power; + var alpha = user_response.alpha; + var advanced_mode = true; + if(user_response.mode == 'Simple') + advanced_mode = false; + + TOOLS.replace_color_process(canvas_active(), WIDTH, HEIGHT, target, repalcement, power, alpha, advanced_mode); + GUI.zoom(); + }, + function (user_response, canvas_preview, w, h) { + var target = user_response.target; + var repalcement = user_response.repalcement; + var power = user_response.power; + var alpha = user_response.alpha; + var advanced_mode = true; + if(user_response.mode == 'Simple') + advanced_mode = false; + + TOOLS.replace_color_process(canvas_preview, w, h, target, repalcement, power, alpha, advanced_mode); + } + ); + }; + + this.replace_color_process = function(context, W, H, target, replacement, power, alpha, advanced_mode){ + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + var target_rgb = HELPER.hex2rgb(target); + var target_hsl = HELPER.rgbToHsl(target_rgb.r, target_rgb.g, target_rgb.b); + var target_normalized = HELPER.hslToRgb(target_hsl[0], target_hsl[1], 0.5); + + var replacement_rgb = HELPER.hex2rgb(replacement); + var replacement_hsl = HELPER.rgbToHsl(replacement_rgb.r, replacement_rgb.g, replacement_rgb.b); + + for (var i = 0; i < imgData.length; i += 4) { + if (imgData[i + 3] == 0) + continue; //transparent + + if(advanced_mode == false){ + //simple replace + + //calculate difference from requested color, and change alpha + var diff = (Math.abs(imgData[i] - target_rgb.r) + Math.abs(imgData[i + 1] - target_rgb.g) + Math.abs(imgData[i + 2] - target_rgb.b) ) / 3; + if(diff > power) + continue; + + imgData[i] = replacement_rgb.r; + imgData[i + 1] = replacement_rgb.g; + imgData[i + 2] = replacement_rgb.b; + if(alpha < 255) + imgData[i + 3] = alpha; + } + else{ + //advanced replace using HSL + + var hsl = HELPER.rgbToHsl(imgData[i], imgData[i+1], imgData[i+2]); + var normalized = HELPER.hslToRgb(hsl[0], hsl[1], 0.5); + var diff = (Math.abs(normalized[0] - target_normalized[0]) + Math.abs(normalized[1] - target_normalized[1]) + Math.abs(normalized[2] - target_normalized[2]) ) / 3; + if(diff > power) + continue; + + //change to new color with exiting luminance + var replacement_normalized = HELPER.hslToRgb(replacement_hsl[0], replacement_hsl[1], hsl[2] * (replacement_hsl[2]*255) / 120); + + imgData[i] = replacement_normalized[0]; + imgData[i + 1] = replacement_normalized[1]; + imgData[i + 2] = replacement_normalized[2]; + if(alpha < 255) + imgData[i + 3] = alpha; + } + } + context.putImageData(img, 0, 0); + }; +} \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/tools.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/tools.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..802ea097107257d0ece56149a0313015b2d48559 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/js/tools.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + tools.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages.xml new file mode 100644 index 0000000000000000000000000000000000000000..1871e5792dcb63bbe0e717747cfd00d32eb25982 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + languages + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/de.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/de.js.js new file mode 100644 index 0000000000000000000000000000000000000000..869a5e6ae4145f695da2306c4ff8c5dddbf561f5 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/de.js.js @@ -0,0 +1,342 @@ +var dict_de = { + "2d": {"de": "2d"}, + "3D position:": {"de": "3d-position:"}, + "3D size:": {"de": "3d größe:"}, + "480p": {"de": "480p"}, + "About": {"de": "Etwa"}, + "Add new layer": {"de": "In neue ebene"}, + "Advanced": {"de": "Fortgeschritten"}, + "All": {"de": "Alle"}, + "Alpha": {"de": "Alpha"}, + "Alpha:": {"de": "Alpha:"}, + "Amount:": {"de": "Menge:"}, + "Anonymous": {"de": "Anonym"}, + "Anti aliasing": {"de": "Kantenglättung"}, + "Area:": {"de": "Bereich:"}, + "Arial": {"de": "Arial"}, + "Arrow": {"de": "Pfeil"}, + "Arrow keys": {"de": "Pfeiltasten"}, + "Attributes": {"de": "Attribute"}, + "Author:": {"de": "Autor:"}, + "Auto adjust colors": {"de": "Auto passen sie farben"}, + "Auto colorize": {"de": "Auto kolorieren"}, + "Average:": {"de": "Durchschnittlich:"}, + "BMP - Windows Bitmap": {"de": "Bmp - windows bitmap"}, + "Basic": {"de": "Basic"}, + "BezierCurve": {"de": "Bézierkurve"}, + "Big grains level:": {"de": "Große körner level:"}, + "Black and White": {"de": "Schwarz und weiß"}, + "Blend": {"de": "Mischung"}, + "Blend:": {"de": "Mischung:"}, + "Blue": {"de": "Blau"}, + "Blue channel:": {"de": "Blau-kanal:"}, + "Blur": {"de": "Verwischen"}, + "Blur Radius:": {"de": "Blur radius:"}, + "Blur tool": {"de": "Blur-werkzeug"}, + "Blur-Box": {"de": "Blur-box"}, + "Blur-Gaussian": {"de": "Blur-gaußsche"}, + "Blur-Stack": {"de": "Blur-stapel"}, + "Blur-Zoom": {"de": "Blur-zoom"}, + "Blur:": {"de": "Verwischen:"}, + "Bold": {"de": "Fett gedruckt"}, + "Bold Italic": {"de": "Fett kursiv"}, + "Borders": {"de": "Borders"}, + "Both": {"de": "Beide"}, + "Bottom-left": {"de": "Unten links"}, + "Bottom-right": {"de": "Rechts unten"}, + "Brightness:": {"de": "Helligkeit:"}, + "Brush": {"de": "Bürste"}, + "Bulge/Pinch": {"de": "Bulge / pinch"}, + "Bulge/Pinch tool": {"de": "Bulge / quetschwerkzeug"}, + "Burn": {"de": "Brennen"}, + "Burn/Dodge tool": {"de": "Brennen / abwedlers"}, + "Cancel": {"de": "Stornieren"}, + "Center x:": {"de": "Zentrum x:"}, + "Center y:": {"de": "Zentrum y:"}, + "Center:": {"de": "Center:"}, + "Channel:": {"de": "Kanal:"}, + "Chrome": {"de": "Chrom"}, + "Circle": {"de": "Kreis"}, + "Clear": {"de": "Klar"}, + "Clear selection": {"de": "Auswahl löschen"}, + "Clone tool": {"de": "Klonwerkzeug"}, + "Color #1:": {"de": "Farbe # 1:"}, + "Color #2:": {"de": "Farbe # 2:"}, + "Color Zoom": {"de": "Farbe zoom"}, + "Color adjust:": {"de": "Farbe anpassen:"}, + "Color corrections": {"de": "Farbkorrekturen"}, + "Color to Alpha": {"de": "Farbe zu alpha"}, + "Color to alpha": {"de": "Farbe zu alpha"}, + "Color:": {"de": "Farbe:"}, + "Colorize": {"de": "Kolorieren"}, + "Colors:": {"de": "Farben:"}, + "Composite": {"de": "Zusammengesetzt"}, + "Composition:": {"de": "Zusammensetzung:"}, + "Contrast:": {"de": "Kontrast:"}, + "Copy selection": {"de": "Kopieren auswahl"}, + "Courier": {"de": "Kurier"}, + "Crop": {"de": "Ernte"}, + "Crop Selection": {"de": "Crop auswahl"}, + "Curve": {"de": "Kurve"}, + "Custom": {"de": "Brauch"}, + "Cut selection": {"de": "Cut auswahl"}, + "Decrease color depth": {"de": "Farbtiefe verringern"}, + "Decrease colors": {"de": "Abnahme farben"}, + "Default": {"de": "Standard"}, + "Del": {"de": "Del"}, + "Delete": {"de": "Löschen"}, + "Delete selection": {"de": "Auswahl löschen"}, + "Denoise": {"de": "Denoise"}, + "Desaturate": {"de": "Desaturate"}, + "Desaturation:": {"de": "Entsättigung:"}, + "Description:": {"de": "Beschreibung:"}, + "Differences": {"de": "Unterschiede"}, + "Differences Down": {"de": "Unterschiede nach unten"}, + "Dither": {"de": "Aufregung"}, + "Dithering:": {"de": "Dithering:"}, + "Dot Screen": {"de": "Dot-bildschirm"}, + "Down": {"de": "Nach unten"}, + "Downloaded": {"de": "Heruntergeladene"}, + "Draw circle": {"de": "Zeichnen kreis"}, + "Draw letters": {"de": "Zeichnen sie buchstaben"}, + "Draw line": {"de": "Draw line"}, + "Draw rectangle": {"de": "Rechteck zeichnen"}, + "Duplicate": {"de": "Duplikat"}, + "Duplicate layer": {"de": "Ebene duplizieren"}, + "Dusts level:": {"de": "Dusts level:"}, + "Edge": {"de": "Rand"}, + "Edit": {"de": "Bearbeiten"}, + "Effects": {"de": "Auswirkungen"}, + "Email:": {"de": "Email:"}, + "Emboss": {"de": "Prägen"}, + "Empty data": {"de": "Leere daten"}, + "English": {"de": "Englisch"}, + "Enrich": {"de": "Bereichern"}, + "Enter angle (0-360):": {"de": "Geben sie winkel (0-360):"}, + "Erase": {"de": "Löschen"}, + "Error": {"de": "Fehler"}, + "Error:": {"de": "Fehler:"}, + "Español": {"de": "Español"}, + "Exponent:": {"de": "Exponent:"}, + "Exposure level:": {"de": "Belichtungsstufe:"}, + "Factor:": {"de": "Faktor:"}, + "File": {"de": "Datei"}, + "File name:": {"de": "Dateiname:"}, + "Fill": {"de": "Füllen"}, + "Fill style:": {"de": "Füllen sie stil:"}, + "Fit": {"de": "Passen"}, + "Fit window": {"de": "Fit fenster"}, + "Flatten Image": {"de": "Flatten bild"}, + "Flip": {"de": "Flip"}, + "Font family:": {"de": "Schriftfamilie:"}, + "Font style:": {"de": "Schriftstil:"}, + "French": {"de": "Französisch"}, + "Full HD, 1080p": {"de": "Full hd 1080p"}, + "Fur": {"de": "Pelz"}, + "Gap:": {"de": "Spalt:"}, + "German": {"de": "Deutsche"}, + "GitHub:": {"de": "Github:"}, + "Gradient": {"de": "Gradient"}, + "Gradient Radius:": {"de": "Gradient radius:"}, + "Grains": {"de": "Grains"}, + "Grains level:": {"de": "Grains level:"}, + "Gray": {"de": "Grau"}, + "GrayScale": {"de": "Graustufen"}, + "Green": {"de": "Grün"}, + "Green channel:": {"de": "Grün-kanal:"}, + "Greyscale:": {"de": "Graustufen:"}, + "Grid": {"de": "Gitter"}, + "Grid on/off": {"de": "Raster ein / aus"}, + "Grouped": {"de": "Gruppiert"}, + "H Radius:": {"de": "H radius:"}, + "Heatmap": {"de": "Heatmap"}, + "Height (%):": {"de": "Höhe (%):"}, + "Height (pixels):": {"de": "Höhe (pixel):"}, + "Height:": {"de": "Höhe:"}, + "Help": {"de": "Hilfe"}, + "Helvetica": {"de": "Helvetica"}, + "Hermite": {"de": "Hermite"}, + "Histogram": {"de": "Histogramm"}, + "Histogram:": {"de": "Histogramm:"}, + "Horizontal": {"de": "Horizontal"}, + "Horizontal gap:": {"de": "Horizontale lücke:"}, + "Hue:": {"de": "Farbton:"}, + "Image": {"de": "Image"}, + "Impact": {"de": "Einfluss"}, + "Information": {"de": "Information"}, + "Italiano": {"de": "Italiano"}, + "Italic": {"de": "Kursiv"}, + "JPG - JPG/JPEG Format": {"de": "Jpg - jpg / jpeg-format"}, + "JPG Compression": {"de": "Jpg kompression"}, + "JSON - Full layers data": {"de": "Json - volle schichten daten"}, + "Japanese": {"de": "Japanisch"}, + "Key-points": {"de": "Key-punkte"}, + "Keyboard Shortcuts": {"de": "Tastatürkürzel"}, + "Korean": {"de": "Koreanisch"}, + "Language": {"de": "Sprache"}, + "Last modified": {"de": "Zuletzt bearbeitet"}, + "Layer": {"de": "Schicht"}, + "Layers": {"de": "Lagen"}, + "Left": {"de": "Links"}, + "Level:": {"de": "Ebene:"}, + "Levels:": {"de": "Stufen:"}, + "Lietuvių": {"de": "Lietuvių"}, + "Light leak:": {"de": "Licht leck:"}, + "Limit:": {"de": "Grenze:"}, + "Luminance:": {"de": "Luminanz:"}, + "Luminosity:": {"de": "Helligkeit:"}, + "Magic Wand Tool": {"de": "Zauberstab werkzeug"}, + "Merge": {"de": "Verschmelzen"}, + "Merge Down": {"de": "Nach unten zusammenfassen"}, + "Mode:": {"de": "Modus:"}, + "Mosaic": {"de": "Mosaik"}, + "Mouse:": {"de": "Maus:"}, + "Move": {"de": "Bewegung"}, + "Move active layer": {"de": "Bewegen aktive schicht"}, + "Move down": {"de": "Sich abwärts bewegen"}, + "Move up": {"de": "Aufrücken"}, + "Multi-line": {"de": "Multi-line"}, + "Name:": {"de": "Name:"}, + "Negative": {"de": "Negativ"}, + "New": {"de": "Neu"}, + "New file...": {"de": "Neue datei ..."}, + "New layer": {"de": "Neue schicht"}, + "No": {"de": "Nein"}, + "Normal": {"de": "Normal"}, + "Notice": {"de": "Beachten"}, + "Notice:": {"de": "Beachten:"}, + "Oil": {"de": "öl"}, + "Ok": {"de": "Ok"}, + "Online image editor": {"de": "Online bildeditor"}, + "Opacity": {"de": "Opazität"}, + "Open": {"de": "öffnen"}, + "Original size": {"de": "Originalgröße"}, + "PNG - Portable Network Graphics": {"de": "Png - portable network graphics"}, + "Paste": {"de": "Paste"}, + "Paste selection": {"de": "Paste auswahl"}, + "Pencil": {"de": "Bleistift"}, + "Perspective": {"de": "Perspektive"}, + "Pick Color": {"de": "Wählen sie farbe"}, + "Pixels:": {"de": "Pixel:"}, + "Portuguese": {"de": "Portugiesisch"}, + "Power:": {"de": "Power:"}, + "Pre-Blur:": {"de": "Pre-unschärfe:"}, + "Preview": {"de": "Vorschau"}, + "Print": {"de": "Drucken"}, + "Quality (jpeg):": {"de": "Qualität (jpeg):"}, + "Quality:": {"de": "Qualität:"}, + "Quick load": {"de": "Schnell laden"}, + "Quick save": {"de": "Schnellspeichern"}, + "Radial": {"de": "Radial"}, + "Radius:": {"de": "Radius:"}, + "Range:": {"de": "Angebot:"}, + "Reason:": {"de": "Grund:"}, + "Recover alpha": {"de": "Recover alpha"}, + "Red": {"de": "Rot"}, + "Red channel:": {"de": "Red-kanal:"}, + "Rename": {"de": "Umbenennen"}, + "Rename layer": {"de": "Umbenennen schicht"}, + "Replace Color": {"de": "Farbe ersetzen"}, + "Replace color": {"de": "Farbe ersetzen"}, + "Replacement:": {"de": "Ersatz:"}, + "Resample - Hermite": {"de": "Resampling - hermite"}, + "Reset zoom level": {"de": "Reset-zoomstufe"}, + "Resize": {"de": "ändern sie die größe"}, + "Resolution:": {"de": "Lösung:"}, + "Restore alpha": {"de": "Wiederherstellen alpha"}, + "Right": {"de": "Recht"}, + "Rotate": {"de": "Drehen"}, + "Rotate left": {"de": "Nach links drehen"}, + "Rotation": {"de": "Drehung"}, + "Russian": {"de": "Russisch"}, + "Saturation:": {"de": "Sättigung:"}, + "Save": {"de": "Sparen"}, + "Save as": {"de": "Speichern als"}, + "Save as type:": {"de": "Speichern unter:"}, + "Save layers:": {"de": "Speichern sie schichten:"}, + "Save resolution:": {"de": "Speichern auflösung:"}, + "Select all": {"de": "Alles auswählen"}, + "Select area first": {"de": "Wählen sie einen bereich zuerst"}, + "Select area tool": {"de": "Wählen sie einen bereich werkzeug"}, + "Select color": {"de": "Wählen sie die farbe"}, + "Select object tool": {"de": "Objektauswahl-werkzeug"}, + "Selected": {"de": "Ausgewählt"}, + "Sensitivity:": {"de": "Empfindlichkeit:"}, + "Sepia": {"de": "Sepia"}, + "Shaded": {"de": "Beschattet"}, + "Shadow blur:": {"de": "Schatten verschwimmen:"}, + "Shadow color:": {"de": "Schattenfarbe:"}, + "Shadow:": {"de": "Schatten:"}, + "Sharpen": {"de": "Schärfen"}, + "Sharpen tool": {"de": "Schärfen werkzeug"}, + "Sharpen:": {"de": "Schärfen:"}, + "Show / Hide": {"de": "Anzeigen ausblenden"}, + "Simple": {"de": "Einfach"}, + "Size": {"de": "Größe"}, + "Size:": {"de": "Größe:"}, + "Sketchy": {"de": "Skizzenhaft"}, + "Solarize": {"de": "Solarisation"}, + "Sorry": {"de": "Es tut uns leid"}, + "Sorry, image is too big, max 5 MB.": {"de": "Sorry, bild ist zu groß, max 5 mb."}, + "Source is empty, right click on image first.": {"de": "Quelle leer ist, nach rechts auf das bild klicken zuerst."}, + "Sprites": {"de": "Sprites"}, + "Square": {"de": "Platz"}, + "Strength:": {"de": "Stärke:"}, + "Strict": {"de": "Streng"}, + "Stroke": {"de": "Schlaganfall"}, + "Stroke size:": {"de": "Stroke größe:"}, + "Target:": {"de": "Ziel:"}, + "Text": {"de": "Text"}, + "Text:": {"de": "Text:"}, + "The image could not be loaded.": {"de": "Das bild konnte nicht geladen werden."}, + "This can not be last layer": {"de": "Dies kann nicht letzte schicht sein"}, + "This can not be last layer.": {"de": "Dies kann nicht letzte schicht sein."}, + "Tilt Shift": {"de": "Tilt-shift"}, + "Times New Roman": {"de": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"de": "Zum einfügen aus der zwischenablage, verwenden sie strg-v."}, + "Tools": {"de": "Werkzeuge"}, + "Top-left": {"de": "Oben links"}, + "Top-right": {"de": "Oben rechts"}, + "Total pixels:": {"de": "Gesamtpixelanzahl:"}, + "Translate error, can not find dictionary:": {"de": "übersetzen fehler kann nicht wörterbuch zu finden:"}, + "Transparency #1:": {"de": "Transparenz # 1:"}, + "Transparency #2:": {"de": "Transparenz # 2:"}, + "Transparent:": {"de": "Transparent:"}, + "Trim": {"de": "Trimmen"}, + "Trim:": {"de": "Trimmen:"}, + "Turkish": {"de": "Türkisch"}, + "Undo": {"de": "Rückgängig machen"}, + "Unique colors:": {"de": "Einzigartige farben:"}, + "Up": {"de": "Oben"}, + "V Radius:": {"de": "V radius:"}, + "Verdana": {"de": "Verdana"}, + "Vertical": {"de": "Vertikal"}, + "Vertical gap:": {"de": "Vertikale lücke:"}, + "Vibrance": {"de": "Vibrance"}, + "Vignette": {"de": "Vignette"}, + "Vignette amount:": {"de": "Vignette betrag:"}, + "Vignette size:": {"de": "Vignette größe:"}, + "ViliusL": {"de": "Viliusl"}, + "Vintage": {"de": "Jahrgang"}, + "Visible": {"de": "Sichtbar"}, + "Visible:": {"de": "Sichtbar:"}, + "WEBP - Weppy File Format": {"de": "Webp - weppy dateiformat"}, + "Website": {"de": "Webseite"}, + "Width (%):": {"de": "Breite (%):"}, + "Width (pixels):": {"de": "Breite (pixel):"}, + "Width:": {"de": "Breite:"}, + "Wrong file type, must be image or json.": {"de": "Falsche dateityp, muss das bild oder json sein."}, + "X end:": {"de": "X-ende:"}, + "X start:": {"de": "X start:"}, + "Y end:": {"de": "Y ende:"}, + "Y start:": {"de": "Y start:"}, + "Yes": {"de": "Ja"}, + "Your browser does not support this format.": {"de": "Ihr browser unterstützt dieses format nicht."}, + "Your browser doesn't support canvas.": {"de": "Ihr browser unterstützt keine leinwand."}, + "Zoom": {"de": "Zoom"}, + "Zoom In": {"de": "Hineinzoomen"}, + "Zoom Out": {"de": "Rauszoomen"}, + "Zoom in": {"de": "Hineinzoomen"}, + "Zoom out": {"de": "Rauszoomen"}, + "Zoom:": {"de": "Zoom:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/de.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/de.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..7bde64d3228fce2823722d9894e82e1017bd3ac3 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/de.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + de.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/empty.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/empty.js.js new file mode 100644 index 0000000000000000000000000000000000000000..a22934cb6d25066c262a27d6b08942e1761a019d --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/empty.js.js @@ -0,0 +1,335 @@ +var dict_lt = { + "2d": {"lt": ""}, + "3D position:": {"lt": ""}, + "3D size:": {"lt": ""}, + "480p": {"lt": ""}, + "About": {"lt": ""}, + "Add new layer": {"lt": ""}, + "Advanced": {"lt": ""}, + "All": {"lt": ""}, + "Alpha": {"lt": ""}, + "Alpha:": {"lt": ""}, + "Amount:": {"lt": ""}, + "Anonymous": {"lt": ""}, + "Anti aliasing": {"lt": ""}, + "Area:": {"lt": ""}, + "Arial": {"lt": ""}, + "Arrow": {"lt": ""}, + "Arrow keys": {"lt": ""}, + "Attributes": {"lt": ""}, + "Author:": {"lt": ""}, + "Auto adjust colors": {"lt": ""}, + "Auto colorize": {"lt": ""}, + "Average:": {"lt": ""}, + "BMP - Windows Bitmap": {"lt": ""}, + "Basic": {"lt": ""}, + "BezierCurve": {"lt": ""}, + "Big grains level:": {"lt": ""}, + "Black and White": {"lt": ""}, + "Blend": {"lt": ""}, + "Blend:": {"lt": ""}, + "Blue": {"lt": ""}, + "Blue channel:": {"lt": ""}, + "Blur": {"lt": ""}, + "Blur Radius:": {"lt": ""}, + "Blur tool": {"lt": ""}, + "Blur-Box": {"lt": ""}, + "Blur-Gaussian": {"lt": ""}, + "Blur-Stack": {"lt": ""}, + "Blur-Zoom": {"lt": ""}, + "Blur:": {"lt": ""}, + "Bold": {"lt": ""}, + "Bold Italic": {"lt": ""}, + "Borders": {"lt": ""}, + "Both": {"lt": ""}, + "Bottom-left": {"lt": ""}, + "Bottom-right": {"lt": ""}, + "Brightness:": {"lt": ""}, + "Brush": {"lt": ""}, + "Bulge/Pinch": {"lt": ""}, + "Bulge/Pinch tool": {"lt": ""}, + "Burn": {"lt": ""}, + "Burn/Dodge tool": {"lt": ""}, + "Cancel": {"lt": ""}, + "Center x:": {"lt": ""}, + "Center y:": {"lt": ""}, + "Center:": {"lt": ""}, + "Channel:": {"lt": ""}, + "Chrome": {"lt": ""}, + "Circle": {"lt": ""}, + "Clear": {"lt": ""}, + "Clear selection": {"lt": ""}, + "Clone tool": {"lt": ""}, + "Color #1:": {"lt": ""}, + "Color #2:": {"lt": ""}, + "Color Zoom": {"lt": ""}, + "Color adjust:": {"lt": ""}, + "Color corrections": {"lt": ""}, + "Color to Alpha": {"lt": ""}, + "Color to alpha": {"lt": ""}, + "Color:": {"lt": ""}, + "Colorize": {"lt": ""}, + "Colors:": {"lt": ""}, + "Composite": {"lt": ""}, + "Composition:": {"lt": ""}, + "Contrast:": {"lt": ""}, + "Copy selection": {"lt": ""}, + "Courier": {"lt": ""}, + "Crop": {"lt": ""}, + "Crop Selection": {"lt": ""}, + "Curve": {"lt": ""}, + "Custom": {"lt": ""}, + "Cut selection": {"lt": ""}, + "Decrease color depth": {"lt": ""}, + "Decrease colors": {"lt": ""}, + "Default": {"lt": ""}, + "Del": {"lt": ""}, + "Delete": {"lt": ""}, + "Delete selection": {"lt": ""}, + "Denoise": {"lt": ""}, + "Desaturate": {"lt": ""}, + "Desaturation:": {"lt": ""}, + "Description:": {"lt": ""}, + "Differences": {"lt": ""}, + "Differences Down": {"lt": ""}, + "Dither": {"lt": ""}, + "Dithering:": {"lt": ""}, + "Dot Screen": {"lt": ""}, + "Down": {"lt": ""}, + "Downloaded": {"lt": ""}, + "Draw circle": {"lt": ""}, + "Draw letters": {"lt": ""}, + "Draw line": {"lt": ""}, + "Draw rectangle": {"lt": ""}, + "Duplicate": {"lt": ""}, + "Duplicate layer": {"lt": ""}, + "Dusts level:": {"lt": ""}, + "Edge": {"lt": ""}, + "Edit": {"lt": ""}, + "Effects": {"lt": ""}, + "Email:": {"lt": ""}, + "Emboss": {"lt": ""}, + "Empty data": {"lt": ""}, + "English": {"lt": ""}, + "Enrich": {"lt": ""}, + "Enter angle (0-360):": {"lt": ""}, + "Erase": {"lt": ""}, + "Error": {"lt": ""}, + "Error:": {"lt": ""}, + "Español": {"lt": ""}, + "Exponent:": {"lt": ""}, + "Exposure level:": {"lt": ""}, + "Factor:": {"lt": ""}, + "File": {"lt": ""}, + "File name:": {"lt": ""}, + "Fill": {"lt": ""}, + "Fill style:": {"lt": ""}, + "Fit": {"lt": ""}, + "Fit window": {"lt": ""}, + "Flatten Image": {"lt": ""}, + "Flip": {"lt": ""}, + "Font family:": {"lt": ""}, + "Font style:": {"lt": ""}, + "Full HD, 1080p": {"lt": ""}, + "Fur": {"lt": ""}, + "Gap:": {"lt": ""}, + "GitHub:": {"lt": ""}, + "Gradient": {"lt": ""}, + "Gradient Radius:": {"lt": ""}, + "Grains": {"lt": ""}, + "Grains level:": {"lt": ""}, + "Gray": {"lt": ""}, + "GrayScale": {"lt": ""}, + "Green": {"lt": ""}, + "Green channel:": {"lt": ""}, + "Greyscale:": {"lt": ""}, + "Grid": {"lt": ""}, + "Grid on/off": {"lt": ""}, + "Grouped": {"lt": ""}, + "H Radius:": {"lt": ""}, + "Heatmap": {"lt": ""}, + "Height (%):": {"lt": ""}, + "Height (pixels):": {"lt": ""}, + "Height:": {"lt": ""}, + "Help": {"lt": ""}, + "Helvetica": {"lt": ""}, + "Hermite": {"lt": ""}, + "Histogram": {"lt": ""}, + "Histogram:": {"lt": ""}, + "Horizontal": {"lt": ""}, + "Horizontal gap:": {"lt": ""}, + "Hue:": {"lt": ""}, + "Image": {"lt": ""}, + "Impact": {"lt": ""}, + "Information": {"lt": ""}, + "Italiano": {"lt": ""}, + "Italic": {"lt": ""}, + "JPG - JPG/JPEG Format": {"lt": ""}, + "JPG Compression": {"lt": ""}, + "JSON - Full layers data": {"lt": ""}, + "Key-points": {"lt": ""}, + "Keyboard Shortcuts": {"lt": ""}, + "Language": {"lt": ""}, + "Last modified": {"lt": ""}, + "Layer": {"lt": ""}, + "Layers": {"lt": ""}, + "Left": {"lt": ""}, + "Level:": {"lt": ""}, + "Levels:": {"lt": ""}, + "Lietuvių": {"lt": ""}, + "Light leak:": {"lt": ""}, + "Limit:": {"lt": ""}, + "Luminance:": {"lt": ""}, + "Luminosity:": {"lt": ""}, + "Magic Wand Tool": {"lt": ""}, + "Merge": {"lt": ""}, + "Merge Down": {"lt": ""}, + "Mode:": {"lt": ""}, + "Mosaic": {"lt": ""}, + "Mouse:": {"lt": ""}, + "Move": {"lt": ""}, + "Move active layer": {"lt": ""}, + "Move down": {"lt": ""}, + "Move up": {"lt": ""}, + "Multi-line": {"lt": ""}, + "Name:": {"lt": ""}, + "Negative": {"lt": ""}, + "New": {"lt": ""}, + "New file...": {"lt": ""}, + "New layer": {"lt": ""}, + "No": {"lt": ""}, + "Normal": {"lt": ""}, + "Notice": {"lt": ""}, + "Notice:": {"lt": ""}, + "Oil": {"lt": ""}, + "Ok": {"lt": ""}, + "Online image editor": {"lt": ""}, + "Opacity": {"lt": ""}, + "Open": {"lt": ""}, + "Original size": {"lt": ""}, + "PNG - Portable Network Graphics": {"lt": ""}, + "Paste": {"lt": ""}, + "Paste selection": {"lt": ""}, + "Pencil": {"lt": ""}, + "Perspective": {"lt": ""}, + "Pick Color": {"lt": ""}, + "Pixels:": {"lt": ""}, + "Power:": {"lt": ""}, + "Pre-Blur:": {"lt": ""}, + "Preview": {"lt": ""}, + "Print": {"lt": ""}, + "Quality (jpeg):": {"lt": ""}, + "Quality:": {"lt": ""}, + "Quick load": {"lt": ""}, + "Quick save": {"lt": ""}, + "Radial": {"lt": ""}, + "Radius:": {"lt": ""}, + "Range:": {"lt": ""}, + "Reason:": {"lt": ""}, + "Recover alpha": {"lt": ""}, + "Red": {"lt": ""}, + "Red channel:": {"lt": ""}, + "Rename": {"lt": ""}, + "Rename layer": {"lt": ""}, + "Replace Color": {"lt": ""}, + "Replace color": {"lt": ""}, + "Replacement:": {"lt": ""}, + "Resample - Hermite": {"lt": ""}, + "Reset zoom level": {"lt": ""}, + "Resize": {"lt": ""}, + "Resolution:": {"lt": ""}, + "Restore alpha": {"lt": ""}, + "Right": {"lt": ""}, + "Rotate": {"lt": ""}, + "Rotate left": {"lt": ""}, + "Rotation": {"lt": ""}, + "Saturation:": {"lt": ""}, + "Save": {"lt": ""}, + "Save as": {"lt": ""}, + "Save as type:": {"lt": ""}, + "Save layers:": {"lt": ""}, + "Save resolution:": {"lt": ""}, + "Select all": {"lt": ""}, + "Select area first": {"lt": ""}, + "Select area tool": {"lt": ""}, + "Select color": {"lt": ""}, + "Select object tool": {"lt": ""}, + "Selected": {"lt": ""}, + "Sensitivity:": {"lt": ""}, + "Sepia": {"lt": ""}, + "Shaded": {"lt": ""}, + "Shadow blur:": {"lt": ""}, + "Shadow color:": {"lt": ""}, + "Shadow:": {"lt": ""}, + "Sharpen": {"lt": ""}, + "Sharpen tool": {"lt": ""}, + "Sharpen:": {"lt": ""}, + "Show / Hide": {"lt": ""}, + "Simple": {"lt": ""}, + "Size": {"lt": ""}, + "Size:": {"lt": ""}, + "Sketchy": {"lt": ""}, + "Solarize": {"lt": ""}, + "Sorry": {"lt": ""}, + "Sorry, image is too big, max 5 MB.": {"lt": ""}, + "Source is empty, right click on image first.": {"lt": ""}, + "Sprites": {"lt": ""}, + "Square": {"lt": ""}, + "Strength:": {"lt": ""}, + "Strict": {"lt": ""}, + "Stroke": {"lt": ""}, + "Stroke size:": {"lt": ""}, + "Target:": {"lt": ""}, + "Text": {"lt": ""}, + "Text:": {"lt": ""}, + "The image could not be loaded.": {"lt": ""}, + "This can not be last layer": {"lt": ""}, + "This can not be last layer.": {"lt": ""}, + "Tilt Shift": {"lt": ""}, + "Times New Roman": {"lt": ""}, + "To paste from clipboard, use Ctrl-V.": {"lt": ""}, + "Tools": {"lt": ""}, + "Top-left": {"lt": ""}, + "Top-right": {"lt": ""}, + "Total pixels:": {"lt": ""}, + "Translate error, can not find dictionary:": {"lt": ""}, + "Transparency #1:": {"lt": ""}, + "Transparency #2:": {"lt": ""}, + "Transparent:": {"lt": ""}, + "Trim": {"lt": ""}, + "Trim:": {"lt": ""}, + "Undo": {"lt": ""}, + "Unique colors:": {"lt": ""}, + "Up": {"lt": ""}, + "V Radius:": {"lt": ""}, + "Verdana": {"lt": ""}, + "Vertical": {"lt": ""}, + "Vertical gap:": {"lt": ""}, + "Vibrance": {"lt": ""}, + "Vignette": {"lt": ""}, + "Vignette amount:": {"lt": ""}, + "Vignette size:": {"lt": ""}, + "ViliusL": {"lt": ""}, + "Vintage": {"lt": ""}, + "Visible": {"lt": ""}, + "Visible:": {"lt": ""}, + "WEBP - Weppy File Format": {"lt": ""}, + "Website": {"lt": ""}, + "Width (%):": {"lt": ""}, + "Width (pixels):": {"lt": ""}, + "Width:": {"lt": ""}, + "Wrong file type, must be image or json.": {"lt": ""}, + "X end:": {"lt": ""}, + "X start:": {"lt": ""}, + "Y end:": {"lt": ""}, + "Y start:": {"lt": ""}, + "Yes": {"lt": ""}, + "Your browser does not support this format.": {"lt": ""}, + "Your browser doesn't support canvas.": {"lt": ""}, + "Zoom": {"lt": ""}, + "Zoom In": {"lt": ""}, + "Zoom Out": {"lt": ""}, + "Zoom in": {"lt": ""}, + "Zoom out": {"lt": ""}, + "Zoom:": {"lt": ""}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/empty.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/empty.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..2afc808ddfdd53731d48d822322f495957390582 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/empty.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + empty.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/es.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/es.js.js new file mode 100644 index 0000000000000000000000000000000000000000..cbcaee31d9e0a260cbf6aa77043cfc42e015c851 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/es.js.js @@ -0,0 +1,342 @@ +var dict_es = { + "2d": {"es": "2d"}, + "3D position:": {"es": "Posición 3d:"}, + "3D size:": {"es": "3d tamaño:"}, + "480p": {"es": "480p"}, + "About": {"es": "Acerca de"}, + "Add new layer": {"es": "Añadir nueva capa"}, + "Advanced": {"es": "Avanzado"}, + "All": {"es": "Todas"}, + "Alpha": {"es": "Alfa"}, + "Alpha:": {"es": "Alfa:"}, + "Amount:": {"es": "Cantidad:"}, + "Anonymous": {"es": "Anónimo"}, + "Anti aliasing": {"es": "Submuestreo"}, + "Area:": {"es": "Zona:"}, + "Arial": {"es": "Arial"}, + "Arrow": {"es": "Flecha"}, + "Arrow keys": {"es": "Teclas de flecha"}, + "Attributes": {"es": "Atributos"}, + "Author:": {"es": "Autor:"}, + "Auto adjust colors": {"es": "Ajuste automático de colores"}, + "Auto colorize": {"es": "Colorear auto"}, + "Average:": {"es": "Promedio:"}, + "BMP - Windows Bitmap": {"es": "Bmp - ventanas de mapa de bits"}, + "Basic": {"es": "Basic"}, + "BezierCurve": {"es": "Curva de bézier"}, + "Big grains level:": {"es": "Granos grandes de nivel:"}, + "Black and White": {"es": "En blanco y negro"}, + "Blend": {"es": "Mezcla"}, + "Blend:": {"es": "Mezcla:"}, + "Blue": {"es": "Azul"}, + "Blue channel:": {"es": "Canal azul:"}, + "Blur": {"es": "Difuminar"}, + "Blur Radius:": {"es": "Radio de desenfoque:"}, + "Blur tool": {"es": "Herramienta de desenfoque"}, + "Blur-Box": {"es": "Falta de definición de la caja"}, + "Blur-Gaussian": {"es": "Desenfoque gaussiano"}, + "Blur-Stack": {"es": "Blur-pila"}, + "Blur-Zoom": {"es": "Blur-zoom"}, + "Blur:": {"es": "Difuminar:"}, + "Bold": {"es": "Negrita"}, + "Bold Italic": {"es": "Negrita cursiva"}, + "Borders": {"es": "Fronteras"}, + "Both": {"es": "Ambos"}, + "Bottom-left": {"es": "Abajo a la izquierda"}, + "Bottom-right": {"es": "Abajo a la derecha"}, + "Brightness:": {"es": "Brillo:"}, + "Brush": {"es": "Cepillo"}, + "Bulge/Pinch": {"es": "Abultamiento / pizca"}, + "Bulge/Pinch tool": {"es": "Abultamiento herramienta / pizca"}, + "Burn": {"es": "Quemar"}, + "Burn/Dodge tool": {"es": "Burn herramienta / esquivar"}, + "Cancel": {"es": "Cancelar"}, + "Center x:": {"es": "Centro de x:"}, + "Center y:": {"es": "Centro y:"}, + "Center:": {"es": "Centrar:"}, + "Channel:": {"es": "Canal:"}, + "Chrome": {"es": "Cromo"}, + "Circle": {"es": "Circulo"}, + "Clear": {"es": "Claro"}, + "Clear selection": {"es": "Selección clara"}, + "Clone tool": {"es": "Herramienta de clonación"}, + "Color #1:": {"es": "Color # 1:"}, + "Color #2:": {"es": "Color # 2:"}, + "Color Zoom": {"es": "Zoom de color"}, + "Color adjust:": {"es": "Ajuste de color:"}, + "Color corrections": {"es": "Correcciones de color"}, + "Color to Alpha": {"es": "Color a alfa"}, + "Color to alpha": {"es": "Color a alfa"}, + "Color:": {"es": "Color:"}, + "Colorize": {"es": "Colorear"}, + "Colors:": {"es": "Colores:"}, + "Composite": {"es": "Compuesto"}, + "Composition:": {"es": "Composición:"}, + "Contrast:": {"es": "Contraste:"}, + "Copy selection": {"es": "Selección de copia"}, + "Courier": {"es": "Mensajero"}, + "Crop": {"es": "Cultivo"}, + "Crop Selection": {"es": "Selección de cultivos"}, + "Curve": {"es": "Curva"}, + "Custom": {"es": "Personalizado"}, + "Cut selection": {"es": "Cortar la selección"}, + "Decrease color depth": {"es": "Disminuir la profundidad de color"}, + "Decrease colors": {"es": "Disminuir los colores"}, + "Default": {"es": "Defecto"}, + "Del": {"es": "Del"}, + "Delete": {"es": "Borrar"}, + "Delete selection": {"es": "Eliminar la selección"}, + "Denoise": {"es": "Eliminación de ruido"}, + "Desaturate": {"es": "Desaturar"}, + "Desaturation:": {"es": "Desaturación:"}, + "Description:": {"es": "Descripción:"}, + "Differences": {"es": "Diferencias"}, + "Differences Down": {"es": "Diferencias abajo"}, + "Dither": {"es": "Vacilar"}, + "Dithering:": {"es": "Difuminado:"}, + "Dot Screen": {"es": "Trama de puntos"}, + "Down": {"es": "Abajo"}, + "Downloaded": {"es": "Descargado"}, + "Draw circle": {"es": "Dibujar círculo"}, + "Draw letters": {"es": "Dibujar letras"}, + "Draw line": {"es": "Dibujar linea"}, + "Draw rectangle": {"es": "Dibujar rectángulo"}, + "Duplicate": {"es": "Duplicar"}, + "Duplicate layer": {"es": "Duplicar capa"}, + "Dusts level:": {"es": "Los polvos nivel:"}, + "Edge": {"es": "Borde"}, + "Edit": {"es": "Editar"}, + "Effects": {"es": "Efectos"}, + "Email:": {"es": "Email:"}, + "Emboss": {"es": "Realzar"}, + "Empty data": {"es": "De datos vacía"}, + "English": {"es": "Inglés"}, + "Enrich": {"es": "Enriquecer"}, + "Enter angle (0-360):": {"es": "Introduzca el ángulo (0-360):"}, + "Erase": {"es": "Borrar"}, + "Error": {"es": "Error"}, + "Error:": {"es": "Error:"}, + "Español": {"es": "Español"}, + "Exponent:": {"es": "Exponente:"}, + "Exposure level:": {"es": "Nivel de exposición:"}, + "Factor:": {"es": "Factor:"}, + "File": {"es": "Archivo"}, + "File name:": {"es": "Nombre del archivo:"}, + "Fill": {"es": "Llenar"}, + "Fill style:": {"es": "Estilo de relleno:"}, + "Fit": {"es": "Ajuste"}, + "Fit window": {"es": "Ajustar ventana"}, + "Flatten Image": {"es": "Imagen aplanada"}, + "Flip": {"es": "Dar la vuelta"}, + "Font family:": {"es": "Familia tipográfica:"}, + "Font style:": {"es": "Estilo de fuente:"}, + "French": {"es": "Francés"}, + "Full HD, 1080p": {"es": "Full hd, 1080p"}, + "Fur": {"es": "Pelaje"}, + "Gap:": {"es": "Brecha:"}, + "German": {"es": "Alemán"}, + "GitHub:": {"es": "Github:"}, + "Gradient": {"es": "Gradiente"}, + "Gradient Radius:": {"es": "Radio de gradiente:"}, + "Grains": {"es": "Granos"}, + "Grains level:": {"es": "Granos nivel:"}, + "Gray": {"es": "Gris"}, + "GrayScale": {"es": "Escala de grises"}, + "Green": {"es": "Verde"}, + "Green channel:": {"es": "Canal verde:"}, + "Greyscale:": {"es": "Escala de grises:"}, + "Grid": {"es": "Cuadrícula"}, + "Grid on/off": {"es": "Rejilla de encendido / apagado"}, + "Grouped": {"es": "Agrupados"}, + "H Radius:": {"es": "Radio h:"}, + "Heatmap": {"es": "Mapa de calor"}, + "Height (%):": {"es": "Altura (%):"}, + "Height (pixels):": {"es": "Altura (píxeles):"}, + "Height:": {"es": "Altura:"}, + "Help": {"es": "Ayuda"}, + "Helvetica": {"es": "Helvetica"}, + "Hermite": {"es": "Hermite"}, + "Histogram": {"es": "Histograma"}, + "Histogram:": {"es": "Histograma:"}, + "Horizontal": {"es": "Horizontal"}, + "Horizontal gap:": {"es": "Brecha horizontal:"}, + "Hue:": {"es": "Matiz:"}, + "Image": {"es": "Imagen"}, + "Impact": {"es": "Impacto"}, + "Information": {"es": "Información"}, + "Italiano": {"es": "Italiano"}, + "Italic": {"es": "Itálico"}, + "JPG - JPG/JPEG Format": {"es": "Jpg - formato jpg / jpeg"}, + "JPG Compression": {"es": "Compresión jpg"}, + "JSON - Full layers data": {"es": "Json - capas de datos completos"}, + "Japanese": {"es": "Japonés"}, + "Key-points": {"es": "Puntos clave"}, + "Keyboard Shortcuts": {"es": "Atajos de teclado"}, + "Korean": {"es": "Coreano"}, + "Language": {"es": "Idioma"}, + "Last modified": {"es": "última modificación"}, + "Layer": {"es": "Capa"}, + "Layers": {"es": "Capas"}, + "Left": {"es": "Izquierda"}, + "Level:": {"es": "Nivel:"}, + "Levels:": {"es": "Niveles:"}, + "Lietuvių": {"es": "Lietuvių"}, + "Light leak:": {"es": "Fuga de luz:"}, + "Limit:": {"es": "Límite:"}, + "Luminance:": {"es": "Luminancia:"}, + "Luminosity:": {"es": "Luminosidad:"}, + "Magic Wand Tool": {"es": "Varita mágica"}, + "Merge": {"es": "Unir"}, + "Merge Down": {"es": "Fusionar"}, + "Mode:": {"es": "Modo:"}, + "Mosaic": {"es": "Mosaico"}, + "Mouse:": {"es": "Ratón:"}, + "Move": {"es": "Movimiento"}, + "Move active layer": {"es": "Mover la capa activa"}, + "Move down": {"es": "Mover hacia abajo"}, + "Move up": {"es": "Ascender"}, + "Multi-line": {"es": "Multilínea"}, + "Name:": {"es": "Nombre:"}, + "Negative": {"es": "Negativo"}, + "New": {"es": "Nuevo"}, + "New file...": {"es": "Archivo nuevo..."}, + "New layer": {"es": "Nueva capa"}, + "No": {"es": "No"}, + "Normal": {"es": "Normal"}, + "Notice": {"es": "Darse cuenta"}, + "Notice:": {"es": "Darse cuenta:"}, + "Oil": {"es": "Petróleo"}, + "Ok": {"es": "De acuerdo"}, + "Online image editor": {"es": "Editor de imágenes en línea"}, + "Opacity": {"es": "Opacidad"}, + "Open": {"es": "Abierto"}, + "Original size": {"es": "Tamaño original"}, + "PNG - Portable Network Graphics": {"es": "Png - portable network graphics"}, + "Paste": {"es": "Pegar"}, + "Paste selection": {"es": "La selección de pasta"}, + "Pencil": {"es": "Lápiz"}, + "Perspective": {"es": "Perspectiva"}, + "Pick Color": {"es": "Color de la selección"}, + "Pixels:": {"es": "Píxeles:"}, + "Portuguese": {"es": "Portugués"}, + "Power:": {"es": "Poder:"}, + "Pre-Blur:": {"es": "Pre-desenfoque:"}, + "Preview": {"es": "Avance"}, + "Print": {"es": "Impresión"}, + "Quality (jpeg):": {"es": "Calidad (jpeg):"}, + "Quality:": {"es": "Calidad:"}, + "Quick load": {"es": "Carga rápida"}, + "Quick save": {"es": "Guardado rapido"}, + "Radial": {"es": "Radial"}, + "Radius:": {"es": "Radio:"}, + "Range:": {"es": "Distancia:"}, + "Reason:": {"es": "Razón:"}, + "Recover alpha": {"es": "Recuperar alfa"}, + "Red": {"es": "Rojo"}, + "Red channel:": {"es": "Canal rojo:"}, + "Rename": {"es": "Rebautizar"}, + "Rename layer": {"es": "Cambiar el nombre de capa"}, + "Replace Color": {"es": "Reemplazar color"}, + "Replace color": {"es": "Reemplazar color"}, + "Replacement:": {"es": "Reemplazo:"}, + "Resample - Hermite": {"es": "Volver a muestrear - hermite"}, + "Reset zoom level": {"es": "Restablecer el nivel de zoom"}, + "Resize": {"es": "Cambiar el tamaño"}, + "Resolution:": {"es": "Resolución:"}, + "Restore alpha": {"es": "Restaurar alfa"}, + "Right": {"es": "Derecha"}, + "Rotate": {"es": "Girar"}, + "Rotate left": {"es": "Girar a la izquierda"}, + "Rotation": {"es": "Rotación"}, + "Russian": {"es": "Ruso"}, + "Saturation:": {"es": "Saturación:"}, + "Save": {"es": "Salvar"}, + "Save as": {"es": "Guardar como"}, + "Save as type:": {"es": "Guardar como tipo:"}, + "Save layers:": {"es": "Guardar capas:"}, + "Save resolution:": {"es": "Guarde resolución:"}, + "Select all": {"es": "Seleccionar todo"}, + "Select area first": {"es": "Elija un área de primera"}, + "Select area tool": {"es": "Seleccionar herramienta de área"}, + "Select color": {"es": "Seleccionar el color"}, + "Select object tool": {"es": "Herramienta de selección de objetos"}, + "Selected": {"es": "Seleccionado"}, + "Sensitivity:": {"es": "Sensibilidad:"}, + "Sepia": {"es": "Sepia"}, + "Shaded": {"es": "Sombreada"}, + "Shadow blur:": {"es": "Sombra desenfoque:"}, + "Shadow color:": {"es": "Color de la sombra:"}, + "Shadow:": {"es": "Sombra:"}, + "Sharpen": {"es": "Afilar"}, + "Sharpen tool": {"es": "Afilar herramientas"}, + "Sharpen:": {"es": "Afilar:"}, + "Show / Hide": {"es": "Mostrar ocultar"}, + "Simple": {"es": "Sencillo"}, + "Size": {"es": "Tamaño"}, + "Size:": {"es": "Tamaño:"}, + "Sketchy": {"es": "Incompleto"}, + "Solarize": {"es": "Solarize"}, + "Sorry": {"es": "Lo siento"}, + "Sorry, image is too big, max 5 MB.": {"es": "Lo sentimos, la imagen es demasiado grande, un máximo de 5 mb."}, + "Source is empty, right click on image first.": {"es": "Fuente está vacía, haga clic derecho en la imagen primero."}, + "Sprites": {"es": "Sprites"}, + "Square": {"es": "Cuadrado"}, + "Strength:": {"es": "Fuerza:"}, + "Strict": {"es": "Estricto"}, + "Stroke": {"es": "Carrera"}, + "Stroke size:": {"es": "El tamaño del trazo:"}, + "Target:": {"es": "Objetivo:"}, + "Text": {"es": "Texto"}, + "Text:": {"es": "Texto:"}, + "The image could not be loaded.": {"es": "La imagen no se pudo cargar."}, + "This can not be last layer": {"es": "Esto no puede ser la última capa"}, + "This can not be last layer.": {"es": "Esto no puede ser la última capa."}, + "Tilt Shift": {"es": "Cambio de inclinación"}, + "Times New Roman": {"es": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"es": "Para pegar desde el portapapeles, use ctrl-v."}, + "Tools": {"es": "Herramientas"}, + "Top-left": {"es": "Arriba a la izquierda"}, + "Top-right": {"es": "Parte superior derecha"}, + "Total pixels:": {"es": "Píxeles en total:"}, + "Translate error, can not find dictionary:": {"es": "Traducir el error, no puede encontrar el diccionario:"}, + "Transparency #1:": {"es": "Transparencia # 1:"}, + "Transparency #2:": {"es": "Transparencia # 2:"}, + "Transparent:": {"es": "Transparente:"}, + "Trim": {"es": "Recortar"}, + "Trim:": {"es": "Recortar:"}, + "Turkish": {"es": "Turco"}, + "Undo": {"es": "Deshacer"}, + "Unique colors:": {"es": "Colores únicas:"}, + "Up": {"es": "Arriba"}, + "V Radius:": {"es": "Radio de v:"}, + "Verdana": {"es": "Verdana"}, + "Vertical": {"es": "Vertical"}, + "Vertical gap:": {"es": "Espacio vertical:"}, + "Vibrance": {"es": "La viveza"}, + "Vignette": {"es": "Viñeta"}, + "Vignette amount:": {"es": "Cantidad viñeta:"}, + "Vignette size:": {"es": "Tamaño de viñeta:"}, + "ViliusL": {"es": "Viliusl"}, + "Vintage": {"es": "Vendimia"}, + "Visible": {"es": "Visible"}, + "Visible:": {"es": "Visible:"}, + "WEBP - Weppy File Format": {"es": "Webp - formato de archivo weppy"}, + "Website": {"es": "Sitio web"}, + "Width (%):": {"es": "Anchura (%):"}, + "Width (pixels):": {"es": "Ancho (píxeles):"}, + "Width:": {"es": "Anchura:"}, + "Wrong file type, must be image or json.": {"es": "Tipo de archivo incorrecto, debe ser una imagen o json."}, + "X end:": {"es": "X final:"}, + "X start:": {"es": "Inicio x:"}, + "Y end:": {"es": "Y final:"}, + "Y start:": {"es": "Y de inicio:"}, + "Yes": {"es": "Sí"}, + "Your browser does not support this format.": {"es": "Su navegador no es compatible con este formato."}, + "Your browser doesn't support canvas.": {"es": "Su navegador no soporta lienzo."}, + "Zoom": {"es": "Enfocar"}, + "Zoom In": {"es": "Acercarse"}, + "Zoom Out": {"es": "Disminuir el zoom"}, + "Zoom in": {"es": "Acercarse"}, + "Zoom out": {"es": "Disminuir el zoom"}, + "Zoom:": {"es": "Enfocar:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/es.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/es.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..69ce503e7aa16335aa00fb70973dfdb2482c0155 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/es.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + es.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/fr.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/fr.js.js new file mode 100644 index 0000000000000000000000000000000000000000..44a0130fd90ed7e0d9185850ab386b69607a801a --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/fr.js.js @@ -0,0 +1,342 @@ +var dict_fr = { + "2d": {"fr": "2d"}, + "3D position:": {"fr": "3d position:"}, + "3D size:": {"fr": "Taille 3d:"}, + "480p": {"fr": "480p"}, + "About": {"fr": "Sur"}, + "Add new layer": {"fr": "Ajouter une nouvelle couche"}, + "Advanced": {"fr": "Avancée"}, + "All": {"fr": "Tout"}, + "Alpha": {"fr": "Alpha"}, + "Alpha:": {"fr": "Alpha:"}, + "Amount:": {"fr": "Montant:"}, + "Anonymous": {"fr": "Anonyme"}, + "Anti aliasing": {"fr": "Anti crénelage"}, + "Area:": {"fr": "Région:"}, + "Arial": {"fr": "Arial"}, + "Arrow": {"fr": "Flèche"}, + "Arrow keys": {"fr": "Touches directionnelles"}, + "Attributes": {"fr": "Les attributs"}, + "Author:": {"fr": "Auteur:"}, + "Auto adjust colors": {"fr": "Auto ajuster les couleurs"}, + "Auto colorize": {"fr": "Colorize auto"}, + "Average:": {"fr": "Moyenne:"}, + "BMP - Windows Bitmap": {"fr": "Bmp - fenêtres bitmap"}, + "Basic": {"fr": "De base"}, + "BezierCurve": {"fr": "Courbe de bézier"}, + "Big grains level:": {"fr": "Big grains niveau:"}, + "Black and White": {"fr": "Noir et blanc"}, + "Blend": {"fr": "Mélange"}, + "Blend:": {"fr": "Mélange:"}, + "Blue": {"fr": "Bleu"}, + "Blue channel:": {"fr": "Bleu canal:"}, + "Blur": {"fr": "Flou"}, + "Blur Radius:": {"fr": "Rayon blur:"}, + "Blur tool": {"fr": "Outil de floutage"}, + "Blur-Box": {"fr": "Flou-box"}, + "Blur-Gaussian": {"fr": "Flou gaussien"}, + "Blur-Stack": {"fr": "Flou-pile"}, + "Blur-Zoom": {"fr": "Flou-zoom"}, + "Blur:": {"fr": "Flou:"}, + "Bold": {"fr": "Audacieux"}, + "Bold Italic": {"fr": "Gras italique"}, + "Borders": {"fr": "Les frontières"}, + "Both": {"fr": "Tous les deux"}, + "Bottom-left": {"fr": "En bas à gauche"}, + "Bottom-right": {"fr": "En bas à droite"}, + "Brightness:": {"fr": "Luminosité:"}, + "Brush": {"fr": "Brosse"}, + "Bulge/Pinch": {"fr": "Ardennes / pincement"}, + "Bulge/Pinch tool": {"fr": "Ardennes / outil de pincement"}, + "Burn": {"fr": "Brûler"}, + "Burn/Dodge tool": {"fr": "Graver / outil dodge"}, + "Cancel": {"fr": "Annuler"}, + "Center x:": {"fr": "Centre x:"}, + "Center y:": {"fr": "Centre y:"}, + "Center:": {"fr": "Centre:"}, + "Channel:": {"fr": "Canal:"}, + "Chrome": {"fr": "Chrome"}, + "Circle": {"fr": "Cercle"}, + "Clear": {"fr": "Clair"}, + "Clear selection": {"fr": "Effacer la sélection"}, + "Clone tool": {"fr": "Outil clone"}, + "Color #1:": {"fr": "Couleur # 1:"}, + "Color #2:": {"fr": "Couleur # 2:"}, + "Color Zoom": {"fr": "Zoom couleur"}, + "Color adjust:": {"fr": "Couleur régler:"}, + "Color corrections": {"fr": "Correction des couleurs"}, + "Color to Alpha": {"fr": "Couleur à l'alpha"}, + "Color to alpha": {"fr": "Couleur à l'alpha"}, + "Color:": {"fr": "Couleur:"}, + "Colorize": {"fr": "Colorier"}, + "Colors:": {"fr": "Les couleurs:"}, + "Composite": {"fr": "Composite"}, + "Composition:": {"fr": "Composition:"}, + "Contrast:": {"fr": "Contraste:"}, + "Copy selection": {"fr": "Copier la sélection"}, + "Courier": {"fr": "Courrier"}, + "Crop": {"fr": "Surgir"}, + "Crop Selection": {"fr": "La sélection des cultures"}, + "Curve": {"fr": "Courbe"}, + "Custom": {"fr": "Coutume"}, + "Cut selection": {"fr": "Couper la sélection"}, + "Decrease color depth": {"fr": "Diminuer la profondeur de couleur"}, + "Decrease colors": {"fr": "Couleurs diminution"}, + "Default": {"fr": "Défaut"}, + "Del": {"fr": "Del"}, + "Delete": {"fr": "Effacer"}, + "Delete selection": {"fr": "Supprimer la sélection"}, + "Denoise": {"fr": "Denoise"}, + "Desaturate": {"fr": "Désaturer"}, + "Desaturation:": {"fr": "Désaturation:"}, + "Description:": {"fr": "La description:"}, + "Differences": {"fr": "Différences"}, + "Differences Down": {"fr": "Différences vers le bas"}, + "Dither": {"fr": "Tremblement"}, + "Dithering:": {"fr": "Trame:"}, + "Dot Screen": {"fr": "écran dot"}, + "Down": {"fr": "Vers le bas"}, + "Downloaded": {"fr": "Téléchargé"}, + "Draw circle": {"fr": "Dessinez cercle"}, + "Draw letters": {"fr": "Dessinez lettres"}, + "Draw line": {"fr": "Dessiner une ligne"}, + "Draw rectangle": {"fr": "Dessinez rectangle"}, + "Duplicate": {"fr": "Dupliquer"}, + "Duplicate layer": {"fr": "Dupliquer le calque"}, + "Dusts level:": {"fr": "Poussières niveau:"}, + "Edge": {"fr": "Bord"}, + "Edit": {"fr": "Modifier"}, + "Effects": {"fr": "Effets"}, + "Email:": {"fr": "Email:"}, + "Emboss": {"fr": "Gaufrer"}, + "Empty data": {"fr": "Données vide"}, + "English": {"fr": "Anglais"}, + "Enrich": {"fr": "Enrichir"}, + "Enter angle (0-360):": {"fr": "Entrez angle (0-360):"}, + "Erase": {"fr": "Effacer"}, + "Error": {"fr": "Erreur"}, + "Error:": {"fr": "Erreur:"}, + "Español": {"fr": "Español"}, + "Exponent:": {"fr": "Exposant:"}, + "Exposure level:": {"fr": "Niveau d'exposition:"}, + "Factor:": {"fr": "Facteur:"}, + "File": {"fr": "Fichier"}, + "File name:": {"fr": "Nom de fichier:"}, + "Fill": {"fr": "Remplir"}, + "Fill style:": {"fr": "Remplissez style:"}, + "Fit": {"fr": "Fit"}, + "Fit window": {"fr": "Fenêtre fit"}, + "Flatten Image": {"fr": "Une image aplatie"}, + "Flip": {"fr": "Retourner"}, + "Font family:": {"fr": "Famille de polices:"}, + "Font style:": {"fr": "Le style de police:"}, + "French": {"fr": "Français"}, + "Full HD, 1080p": {"fr": "Full hd, 1080p"}, + "Fur": {"fr": "Fourrure"}, + "Gap:": {"fr": "écart:"}, + "German": {"fr": "Allemand"}, + "GitHub:": {"fr": "Github:"}, + "Gradient": {"fr": "Pente"}, + "Gradient Radius:": {"fr": "Rayon gradient:"}, + "Grains": {"fr": "Céréales"}, + "Grains level:": {"fr": "Grains niveau:"}, + "Gray": {"fr": "Gris"}, + "GrayScale": {"fr": "Grayscale"}, + "Green": {"fr": "Vert"}, + "Green channel:": {"fr": "Circuit vert:"}, + "Greyscale:": {"fr": "Greyscale:"}, + "Grid": {"fr": "La grille"}, + "Grid on/off": {"fr": "Grille on / off"}, + "Grouped": {"fr": "Regroupées"}, + "H Radius:": {"fr": "H rayon:"}, + "Heatmap": {"fr": "Carte de chaleur"}, + "Height (%):": {"fr": "La taille (%):"}, + "Height (pixels):": {"fr": "Hauteur (pixels):"}, + "Height:": {"fr": "La taille:"}, + "Help": {"fr": "Aidez-moi"}, + "Helvetica": {"fr": "Helvetica"}, + "Hermite": {"fr": "Hermite"}, + "Histogram": {"fr": "Histogramme"}, + "Histogram:": {"fr": "Histogramme:"}, + "Horizontal": {"fr": "Horizontal"}, + "Horizontal gap:": {"fr": "écart horizontal:"}, + "Hue:": {"fr": "Teinte:"}, + "Image": {"fr": "Image"}, + "Impact": {"fr": "Impact"}, + "Information": {"fr": "Information"}, + "Italiano": {"fr": "Italiano"}, + "Italic": {"fr": "Italique"}, + "JPG - JPG/JPEG Format": {"fr": "Jpg - format jpg / jpeg"}, + "JPG Compression": {"fr": "Compression jpg"}, + "JSON - Full layers data": {"fr": "Json - couches pleines données"}, + "Japanese": {"fr": "Japonais"}, + "Key-points": {"fr": "Points clés"}, + "Keyboard Shortcuts": {"fr": "Raccourcis clavier"}, + "Korean": {"fr": "Coréen"}, + "Language": {"fr": "La langue"}, + "Last modified": {"fr": "Dernière mise à jour"}, + "Layer": {"fr": "Couche"}, + "Layers": {"fr": "Couches"}, + "Left": {"fr": "à gauche"}, + "Level:": {"fr": "Niveau:"}, + "Levels:": {"fr": "Les niveaux:"}, + "Lietuvių": {"fr": "Lietuvių"}, + "Light leak:": {"fr": "Fuite de lumière:"}, + "Limit:": {"fr": "Limite:"}, + "Luminance:": {"fr": "Luminance:"}, + "Luminosity:": {"fr": "Luminosité:"}, + "Magic Wand Tool": {"fr": "Un outil baguette magique"}, + "Merge": {"fr": "Fusionner"}, + "Merge Down": {"fr": "Fusionner vers le bas"}, + "Mode:": {"fr": "Mode:"}, + "Mosaic": {"fr": "Mosaïque"}, + "Mouse:": {"fr": "Souris:"}, + "Move": {"fr": "Déplacer"}, + "Move active layer": {"fr": "Déplacer la couche active"}, + "Move down": {"fr": "Descendre"}, + "Move up": {"fr": "Déplacer vers le haut"}, + "Multi-line": {"fr": "Multi-line"}, + "Name:": {"fr": "Prénom:"}, + "Negative": {"fr": "Négatif"}, + "New": {"fr": "Nouveau"}, + "New file...": {"fr": "Nouveau fichier..."}, + "New layer": {"fr": "Nouvelle couche"}, + "No": {"fr": "Non"}, + "Normal": {"fr": "Ordinaire"}, + "Notice": {"fr": "Avis"}, + "Notice:": {"fr": "Avis:"}, + "Oil": {"fr": "Pétrole"}, + "Ok": {"fr": "D'accord"}, + "Online image editor": {"fr": "éditeur d'images en ligne"}, + "Opacity": {"fr": "Opacité"}, + "Open": {"fr": "Ouvert"}, + "Original size": {"fr": "Format original"}, + "PNG - Portable Network Graphics": {"fr": "Png - portable network graphics"}, + "Paste": {"fr": "Pâte"}, + "Paste selection": {"fr": "Coller la sélection"}, + "Pencil": {"fr": "Crayon"}, + "Perspective": {"fr": "La perspective"}, + "Pick Color": {"fr": "Choisissez la couleur"}, + "Pixels:": {"fr": "Pixels:"}, + "Portuguese": {"fr": "Portugais"}, + "Power:": {"fr": "Puissance:"}, + "Pre-Blur:": {"fr": "Pré-flou:"}, + "Preview": {"fr": "Aperçu"}, + "Print": {"fr": "Impression"}, + "Quality (jpeg):": {"fr": "Qualité (jpeg):"}, + "Quality:": {"fr": "Qualité:"}, + "Quick load": {"fr": "Charge rapide"}, + "Quick save": {"fr": "Sauvegarde rapide"}, + "Radial": {"fr": "Radial"}, + "Radius:": {"fr": "Rayon:"}, + "Range:": {"fr": "Gamme:"}, + "Reason:": {"fr": "Raison:"}, + "Recover alpha": {"fr": "Récupérer alpha"}, + "Red": {"fr": "Rouge"}, + "Red channel:": {"fr": "Circuit rouge:"}, + "Rename": {"fr": "Rebaptiser"}, + "Rename layer": {"fr": "Renommez couche"}, + "Replace Color": {"fr": "Remplacer la couleur"}, + "Replace color": {"fr": "Remplacer la couleur"}, + "Replacement:": {"fr": "Remplacement:"}, + "Resample - Hermite": {"fr": "Resample - hermite"}, + "Reset zoom level": {"fr": "Niveau de zoom réinitialiser"}, + "Resize": {"fr": "Redimensionner"}, + "Resolution:": {"fr": "Résolution:"}, + "Restore alpha": {"fr": "Restaurer alpha"}, + "Right": {"fr": "Droite"}, + "Rotate": {"fr": "Faire tourner"}, + "Rotate left": {"fr": "Tourne à gauche"}, + "Rotation": {"fr": "Rotation"}, + "Russian": {"fr": "Russe"}, + "Saturation:": {"fr": "Saturation:"}, + "Save": {"fr": "Sauvegarder"}, + "Save as": {"fr": "Enregistrer sous"}, + "Save as type:": {"fr": "Sauvegarder comme type:"}, + "Save layers:": {"fr": "Enregistrer couches:"}, + "Save resolution:": {"fr": "Enregistrer résolution:"}, + "Select all": {"fr": "Sélectionner tout"}, + "Select area first": {"fr": "Sélectionnez la première zone"}, + "Select area tool": {"fr": "Outil de sélection de la zone"}, + "Select color": {"fr": "Choisissez la couleur"}, + "Select object tool": {"fr": "Outil de sélection d'objet"}, + "Selected": {"fr": "Choisi"}, + "Sensitivity:": {"fr": "Sensibilité:"}, + "Sepia": {"fr": "Sépia"}, + "Shaded": {"fr": "Shaded"}, + "Shadow blur:": {"fr": "Le flou de l'ombre:"}, + "Shadow color:": {"fr": "Couleur de l'ombre:"}, + "Shadow:": {"fr": "Ombre:"}, + "Sharpen": {"fr": "Affiler"}, + "Sharpen tool": {"fr": "Aiguisez outil"}, + "Sharpen:": {"fr": "Aiguisez:"}, + "Show / Hide": {"fr": "Show / hide"}, + "Simple": {"fr": "Simple"}, + "Size": {"fr": "Taille"}, + "Size:": {"fr": "Taille:"}, + "Sketchy": {"fr": "Vague"}, + "Solarize": {"fr": "Solariser"}, + "Sorry": {"fr": "Pardon"}, + "Sorry, image is too big, max 5 MB.": {"fr": "Désolé, l'image est trop grande, max 5 mb."}, + "Source is empty, right click on image first.": {"fr": "Source est vide, cliquez à droite sur l'image première."}, + "Sprites": {"fr": "Sprites"}, + "Square": {"fr": "Carré"}, + "Strength:": {"fr": "Force:"}, + "Strict": {"fr": "Strict"}, + "Stroke": {"fr": "Accident vasculaire cérébral"}, + "Stroke size:": {"fr": "Taille de l'avc:"}, + "Target:": {"fr": "Cible:"}, + "Text": {"fr": "Texte"}, + "Text:": {"fr": "Texte:"}, + "The image could not be loaded.": {"fr": "L'image n'a pas pu être chargé."}, + "This can not be last layer": {"fr": "Cela ne peut pas être la dernière couche"}, + "This can not be last layer.": {"fr": "Cela ne peut pas être la dernière couche."}, + "Tilt Shift": {"fr": "Tilt shift"}, + "Times New Roman": {"fr": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"fr": "Pour coller du presse-papiers, utilisez ctrl-v."}, + "Tools": {"fr": "Outils"}, + "Top-left": {"fr": "En haut à gauche"}, + "Top-right": {"fr": "En haut à droite"}, + "Total pixels:": {"fr": "Nombre de pixels:"}, + "Translate error, can not find dictionary:": {"fr": "Traduire l'erreur, ne peut pas trouver le dictionnaire:"}, + "Transparency #1:": {"fr": "Transparence # 1:"}, + "Transparency #2:": {"fr": "Transparence # 2:"}, + "Transparent:": {"fr": "Transparent:"}, + "Trim": {"fr": "Réduire"}, + "Trim:": {"fr": "Réduire:"}, + "Turkish": {"fr": "Turc"}, + "Undo": {"fr": "Annuler"}, + "Unique colors:": {"fr": "Couleurs uniques:"}, + "Up": {"fr": "En haut"}, + "V Radius:": {"fr": "Rayon v:"}, + "Verdana": {"fr": "Verdana"}, + "Vertical": {"fr": "Verticale"}, + "Vertical gap:": {"fr": "écart vertical:"}, + "Vibrance": {"fr": "Vibrance"}, + "Vignette": {"fr": "Vignette"}, + "Vignette amount:": {"fr": "Montant de la vignette:"}, + "Vignette size:": {"fr": "Taille de vignette:"}, + "ViliusL": {"fr": "Viliusl"}, + "Vintage": {"fr": "Cru"}, + "Visible": {"fr": "Visible"}, + "Visible:": {"fr": "Visible:"}, + "WEBP - Weppy File Format": {"fr": "Webp - format de fichier weppy"}, + "Website": {"fr": "Site internet"}, + "Width (%):": {"fr": "Largeur (%):"}, + "Width (pixels):": {"fr": "Largeur (pixels):"}, + "Width:": {"fr": "Largeur:"}, + "Wrong file type, must be image or json.": {"fr": "Mauvais type de fichier, doit être l'image ou json."}, + "X end:": {"fr": "X fin:"}, + "X start:": {"fr": "X début:"}, + "Y end:": {"fr": "Y fin:"}, + "Y start:": {"fr": "Y début:"}, + "Yes": {"fr": "Oui"}, + "Your browser does not support this format.": {"fr": "Votre navigateur ne supporte pas ce format."}, + "Your browser doesn't support canvas.": {"fr": "Votre navigateur ne supporte pas la toile."}, + "Zoom": {"fr": "Zoom"}, + "Zoom In": {"fr": "Agrandir"}, + "Zoom Out": {"fr": "Dézoomer"}, + "Zoom in": {"fr": "Agrandir"}, + "Zoom out": {"fr": "Dézoomer"}, + "Zoom:": {"fr": "Zoom:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/fr.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/fr.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..c745a784547c253946852a9ccfb74ec0655ccee6 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/fr.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + fr.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/it.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/it.js.js new file mode 100644 index 0000000000000000000000000000000000000000..eddbb851bd3305dad4a44b596a5f5c000663a700 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/it.js.js @@ -0,0 +1,342 @@ +var dict_it = { + "2d": {"it": "2d"}, + "3D position:": {"it": "Posizione 3d:"}, + "3D size:": {"it": "Formato 3d:"}, + "480p": {"it": "480p"}, + "About": {"it": "Di"}, + "Add new layer": {"it": "Aggiungere nuovo livello"}, + "Advanced": {"it": "Avanzate"}, + "All": {"it": "Tutti"}, + "Alpha": {"it": "Alfa"}, + "Alpha:": {"it": "Alfa:"}, + "Amount:": {"it": "Quantità:"}, + "Anonymous": {"it": "Anonimo"}, + "Anti aliasing": {"it": "Anti aliasing"}, + "Area:": {"it": "La zona:"}, + "Arial": {"it": "Arial"}, + "Arrow": {"it": "Freccia"}, + "Arrow keys": {"it": "Tasti freccia"}, + "Attributes": {"it": "Attributi"}, + "Author:": {"it": "Autore:"}, + "Auto adjust colors": {"it": "Regolazione automatica colori"}, + "Auto colorize": {"it": "Colorare auto"}, + "Average:": {"it": "Media:"}, + "BMP - Windows Bitmap": {"it": "Bmp - windows bitmap"}, + "Basic": {"it": "Di base"}, + "BezierCurve": {"it": "Curva di bézier"}, + "Big grains level:": {"it": "Di livello grani grossi:"}, + "Black and White": {"it": "Bianco e nero"}, + "Blend": {"it": "Miscela"}, + "Blend:": {"it": "Miscela:"}, + "Blue": {"it": "Blu"}, + "Blue channel:": {"it": "Blue channel:"}, + "Blur": {"it": "Blur"}, + "Blur Radius:": {"it": "Raggio di sfocatura:"}, + "Blur tool": {"it": "Strumento blur"}, + "Blur-Box": {"it": "Blur-box"}, + "Blur-Gaussian": {"it": "Blur-gaussiano"}, + "Blur-Stack": {"it": "Blur-stack"}, + "Blur-Zoom": {"it": "Blur-zoom"}, + "Blur:": {"it": "Blur:"}, + "Bold": {"it": "Grassetto"}, + "Bold Italic": {"it": "Italico grassetto"}, + "Borders": {"it": "Frontiere"}, + "Both": {"it": "Entrambi"}, + "Bottom-left": {"it": "In basso a sinistra"}, + "Bottom-right": {"it": "In basso a destra"}, + "Brightness:": {"it": "Luminosità:"}, + "Brush": {"it": "Pennello"}, + "Bulge/Pinch": {"it": "Bulge / pinch"}, + "Bulge/Pinch tool": {"it": "Bulge / strumento pinch"}, + "Burn": {"it": "Bruciare"}, + "Burn/Dodge tool": {"it": "Masterizzare strumento / dodge"}, + "Cancel": {"it": "Annulla"}, + "Center x:": {"it": "Centro x:"}, + "Center y:": {"it": "Centro y:"}, + "Center:": {"it": "Centro:"}, + "Channel:": {"it": "Canale:"}, + "Chrome": {"it": "Cromo"}, + "Circle": {"it": "Cerchio"}, + "Clear": {"it": "Pulire"}, + "Clear selection": {"it": "Cancella selezione"}, + "Clone tool": {"it": "Strumento clone"}, + "Color #1:": {"it": "Colore # 1:"}, + "Color #2:": {"it": "Colore # 2:"}, + "Color Zoom": {"it": "Zoom colore"}, + "Color adjust:": {"it": "Regola colore:"}, + "Color corrections": {"it": "Correzioni di colore"}, + "Color to Alpha": {"it": "Colore ad alfa"}, + "Color to alpha": {"it": "Colore ad alfa"}, + "Color:": {"it": "Colore:"}, + "Colorize": {"it": "Colorize"}, + "Colors:": {"it": "Colori:"}, + "Composite": {"it": "Composito"}, + "Composition:": {"it": "Composizione:"}, + "Contrast:": {"it": "Contrasto:"}, + "Copy selection": {"it": "Selezione copy"}, + "Courier": {"it": "Corriere"}, + "Crop": {"it": "Raccolto"}, + "Crop Selection": {"it": "Selezione di ritaglio"}, + "Curve": {"it": "Curva"}, + "Custom": {"it": "Costume"}, + "Cut selection": {"it": "Selezione cut"}, + "Decrease color depth": {"it": "Diminuire la profondità di colore"}, + "Decrease colors": {"it": "Diminuzione colori"}, + "Default": {"it": "Predefinito"}, + "Del": {"it": "Del"}, + "Delete": {"it": "Cancellare"}, + "Delete selection": {"it": "Elimina la selezione"}, + "Denoise": {"it": "Denoise"}, + "Desaturate": {"it": "Desatura"}, + "Desaturation:": {"it": "Desaturazione:"}, + "Description:": {"it": "Descrizione:"}, + "Differences": {"it": "Differenze"}, + "Differences Down": {"it": "Differenze giù"}, + "Dither": {"it": "Agitarsi"}, + "Dithering:": {"it": "Dithering:"}, + "Dot Screen": {"it": "Schermo dot"}, + "Down": {"it": "Giù"}, + "Downloaded": {"it": "Scaricati"}, + "Draw circle": {"it": "Disegna cerchio"}, + "Draw letters": {"it": "Disegnare le lettere"}, + "Draw line": {"it": "Draw line"}, + "Draw rectangle": {"it": "Disegna rettangolo"}, + "Duplicate": {"it": "Duplicare"}, + "Duplicate layer": {"it": "Livello duplicato"}, + "Dusts level:": {"it": "Polveri di livello:"}, + "Edge": {"it": "Bordo"}, + "Edit": {"it": "Modifica"}, + "Effects": {"it": "Effetti"}, + "Email:": {"it": "E-mail:"}, + "Emboss": {"it": "Rilievo"}, + "Empty data": {"it": "Dati vuota"}, + "English": {"it": "Inglese"}, + "Enrich": {"it": "Arricchire"}, + "Enter angle (0-360):": {"it": "Digitare l'angolo (0-360):"}, + "Erase": {"it": "Cancellare"}, + "Error": {"it": "Errore"}, + "Error:": {"it": "Errore:"}, + "Español": {"it": "Español"}, + "Exponent:": {"it": "Esponente:"}, + "Exposure level:": {"it": "Livello di esposizione:"}, + "Factor:": {"it": "Fattore:"}, + "File": {"it": "File"}, + "File name:": {"it": "Nome del file:"}, + "Fill": {"it": "Riempire"}, + "Fill style:": {"it": "Fill stile:"}, + "Fit": {"it": "In forma"}, + "Fit window": {"it": "Fit finestra"}, + "Flatten Image": {"it": "Immagine piatta"}, + "Flip": {"it": "Capovolgere"}, + "Font family:": {"it": "Famiglia di font:"}, + "Font style:": {"it": "Stile carattere:"}, + "French": {"it": "Francese"}, + "Full HD, 1080p": {"it": "Full hd, 1080p"}, + "Fur": {"it": "Pelliccia"}, + "Gap:": {"it": "Gap:"}, + "German": {"it": "Tedesco"}, + "GitHub:": {"it": "Github:"}, + "Gradient": {"it": "Pendenza"}, + "Gradient Radius:": {"it": "Raggio gradiente:"}, + "Grains": {"it": "Grani"}, + "Grains level:": {"it": "Di livello grains:"}, + "Gray": {"it": "Grigio"}, + "GrayScale": {"it": "Scala di grigi"}, + "Green": {"it": "Verde"}, + "Green channel:": {"it": "Canale verde:"}, + "Greyscale:": {"it": "Scala di grigi:"}, + "Grid": {"it": "Griglia"}, + "Grid on/off": {"it": "Griglia on / off"}, + "Grouped": {"it": "Raggruppate"}, + "H Radius:": {"it": "Raggio h:"}, + "Heatmap": {"it": "Mappa di calore"}, + "Height (%):": {"it": "Altezza (%):"}, + "Height (pixels):": {"it": "Altezza (pixel):"}, + "Height:": {"it": "Altezza:"}, + "Help": {"it": "Aiuto"}, + "Helvetica": {"it": "Helvetica"}, + "Hermite": {"it": "Hermite"}, + "Histogram": {"it": "Istogramma"}, + "Histogram:": {"it": "Istogramma:"}, + "Horizontal": {"it": "Orizzontale"}, + "Horizontal gap:": {"it": "Gap orizzontale:"}, + "Hue:": {"it": "Hue:"}, + "Image": {"it": "Immagine"}, + "Impact": {"it": "Urto"}, + "Information": {"it": "Informazioni"}, + "Italiano": {"it": "Italiano"}, + "Italic": {"it": "Corsivo"}, + "JPG - JPG/JPEG Format": {"it": "Jpg - jpg / jpeg"}, + "JPG Compression": {"it": "Compressione jpg"}, + "JSON - Full layers data": {"it": "Json - strati pieni di dati"}, + "Japanese": {"it": "Giapponese"}, + "Key-points": {"it": "Punti chiave"}, + "Keyboard Shortcuts": {"it": "Tasti rapidi"}, + "Korean": {"it": "Coreano"}, + "Language": {"it": "Lingua"}, + "Last modified": {"it": "Ultima modifica"}, + "Layer": {"it": "Strato"}, + "Layers": {"it": "Livelli"}, + "Left": {"it": "Sinistra"}, + "Level:": {"it": "Livello:"}, + "Levels:": {"it": "Livelli:"}, + "Lietuvių": {"it": "Lietuvių"}, + "Light leak:": {"it": "Perdita di luce:"}, + "Limit:": {"it": "Limite:"}, + "Luminance:": {"it": "Luminance:"}, + "Luminosity:": {"it": "Luminosità:"}, + "Magic Wand Tool": {"it": "Strumento bacchetta magica"}, + "Merge": {"it": "Fondere"}, + "Merge Down": {"it": "Fondere"}, + "Mode:": {"it": "Modalità:"}, + "Mosaic": {"it": "Mosaico"}, + "Mouse:": {"it": "Topo:"}, + "Move": {"it": "Mossa"}, + "Move active layer": {"it": "Spostare strato attivo"}, + "Move down": {"it": "Abbassati"}, + "Move up": {"it": "Rimontare"}, + "Multi-line": {"it": "Multi-line"}, + "Name:": {"it": "Nome:"}, + "Negative": {"it": "Negativo"}, + "New": {"it": "Nuovo"}, + "New file...": {"it": "Nuovo file..."}, + "New layer": {"it": "Nuovo livello"}, + "No": {"it": "No"}, + "Normal": {"it": "Normale"}, + "Notice": {"it": "Avviso"}, + "Notice:": {"it": "Avviso:"}, + "Oil": {"it": "Olio"}, + "Ok": {"it": "Ok"}, + "Online image editor": {"it": "Editor di immagini online"}, + "Opacity": {"it": "Opacità"}, + "Open": {"it": "Aperto"}, + "Original size": {"it": "Misura originale"}, + "PNG - Portable Network Graphics": {"it": "Png - portable network graphics"}, + "Paste": {"it": "Incolla"}, + "Paste selection": {"it": "Selezione incolla"}, + "Pencil": {"it": "Matita"}, + "Perspective": {"it": "Prospettiva"}, + "Pick Color": {"it": "Scegli il colore"}, + "Pixels:": {"it": "Pixel:"}, + "Portuguese": {"it": "Portoghese"}, + "Power:": {"it": "Energia:"}, + "Pre-Blur:": {"it": "Pre-sfocatura:"}, + "Preview": {"it": "Anteprima"}, + "Print": {"it": "Stampare"}, + "Quality (jpeg):": {"it": "Qualità (jpeg):"}, + "Quality:": {"it": "Qualità:"}, + "Quick load": {"it": "Carico rapida"}, + "Quick save": {"it": "Salvataggio veloce"}, + "Radial": {"it": "Radiale"}, + "Radius:": {"it": "Raggio:"}, + "Range:": {"it": "Gamma:"}, + "Reason:": {"it": "Ragionare:"}, + "Recover alpha": {"it": "Recuperare alpha"}, + "Red": {"it": "Rosso"}, + "Red channel:": {"it": "Canale rosso:"}, + "Rename": {"it": "Rinominare"}, + "Rename layer": {"it": "Rinomina strato"}, + "Replace Color": {"it": "Sostituire colore"}, + "Replace color": {"it": "Sostituire colore"}, + "Replacement:": {"it": "Sostituzione:"}, + "Resample - Hermite": {"it": "Resample - hermite"}, + "Reset zoom level": {"it": "Livello di zoom reset"}, + "Resize": {"it": "Ridimensiona"}, + "Resolution:": {"it": "Risoluzione:"}, + "Restore alpha": {"it": "Ripristinare alpha"}, + "Right": {"it": "Destra"}, + "Rotate": {"it": "Ruotare"}, + "Rotate left": {"it": "Gira a sinistra"}, + "Rotation": {"it": "Rotazione"}, + "Russian": {"it": "Russo"}, + "Saturation:": {"it": "Saturazione:"}, + "Save": {"it": "Salvare"}, + "Save as": {"it": "Salva come"}, + "Save as type:": {"it": "Salva come tipo:"}, + "Save layers:": {"it": "Salva strati:"}, + "Save resolution:": {"it": "Salva risoluzione:"}, + "Select all": {"it": "Seleziona tutto"}, + "Select area first": {"it": "Seleziona l'area prima"}, + "Select area tool": {"it": "Selezionare lo strumento zona"}, + "Select color": {"it": "Scegli il colore"}, + "Select object tool": {"it": "Selezionare lo strumento oggetto"}, + "Selected": {"it": "Selezionato"}, + "Sensitivity:": {"it": "Sensibilità:"}, + "Sepia": {"it": "Nero di seppia"}, + "Shaded": {"it": "Ombroso"}, + "Shadow blur:": {"it": "Ombra sfocatura:"}, + "Shadow color:": {"it": "Colore dell'ombra:"}, + "Shadow:": {"it": "Ombra:"}, + "Sharpen": {"it": "Affilare"}, + "Sharpen tool": {"it": "Contrasta strumento"}, + "Sharpen:": {"it": "Affilare:"}, + "Show / Hide": {"it": "Mostra nascondi"}, + "Simple": {"it": "Semplice"}, + "Size": {"it": "Dimensione"}, + "Size:": {"it": "Dimensione:"}, + "Sketchy": {"it": "Abbozzato"}, + "Solarize": {"it": "Solarizzare"}, + "Sorry": {"it": "Scusate"}, + "Sorry, image is too big, max 5 MB.": {"it": "Siamo spiacenti, l'immagine è troppo grande, max 5 mb."}, + "Source is empty, right click on image first.": {"it": "Source è vuoto, fate clic destro sull'immagine prima."}, + "Sprites": {"it": "Sprites"}, + "Square": {"it": "Piazza"}, + "Strength:": {"it": "Forza:"}, + "Strict": {"it": "Rigoroso"}, + "Stroke": {"it": "Ictus"}, + "Stroke size:": {"it": "Dimensioni corsa:"}, + "Target:": {"it": "Bersaglio:"}, + "Text": {"it": "Testo"}, + "Text:": {"it": "Testo:"}, + "The image could not be loaded.": {"it": "L'immagine non può essere caricato."}, + "This can not be last layer": {"it": "Questo non può essere ultimo strato"}, + "This can not be last layer.": {"it": "Questo non può essere ultimo strato."}, + "Tilt Shift": {"it": "Tilt shift"}, + "Times New Roman": {"it": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"it": "Per incollare dagli appunti, utilizzare ctrl-v."}, + "Tools": {"it": "Utensili"}, + "Top-left": {"it": "A sinistra in alto"}, + "Top-right": {"it": "In alto a destra"}, + "Total pixels:": {"it": "Pixel totali:"}, + "Translate error, can not find dictionary:": {"it": "Tradurre errore, non riesce a trovare dizionario:"}, + "Transparency #1:": {"it": "Trasparenza # 1:"}, + "Transparency #2:": {"it": "Trasparenza # 2:"}, + "Transparent:": {"it": "Trasparente:"}, + "Trim": {"it": "Tagliare"}, + "Trim:": {"it": "Trim:"}, + "Turkish": {"it": "Turco"}, + "Undo": {"it": "Disfare"}, + "Unique colors:": {"it": "Colori unici:"}, + "Up": {"it": "Su"}, + "V Radius:": {"it": "Raggio v:"}, + "Verdana": {"it": "Verdana"}, + "Vertical": {"it": "Verticale"}, + "Vertical gap:": {"it": "Gap verticale:"}, + "Vibrance": {"it": "Vibrance"}, + "Vignette": {"it": "Vignette"}, + "Vignette amount:": {"it": "Importo vignette:"}, + "Vignette size:": {"it": "Dimensioni vignette:"}, + "ViliusL": {"it": "Viliusl"}, + "Vintage": {"it": "Annata"}, + "Visible": {"it": "Visibile"}, + "Visible:": {"it": "Visibile:"}, + "WEBP - Weppy File Format": {"it": "Webp - formato di file weppy"}, + "Website": {"it": "Sito web"}, + "Width (%):": {"it": "Larghezza (%):"}, + "Width (pixels):": {"it": "Larghezza (pixel):"}, + "Width:": {"it": "Larghezza:"}, + "Wrong file type, must be image or json.": {"it": "Tipo di file sbagliato, deve essere immagine o json."}, + "X end:": {"it": "X fine:"}, + "X start:": {"it": "X inizio:"}, + "Y end:": {"it": "Fine y:"}, + "Y start:": {"it": "Y inizio:"}, + "Yes": {"it": "Sì"}, + "Your browser does not support this format.": {"it": "Il tuo browser non supporta questo formato."}, + "Your browser doesn't support canvas.": {"it": "Il tuo browser non supporta tela."}, + "Zoom": {"it": "Ingrandimento"}, + "Zoom In": {"it": "Ingrandire"}, + "Zoom Out": {"it": "Zoom indietro"}, + "Zoom in": {"it": "Ingrandire"}, + "Zoom out": {"it": "Zoom indietro"}, + "Zoom:": {"it": "Ingrandimento:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/it.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/it.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..26c32e75187cc427f51bbc7853dcab816b13728a --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/it.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + it.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ja.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ja.js.js new file mode 100644 index 0000000000000000000000000000000000000000..35d23aa133ab9edd2c5d94266b0624f0ee4d1318 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ja.js.js @@ -0,0 +1,342 @@ +var dict_ja = { + "2d": {"ja": "図2d"}, + "3D position:": {"ja": "3d位置:"}, + "3D size:": {"ja": "3dサイズ:"}, + "480p": {"ja": "480p"}, + "About": {"ja": "約"}, + "Add new layer": {"ja": "新しいレイヤーを追加します。"}, + "Advanced": {"ja": "高度な"}, + "All": {"ja": "すべて"}, + "Alpha": {"ja": "アルファ"}, + "Alpha:": {"ja": "アルファ:"}, + "Amount:": {"ja": "量:"}, + "Anonymous": {"ja": "匿名の"}, + "Anti aliasing": {"ja": "アンチエイリアシング"}, + "Area:": {"ja": "エリア:"}, + "Arial": {"ja": "Arialの"}, + "Arrow": {"ja": "矢印"}, + "Arrow keys": {"ja": "矢印キー"}, + "Attributes": {"ja": "属性"}, + "Author:": {"ja": "著者:"}, + "Auto adjust colors": {"ja": "自動色を調整します"}, + "Auto colorize": {"ja": "自動色付け"}, + "Average:": {"ja": "平均:"}, + "BMP - Windows Bitmap": {"ja": "Bmp - windowsビットマップ"}, + "Basic": {"ja": "基本"}, + "BezierCurve": {"ja": "ベジェ曲線"}, + "Big grains level:": {"ja": "ビッグ粒レベル:"}, + "Black and White": {"ja": "白黒"}, + "Blend": {"ja": "ブレンド"}, + "Blend:": {"ja": "ブレンド:"}, + "Blue": {"ja": "青"}, + "Blue channel:": {"ja": "ブルーチャンネル:"}, + "Blur": {"ja": "ブラー"}, + "Blur Radius:": {"ja": "ぼかし半径:"}, + "Blur tool": {"ja": "ぼかしツール"}, + "Blur-Box": {"ja": "ぼかしボックス"}, + "Blur-Gaussian": {"ja": "ぼかし、ガウス"}, + "Blur-Stack": {"ja": "ブラースタック"}, + "Blur-Zoom": {"ja": "ぼかしズーム"}, + "Blur:": {"ja": "ぼかし:"}, + "Bold": {"ja": "大胆な"}, + "Bold Italic": {"ja": "太字イタリック"}, + "Borders": {"ja": "ボーダーズ"}, + "Both": {"ja": "どちらも"}, + "Bottom-left": {"ja": "左下"}, + "Bottom-right": {"ja": "右下"}, + "Brightness:": {"ja": "輝度:"}, + "Brush": {"ja": "みがきます"}, + "Bulge/Pinch": {"ja": "バルジ/ピンチ"}, + "Bulge/Pinch tool": {"ja": "バルジ/ピンチツール"}, + "Burn": {"ja": "燃やす"}, + "Burn/Dodge tool": {"ja": "バーン/覆い焼きツール"}, + "Cancel": {"ja": "キャンセル"}, + "Center x:": {"ja": "中央のx:"}, + "Center y:": {"ja": "センターy:"}, + "Center:": {"ja": "センター:"}, + "Channel:": {"ja": "チャネル:"}, + "Chrome": {"ja": "クロム"}, + "Circle": {"ja": "サークル"}, + "Clear": {"ja": "クリア"}, + "Clear selection": {"ja": "クリア選択"}, + "Clone tool": {"ja": "クローンツール"}, + "Color #1:": {"ja": "カラー#1:"}, + "Color #2:": {"ja": "カラー#2:"}, + "Color Zoom": {"ja": "カラーズーム"}, + "Color adjust:": {"ja": "カラー調整します:"}, + "Color corrections": {"ja": "色補正"}, + "Color to Alpha": {"ja": "アルファの色"}, + "Color to alpha": {"ja": "アルファの色"}, + "Color:": {"ja": "色:"}, + "Colorize": {"ja": "カラー化します"}, + "Colors:": {"ja": "色:"}, + "Composite": {"ja": "複合"}, + "Composition:": {"ja": "組成:"}, + "Contrast:": {"ja": "コントラスト:"}, + "Copy selection": {"ja": "コピー選択"}, + "Courier": {"ja": "クーリエ"}, + "Crop": {"ja": "作物"}, + "Crop Selection": {"ja": "作物の選択"}, + "Curve": {"ja": "曲線"}, + "Custom": {"ja": "カスタム"}, + "Cut selection": {"ja": "カット選択"}, + "Decrease color depth": {"ja": "色深度を減らします"}, + "Decrease colors": {"ja": "色を減少させます"}, + "Default": {"ja": "デフォルト"}, + "Del": {"ja": "デル"}, + "Delete": {"ja": "削除"}, + "Delete selection": {"ja": "選択範囲を削除"}, + "Denoise": {"ja": "ノイズ除去"}, + "Desaturate": {"ja": "彩度を減じます"}, + "Desaturation:": {"ja": "不飽和化:"}, + "Description:": {"ja": "説明:"}, + "Differences": {"ja": "違い"}, + "Differences Down": {"ja": "ダウン違い"}, + "Dither": {"ja": "ディザー"}, + "Dithering:": {"ja": "ディザリング:"}, + "Dot Screen": {"ja": "ドットスクリーン"}, + "Down": {"ja": "ダウン"}, + "Downloaded": {"ja": "ダウンロード"}, + "Draw circle": {"ja": "円を描きます"}, + "Draw letters": {"ja": "文字を描きます"}, + "Draw line": {"ja": "ドローライン"}, + "Draw rectangle": {"ja": "四角形を描画"}, + "Duplicate": {"ja": "複製"}, + "Duplicate layer": {"ja": "レイヤーの複製"}, + "Dusts level:": {"ja": "粉剤はレベル:"}, + "Edge": {"ja": "エッジ"}, + "Edit": {"ja": "編集"}, + "Effects": {"ja": "エフェクト"}, + "Email:": {"ja": "Eメール:"}, + "Emboss": {"ja": "エンボス"}, + "Empty data": {"ja": "空のデータ"}, + "English": {"ja": "英語"}, + "Enrich": {"ja": "強化します"}, + "Enter angle (0-360):": {"ja": "角度(0から360)を入力します。"}, + "Erase": {"ja": "消します"}, + "Error": {"ja": "エラー"}, + "Error:": {"ja": "エラー:"}, + "Español": {"ja": "スペイン語"}, + "Exponent:": {"ja": "指数:"}, + "Exposure level:": {"ja": "露出レベル:"}, + "Factor:": {"ja": "因子:"}, + "File": {"ja": "ファイル"}, + "File name:": {"ja": "ファイル名:"}, + "Fill": {"ja": "埋めます"}, + "Fill style:": {"ja": "スタイルを入力します。"}, + "Fit": {"ja": "フィット"}, + "Fit window": {"ja": "フィット窓"}, + "Flatten Image": {"ja": "画像をフラット化"}, + "Flip": {"ja": "フリップ"}, + "Font family:": {"ja": "フォントファミリー:"}, + "Font style:": {"ja": "フォントスタイル:"}, + "French": {"ja": "フランス語"}, + "Full HD, 1080p": {"ja": "フルhd、1080"}, + "Fur": {"ja": "毛皮"}, + "Gap:": {"ja": "ギャップ:"}, + "German": {"ja": "ドイツ人"}, + "GitHub:": {"ja": "Githubの:"}, + "Gradient": {"ja": "勾配"}, + "Gradient Radius:": {"ja": "グラデーションの半径:"}, + "Grains": {"ja": "穀類"}, + "Grains level:": {"ja": "穀物レベル:"}, + "Gray": {"ja": "グレー"}, + "GrayScale": {"ja": "グレースケール"}, + "Green": {"ja": "緑"}, + "Green channel:": {"ja": "グリーンチャンネル:"}, + "Greyscale:": {"ja": "グレースケール:"}, + "Grid": {"ja": "グリッド"}, + "Grid on/off": {"ja": "オン/オフグリッド"}, + "Grouped": {"ja": "グループ化されました"}, + "H Radius:": {"ja": "H半径:"}, + "Heatmap": {"ja": "ヒートマップ"}, + "Height (%):": {"ja": "高さ (%):"}, + "Height (pixels):": {"ja": "高さ(ピクセル):"}, + "Height:": {"ja": "高さ:"}, + "Help": {"ja": "助けて"}, + "Helvetica": {"ja": "ヘルベチカ"}, + "Hermite": {"ja": "エルミート"}, + "Histogram": {"ja": "ヒストグラム"}, + "Histogram:": {"ja": "ヒストグラム:"}, + "Horizontal": {"ja": "水平の"}, + "Horizontal gap:": {"ja": "水平方向のギャップ:"}, + "Hue:": {"ja": "フエ:"}, + "Image": {"ja": "画像"}, + "Impact": {"ja": "影響"}, + "Information": {"ja": "情報"}, + "Italiano": {"ja": "イタリアーノ"}, + "Italic": {"ja": "イタリック"}, + "JPG - JPG/JPEG Format": {"ja": "Jpg - jpg / jpeg形式"}, + "JPG Compression": {"ja": "Jpg圧縮"}, + "JSON - Full layers data": {"ja": "Json - フルレイヤーデータ"}, + "Japanese": {"ja": "日本語"}, + "Key-points": {"ja": "キーポイント"}, + "Keyboard Shortcuts": {"ja": "キーボードショートカット"}, + "Korean": {"ja": "韓国語"}, + "Language": {"ja": "言語"}, + "Last modified": {"ja": "最終更新日"}, + "Layer": {"ja": "層"}, + "Layers": {"ja": "層"}, + "Left": {"ja": "左"}, + "Level:": {"ja": "レベル:"}, + "Levels:": {"ja": "レベル:"}, + "Lietuvių": {"ja": "Lietuvių"}, + "Light leak:": {"ja": "光漏れ:"}, + "Limit:": {"ja": "リミット:"}, + "Luminance:": {"ja": "輝度:"}, + "Luminosity:": {"ja": "光度:"}, + "Magic Wand Tool": {"ja": "マジックワンドツール"}, + "Merge": {"ja": "マージ"}, + "Merge Down": {"ja": "ダウンマージ"}, + "Mode:": {"ja": "モード:"}, + "Mosaic": {"ja": "モザイク"}, + "Mouse:": {"ja": "マウス:"}, + "Move": {"ja": "移動"}, + "Move active layer": {"ja": "活性層を移動します"}, + "Move down": {"ja": "下に移動"}, + "Move up": {"ja": "上がります"}, + "Multi-line": {"ja": "マルチライン"}, + "Name:": {"ja": "名:"}, + "Negative": {"ja": "負"}, + "New": {"ja": "新しい"}, + "New file...": {"ja": "新規ファイル..."}, + "New layer": {"ja": "新しい層"}, + "No": {"ja": "いいえ"}, + "Normal": {"ja": "ノーマル"}, + "Notice": {"ja": "通知"}, + "Notice:": {"ja": "通知:"}, + "Oil": {"ja": "油"}, + "Ok": {"ja": "Ok"}, + "Online image editor": {"ja": "オンライン画像エディタ"}, + "Opacity": {"ja": "不透明度"}, + "Open": {"ja": "開いた"}, + "Original size": {"ja": "オリジナルサイズ"}, + "PNG - Portable Network Graphics": {"ja": "Png形式 - ポータブルネットワークグラフィックス"}, + "Paste": {"ja": "ペースト"}, + "Paste selection": {"ja": "貼り付け選択"}, + "Pencil": {"ja": "鉛筆"}, + "Perspective": {"ja": "視点"}, + "Pick Color": {"ja": "色を選択"}, + "Pixels:": {"ja": "画素数:"}, + "Portuguese": {"ja": "ポルトガル語"}, + "Power:": {"ja": "力:"}, + "Pre-Blur:": {"ja": "前ぼかし:"}, + "Preview": {"ja": "プレビュー"}, + "Print": {"ja": "印刷"}, + "Quality (jpeg):": {"ja": "品質(jpeg):"}, + "Quality:": {"ja": "品質:"}, + "Quick load": {"ja": "クイックロード"}, + "Quick save": {"ja": "クイックセーブ"}, + "Radial": {"ja": "ラジアル"}, + "Radius:": {"ja": "半径:"}, + "Range:": {"ja": "範囲:"}, + "Reason:": {"ja": "理由:"}, + "Recover alpha": {"ja": "アルファを回復"}, + "Red": {"ja": "赤"}, + "Red channel:": {"ja": "レッドチャンネル:"}, + "Rename": {"ja": "リネーム"}, + "Rename layer": {"ja": "層の名前を変更"}, + "Replace Color": {"ja": "色を交換してください"}, + "Replace color": {"ja": "色を交換してください"}, + "Replacement:": {"ja": "置換:"}, + "Resample - Hermite": {"ja": "リサンプル - エルミート"}, + "Reset zoom level": {"ja": "ズームレベルをリセット"}, + "Resize": {"ja": "リサイズ"}, + "Resolution:": {"ja": "解決:"}, + "Restore alpha": {"ja": "アルファを復元"}, + "Right": {"ja": "右"}, + "Rotate": {"ja": "ローテート"}, + "Rotate left": {"ja": "左を回転させます"}, + "Rotation": {"ja": "回転"}, + "Russian": {"ja": "ロシア"}, + "Saturation:": {"ja": "飽和:"}, + "Save": {"ja": "セーブ"}, + "Save as": {"ja": "名前を付けて保存"}, + "Save as type:": {"ja": "タイプとして保存:"}, + "Save layers:": {"ja": "レイヤを保存します。"}, + "Save resolution:": {"ja": "解像度を保存します。"}, + "Select all": {"ja": "すべて選択"}, + "Select area first": {"ja": "最初のエリアを選択"}, + "Select area tool": {"ja": "エリアツールを選択します"}, + "Select color": {"ja": "色を選択"}, + "Select object tool": {"ja": "オブジェクトツールを選択します"}, + "Selected": {"ja": "選択しました"}, + "Sensitivity:": {"ja": "感度:"}, + "Sepia": {"ja": "セピア"}, + "Shaded": {"ja": "影付きの"}, + "Shadow blur:": {"ja": "シャドウぼかし:"}, + "Shadow color:": {"ja": "影の色:"}, + "Shadow:": {"ja": "シャドウ:"}, + "Sharpen": {"ja": "研ぎます"}, + "Sharpen tool": {"ja": "ツールシャープ"}, + "Sharpen:": {"ja": "シャープ:"}, + "Show / Hide": {"ja": "表示/非表示"}, + "Simple": {"ja": "シンプル"}, + "Size": {"ja": "サイズ"}, + "Size:": {"ja": "サイズ:"}, + "Sketchy": {"ja": "大雑把"}, + "Solarize": {"ja": "太陽光線にさらします"}, + "Sorry": {"ja": "ごめんなさい"}, + "Sorry, image is too big, max 5 MB.": {"ja": "申し訳ありませんが、画像が大きすぎ、最大5メガバイトです。"}, + "Source is empty, right click on image first.": {"ja": "ソースが空で、右側の最初の画像をクリックしてください。"}, + "Sprites": {"ja": "スプライト"}, + "Square": {"ja": "平方"}, + "Strength:": {"ja": "力:"}, + "Strict": {"ja": "厳格な"}, + "Stroke": {"ja": "ストローク"}, + "Stroke size:": {"ja": "ストロークサイズ:"}, + "Target:": {"ja": "ターゲット:"}, + "Text": {"ja": "テキスト"}, + "Text:": {"ja": "テキスト:"}, + "The image could not be loaded.": {"ja": "イメージがロードできませんでした。"}, + "This can not be last layer": {"ja": "これが最後の層にすることはできません"}, + "This can not be last layer.": {"ja": "これが最後の層にすることはできません。"}, + "Tilt Shift": {"ja": "ティルトシフト"}, + "Times New Roman": {"ja": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"ja": "クリップボードから貼り付けるには、ctrl-vを使用します。"}, + "Tools": {"ja": "ツール"}, + "Top-left": {"ja": "左上"}, + "Top-right": {"ja": "右上"}, + "Total pixels:": {"ja": "総画素数:"}, + "Translate error, can not find dictionary:": {"ja": "エラーを翻訳、辞書を見つけることができません。"}, + "Transparency #1:": {"ja": "透明度#1:"}, + "Transparency #2:": {"ja": "透明性#2:"}, + "Transparent:": {"ja": "トランスペアレント:"}, + "Trim": {"ja": "トリム"}, + "Trim:": {"ja": "トリム:"}, + "Turkish": {"ja": "トルコ語"}, + "Undo": {"ja": "アンドゥ"}, + "Unique colors:": {"ja": "ユニークな色:"}, + "Up": {"ja": "アップ"}, + "V Radius:": {"ja": "V半径:"}, + "Verdana": {"ja": "Ms pゴシック"}, + "Vertical": {"ja": "垂直"}, + "Vertical gap:": {"ja": "垂直方向のギャップ:"}, + "Vibrance": {"ja": "自然な彩度"}, + "Vignette": {"ja": "寸描"}, + "Vignette amount:": {"ja": "ビネット量:"}, + "Vignette size:": {"ja": "ビネットサイズ:"}, + "ViliusL": {"ja": "Viliusl"}, + "Vintage": {"ja": "ビンテージ"}, + "Visible": {"ja": "目に見えます"}, + "Visible:": {"ja": "可視:"}, + "WEBP - Weppy File Format": {"ja": "Webp - weppyファイル形式"}, + "Website": {"ja": "ウェブサイト"}, + "Width (%):": {"ja": "幅(%):"}, + "Width (pixels):": {"ja": "幅(ピクセル):"}, + "Width:": {"ja": "幅:"}, + "Wrong file type, must be image or json.": {"ja": "間違ったファイルの種類、画像またはjsonでなければなりません。"}, + "X end:": {"ja": "Xのエンド:"}, + "X start:": {"ja": "Xが起動します。"}, + "Y end:": {"ja": "Y端:"}, + "Y start:": {"ja": "Y開始:"}, + "Yes": {"ja": "はい"}, + "Your browser does not support this format.": {"ja": "あなたのブラウザはこの形式をサポートしていません。"}, + "Your browser doesn't support canvas.": {"ja": "お使いのブラウザはキャンバスをサポートしていません。"}, + "Zoom": {"ja": "ズーム"}, + "Zoom In": {"ja": "ズームイン"}, + "Zoom Out": {"ja": "ズームアウトする"}, + "Zoom in": {"ja": "ズームイン"}, + "Zoom out": {"ja": "ズームアウトする"}, + "Zoom:": {"ja": "ズーム:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ja.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ja.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..309633867a19bf7ce5e36a73f8c513ca3ea67f9b --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ja.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + ja.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ko.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ko.js.js new file mode 100644 index 0000000000000000000000000000000000000000..2bc1ebd1cd466dce14c863e40a021350a767ddc6 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ko.js.js @@ -0,0 +1,342 @@ +var dict_ko = { + "2d": {"ko": "2 차원"}, + "3D position:": {"ko": "3 차원 위치 :"}, + "3D size:": {"ko": "3 차원 크기 :"}, + "480p": {"ko": "480p"}, + "About": {"ko": "약"}, + "Add new layer": {"ko": "새 레이어를 추가"}, + "Advanced": {"ko": "많은"}, + "All": {"ko": "모든"}, + "Alpha": {"ko": "알파"}, + "Alpha:": {"ko": "알파 :"}, + "Amount:": {"ko": "양:"}, + "Anonymous": {"ko": "익명"}, + "Anti aliasing": {"ko": "안티 앨리어싱"}, + "Area:": {"ko": "지역:"}, + "Arial": {"ko": "굴림"}, + "Arrow": {"ko": "화살"}, + "Arrow keys": {"ko": "화살표 키"}, + "Attributes": {"ko": "속성"}, + "Author:": {"ko": "저자:"}, + "Auto adjust colors": {"ko": "자동 색상 조정"}, + "Auto colorize": {"ko": "자동 색상 화"}, + "Average:": {"ko": "평균:"}, + "BMP - Windows Bitmap": {"ko": "Bmp - 윈도우 비트 맵"}, + "Basic": {"ko": "기본"}, + "BezierCurve": {"ko": "베지에 곡선"}, + "Big grains level:": {"ko": "큰 입자 수준 :"}, + "Black and White": {"ko": "검정색과 흰색"}, + "Blend": {"ko": "혼합"}, + "Blend:": {"ko": "혼합:"}, + "Blue": {"ko": "푸른"}, + "Blue channel:": {"ko": "블루 채널 :"}, + "Blur": {"ko": "흐림"}, + "Blur Radius:": {"ko": "흐림 반경 :"}, + "Blur tool": {"ko": "흐림 도구"}, + "Blur-Box": {"ko": "흐림 박스"}, + "Blur-Gaussian": {"ko": "블러 - 가우스"}, + "Blur-Stack": {"ko": "흐림 스택"}, + "Blur-Zoom": {"ko": "흐림 줌"}, + "Blur:": {"ko": "흐림:"}, + "Bold": {"ko": "대담한"}, + "Bold Italic": {"ko": "굵은 기울임 꼴"}, + "Borders": {"ko": "테두리"}, + "Both": {"ko": "양자 모두"}, + "Bottom-left": {"ko": "왼쪽 아래"}, + "Bottom-right": {"ko": "오른쪽 아래"}, + "Brightness:": {"ko": "명도:"}, + "Brush": {"ko": "붓"}, + "Bulge/Pinch": {"ko": "벌지 / 핀치"}, + "Bulge/Pinch tool": {"ko": "벌지 / 핀치 도구"}, + "Burn": {"ko": "화상"}, + "Burn/Dodge tool": {"ko": "/ 닷지 도구를 굽기"}, + "Cancel": {"ko": "취소하다"}, + "Center x:": {"ko": "센터 x :"}, + "Center y:": {"ko": "센터 y :"}, + "Center:": {"ko": "센터:"}, + "Channel:": {"ko": "채널:"}, + "Chrome": {"ko": "크롬"}, + "Circle": {"ko": "원"}, + "Clear": {"ko": "명확한"}, + "Clear selection": {"ko": "지우기 선택"}, + "Clone tool": {"ko": "복제 도구"}, + "Color #1:": {"ko": "색상 # 1 :"}, + "Color #2:": {"ko": "색상 # 2 :"}, + "Color Zoom": {"ko": "색상 줌"}, + "Color adjust:": {"ko": "색상 조정 :"}, + "Color corrections": {"ko": "색상 보정"}, + "Color to Alpha": {"ko": "알파에 색상"}, + "Color to alpha": {"ko": "알파에 색상"}, + "Color:": {"ko": "색:"}, + "Colorize": {"ko": "색상 화"}, + "Colors:": {"ko": "그림 물감:"}, + "Composite": {"ko": "합성물"}, + "Composition:": {"ko": "구성:"}, + "Contrast:": {"ko": "대조:"}, + "Copy selection": {"ko": "복사 선택"}, + "Courier": {"ko": "급사"}, + "Crop": {"ko": "수확고"}, + "Crop Selection": {"ko": "작물 선택"}, + "Curve": {"ko": "곡선"}, + "Custom": {"ko": "관습"}, + "Cut selection": {"ko": "컷 선택"}, + "Decrease color depth": {"ko": "색 농도를 감소"}, + "Decrease colors": {"ko": "감소 색상"}, + "Default": {"ko": "태만"}, + "Del": {"ko": "델"}, + "Delete": {"ko": "지우다"}, + "Delete selection": {"ko": "선택 삭제"}, + "Denoise": {"ko": "노이즈 제거"}, + "Desaturate": {"ko": "채도"}, + "Desaturation:": {"ko": "불포화 :"}, + "Description:": {"ko": "기술:"}, + "Differences": {"ko": "차이점"}, + "Differences Down": {"ko": "아래의 차이점"}, + "Dither": {"ko": "떨림"}, + "Dithering:": {"ko": "디더링 :"}, + "Dot Screen": {"ko": "도트 화면"}, + "Down": {"ko": "하위"}, + "Downloaded": {"ko": "다운로드"}, + "Draw circle": {"ko": "원 그리기"}, + "Draw letters": {"ko": "편지를 그리기"}, + "Draw line": {"ko": "그리기 라인"}, + "Draw rectangle": {"ko": "사각형을 그립니다"}, + "Duplicate": {"ko": "복제"}, + "Duplicate layer": {"ko": "중복 층"}, + "Dusts level:": {"ko": "먼지는 수준 :"}, + "Edge": {"ko": "가장자리"}, + "Edit": {"ko": "편집하다"}, + "Effects": {"ko": "효과"}, + "Email:": {"ko": "이메일:"}, + "Emboss": {"ko": "엠 보스"}, + "Empty data": {"ko": "빈 데이터"}, + "English": {"ko": "영어"}, + "Enrich": {"ko": "높이다"}, + "Enter angle (0-360):": {"ko": "각도 (0-360)를 입력합니다 :"}, + "Erase": {"ko": "삭제"}, + "Error": {"ko": "오류"}, + "Error:": {"ko": "오류:"}, + "Español": {"ko": "스페인어"}, + "Exponent:": {"ko": "멱지수:"}, + "Exposure level:": {"ko": "노출 수준 :"}, + "Factor:": {"ko": "인자:"}, + "File": {"ko": "파일"}, + "File name:": {"ko": "파일 이름:"}, + "Fill": {"ko": "가득 따르다"}, + "Fill style:": {"ko": "스타일 채우기 :"}, + "Fit": {"ko": "적당한"}, + "Fit window": {"ko": "맞춤 창"}, + "Flatten Image": {"ko": "이미지를 평평"}, + "Flip": {"ko": "튀기다"}, + "Font family:": {"ko": "글꼴 가족 :"}, + "Font style:": {"ko": "글꼴 스타일 :"}, + "French": {"ko": "프랑스 국민"}, + "Full HD, 1080p": {"ko": "풀 hd 1080p의"}, + "Fur": {"ko": "모피"}, + "Gap:": {"ko": "갭:"}, + "German": {"ko": "독일 사람"}, + "GitHub:": {"ko": "Github의 :"}, + "Gradient": {"ko": "구배"}, + "Gradient Radius:": {"ko": "그라데이션 반경 :"}, + "Grains": {"ko": "작살"}, + "Grains level:": {"ko": "곡물은 레벨 :"}, + "Gray": {"ko": "회색"}, + "GrayScale": {"ko": "그레이 스케일"}, + "Green": {"ko": "녹색"}, + "Green channel:": {"ko": "녹색 통로:"}, + "Greyscale:": {"ko": "그레이 스케일 :"}, + "Grid": {"ko": "그리드"}, + "Grid on/off": {"ko": "온 / 오프 그리드"}, + "Grouped": {"ko": "그룹화"}, + "H Radius:": {"ko": "H 반경 :"}, + "Heatmap": {"ko": "히트 맵"}, + "Height (%):": {"ko": "신장 (%) :"}, + "Height (pixels):": {"ko": "높이 (픽셀) :"}, + "Height:": {"ko": "신장:"}, + "Help": {"ko": "도움"}, + "Helvetica": {"ko": "헬 베티"}, + "Hermite": {"ko": "에르 미트"}, + "Histogram": {"ko": "히스토그램"}, + "Histogram:": {"ko": "히스토그램 :"}, + "Horizontal": {"ko": "수평"}, + "Horizontal gap:": {"ko": "수평 방향의 간격 :"}, + "Hue:": {"ko": "색조:"}, + "Image": {"ko": "영상"}, + "Impact": {"ko": "충격"}, + "Information": {"ko": "정보"}, + "Italiano": {"ko": "이탈리아어"}, + "Italic": {"ko": "이탤릭체"}, + "JPG - JPG/JPEG Format": {"ko": "도트 jpg - jpg / jpeg 형식"}, + "JPG Compression": {"ko": "도트 jpg 압축"}, + "JSON - Full layers data": {"ko": "Json - 전체 계층 데이터"}, + "Japanese": {"ko": "일본어"}, + "Key-points": {"ko": "키 포인트"}, + "Keyboard Shortcuts": {"ko": "키보드 바로 가기"}, + "Korean": {"ko": "한국어"}, + "Language": {"ko": "언어"}, + "Last modified": {"ko": "마지막으로 수정"}, + "Layer": {"ko": "층"}, + "Layers": {"ko": "레이어"}, + "Left": {"ko": "왼쪽"}, + "Level:": {"ko": "수평:"}, + "Levels:": {"ko": "레벨 :"}, + "Lietuvių": {"ko": "Lietuvių"}, + "Light leak:": {"ko": "빛 누출 :"}, + "Limit:": {"ko": "한도:"}, + "Luminance:": {"ko": "휘도 :"}, + "Luminosity:": {"ko": "밝기:"}, + "Magic Wand Tool": {"ko": "마법 지팡이 도구"}, + "Merge": {"ko": "병합"}, + "Merge Down": {"ko": "아래로 병합"}, + "Mode:": {"ko": "방법:"}, + "Mosaic": {"ko": "모자이크"}, + "Mouse:": {"ko": "쥐:"}, + "Move": {"ko": "움직임"}, + "Move active layer": {"ko": "활성층 이동"}, + "Move down": {"ko": "아래로 이동"}, + "Move up": {"ko": "위로 이동"}, + "Multi-line": {"ko": "멀티 라인"}, + "Name:": {"ko": "이름:"}, + "Negative": {"ko": "부정"}, + "New": {"ko": "새로운"}, + "New file...": {"ko": "새 파일 ..."}, + "New layer": {"ko": "새 레이어"}, + "No": {"ko": "아니"}, + "Normal": {"ko": "표준"}, + "Notice": {"ko": "주의"}, + "Notice:": {"ko": "주의:"}, + "Oil": {"ko": "기름"}, + "Ok": {"ko": "승인"}, + "Online image editor": {"ko": "온라인 이미지 편집기"}, + "Opacity": {"ko": "불투명"}, + "Open": {"ko": "열다"}, + "Original size": {"ko": "원본 크기"}, + "PNG - Portable Network Graphics": {"ko": "Png - 휴대용 네트워크 그래픽"}, + "Paste": {"ko": "풀"}, + "Paste selection": {"ko": "붙여 넣기 선택"}, + "Pencil": {"ko": "연필"}, + "Perspective": {"ko": "원근법"}, + "Pick Color": {"ko": "색상을 선택"}, + "Pixels:": {"ko": "픽셀 :"}, + "Portuguese": {"ko": "포르투갈 인"}, + "Power:": {"ko": "힘:"}, + "Pre-Blur:": {"ko": "사전 흐림 :"}, + "Preview": {"ko": "시사"}, + "Print": {"ko": "인쇄"}, + "Quality (jpeg):": {"ko": "품질 (jpeg) :"}, + "Quality:": {"ko": "품질:"}, + "Quick load": {"ko": "빠른로드"}, + "Quick save": {"ko": "저장 빠른"}, + "Radial": {"ko": "레이디 얼"}, + "Radius:": {"ko": "반지름:"}, + "Range:": {"ko": "범위:"}, + "Reason:": {"ko": "이유:"}, + "Recover alpha": {"ko": "알파 복구"}, + "Red": {"ko": "빨간"}, + "Red channel:": {"ko": "적색 통로:"}, + "Rename": {"ko": "이름 바꾸기"}, + "Rename layer": {"ko": "레이어의 이름을 바꿉니다"}, + "Replace Color": {"ko": "색상을 교체"}, + "Replace color": {"ko": "색상을 교체"}, + "Replacement:": {"ko": "바꿔 놓음:"}, + "Resample - Hermite": {"ko": "리 샘플 - 에르 미트"}, + "Reset zoom level": {"ko": "리셋 줌 레벨"}, + "Resize": {"ko": "크기 조정"}, + "Resolution:": {"ko": "해결:"}, + "Restore alpha": {"ko": "알파 복원"}, + "Right": {"ko": "권리"}, + "Rotate": {"ko": "회전"}, + "Rotate left": {"ko": "왼쪽으로 회전"}, + "Rotation": {"ko": "회전"}, + "Russian": {"ko": "러시아인"}, + "Saturation:": {"ko": "포화:"}, + "Save": {"ko": "구하다"}, + "Save as": {"ko": "다른 이름으로 저장"}, + "Save as type:": {"ko": "형식으로 저장 :"}, + "Save layers:": {"ko": "레이어를 저장 :"}, + "Save resolution:": {"ko": "해상도를 저장 :"}, + "Select all": {"ko": "모든 선택"}, + "Select area first": {"ko": "선택 영역 처음"}, + "Select area tool": {"ko": "선택 영역 도구"}, + "Select color": {"ko": "색상을 선택"}, + "Select object tool": {"ko": "개체 선택 도구"}, + "Selected": {"ko": "선택된"}, + "Sensitivity:": {"ko": "감광도:"}, + "Sepia": {"ko": "세피아"}, + "Shaded": {"ko": "음영"}, + "Shadow blur:": {"ko": "그림자 흐림 :"}, + "Shadow color:": {"ko": "그림자 색상 :"}, + "Shadow:": {"ko": "그림자:"}, + "Sharpen": {"ko": "갈다"}, + "Sharpen tool": {"ko": "도구를 선명하게"}, + "Sharpen:": {"ko": "갈다:"}, + "Show / Hide": {"ko": "표시 / 숨기기"}, + "Simple": {"ko": "단순한"}, + "Size": {"ko": "크기"}, + "Size:": {"ko": "크기:"}, + "Sketchy": {"ko": "스케치의"}, + "Solarize": {"ko": "지나치게 노출되다"}, + "Sorry": {"ko": "죄송합니다"}, + "Sorry, image is too big, max 5 MB.": {"ko": "죄송합니다, 이미지가 너무 큰, 최대 5메가바이트입니다."}, + "Source is empty, right click on image first.": {"ko": "소스가 비어있는 오른쪽 첫 번째 이미지를 클릭하십시오."}, + "Sprites": {"ko": "스프라이트"}, + "Square": {"ko": "광장"}, + "Strength:": {"ko": "힘:"}, + "Strict": {"ko": "엄격한"}, + "Stroke": {"ko": "행정"}, + "Stroke size:": {"ko": "스트로크의 크기 :"}, + "Target:": {"ko": "목표:"}, + "Text": {"ko": "본문"}, + "Text:": {"ko": "본문:"}, + "The image could not be loaded.": {"ko": "이미지를로드 할 수 없습니다."}, + "This can not be last layer": {"ko": "이 마지막 층이 될 수 없습니다"}, + "This can not be last layer.": {"ko": "이 마지막 층이 될 수 없습니다."}, + "Tilt Shift": {"ko": "틸트 시프트"}, + "Times New Roman": {"ko": "타임즈 새로운 로마"}, + "To paste from clipboard, use Ctrl-V.": {"ko": "클립 보드에서 붙여 넣으려면 ctrl 키-v를 사용합니다."}, + "Tools": {"ko": "도구"}, + "Top-left": {"ko": "왼쪽 위"}, + "Top-right": {"ko": "오른쪽 상단"}, + "Total pixels:": {"ko": "총 픽셀 :"}, + "Translate error, can not find dictionary:": {"ko": "사전을 찾을 수 없습니다, 오류를 번역 :"}, + "Transparency #1:": {"ko": "투명 # 1 :"}, + "Transparency #2:": {"ko": "투명 # 2 :"}, + "Transparent:": {"ko": "투명한:"}, + "Trim": {"ko": "손질"}, + "Trim:": {"ko": "손질:"}, + "Turkish": {"ko": "터키의"}, + "Undo": {"ko": "끄르다"}, + "Unique colors:": {"ko": "고유 색상 :"}, + "Up": {"ko": "쪽으로"}, + "V Radius:": {"ko": "V 반경 :"}, + "Verdana": {"ko": "굴림"}, + "Vertical": {"ko": "수직선"}, + "Vertical gap:": {"ko": "수직 방향의 간격 :"}, + "Vibrance": {"ko": "활기"}, + "Vignette": {"ko": "삽화"}, + "Vignette amount:": {"ko": "네트 금액 :"}, + "Vignette size:": {"ko": "네트의 크기 :"}, + "ViliusL": {"ko": "Viliusl"}, + "Vintage": {"ko": "포도 수확"}, + "Visible": {"ko": "명백한"}, + "Visible:": {"ko": "명백한:"}, + "WEBP - Weppy File Format": {"ko": "Webp 형식 - weppy 파일 형식"}, + "Website": {"ko": "웹 사이트"}, + "Width (%):": {"ko": "폭 (%) :"}, + "Width (pixels):": {"ko": "폭 (픽셀) :"}, + "Width:": {"ko": "폭:"}, + "Wrong file type, must be image or json.": {"ko": "잘못된 파일 형식, 이미지 또는 json해야합니다."}, + "X end:": {"ko": "X의 말 :"}, + "X start:": {"ko": "X 시작 :"}, + "Y end:": {"ko": "Y 끝 :"}, + "Y start:": {"ko": "Y 시작 :"}, + "Yes": {"ko": "예"}, + "Your browser does not support this format.": {"ko": "브라우저가이 형식을 지원하지 않습니다."}, + "Your browser doesn't support canvas.": {"ko": "브라우저가 캔버스를 지원하지 않습니다."}, + "Zoom": {"ko": "줌"}, + "Zoom In": {"ko": "확대"}, + "Zoom Out": {"ko": "축소"}, + "Zoom in": {"ko": "확대"}, + "Zoom out": {"ko": "축소"}, + "Zoom:": {"ko": "줌:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ko.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ko.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..f854814ceedfc02140d20c862cd6fd64e07d21f9 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ko.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + ko.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/lt.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/lt.js.js new file mode 100644 index 0000000000000000000000000000000000000000..66f9262c97a788f9fdef359e08388e50e4518c74 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/lt.js.js @@ -0,0 +1,342 @@ +var dict_lt = { + "2d": {"lt": "2d"}, + "3D position:": {"lt": "3d vieta:"}, + "3D size:": {"lt": "3d dydis:"}, + "480p": {"lt": "480p"}, + "About": {"lt": "Apie"}, + "Add new layer": {"lt": "Įdėti naują sluoksnį"}, + "Advanced": {"lt": "Pažangus"}, + "All": {"lt": "Visi"}, + "Alpha": {"lt": "Alfa"}, + "Alpha:": {"lt": "Alfa:"}, + "Amount:": {"lt": "Kiekis:"}, + "Anonymous": {"lt": "Anoniminis"}, + "Anti aliasing": {"lt": "Sulieti"}, + "Area:": {"lt": "Plotas:"}, + "Arial": {"lt": "Arial"}, + "Arrow": {"lt": "Rodyklė"}, + "Arrow keys": {"lt": "Rodyklių klavišai"}, + "Attributes": {"lt": "Atributai"}, + "Author:": {"lt": "Autorius:"}, + "Auto adjust colors": {"lt": "Sureguliuoti spalvas"}, + "Auto colorize": {"lt": "Auto dažymas"}, + "Average:": {"lt": "Vidurkis:"}, + "BMP - Windows Bitmap": {"lt": "BMP - Windows Bitmap"}, + "Basic": {"lt": "Paprastas"}, + "BezierCurve": {"lt": "Bezjė kreivė"}, + "Big grains level:": {"lt": "Didelis grūdėtumo lygis:"}, + "Black and White": {"lt": "Juoda ir balta"}, + "Blend": {"lt": "Mišinys"}, + "Blend:": {"lt": "Mišinys:"}, + "Blue": {"lt": "Mėlynas"}, + "Blue channel:": {"lt": "Mėlyna kanalas:"}, + "Blur": {"lt": "Migla"}, + "Blur Radius:": {"lt": "Migla spindulys:"}, + "Blur tool": {"lt": "Migla įrankis"}, + "Blur-Box": {"lt": "Migla dėžė"}, + "Blur-Gaussian": {"lt": "Migla gauso"}, + "Blur-Stack": {"lt": "Migla stack"}, + "Blur-Zoom": {"lt": "Migla stekas"}, + "Blur:": {"lt": "Migla:"}, + "Bold": {"lt": "Drąsus"}, + "Bold Italic": {"lt": "Bold italic"}, + "Borders": {"lt": "Ribojasi"}, + "Both": {"lt": "Abu"}, + "Bottom-left": {"lt": "Apatiniame kairiajame"}, + "Bottom-right": {"lt": "Apačioje dešinėje"}, + "Brightness:": {"lt": "Ryškumas:"}, + "Brush": {"lt": "Šepetys"}, + "Bulge/Pinch": {"lt": "Bumbulas/Žiupsnelis"}, + "Bulge/Pinch tool": {"lt": "Bumbulas/Žiupsnelis"}, + "Burn": {"lt": "Deginti"}, + "Burn/Dodge tool": {"lt": "Burn / dodge nuorodą"}, + "Cancel": {"lt": "Atšaukti"}, + "Center x:": {"lt": "Centras x:"}, + "Center y:": {"lt": "Centras y:"}, + "Center:": {"lt": "Centras:"}, + "Channel:": {"lt": "Kanalas:"}, + "Chrome": {"lt": "Chromas"}, + "Circle": {"lt": "Ratas"}, + "Clear": {"lt": "Išvalyti"}, + "Clear selection": {"lt": "Išvalyti žymėjimą"}, + "Clone tool": {"lt": "Klonas įrankis"}, + "Color #1:": {"lt": "Spalva # 1:"}, + "Color #2:": {"lt": "Spalva # 2:"}, + "Color Zoom": {"lt": "Spalvų priartinimas"}, + "Color adjust:": {"lt": "Spalva reguliuoti:"}, + "Color corrections": {"lt": "Spalvų korekcijos"}, + "Color to Alpha": {"lt": "Spalva alfa"}, + "Color to alpha": {"lt": "Spalva alfa"}, + "Color:": {"lt": "Spalva:"}, + "Colorize": {"lt": "Dažymas"}, + "Colors:": {"lt": "Spalvos:"}, + "Composite": {"lt": "Sudėtinis"}, + "Composition:": {"lt": "Sudėtis:"}, + "Contrast:": {"lt": "Kontrastas:"}, + "Copy selection": {"lt": "Kopijuoti pasirinkimas"}, + "Courier": {"lt": "Kurjeris"}, + "Crop": {"lt": "Iškirpti"}, + "Crop Selection": {"lt": "Iškirpti parinkimą"}, + "Curve": {"lt": "Kreivė"}, + "Custom": {"lt": "Kitas"}, + "Cut selection": {"lt": "Iškirpti pasirinkimas"}, + "Decrease color depth": {"lt": "Sumažinti spalvų gylį"}, + "Decrease colors": {"lt": "Sumažinti spalvos"}, + "Default": {"lt": "Numatytas"}, + "Del": {"lt": "Del"}, + "Delete": {"lt": "Panaikinti"}, + "Delete selection": {"lt": "Ištrinti pasirinkimą"}, + "Denoise": {"lt": "Sumažinti triukšmą"}, + "Desaturate": {"lt": "Sumažinti ryškumą"}, + "Desaturation:": {"lt": "Sumažėjimas ryškumo:"}, + "Description:": {"lt": "Aprašymas:"}, + "Differences": {"lt": "Skirtumai"}, + "Differences Down": {"lt": "Skirtumai žemyn"}, + "Dither": {"lt": "Papildymas"}, + "Dithering:": {"lt": "Papildymu:"}, + "Dot Screen": {"lt": "Taškų ekranas"}, + "Down": {"lt": "žemyn"}, + "Downloaded": {"lt": "Siuntėsi"}, + "Draw circle": {"lt": "Piešti apskritimą"}, + "Draw letters": {"lt": "Piešti raides"}, + "Draw line": {"lt": "Piešti liniją"}, + "Draw rectangle": {"lt": "Piešti stačiakampį"}, + "Duplicate": {"lt": "Dauginti"}, + "Duplicate layer": {"lt": "Duplicate layer"}, + "Dusts level:": {"lt": "Dulkių lygis:"}, + "Edge": {"lt": "Kraštas"}, + "Edit": {"lt": "Redaguoti"}, + "Effects": {"lt": "Efektai"}, + "Email:": {"lt": "El. paštas:"}, + "Emboss": {"lt": "Įspausti"}, + "Empty data": {"lt": "Tušti duomenys"}, + "English": {"lt": "Anglų"}, + "Enrich": {"lt": "Praturtinti"}, + "Enter angle (0-360):": {"lt": "įveskite kampą (0-360):"}, + "Erase": {"lt": "Ištrinti"}, + "Error": {"lt": "Klaida"}, + "Error:": {"lt": "Klaida:"}, + "Español": {"lt": "Ispanų"}, + "Exponent:": {"lt": "Eksponentė:"}, + "Exposure level:": {"lt": "Ekspozicijos lygis:"}, + "Factor:": {"lt": "Veiksnys:"}, + "File": {"lt": "Byla"}, + "File name:": {"lt": "Failo pavadinimas:"}, + "Fill": {"lt": "Pildyti"}, + "Fill style:": {"lt": "Užpildykite stilius:"}, + "Fit": {"lt": "Talpinti"}, + "Fit window": {"lt": "Talpinti į langą"}, + "Flatten Image": {"lt": "Priploti vaizdą"}, + "Flip": {"lt": "Apversti"}, + "Font family:": {"lt": "Šrifto šeima:"}, + "Font style:": {"lt": "Šrifto stilius:"}, + "French": {"lt": "Prancūzų kalba"}, + "Full HD, 1080p": {"lt": "Full HD, 1080p"}, + "Fur": {"lt": "Kailis"}, + "Gap:": {"lt": "Atotrūkis:"}, + "German": {"lt": "Vokiečių"}, + "GitHub:": {"lt": "Github:"}, + "Gradient": {"lt": "Gradientas"}, + "Gradient Radius:": {"lt": "Gradientas spindulys:"}, + "Grains": {"lt": "Grūdėtumas"}, + "Grains level:": {"lt": "Grūdėtumo lygis:"}, + "Gray": {"lt": "Pilkas"}, + "GrayScale": {"lt": "Pilkai"}, + "Green": {"lt": "Žalias"}, + "Green channel:": {"lt": "Žalias kanalas:"}, + "Greyscale:": {"lt": "Pilkieji pustoniai:"}, + "Grid": {"lt": "Tinklelis"}, + "Grid on/off": {"lt": "Tinklelis"}, + "Grouped": {"lt": "Grupuoti"}, + "H Radius:": {"lt": "H spindulys:"}, + "Heatmap": {"lt": "Spalvinė diagrama"}, + "Height (%):": {"lt": "Aukštis (%):"}, + "Height (pixels):": {"lt": "Aukštis (pikselių):"}, + "Height:": {"lt": "Aukštis:"}, + "Help": {"lt": "Pagalba"}, + "Helvetica": {"lt": "Helvetica"}, + "Hermite": {"lt": "Hermite"}, + "Histogram": {"lt": "Histograma"}, + "Histogram:": {"lt": "Histograma:"}, + "Horizontal": {"lt": "Horizontalus"}, + "Horizontal gap:": {"lt": "Horizontalus tarpas:"}, + "Hue:": {"lt": "Atspalvis:"}, + "Image": {"lt": "Vaizdas"}, + "Impact": {"lt": "Poveikis"}, + "Information": {"lt": "Informacija"}, + "Italiano": {"lt": "Italų"}, + "Italic": {"lt": "Kursyvinis"}, + "JPG - JPG/JPEG Format": {"lt": "JPG - JPG/JPEG formatas"}, + "JPG Compression": {"lt": "JPG suspaudimo"}, + "JSON - Full layers data": {"lt": "JSON - sluoksnių duomenys"}, + "Japanese": {"lt": "Japonijos"}, + "Key-points": {"lt": "Pagrindiniai taškai"}, + "Keyboard Shortcuts": {"lt": "Klaviatūros nuorodos"}, + "Korean": {"lt": "Korėjiečių"}, + "Language": {"lt": "Kalba"}, + "Last modified": {"lt": "Paskutinį kartą keistas"}, + "Layer": {"lt": "Sluoksnis"}, + "Layers": {"lt": "Sluoksniai"}, + "Left": {"lt": "Į kairę"}, + "Level:": {"lt": "Lygis:"}, + "Levels:": {"lt": "Lygiais:"}, + "Lietuvių": {"lt": "Lietuvių"}, + "Light leak:": {"lt": "šviesos nuotėkio:"}, + "Limit:": {"lt": "Riba:"}, + "Luminance:": {"lt": "Skaisčio:"}, + "Luminosity:": {"lt": "Ryškumas:"}, + "Magic Wand Tool": {"lt": "Stebuklinga lazdelė"}, + "Merge": {"lt": "Susijungti"}, + "Merge Down": {"lt": "Sujungti žemyn"}, + "Mode:": {"lt": "Režimas:"}, + "Mosaic": {"lt": "Mozaika"}, + "Mouse:": {"lt": "Pelė:"}, + "Move": {"lt": "Judėti"}, + "Move active layer": {"lt": "Perkelti aktyvų sluoksnį"}, + "Move down": {"lt": "Judėti žemyn"}, + "Move up": {"lt": "Perkelti"}, + "Multi-line": {"lt": "Kelių eilučių"}, + "Name:": {"lt": "Vardas:"}, + "Negative": {"lt": "Neigiamas"}, + "New": {"lt": "Naujas"}, + "New file...": {"lt": "Naujas failas ..."}, + "New layer": {"lt": "Nauja sluoksnis"}, + "No": {"lt": "Ne"}, + "Normal": {"lt": "Normalus"}, + "Notice": {"lt": "Pastebėti"}, + "Notice:": {"lt": "Pastebėti:"}, + "Oil": {"lt": "Aliejus"}, + "Ok": {"lt": "Gerai"}, + "Online image editor": {"lt": "Prisijungę grafinis redaktorius"}, + "Opacity": {"lt": "Nepermatomumas"}, + "Open": {"lt": "Atidaryti"}, + "Original size": {"lt": "Originalus dydis"}, + "PNG - Portable Network Graphics": {"lt": "PNG - portable network graphics"}, + "Paste": {"lt": "Įkelti"}, + "Paste selection": {"lt": "Nukopijuokite pasirinkimas"}, + "Pencil": {"lt": "Pieštukas"}, + "Perspective": {"lt": "Perspektyva"}, + "Pick Color": {"lt": "Pasirinkite spalvą"}, + "Pixels:": {"lt": "Taškai:"}, + "Portuguese": {"lt": "Portugalų"}, + "Power:": {"lt": "Galia:"}, + "Pre-Blur:": {"lt": "Migla:"}, + "Preview": {"lt": "Peržiūrėti"}, + "Print": {"lt": "Spausdinti"}, + "Quality (jpeg):": {"lt": "Kokybė (jpeg):"}, + "Quality:": {"lt": "Kokybė:"}, + "Quick load": {"lt": "Greitas įkrovimas"}, + "Quick save": {"lt": "Greitas išsaugojimas"}, + "Radial": {"lt": "Radialinis"}, + "Radius:": {"lt": "Spindulys:"}, + "Range:": {"lt": "Kategorijos:"}, + "Reason:": {"lt": "Priežastis:"}, + "Recover alpha": {"lt": "Atkurti permatomumą"}, + "Red": {"lt": "Raudonas"}, + "Red channel:": {"lt": "Raudonasis kanalas:"}, + "Rename": {"lt": "Pervadinti"}, + "Rename layer": {"lt": "Pervadinti sluoksnį"}, + "Replace Color": {"lt": "Pakeiskite spalvą"}, + "Replace color": {"lt": "Pakeiskite spalvą"}, + "Replacement:": {"lt": "Pakeitimas:"}, + "Resample - Hermite": {"lt": "Resample - hermite"}, + "Reset zoom level": {"lt": "Atstatyti mastelį"}, + "Resize": {"lt": "Keisti dydį"}, + "Resolution:": {"lt": "Rezoliucija:"}, + "Restore alpha": {"lt": "Atkurti alfa"}, + "Right": {"lt": "Dešinė"}, + "Rotate": {"lt": "Sukti"}, + "Rotate left": {"lt": "Pasukti į kairę"}, + "Rotation": {"lt": "Rotacija"}, + "Russian": {"lt": "Rusijos"}, + "Saturation:": {"lt": "Spalvingumas:"}, + "Save": {"lt": "Išsaugoti"}, + "Save as": {"lt": "Išsaugoti kaip"}, + "Save as type:": {"lt": "Išsaugoti kaip:"}, + "Save layers:": {"lt": "Išsaugoti sluoksnius:"}, + "Save resolution:": {"lt": "Išsaugoti rezoliuciją:"}, + "Select all": {"lt": "Pasirinkti viską"}, + "Select area first": {"lt": "Pasirinkite plotas pirmas"}, + "Select area tool": {"lt": "Pasirinkite plotas įrankis"}, + "Select color": {"lt": "Pasirinkite spalvą"}, + "Select object tool": {"lt": "Pasirinkite objektas įrankis"}, + "Selected": {"lt": "Pasirinkti"}, + "Sensitivity:": {"lt": "Jautrumas:"}, + "Sepia": {"lt": "Sepija"}, + "Shaded": {"lt": "Tamsioje"}, + "Shadow blur:": {"lt": "Šešėlių migla:"}, + "Shadow color:": {"lt": "Šešėlių spalva:"}, + "Shadow:": {"lt": "Šešėlis:"}, + "Sharpen": {"lt": "Pagaląsti"}, + "Sharpen tool": {"lt": "Paryškinti nuorodą"}, + "Sharpen:": {"lt": "Paryškinti:"}, + "Show / Hide": {"lt": "Rodyti / slėpti"}, + "Simple": {"lt": "Paprastas"}, + "Size": {"lt": "Dydis"}, + "Size:": {"lt": "Dydis:"}, + "Sketchy": {"lt": "Paviršutiniškas"}, + "Solarize": {"lt": "Soliarizacija"}, + "Sorry": {"lt": "Atsiprašau"}, + "Sorry, image is too big, max 5 MB.": {"lt": "Atsiprašome, vaizdas yra per didelis, daugiausiai 5 MB."}, + "Source is empty, right click on image first.": {"lt": "šaltinis yra tuščias, dešiniuoju pelės mygtuku spustelėkite ant nuotraukos pirmą kartą."}, + "Sprites": {"lt": "Sprites"}, + "Square": {"lt": "Langelis"}, + "Strength:": {"lt": "Jėga:"}, + "Strict": {"lt": "Griežtas"}, + "Stroke": {"lt": "Brūkšnys"}, + "Stroke size:": {"lt": "Brūkšnio dydis:"}, + "Target:": {"lt": "Tikslas:"}, + "Text": {"lt": "Tekstas"}, + "Text:": {"lt": "Tekstas:"}, + "The image could not be loaded.": {"lt": "Vaizdas negali būti įkeltas."}, + "This can not be last layer": {"lt": "Tai gali būti ne paskutinis sluoksnis"}, + "This can not be last layer.": {"lt": "Tai gali būti ne paskutinis sluoksnis."}, + "Tilt Shift": {"lt": "Tento perkelimas"}, + "Times New Roman": {"lt": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"lt": "Norėdami įklijuoti iš mainų srities, naudokite ctrl-v."}, + "Tools": {"lt": "Įrankiai"}, + "Top-left": {"lt": "Viršuje kairėje"}, + "Top-right": {"lt": "Viršutiniame dešiniajame"}, + "Total pixels:": {"lt": "Iš viso taškų:"}, + "Translate error, can not find dictionary:": {"lt": "Versti klaidą, negali rasti žodyną:"}, + "Transparency #1:": {"lt": "Skaidrumas # 1:"}, + "Transparency #2:": {"lt": "Skaidrumas # 2:"}, + "Transparent:": {"lt": "Skaidri:"}, + "Trim": {"lt": "Apkarpyti"}, + "Trim:": {"lt": "Apkarpyti:"}, + "Turkish": {"lt": "Turkų"}, + "Undo": {"lt": "Anuliuoti"}, + "Unique colors:": {"lt": "Unikalios spalvos:"}, + "Up": {"lt": "Aukštyn"}, + "V Radius:": {"lt": "V spindulys:"}, + "Verdana": {"lt": "Verdana"}, + "Vertical": {"lt": "Vertikalus"}, + "Vertical gap:": {"lt": "Vertikali atotrūkis:"}, + "Vibrance": {"lt": "Rezonansas"}, + "Vignette": {"lt": "Vinjetė"}, + "Vignette amount:": {"lt": "Vinjetė suma:"}, + "Vignette size:": {"lt": "Vinjetė dydis:"}, + "ViliusL": {"lt": "Viliusl"}, + "Vintage": {"lt": "Senoviškas"}, + "Visible": {"lt": "Matomas"}, + "Visible:": {"lt": "Matomas:"}, + "WEBP - Weppy File Format": {"lt": "WEBP - weppy failo formatas"}, + "Website": {"lt": "Interneto svetainė"}, + "Width (%):": {"lt": "Plotis (%):"}, + "Width (pixels):": {"lt": "Plotis (taškų):"}, + "Width:": {"lt": "Plotis:"}, + "Wrong file type, must be image or json.": {"lt": "Neteisingas failo tipas, turi būti paveikslėlis arba json."}, + "X end:": {"lt": "X pabaiga:"}, + "X start:": {"lt": "X pradžia::"}, + "Y end:": {"lt": "Y pabaiga:"}, + "Y start:": {"lt": "Y pradžia:"}, + "Yes": {"lt": "Taip"}, + "Your browser does not support this format.": {"lt": "Jūsų naršyklė nepalaiko šio formato."}, + "Your browser doesn't support canvas.": {"lt": "Jūsų naršyklė nepalaiko drobės."}, + "Zoom": {"lt": "Padidinti"}, + "Zoom In": {"lt": "Priartinti"}, + "Zoom Out": {"lt": "Nutolinti"}, + "Zoom in": {"lt": "Priartinti"}, + "Zoom out": {"lt": "Nutolinti"}, + "Zoom:": {"lt": "Priartinimas:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/lt.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/lt.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..d5c9caf3c79307b1b783ae41e5c87830e76a6a2f --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/lt.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + lt.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/pt.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/pt.js.js new file mode 100644 index 0000000000000000000000000000000000000000..90cf0f061475fd2d6ce040efa8266a0e8de25503 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/pt.js.js @@ -0,0 +1,342 @@ +var dict_pt = { + "2d": {"pt": "2d"}, + "3D position:": {"pt": "Posição 3d:"}, + "3D size:": {"pt": "Tamanho 3d:"}, + "480p": {"pt": "480p"}, + "About": {"pt": "Sobre"}, + "Add new layer": {"pt": "Adicionar nova camada"}, + "Advanced": {"pt": "Avançado"}, + "All": {"pt": "Todos"}, + "Alpha": {"pt": "Alfa"}, + "Alpha:": {"pt": "Alfa:"}, + "Amount:": {"pt": "Quantidade:"}, + "Anonymous": {"pt": "Anônimo"}, + "Anti aliasing": {"pt": "Aliasing anti"}, + "Area:": {"pt": "área:"}, + "Arial": {"pt": "Arial"}, + "Arrow": {"pt": "Flecha"}, + "Arrow keys": {"pt": "Teclas de seta"}, + "Attributes": {"pt": "Atributos"}, + "Author:": {"pt": "Autor:"}, + "Auto adjust colors": {"pt": "Auto ajustar cores"}, + "Auto colorize": {"pt": "Colorize auto"}, + "Average:": {"pt": "Média:"}, + "BMP - Windows Bitmap": {"pt": "Bmp - janelas bitmap"}, + "Basic": {"pt": "Básico"}, + "BezierCurve": {"pt": "Curva de bézier"}, + "Big grains level:": {"pt": "Big grãos nível:"}, + "Black and White": {"pt": "Preto e branco"}, + "Blend": {"pt": "Mistura"}, + "Blend:": {"pt": "Mistura:"}, + "Blue": {"pt": "Azul"}, + "Blue channel:": {"pt": "Canal de azul:"}, + "Blur": {"pt": "Borrão"}, + "Blur Radius:": {"pt": "Raio de desfoque:"}, + "Blur tool": {"pt": "Ferramenta de desfoque"}, + "Blur-Box": {"pt": "Borrão-box"}, + "Blur-Gaussian": {"pt": "Borrão-gaussian"}, + "Blur-Stack": {"pt": "Borrão-stack"}, + "Blur-Zoom": {"pt": "Borrão-zoom"}, + "Blur:": {"pt": "Borrão:"}, + "Bold": {"pt": "Negrito"}, + "Bold Italic": {"pt": "Negrito itálico"}, + "Borders": {"pt": "Fronteiras"}, + "Both": {"pt": "Ambos"}, + "Bottom-left": {"pt": "Inferior esquerdo"}, + "Bottom-right": {"pt": "Canto inferior direito"}, + "Brightness:": {"pt": "Brilho:"}, + "Brush": {"pt": "Escova"}, + "Bulge/Pinch": {"pt": "Bulge / pitada"}, + "Bulge/Pinch tool": {"pt": "Bulge / ferramenta pitada"}, + "Burn": {"pt": "Queimar"}, + "Burn/Dodge tool": {"pt": "Queimadura / ferramenta dodge"}, + "Cancel": {"pt": "Cancelar"}, + "Center x:": {"pt": "Centro x:"}, + "Center y:": {"pt": "Centro y:"}, + "Center:": {"pt": "Centro:"}, + "Channel:": {"pt": "Canal:"}, + "Chrome": {"pt": "Cromada"}, + "Circle": {"pt": "Círculo"}, + "Clear": {"pt": "Claro"}, + "Clear selection": {"pt": "Seleção clara"}, + "Clone tool": {"pt": "Ferramenta clone"}, + "Color #1:": {"pt": "Cor # 1:"}, + "Color #2:": {"pt": "Color # 2:"}, + "Color Zoom": {"pt": "Zoom cor"}, + "Color adjust:": {"pt": "Cor ajustar:"}, + "Color corrections": {"pt": "Correções de cores"}, + "Color to Alpha": {"pt": "Cor para alpha"}, + "Color to alpha": {"pt": "Cor para alpha"}, + "Color:": {"pt": "Cor:"}, + "Colorize": {"pt": "Colorir"}, + "Colors:": {"pt": "Colors:"}, + "Composite": {"pt": "Composto"}, + "Composition:": {"pt": "Composição:"}, + "Contrast:": {"pt": "Contraste:"}, + "Copy selection": {"pt": "Copiar seleção"}, + "Courier": {"pt": "Correio"}, + "Crop": {"pt": "Colheita"}, + "Crop Selection": {"pt": "Seleção de culturas"}, + "Curve": {"pt": "Curva"}, + "Custom": {"pt": "Personalizadas"}, + "Cut selection": {"pt": "Seleção cut"}, + "Decrease color depth": {"pt": "Diminuir a profundidade de cor"}, + "Decrease colors": {"pt": "Cores diminuir"}, + "Default": {"pt": "Padrão"}, + "Del": {"pt": "Del"}, + "Delete": {"pt": "Excluir"}, + "Delete selection": {"pt": "Excluir seleção"}, + "Denoise": {"pt": "Denoise"}, + "Desaturate": {"pt": "Desaturate"}, + "Desaturation:": {"pt": "Dessaturação:"}, + "Description:": {"pt": "Descrição:"}, + "Differences": {"pt": "Diferenças"}, + "Differences Down": {"pt": "Diferenças para baixo"}, + "Dither": {"pt": "Tremor"}, + "Dithering:": {"pt": "Composição de cores:"}, + "Dot Screen": {"pt": "Tela de ponto"}, + "Down": {"pt": "Baixa"}, + "Downloaded": {"pt": "Transferido"}, + "Draw circle": {"pt": "Desenhar círculo"}, + "Draw letters": {"pt": "Desenhar as letras"}, + "Draw line": {"pt": "Desenhar linha"}, + "Draw rectangle": {"pt": "Desenhar rectângulo"}, + "Duplicate": {"pt": "Duplicado"}, + "Duplicate layer": {"pt": "Duplicar camada"}, + "Dusts level:": {"pt": "Poeiras nível:"}, + "Edge": {"pt": "Beira"}, + "Edit": {"pt": "Editar"}, + "Effects": {"pt": "Efeito"}, + "Email:": {"pt": "O email:"}, + "Emboss": {"pt": "Emboss"}, + "Empty data": {"pt": "De dados vazio"}, + "English": {"pt": "Inglês"}, + "Enrich": {"pt": "Enriquecer"}, + "Enter angle (0-360):": {"pt": "Digite o ângulo (0-360):"}, + "Erase": {"pt": "Apagar"}, + "Error": {"pt": "Erro"}, + "Error:": {"pt": "Erro:"}, + "Español": {"pt": "Español"}, + "Exponent:": {"pt": "Expoente:"}, + "Exposure level:": {"pt": "Nível de exposição:"}, + "Factor:": {"pt": "Fator:"}, + "File": {"pt": "Arquivo"}, + "File name:": {"pt": "Nome do arquivo:"}, + "Fill": {"pt": "Preencher"}, + "Fill style:": {"pt": "Estilo de preenchimento:"}, + "Fit": {"pt": "Caber"}, + "Fit window": {"pt": "Janela de ajuste"}, + "Flatten Image": {"pt": "Achatar imagem"}, + "Flip": {"pt": "Giro"}, + "Font family:": {"pt": "Família de fontes:"}, + "Font style:": {"pt": "Estilo de fonte:"}, + "French": {"pt": "Francês"}, + "Full HD, 1080p": {"pt": "Full hd, 1080p"}, + "Fur": {"pt": "Pele"}, + "Gap:": {"pt": "Gap:"}, + "German": {"pt": "Alemão"}, + "GitHub:": {"pt": "Github:"}, + "Gradient": {"pt": "Gradiente"}, + "Gradient Radius:": {"pt": "Raio gradiente:"}, + "Grains": {"pt": "Grãos"}, + "Grains level:": {"pt": "Grãos nível:"}, + "Gray": {"pt": "Cinzento"}, + "GrayScale": {"pt": "Tons de cinza"}, + "Green": {"pt": "Verde"}, + "Green channel:": {"pt": "Canal verde:"}, + "Greyscale:": {"pt": "Escala de cinzentos:"}, + "Grid": {"pt": "Grade"}, + "Grid on/off": {"pt": "Grade on / off"}, + "Grouped": {"pt": "Agrupados"}, + "H Radius:": {"pt": "Raio h:"}, + "Heatmap": {"pt": "Mapa de calor"}, + "Height (%):": {"pt": "Altura (%):"}, + "Height (pixels):": {"pt": "Altura (pixels):"}, + "Height:": {"pt": "Altura:"}, + "Help": {"pt": "Socorro"}, + "Helvetica": {"pt": "Helvética"}, + "Hermite": {"pt": "Hermite"}, + "Histogram": {"pt": "Histograma"}, + "Histogram:": {"pt": "Histograma:"}, + "Horizontal": {"pt": "Horizontal"}, + "Horizontal gap:": {"pt": "Lacuna horizontal:"}, + "Hue:": {"pt": "Matiz:"}, + "Image": {"pt": "Imagem"}, + "Impact": {"pt": "Impacto"}, + "Information": {"pt": "Em formação"}, + "Italiano": {"pt": "Italiano"}, + "Italic": {"pt": "Itálico"}, + "JPG - JPG/JPEG Format": {"pt": "Jpg - jpg / jpeg"}, + "JPG Compression": {"pt": "Compressão jpg"}, + "JSON - Full layers data": {"pt": "Json - camadas completas de dados"}, + "Japanese": {"pt": "Japonês"}, + "Key-points": {"pt": "Pontos chave"}, + "Keyboard Shortcuts": {"pt": "Atalhos do teclado"}, + "Korean": {"pt": "Coreano"}, + "Language": {"pt": "Língua"}, + "Last modified": {"pt": "última modificação"}, + "Layer": {"pt": "Camada"}, + "Layers": {"pt": "Camadas"}, + "Left": {"pt": "Esquerda"}, + "Level:": {"pt": "Nível:"}, + "Levels:": {"pt": "Níveis:"}, + "Lietuvių": {"pt": "Lietuvių"}, + "Light leak:": {"pt": "Vazamento de luz:"}, + "Limit:": {"pt": "Limite:"}, + "Luminance:": {"pt": "Luminância:"}, + "Luminosity:": {"pt": "Luminosidade:"}, + "Magic Wand Tool": {"pt": "Varinha mágica"}, + "Merge": {"pt": "Fundir"}, + "Merge Down": {"pt": "Unir"}, + "Mode:": {"pt": "Modo:"}, + "Mosaic": {"pt": "Mosaico"}, + "Mouse:": {"pt": "Rato:"}, + "Move": {"pt": "Mover"}, + "Move active layer": {"pt": "Mover camada ativa"}, + "Move down": {"pt": "Mover para baixo"}, + "Move up": {"pt": "Subir"}, + "Multi-line": {"pt": "Multi-linha"}, + "Name:": {"pt": "Nome:"}, + "Negative": {"pt": "Negativo"}, + "New": {"pt": "Novo"}, + "New file...": {"pt": "Novo arquivo..."}, + "New layer": {"pt": "Nova camada"}, + "No": {"pt": "Não"}, + "Normal": {"pt": "Normal"}, + "Notice": {"pt": "Aviso prévio"}, + "Notice:": {"pt": "Aviso prévio:"}, + "Oil": {"pt": "Oleo"}, + "Ok": {"pt": "Está bem"}, + "Online image editor": {"pt": "Editor de imagens online"}, + "Opacity": {"pt": "Opacidade"}, + "Open": {"pt": "Aberto"}, + "Original size": {"pt": "Tamanho original"}, + "PNG - Portable Network Graphics": {"pt": "Png - portable network gráficos"}, + "Paste": {"pt": "Colar"}, + "Paste selection": {"pt": "Seleção paste"}, + "Pencil": {"pt": "Lápis"}, + "Perspective": {"pt": "Perspectiva"}, + "Pick Color": {"pt": "Escolher a cor"}, + "Pixels:": {"pt": "Píxeis:"}, + "Portuguese": {"pt": "Português"}, + "Power:": {"pt": "Poder:"}, + "Pre-Blur:": {"pt": "Pré-borrão:"}, + "Preview": {"pt": "Visualização"}, + "Print": {"pt": "Impressão"}, + "Quality (jpeg):": {"pt": "Qualidade (jpeg):"}, + "Quality:": {"pt": "Qualidade:"}, + "Quick load": {"pt": "Carga rápida"}, + "Quick save": {"pt": "Salvamento rapido"}, + "Radial": {"pt": "Radial"}, + "Radius:": {"pt": "Raio:"}, + "Range:": {"pt": "Alcance:"}, + "Reason:": {"pt": "Razão:"}, + "Recover alpha": {"pt": "Recuperar alpha"}, + "Red": {"pt": "Vermelho"}, + "Red channel:": {"pt": "Canal vermelho:"}, + "Rename": {"pt": "Rebatizar"}, + "Rename layer": {"pt": "Renomeie camada"}, + "Replace Color": {"pt": "Substituir cor"}, + "Replace color": {"pt": "Substituir cor"}, + "Replacement:": {"pt": "Substituição:"}, + "Resample - Hermite": {"pt": "Resample - hermite"}, + "Reset zoom level": {"pt": "Nível de zoom de reset"}, + "Resize": {"pt": "Redimensionar"}, + "Resolution:": {"pt": "Resolução:"}, + "Restore alpha": {"pt": "Restaurar alpha"}, + "Right": {"pt": "Certo"}, + "Rotate": {"pt": "Rodar"}, + "Rotate left": {"pt": "Vire à esquerda"}, + "Rotation": {"pt": "Rotação"}, + "Russian": {"pt": "Russo"}, + "Saturation:": {"pt": "Saturação:"}, + "Save": {"pt": "Salvar"}, + "Save as": {"pt": "Salvar como"}, + "Save as type:": {"pt": "Salvar como tipo:"}, + "Save layers:": {"pt": "Salve camadas:"}, + "Save resolution:": {"pt": "Salve resolução:"}, + "Select all": {"pt": "Selecionar tudo"}, + "Select area first": {"pt": "Selecionar área primeira"}, + "Select area tool": {"pt": "Ferramenta selecionar área"}, + "Select color": {"pt": "Selecione a cor"}, + "Select object tool": {"pt": "Ferramenta selecionar objeto"}, + "Selected": {"pt": "Selecionado"}, + "Sensitivity:": {"pt": "Sensibilidade:"}, + "Sepia": {"pt": "Sépia"}, + "Shaded": {"pt": "Sombreado"}, + "Shadow blur:": {"pt": "Borrão da sombra:"}, + "Shadow color:": {"pt": "Cor da sombra:"}, + "Shadow:": {"pt": "Sombra:"}, + "Sharpen": {"pt": "Aguçar"}, + "Sharpen tool": {"pt": "Afiar ferramenta"}, + "Sharpen:": {"pt": "Aguçar:"}, + "Show / Hide": {"pt": "Aparecer esconder"}, + "Simple": {"pt": "Simples"}, + "Size": {"pt": "Tamanho"}, + "Size:": {"pt": "Tamanho:"}, + "Sketchy": {"pt": "Esboçado"}, + "Solarize": {"pt": "Solarizar"}, + "Sorry": {"pt": "Desculpa"}, + "Sorry, image is too big, max 5 MB.": {"pt": "Desculpe, imagem é muito grande, max 5 mb."}, + "Source is empty, right click on image first.": {"pt": "Fonte está vazio, clique direito na imagem em primeiro lugar."}, + "Sprites": {"pt": "Sprites"}, + "Square": {"pt": "Quadrado"}, + "Strength:": {"pt": "Força:"}, + "Strict": {"pt": "Rigoroso"}, + "Stroke": {"pt": "Acidente vascular encefálico"}, + "Stroke size:": {"pt": "Tamanho do traço:"}, + "Target:": {"pt": "Alvo:"}, + "Text": {"pt": "Texto"}, + "Text:": {"pt": "Texto:"}, + "The image could not be loaded.": {"pt": "A imagem não pôde ser carregado."}, + "This can not be last layer": {"pt": "Esta não pode ser a última camada"}, + "This can not be last layer.": {"pt": "Esta não pode ser a última camada."}, + "Tilt Shift": {"pt": "Tilt shift"}, + "Times New Roman": {"pt": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"pt": "Para colar da área de transferência, use ctrl-v."}, + "Tools": {"pt": "Ferramentas"}, + "Top-left": {"pt": "Superior esquerdo"}, + "Top-right": {"pt": "Canto superior direito"}, + "Total pixels:": {"pt": "Total de pixels:"}, + "Translate error, can not find dictionary:": {"pt": "Traduzir de erro, não consegue encontrar dicionário:"}, + "Transparency #1:": {"pt": "Transparência # 1:"}, + "Transparency #2:": {"pt": "Transparência # 2:"}, + "Transparent:": {"pt": "Transparente:"}, + "Trim": {"pt": "Aparar"}, + "Trim:": {"pt": "Apare:"}, + "Turkish": {"pt": "Turco"}, + "Undo": {"pt": "Desfazer"}, + "Unique colors:": {"pt": "Cores exclusivas:"}, + "Up": {"pt": "Acima"}, + "V Radius:": {"pt": "V raio:"}, + "Verdana": {"pt": "Verdana"}, + "Vertical": {"pt": "Vertical"}, + "Vertical gap:": {"pt": "Gap vertical:"}, + "Vibrance": {"pt": "Vibração"}, + "Vignette": {"pt": "Vinheta"}, + "Vignette amount:": {"pt": "Montante vinheta:"}, + "Vignette size:": {"pt": "Tamanho vinheta:"}, + "ViliusL": {"pt": "Viliusl"}, + "Vintage": {"pt": "Vintage"}, + "Visible": {"pt": "Visível"}, + "Visible:": {"pt": "Visível:"}, + "WEBP - Weppy File Format": {"pt": "Webp - formato de arquivo weppy"}, + "Website": {"pt": "Site"}, + "Width (%):": {"pt": "Largura (%):"}, + "Width (pixels):": {"pt": "Largura (pixels):"}, + "Width:": {"pt": "Largura:"}, + "Wrong file type, must be image or json.": {"pt": "Tipo de arquivo errado, deve ser imagem ou json."}, + "X end:": {"pt": "X final:"}, + "X start:": {"pt": "X início:"}, + "Y end:": {"pt": "Y final:"}, + "Y start:": {"pt": "Y início:"}, + "Yes": {"pt": "Sim"}, + "Your browser does not support this format.": {"pt": "Seu navegador não suporta este formato."}, + "Your browser doesn't support canvas.": {"pt": "Seu navegador não suporta tela."}, + "Zoom": {"pt": "Zoom"}, + "Zoom In": {"pt": "Mais zoom"}, + "Zoom Out": {"pt": "Zoom out"}, + "Zoom in": {"pt": "Mais zoom"}, + "Zoom out": {"pt": "Zoom out"}, + "Zoom:": {"pt": "Zoom:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/pt.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/pt.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..f7a9f02de53c0fb2552f4325f05a7cd920ed49c2 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/pt.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + pt.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ru.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ru.js.js new file mode 100644 index 0000000000000000000000000000000000000000..7d8803c17b3d8d3681c234097cbedc0581484903 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ru.js.js @@ -0,0 +1,342 @@ +var dict_ru = { + "2d": {"ru": "2d"}, + "3D position:": {"ru": "3d позиция:"}, + "3D size:": {"ru": "3d размер:"}, + "480p": {"ru": "480p"}, + "About": {"ru": "около"}, + "Add new layer": {"ru": "добавить новый слой"}, + "Advanced": {"ru": "продвинутый"}, + "All": {"ru": "все"}, + "Alpha": {"ru": "альфа"}, + "Alpha:": {"ru": "альфа:"}, + "Amount:": {"ru": "количество:"}, + "Anonymous": {"ru": "анонимный"}, + "Anti aliasing": {"ru": "сглаживание"}, + "Area:": {"ru": "площадь:"}, + "Arial": {"ru": "Arial"}, + "Arrow": {"ru": "стрела"}, + "Arrow keys": {"ru": "клавиши со стрелками"}, + "Attributes": {"ru": "атрибуты"}, + "Author:": {"ru": "автор:"}, + "Auto adjust colors": {"ru": "автоматическая настройка цвета"}, + "Auto colorize": {"ru": "авто раскрасить"}, + "Average:": {"ru": "в среднем:"}, + "BMP - Windows Bitmap": {"ru": "Bmp - окна растровый"}, + "Basic": {"ru": "базовый"}, + "BezierCurve": {"ru": "кривая безье"}, + "Big grains level:": {"ru": "большие зерна уровня:"}, + "Black and White": {"ru": "черное и белое"}, + "Blend": {"ru": "смесь"}, + "Blend:": {"ru": "смешать:"}, + "Blue": {"ru": "синий"}, + "Blue channel:": {"ru": "синий канал:"}, + "Blur": {"ru": "пятно"}, + "Blur Radius:": {"ru": "размытие радиус:"}, + "Blur tool": {"ru": "инструмент размытия"}, + "Blur-Box": {"ru": "размытие-бокс"}, + "Blur-Gaussian": {"ru": "размытие-gaussian"}, + "Blur-Stack": {"ru": "размытие-стек"}, + "Blur-Zoom": {"ru": "размытие-зум"}, + "Blur:": {"ru": "размытие:"}, + "Bold": {"ru": "жирный"}, + "Bold Italic": {"ru": "жирный курсив"}, + "Borders": {"ru": "границы"}, + "Both": {"ru": "и то и другое"}, + "Bottom-left": {"ru": "нижняя левая"}, + "Bottom-right": {"ru": "внизу справа"}, + "Brightness:": {"ru": "яркость:"}, + "Brush": {"ru": "щетка"}, + "Bulge/Pinch": {"ru": "выпуклость / пинч"}, + "Bulge/Pinch tool": {"ru": "выпуклость / инструмент щепотка"}, + "Burn": {"ru": "жечь"}, + "Burn/Dodge tool": {"ru": "запись / инструмент уворачивания"}, + "Cancel": {"ru": "отмена"}, + "Center x:": {"ru": "центр х:"}, + "Center y:": {"ru": "центр у:"}, + "Center:": {"ru": "центр:"}, + "Channel:": {"ru": "источник:"}, + "Chrome": {"ru": "хром"}, + "Circle": {"ru": "круг"}, + "Clear": {"ru": "очистить"}, + "Clear selection": {"ru": "очистить выбор"}, + "Clone tool": {"ru": "клон инструмент"}, + "Color #1:": {"ru": "цвет # 1:"}, + "Color #2:": {"ru": "цвет # 2:"}, + "Color Zoom": {"ru": "цвет зум"}, + "Color adjust:": {"ru": "настройка цвета:"}, + "Color corrections": {"ru": "цветовая коррекция"}, + "Color to Alpha": {"ru": "цвет в альфа"}, + "Color to alpha": {"ru": "цвет в альфа"}, + "Color:": {"ru": "цвет:"}, + "Colorize": {"ru": "раскрасить"}, + "Colors:": {"ru": "цвета:"}, + "Composite": {"ru": "композитный"}, + "Composition:": {"ru": "состав:"}, + "Contrast:": {"ru": "контраст:"}, + "Copy selection": {"ru": "выбор копирования"}, + "Courier": {"ru": "курьер"}, + "Crop": {"ru": "урожай"}, + "Crop Selection": {"ru": "выбор crop"}, + "Curve": {"ru": "кривая"}, + "Custom": {"ru": "изготовленный на заказ"}, + "Cut selection": {"ru": "выбор cut"}, + "Decrease color depth": {"ru": "уменьшение глубины цвета"}, + "Decrease colors": {"ru": "уменьшение цветов"}, + "Default": {"ru": "по умолчанию"}, + "Del": {"ru": "Del"}, + "Delete": {"ru": "удалить"}, + "Delete selection": {"ru": "удалить выбор"}, + "Denoise": {"ru": "Denoise"}, + "Desaturate": {"ru": "обесцветьте"}, + "Desaturation:": {"ru": "Desaturation:"}, + "Description:": {"ru": "описание:"}, + "Differences": {"ru": "различия"}, + "Differences Down": {"ru": "различия вниз"}, + "Dither": {"ru": "трястись"}, + "Dithering:": {"ru": "смешение:"}, + "Dot Screen": {"ru": "экран dot"}, + "Down": {"ru": "вниз"}, + "Downloaded": {"ru": "загруженный"}, + "Draw circle": {"ru": "нарисуйте круг"}, + "Draw letters": {"ru": "Draw буквы"}, + "Draw line": {"ru": "розыгрыш линия"}, + "Draw rectangle": {"ru": "нарисуйте прямоугольник"}, + "Duplicate": {"ru": "дублировать"}, + "Duplicate layer": {"ru": "дублировать слой"}, + "Dusts level:": {"ru": "уровень пыли:"}, + "Edge": {"ru": "край"}, + "Edit": {"ru": "редактировать"}, + "Effects": {"ru": "последствия"}, + "Email:": {"ru": "эл. адрес:"}, + "Emboss": {"ru": "выбивать"}, + "Empty data": {"ru": "пустые данные"}, + "English": {"ru": "английский"}, + "Enrich": {"ru": "обогащать"}, + "Enter angle (0-360):": {"ru": "введите угол (0-360):"}, + "Erase": {"ru": "стирать"}, + "Error": {"ru": "ошибка"}, + "Error:": {"ru": "ошибка:"}, + "Español": {"ru": "Español"}, + "Exponent:": {"ru": "экспонент:"}, + "Exposure level:": {"ru": "уровень экспозиции:"}, + "Factor:": {"ru": "фактор:"}, + "File": {"ru": "файл"}, + "File name:": {"ru": "имя файла:"}, + "Fill": {"ru": "заполнить"}, + "Fill style:": {"ru": "стиль заполнения:"}, + "Fit": {"ru": "поместиться"}, + "Fit window": {"ru": "по размеру окна"}, + "Flatten Image": {"ru": "свести изображение"}, + "Flip": {"ru": "кувырок"}, + "Font family:": {"ru": "семейство шрифтов:"}, + "Font style:": {"ru": "стиль шрифта:"}, + "French": {"ru": "французский"}, + "Full HD, 1080p": {"ru": "Full hd, 1080p"}, + "Fur": {"ru": "мех"}, + "Gap:": {"ru": "Gap:"}, + "German": {"ru": "немецкий"}, + "GitHub:": {"ru": "Github:"}, + "Gradient": {"ru": "градиент"}, + "Gradient Radius:": {"ru": "градиент радиус:"}, + "Grains": {"ru": "зерна"}, + "Grains level:": {"ru": "зерна уровень:"}, + "Gray": {"ru": "серый"}, + "GrayScale": {"ru": "оттенки серого"}, + "Green": {"ru": "зеленый"}, + "Green channel:": {"ru": "зеленый коридор:"}, + "Greyscale:": {"ru": "оттенки серого:"}, + "Grid": {"ru": "сетка"}, + "Grid on/off": {"ru": "сетка вкл / выкл"}, + "Grouped": {"ru": "сгруппированные"}, + "H Radius:": {"ru": "радиус h:"}, + "Heatmap": {"ru": "тепловая карта"}, + "Height (%):": {"ru": "высота (%):"}, + "Height (pixels):": {"ru": "высота (в пикселях):"}, + "Height:": {"ru": "высота:"}, + "Help": {"ru": "помогите"}, + "Helvetica": {"ru": "Helvetica"}, + "Hermite": {"ru": "эрмита"}, + "Histogram": {"ru": "гистограмма"}, + "Histogram:": {"ru": "гистограмма:"}, + "Horizontal": {"ru": "горизонтальный"}, + "Horizontal gap:": {"ru": "горизонтальный разрыв:"}, + "Hue:": {"ru": "оттенок:"}, + "Image": {"ru": "образ"}, + "Impact": {"ru": "влияние"}, + "Information": {"ru": "информация"}, + "Italiano": {"ru": "Italiano"}, + "Italic": {"ru": "курсив"}, + "JPG - JPG/JPEG Format": {"ru": "Jpg - формате jpg / jpeg"}, + "JPG Compression": {"ru": "сжатия jpg"}, + "JSON - Full layers data": {"ru": "Json - полные слои данных"}, + "Japanese": {"ru": "японский"}, + "Key-points": {"ru": "ключевые пункты"}, + "Keyboard Shortcuts": {"ru": "горячие клавиши"}, + "Korean": {"ru": "корейский"}, + "Language": {"ru": "язык"}, + "Last modified": {"ru": "последнее изменение"}, + "Layer": {"ru": "слой"}, + "Layers": {"ru": "слои"}, + "Left": {"ru": "оставил"}, + "Level:": {"ru": "уровень:"}, + "Levels:": {"ru": "уровни:"}, + "Lietuvių": {"ru": "Lietuvių"}, + "Light leak:": {"ru": "свет утечки:"}, + "Limit:": {"ru": "лимит:"}, + "Luminance:": {"ru": "светимость:"}, + "Luminosity:": {"ru": "светимость:"}, + "Magic Wand Tool": {"ru": "волшебный инструмент палочки"}, + "Merge": {"ru": "сливаться"}, + "Merge Down": {"ru": "слить"}, + "Mode:": {"ru": "режим:"}, + "Mosaic": {"ru": "мозаика"}, + "Mouse:": {"ru": "мышь:"}, + "Move": {"ru": "переехать"}, + "Move active layer": {"ru": "переместить активный слой"}, + "Move down": {"ru": "переместить вниз"}, + "Move up": {"ru": "переместить вверх"}, + "Multi-line": {"ru": "многоканальный"}, + "Name:": {"ru": "имя:"}, + "Negative": {"ru": "отрицательный"}, + "New": {"ru": "новый"}, + "New file...": {"ru": "новый файл..."}, + "New layer": {"ru": "новый слой"}, + "No": {"ru": "нет"}, + "Normal": {"ru": "нормальный"}, + "Notice": {"ru": "уведомление"}, + "Notice:": {"ru": "обратите внимание:"}, + "Oil": {"ru": "масло"}, + "Ok": {"ru": "ок"}, + "Online image editor": {"ru": "интернет редактор изображений"}, + "Opacity": {"ru": "помутнение"}, + "Open": {"ru": "открыто"}, + "Original size": {"ru": "оригинальный размер"}, + "PNG - Portable Network Graphics": {"ru": "Png - переносимая сетевая графика"}, + "Paste": {"ru": "вставить"}, + "Paste selection": {"ru": "выбор пасты"}, + "Pencil": {"ru": "карандаш"}, + "Perspective": {"ru": "перспективы"}, + "Pick Color": {"ru": "выберите цвет"}, + "Pixels:": {"ru": "разрешение:"}, + "Portuguese": {"ru": "португальский"}, + "Power:": {"ru": "мощность:"}, + "Pre-Blur:": {"ru": "Pre-размытости:"}, + "Preview": {"ru": "предварительный просмотр"}, + "Print": {"ru": "распечатать"}, + "Quality (jpeg):": {"ru": "качество (jpeg):"}, + "Quality:": {"ru": "качественный:"}, + "Quick load": {"ru": "быстрая загрузка"}, + "Quick save": {"ru": "быстрое сохранение"}, + "Radial": {"ru": "радиальный"}, + "Radius:": {"ru": "радиус:"}, + "Range:": {"ru": "ассортимент:"}, + "Reason:": {"ru": "причина:"}, + "Recover alpha": {"ru": "восстановление альфа"}, + "Red": {"ru": "красный"}, + "Red channel:": {"ru": "красный канал:"}, + "Rename": {"ru": "переименовывать"}, + "Rename layer": {"ru": "переименовать слой"}, + "Replace Color": {"ru": "заменить цвет"}, + "Replace color": {"ru": "заменить цвет"}, + "Replacement:": {"ru": "замена:"}, + "Resample - Hermite": {"ru": "Resample - эрмита"}, + "Reset zoom level": {"ru": "сброс уровня масштабирования"}, + "Resize": {"ru": "изменение размера"}, + "Resolution:": {"ru": "разрешение:"}, + "Restore alpha": {"ru": "восстановление альфа"}, + "Right": {"ru": "правильно"}, + "Rotate": {"ru": "поворот"}, + "Rotate left": {"ru": "поверните влево"}, + "Rotation": {"ru": "вращение"}, + "Russian": {"ru": "русский"}, + "Saturation:": {"ru": "насыщенность:"}, + "Save": {"ru": "сохранить"}, + "Save as": {"ru": "сохранить как"}, + "Save as type:": {"ru": "сохранить как тип:"}, + "Save layers:": {"ru": "сохранить слои:"}, + "Save resolution:": {"ru": "сохранить разрешение:"}, + "Select all": {"ru": "выбрать все"}, + "Select area first": {"ru": "выберите область первой"}, + "Select area tool": {"ru": "выберите инструмент область"}, + "Select color": {"ru": "выбрать цвет"}, + "Select object tool": {"ru": "выберите инструмент объекта"}, + "Selected": {"ru": "выбранный"}, + "Sensitivity:": {"ru": "чувствительность:"}, + "Sepia": {"ru": "сепия"}, + "Shaded": {"ru": "заштрихованное"}, + "Shadow blur:": {"ru": "тень размытия:"}, + "Shadow color:": {"ru": "цвет тени:"}, + "Shadow:": {"ru": "тень:"}, + "Sharpen": {"ru": "точить"}, + "Sharpen tool": {"ru": "резкость инструмент"}, + "Sharpen:": {"ru": "резкость:"}, + "Show / Hide": {"ru": "показать спрятать"}, + "Simple": {"ru": "просто"}, + "Size": {"ru": "размер"}, + "Size:": {"ru": "размер:"}, + "Sketchy": {"ru": "отрывочный"}, + "Solarize": {"ru": "передержать"}, + "Sorry": {"ru": "сожалею"}, + "Sorry, image is too big, max 5 MB.": {"ru": "к сожалению, изображение слишком большие, не более 5 мб."}, + "Source is empty, right click on image first.": {"ru": "источник пуст, щелкните правой кнопкой мыши на изображение в первую очередь."}, + "Sprites": {"ru": "спрайты"}, + "Square": {"ru": "квадрат"}, + "Strength:": {"ru": "прочность:"}, + "Strict": {"ru": "строгий"}, + "Stroke": {"ru": "инсульт"}, + "Stroke size:": {"ru": "размер инсульт:"}, + "Target:": {"ru": "цель:"}, + "Text": {"ru": "текст"}, + "Text:": {"ru": "текст:"}, + "The image could not be loaded.": {"ru": "изображение не может быть загружен."}, + "This can not be last layer": {"ru": "это не может быть последний слой"}, + "This can not be last layer.": {"ru": "это не может быть последним слоем."}, + "Tilt Shift": {"ru": "Tilt сдвиг"}, + "Times New Roman": {"ru": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"ru": "чтобы вставить из буфера обмена, используйте ctrl-v."}, + "Tools": {"ru": "инструменты"}, + "Top-left": {"ru": "верхний левый"}, + "Top-right": {"ru": "в правом верхнем углу"}, + "Total pixels:": {"ru": "общее число пикселей:"}, + "Translate error, can not find dictionary:": {"ru": "перевести ошибку, не может найти словарь:"}, + "Transparency #1:": {"ru": "прозрачность № 1:"}, + "Transparency #2:": {"ru": "прозрачность № 2:"}, + "Transparent:": {"ru": "прозрачный:"}, + "Trim": {"ru": "отделка"}, + "Trim:": {"ru": "отделка:"}, + "Turkish": {"ru": "турецкий"}, + "Undo": {"ru": "расстегивать"}, + "Unique colors:": {"ru": "уникальные цвета:"}, + "Up": {"ru": "вверх"}, + "V Radius:": {"ru": "радиус v:"}, + "Verdana": {"ru": "Verdana"}, + "Vertical": {"ru": "вертикальный"}, + "Vertical gap:": {"ru": "вертикальный зазор:"}, + "Vibrance": {"ru": "вибрация"}, + "Vignette": {"ru": "виньетка"}, + "Vignette amount:": {"ru": "количество виньетирования:"}, + "Vignette size:": {"ru": "размер виньетирования:"}, + "ViliusL": {"ru": "Viliusl"}, + "Vintage": {"ru": "марочный"}, + "Visible": {"ru": "видимый"}, + "Visible:": {"ru": "видимых:"}, + "WEBP - Weppy File Format": {"ru": "Webp - формат файла weppy"}, + "Website": {"ru": "веб-сайт"}, + "Width (%):": {"ru": "ширина (%):"}, + "Width (pixels):": {"ru": "ширина (в пикселях):"}, + "Width:": {"ru": "ширина:"}, + "Wrong file type, must be image or json.": {"ru": "неправильный тип файла, должен быть изображение или json."}, + "X end:": {"ru": "X конец:"}, + "X start:": {"ru": "начало x:"}, + "Y end:": {"ru": "Y конец:"}, + "Y start:": {"ru": "Y старт:"}, + "Yes": {"ru": "да"}, + "Your browser does not support this format.": {"ru": "ваш браузер не поддерживает этот формат."}, + "Your browser doesn't support canvas.": {"ru": "ваш браузер не поддерживает холст."}, + "Zoom": {"ru": "увеличить"}, + "Zoom In": {"ru": "приблизить"}, + "Zoom Out": {"ru": "уменьшить"}, + "Zoom in": {"ru": "приблизить"}, + "Zoom out": {"ru": "уменьшить"}, + "Zoom:": {"ru": "Zoom:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ru.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ru.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..e413f9681d8e00648e47424dca9429b19ccd86d0 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/ru.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + ru.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/tr.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/tr.js.js new file mode 100644 index 0000000000000000000000000000000000000000..e6892ef2aec6700d461d2837e61b4401b6237b32 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/tr.js.js @@ -0,0 +1,342 @@ +var dict_tr = { + "2d": {"tr": "2d"}, + "3D position:": {"tr": "3d pozisyonlar:"}, + "3D size:": {"tr": "3d boyutu:"}, + "480p": {"tr": "480p"}, + "About": {"tr": "Hakkında"}, + "Add new layer": {"tr": "Yeni bir katman ekleyin"}, + "Advanced": {"tr": "Ileri"}, + "All": {"tr": "Herşey"}, + "Alpha": {"tr": "Alfa"}, + "Alpha:": {"tr": "Alfa:"}, + "Amount:": {"tr": "Tutar:"}, + "Anonymous": {"tr": "Anonim"}, + "Anti aliasing": {"tr": "Anti-aliasing"}, + "Area:": {"tr": "Bölge:"}, + "Arial": {"tr": "Arial"}, + "Arrow": {"tr": "Ok"}, + "Arrow keys": {"tr": "Ok tuşları"}, + "Attributes": {"tr": "Nitelikler"}, + "Author:": {"tr": "Yazar:"}, + "Auto adjust colors": {"tr": "Oto renkleri ayarlamak"}, + "Auto colorize": {"tr": "Otomatik colorize"}, + "Average:": {"tr": "Ortalama:"}, + "BMP - Windows Bitmap": {"tr": "Bmp - pencere bitmap"}, + "Basic": {"tr": "Temel"}, + "BezierCurve": {"tr": "Bézier eğrisi"}, + "Big grains level:": {"tr": "Büyük taneler seviye:"}, + "Black and White": {"tr": "Siyah ve beyaz"}, + "Blend": {"tr": "Harman"}, + "Blend:": {"tr": "Harman:"}, + "Blue": {"tr": "Mavi"}, + "Blue channel:": {"tr": "Mavi kanal:"}, + "Blur": {"tr": "Bulanıklık"}, + "Blur Radius:": {"tr": "Bulanıklık yarıçapı:"}, + "Blur tool": {"tr": "Bulanıklık aracı"}, + "Blur-Box": {"tr": "Bulanıklık-box"}, + "Blur-Gaussian": {"tr": "Bulanıklık-gauss"}, + "Blur-Stack": {"tr": "Bulanıklık-yığını"}, + "Blur-Zoom": {"tr": "Bulanıklık-zoom"}, + "Blur:": {"tr": "Bulanıklık:"}, + "Bold": {"tr": "Cesur"}, + "Bold Italic": {"tr": "Kalın italik"}, + "Borders": {"tr": "Sınırlar"}, + "Both": {"tr": "Her ikisi de"}, + "Bottom-left": {"tr": "Sol alt"}, + "Bottom-right": {"tr": "Sağ alt"}, + "Brightness:": {"tr": "Parlaklık:"}, + "Brush": {"tr": "Fırça"}, + "Bulge/Pinch": {"tr": "Bulge / tutam"}, + "Bulge/Pinch tool": {"tr": "Bulge / çimdik aracı"}, + "Burn": {"tr": "Yanmak"}, + "Burn/Dodge tool": {"tr": "/ dodge aracını yakmak"}, + "Cancel": {"tr": "Iptal etmek"}, + "Center x:": {"tr": "Merkez x:"}, + "Center y:": {"tr": "Merkez y:"}, + "Center:": {"tr": "Merkezi:"}, + "Channel:": {"tr": "Kanal:"}, + "Chrome": {"tr": "Krom"}, + "Circle": {"tr": "Daire"}, + "Clear": {"tr": "Açık"}, + "Clear selection": {"tr": "Seçimi temizle"}, + "Clone tool": {"tr": "Klon aracı"}, + "Color #1:": {"tr": "Renk # 1:"}, + "Color #2:": {"tr": "Renk # 2:"}, + "Color Zoom": {"tr": "Renk yakınlaştırma"}, + "Color adjust:": {"tr": "Renk ayarı:"}, + "Color corrections": {"tr": "Renk düzeltmeleri"}, + "Color to Alpha": {"tr": "Alfa renk"}, + "Color to alpha": {"tr": "Alfa renk"}, + "Color:": {"tr": "Renk:"}, + "Colorize": {"tr": "Renklendirme"}, + "Colors:": {"tr": "Renkler:"}, + "Composite": {"tr": "Bileşik"}, + "Composition:": {"tr": "Bileşim:"}, + "Contrast:": {"tr": "Kontrast:"}, + "Copy selection": {"tr": "Kopya seçimi"}, + "Courier": {"tr": "Kurye"}, + "Crop": {"tr": "Ekin"}, + "Crop Selection": {"tr": "Kırpma seçimi"}, + "Curve": {"tr": "Eğri"}, + "Custom": {"tr": "Görenek"}, + "Cut selection": {"tr": "Kesme seçimi"}, + "Decrease color depth": {"tr": "Renk derinliğini azaltmak"}, + "Decrease colors": {"tr": "Azalış renkleri"}, + "Default": {"tr": "Varsayılan"}, + "Del": {"tr": "Del"}, + "Delete": {"tr": "Silmek"}, + "Delete selection": {"tr": "Seçimi sil"}, + "Denoise": {"tr": "Denoise"}, + "Desaturate": {"tr": "Desaturate"}, + "Desaturation:": {"tr": "Desatürasyon:"}, + "Description:": {"tr": "Açıklama:"}, + "Differences": {"tr": "Farklılıklar"}, + "Differences Down": {"tr": "Aşağı farklar"}, + "Dither": {"tr": "Titreme"}, + "Dithering:": {"tr": "Taklidi:"}, + "Dot Screen": {"tr": "Nokta ekranı"}, + "Down": {"tr": "Aşağı"}, + "Downloaded": {"tr": "Indirilen"}, + "Draw circle": {"tr": "Daire çizin"}, + "Draw letters": {"tr": "Harfleri çizin"}, + "Draw line": {"tr": "çekme hattı"}, + "Draw rectangle": {"tr": "Dikdörtgen çizer"}, + "Duplicate": {"tr": "çift"}, + "Duplicate layer": {"tr": "Yinelenen katman"}, + "Dusts level:": {"tr": "Tozlar seviye:"}, + "Edge": {"tr": "Kenar"}, + "Edit": {"tr": "Düzenleme"}, + "Effects": {"tr": "Etkileri"}, + "Email:": {"tr": "E-posta:"}, + "Emboss": {"tr": "Kabartma yapmak"}, + "Empty data": {"tr": "Boş veri"}, + "English": {"tr": "Ingilizce"}, + "Enrich": {"tr": "Zenginleştirmek"}, + "Enter angle (0-360):": {"tr": "Açı (0-360) girin:"}, + "Erase": {"tr": "Silmek"}, + "Error": {"tr": "Hata"}, + "Error:": {"tr": "Hata:"}, + "Español": {"tr": "Español"}, + "Exponent:": {"tr": "üstel:"}, + "Exposure level:": {"tr": "Pozlama seviyesi:"}, + "Factor:": {"tr": "Faktörü:"}, + "File": {"tr": "Dosya"}, + "File name:": {"tr": "Dosya adı:"}, + "Fill": {"tr": "Doldurmak"}, + "Fill style:": {"tr": "Fill style:"}, + "Fit": {"tr": "Fit"}, + "Fit window": {"tr": "Fit pencere"}, + "Flatten Image": {"tr": "Görüntüyü düzleştirmek"}, + "Flip": {"tr": "çevirmek"}, + "Font family:": {"tr": "Font ailesi:"}, + "Font style:": {"tr": "Yazı stili:"}, + "French": {"tr": "Fransızca"}, + "Full HD, 1080p": {"tr": "Full hd, 1080p"}, + "Fur": {"tr": "Kürk"}, + "Gap:": {"tr": "Boşluk:"}, + "German": {"tr": "Almanca"}, + "GitHub:": {"tr": "Github:"}, + "Gradient": {"tr": "Eğim"}, + "Gradient Radius:": {"tr": "Gradyan yarıçapı:"}, + "Grains": {"tr": "Taneler"}, + "Grains level:": {"tr": "Taneleri seviye:"}, + "Gray": {"tr": "Gri"}, + "GrayScale": {"tr": "Gri tonlama"}, + "Green": {"tr": "Yeşil"}, + "Green channel:": {"tr": "Yeşil kanal:"}, + "Greyscale:": {"tr": "Gri tonlama:"}, + "Grid": {"tr": "ızgara"}, + "Grid on/off": {"tr": "Açma / kapama izgara"}, + "Grouped": {"tr": "Grouped"}, + "H Radius:": {"tr": "H yarıçapı:"}, + "Heatmap": {"tr": "Sıcaklık haritası"}, + "Height (%):": {"tr": "Yükseklik (%):"}, + "Height (pixels):": {"tr": "Yükseklik (piksel):"}, + "Height:": {"tr": "Yükseklik:"}, + "Help": {"tr": "Yardım et"}, + "Helvetica": {"tr": "Helvetica"}, + "Hermite": {"tr": "Hermite"}, + "Histogram": {"tr": "Histogram"}, + "Histogram:": {"tr": "Histogram:"}, + "Horizontal": {"tr": "Yatay"}, + "Horizontal gap:": {"tr": "Yatay boşluk:"}, + "Hue:": {"tr": "Hue:"}, + "Image": {"tr": "Görüntü"}, + "Impact": {"tr": "Darbe"}, + "Information": {"tr": "Bilgi"}, + "Italiano": {"tr": "Italiano"}, + "Italic": {"tr": "Italik"}, + "JPG - JPG/JPEG Format": {"tr": "Jpg - jpg / jpeg formatında"}, + "JPG Compression": {"tr": "Jpg sıkıştırma"}, + "JSON - Full layers data": {"tr": "Json - tam katmanları verileri"}, + "Japanese": {"tr": "Japonca"}, + "Key-points": {"tr": "Kilit noktaları"}, + "Keyboard Shortcuts": {"tr": "Klavye kısayolları"}, + "Korean": {"tr": "Koreli"}, + "Language": {"tr": "Dil"}, + "Last modified": {"tr": "Son düzenleme"}, + "Layer": {"tr": "Tabaka"}, + "Layers": {"tr": "Katmanlar"}, + "Left": {"tr": "Sol"}, + "Level:": {"tr": "Seviye:"}, + "Levels:": {"tr": "Seviyeleri:"}, + "Lietuvių": {"tr": "Litvanya"}, + "Light leak:": {"tr": "Işık sızıntısı:"}, + "Limit:": {"tr": "Limit:"}, + "Luminance:": {"tr": "Parlaklık:"}, + "Luminosity:": {"tr": "Parlaklığı:"}, + "Magic Wand Tool": {"tr": "Sihirli değnek aracı"}, + "Merge": {"tr": "Birleşmek"}, + "Merge Down": {"tr": "Aşağı birleştirme"}, + "Mode:": {"tr": "Modu:"}, + "Mosaic": {"tr": "Mozaik"}, + "Mouse:": {"tr": "Fare:"}, + "Move": {"tr": "Hareket"}, + "Move active layer": {"tr": "Aktif katman hareket"}, + "Move down": {"tr": "Aşağı inmek"}, + "Move up": {"tr": "Yukarı çıkmak"}, + "Multi-line": {"tr": "çok satırlı"}, + "Name:": {"tr": "Adı:"}, + "Negative": {"tr": "Negatif"}, + "New": {"tr": "Yeni"}, + "New file...": {"tr": "Yeni dosya..."}, + "New layer": {"tr": "Yeni katman"}, + "No": {"tr": "Yok hayır"}, + "Normal": {"tr": "Normal"}, + "Notice": {"tr": "Ihbar"}, + "Notice:": {"tr": "Uyarı:"}, + "Oil": {"tr": "Sıvı yağ"}, + "Ok": {"tr": "Tamam"}, + "Online image editor": {"tr": "çevrimiçi resim editörü"}, + "Opacity": {"tr": "Saydamlık"}, + "Open": {"tr": "Açık"}, + "Original size": {"tr": "Orijinal boyut"}, + "PNG - Portable Network Graphics": {"tr": "Png - taşınabilir ağ grafik"}, + "Paste": {"tr": "Yapıştırmak"}, + "Paste selection": {"tr": "Yapıştır seçimi"}, + "Pencil": {"tr": "Kalem"}, + "Perspective": {"tr": "Perspektif"}, + "Pick Color": {"tr": "Rengi seçin"}, + "Pixels:": {"tr": "Piksel:"}, + "Portuguese": {"tr": "Portekizce"}, + "Power:": {"tr": "Güç:"}, + "Pre-Blur:": {"tr": "ön bulanıklık:"}, + "Preview": {"tr": "önizleme"}, + "Print": {"tr": "Baskı"}, + "Quality (jpeg):": {"tr": "Kalitesi (jpeg):"}, + "Quality:": {"tr": "Kalite:"}, + "Quick load": {"tr": "Hızlı yük"}, + "Quick save": {"tr": "Hızlı kaydet"}, + "Radial": {"tr": "Radyal"}, + "Radius:": {"tr": "Radius:"}, + "Range:": {"tr": "Menzil:"}, + "Reason:": {"tr": "Sebep:"}, + "Recover alpha": {"tr": "Alfa kurtarmak"}, + "Red": {"tr": "Kırmızı"}, + "Red channel:": {"tr": "Kırmızı kanal:"}, + "Rename": {"tr": "Adını değiştirmek"}, + "Rename layer": {"tr": "Katmanı yeniden adlandırmak"}, + "Replace Color": {"tr": "Rengini değiştirme"}, + "Replace color": {"tr": "Rengini değiştirme"}, + "Replacement:": {"tr": "Değiştirme:"}, + "Resample - Hermite": {"tr": "Yeniden örnekle - hermite"}, + "Reset zoom level": {"tr": "Sıfırlama yakınlaştırma düzeyi"}, + "Resize": {"tr": "Yeniden boyutlandırma"}, + "Resolution:": {"tr": "çözüm:"}, + "Restore alpha": {"tr": "Alfa restore"}, + "Right": {"tr": "Sağ"}, + "Rotate": {"tr": "Döndür"}, + "Rotate left": {"tr": "Sola dön"}, + "Rotation": {"tr": "Rotasyon"}, + "Russian": {"tr": "Rusça"}, + "Saturation:": {"tr": "Doyma:"}, + "Save": {"tr": "Kayıt etmek"}, + "Save as": {"tr": "Farklı kaydet"}, + "Save as type:": {"tr": "Kayıt türü:"}, + "Save layers:": {"tr": "Katmanları kaydet:"}, + "Save resolution:": {"tr": "çözünürlüğü kaydet:"}, + "Select all": {"tr": "Hepsini seç"}, + "Select area first": {"tr": "Alan seçin ilk"}, + "Select area tool": {"tr": "Alan seçin aracı"}, + "Select color": {"tr": "Renk seç"}, + "Select object tool": {"tr": "Seç nesne aracı"}, + "Selected": {"tr": "Seçilmiş"}, + "Sensitivity:": {"tr": "Duyarlılık:"}, + "Sepia": {"tr": "Sepya"}, + "Shaded": {"tr": "Gölgeli"}, + "Shadow blur:": {"tr": "Gölge bulanıklık:"}, + "Shadow color:": {"tr": "Gölge rengi:"}, + "Shadow:": {"tr": "Gölge:"}, + "Sharpen": {"tr": "Keskinleştirmek"}, + "Sharpen tool": {"tr": "Aracı keskinleştirmek"}, + "Sharpen:": {"tr": "Sharpen:"}, + "Show / Hide": {"tr": "Göster / gizle"}, + "Simple": {"tr": "Basit"}, + "Size": {"tr": "Boyut"}, + "Size:": {"tr": "Boyut:"}, + "Sketchy": {"tr": "Kabataslak"}, + "Solarize": {"tr": "Güneşte bırakmak"}, + "Sorry": {"tr": "üzgünüm"}, + "Sorry, image is too big, max 5 MB.": {"tr": "Maalesef resim çok büyük, en fazla 5 mb."}, + "Source is empty, right click on image first.": {"tr": "Kaynak boş, doğru ilk resmin üzerine tıklayın."}, + "Sprites": {"tr": "Sprite"}, + "Square": {"tr": "Kare"}, + "Strength:": {"tr": "Güç:"}, + "Strict": {"tr": "Sıkı"}, + "Stroke": {"tr": "Inme"}, + "Stroke size:": {"tr": "Inme boyutu:"}, + "Target:": {"tr": "Hedef:"}, + "Text": {"tr": "Metin"}, + "Text:": {"tr": "Metin:"}, + "The image could not be loaded.": {"tr": "Görüntü yüklenemedi."}, + "This can not be last layer": {"tr": "Bu son tabaka olamaz"}, + "This can not be last layer.": {"tr": "Bu son tabaka olamaz."}, + "Tilt Shift": {"tr": "Tilt shift"}, + "Times New Roman": {"tr": "Times new roman"}, + "To paste from clipboard, use Ctrl-V.": {"tr": "Panodan yapıştırmak için, ctrl-v kullanın."}, + "Tools": {"tr": "Araçlar"}, + "Top-left": {"tr": "Sol üst"}, + "Top-right": {"tr": "Sağ üst"}, + "Total pixels:": {"tr": "Toplam piksel:"}, + "Translate error, can not find dictionary:": {"tr": "Sözlüğü bulamıyorum, hata çevir:"}, + "Transparency #1:": {"tr": "şeffaflık # 1:"}, + "Transparency #2:": {"tr": "şeffaflık # 2:"}, + "Transparent:": {"tr": "şeffaf:"}, + "Trim": {"tr": "Süs"}, + "Trim:": {"tr": "Trim:"}, + "Turkish": {"tr": "Türk"}, + "Undo": {"tr": "Geri alma"}, + "Unique colors:": {"tr": "Benzersiz renkler:"}, + "Up": {"tr": "Yukarı"}, + "V Radius:": {"tr": "V yarıçapı:"}, + "Verdana": {"tr": "Verdana"}, + "Vertical": {"tr": "Dikey"}, + "Vertical gap:": {"tr": "Dikey boşluk:"}, + "Vibrance": {"tr": "Titreşim"}, + "Vignette": {"tr": "Skeç"}, + "Vignette amount:": {"tr": "Vignette miktarı:"}, + "Vignette size:": {"tr": "Vignette boyutu:"}, + "ViliusL": {"tr": "Viliusl"}, + "Vintage": {"tr": "Bağbozumu"}, + "Visible": {"tr": "Gözle görülür"}, + "Visible:": {"tr": "Gözle görülür:"}, + "WEBP - Weppy File Format": {"tr": "Webp - weppy dosya biçimi"}, + "Website": {"tr": "Web sitesi"}, + "Width (%):": {"tr": "Genişlik (%):"}, + "Width (pixels):": {"tr": "Genişlik (piksel):"}, + "Width:": {"tr": "Genişlik:"}, + "Wrong file type, must be image or json.": {"tr": "Yanlış dosya türü, görüntü veya json olmalıdır."}, + "X end:": {"tr": "X bitiş:"}, + "X start:": {"tr": "X başlangıcı:"}, + "Y end:": {"tr": "Y bitiş:"}, + "Y start:": {"tr": "Y başlangıcı:"}, + "Yes": {"tr": "Evet"}, + "Your browser does not support this format.": {"tr": "Tarayıcınız bu biçimi desteklemiyor."}, + "Your browser doesn't support canvas.": {"tr": "Tarayıcınız tuval desteklemiyor."}, + "Zoom": {"tr": "Yakınlaştırma"}, + "Zoom In": {"tr": "Yakınlaştır"}, + "Zoom Out": {"tr": "Uzaklaştır"}, + "Zoom in": {"tr": "Yakınlaştır"}, + "Zoom out": {"tr": "Uzaklaştır"}, + "Zoom:": {"tr": "Zoom:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/tr.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/tr.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..84ed59f271d8bc56171efafab10957669878d74d --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/tr.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + tr.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/zh.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/zh.js.js new file mode 100644 index 0000000000000000000000000000000000000000..7b5347618a1ca4cec991b6d61c14fbada6f614a3 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/zh.js.js @@ -0,0 +1,342 @@ +var dict_zh = { + "2d": {"zh": "2d"}, + "3D position:": {"zh": "三维位置:"}, + "3D size:": {"zh": "三维尺寸:"}, + "480p": {"zh": "480p"}, + "About": {"zh": "关于"}, + "Add new layer": {"zh": "添加新图层"}, + "Advanced": {"zh": "高级"}, + "All": {"zh": "所有"}, + "Alpha": {"zh": "Α"}, + "Alpha:": {"zh": "Α:"}, + "Amount:": {"zh": "量:"}, + "Anonymous": {"zh": "匿名"}, + "Anti aliasing": {"zh": "反走样"}, + "Area:": {"zh": "区:"}, + "Arial": {"zh": "宋体"}, + "Arrow": {"zh": "箭头"}, + "Arrow keys": {"zh": "方向键"}, + "Attributes": {"zh": "属性"}, + "Author:": {"zh": "作者:"}, + "Auto adjust colors": {"zh": "自动调整颜色"}, + "Auto colorize": {"zh": "汽车着色"}, + "Average:": {"zh": "平均:"}, + "BMP - Windows Bitmap": {"zh": "Bmp - windows位图"}, + "Basic": {"zh": "基本"}, + "BezierCurve": {"zh": "贝兹曲线"}, + "Big grains level:": {"zh": "大粒级:"}, + "Black and White": {"zh": "黑与白"}, + "Blend": {"zh": "混合"}, + "Blend:": {"zh": "混合:"}, + "Blue": {"zh": "蓝色"}, + "Blue channel:": {"zh": "蓝色通道:"}, + "Blur": {"zh": "模糊"}, + "Blur Radius:": {"zh": "模糊半径:"}, + "Blur tool": {"zh": "模糊工具"}, + "Blur-Box": {"zh": "模糊箱"}, + "Blur-Gaussian": {"zh": "模糊 - 高斯"}, + "Blur-Stack": {"zh": "模糊堆栈"}, + "Blur-Zoom": {"zh": "模糊变焦"}, + "Blur:": {"zh": "模糊:"}, + "Bold": {"zh": "胆大"}, + "Bold Italic": {"zh": "加粗斜体"}, + "Borders": {"zh": "国界"}, + "Both": {"zh": "都"}, + "Bottom-left": {"zh": "左下方"}, + "Bottom-right": {"zh": "右下角"}, + "Brightness:": {"zh": "亮度:"}, + "Brush": {"zh": "刷"}, + "Bulge/Pinch": {"zh": "隆起/捏"}, + "Bulge/Pinch tool": {"zh": "隆起/捏工具"}, + "Burn": {"zh": "烧伤"}, + "Burn/Dodge tool": {"zh": "刻录/减淡工具"}, + "Cancel": {"zh": "取消"}, + "Center x:": {"zh": "中心x:"}, + "Center y:": {"zh": "中心y:"}, + "Center:": {"zh": "中央:"}, + "Channel:": {"zh": "渠道:"}, + "Chrome": {"zh": "铬"}, + "Circle": {"zh": "圈"}, + "Clear": {"zh": "明确"}, + "Clear selection": {"zh": "清除选择"}, + "Clone tool": {"zh": "克隆工具"}, + "Color #1:": {"zh": "颜色#1:"}, + "Color #2:": {"zh": "颜色#2:"}, + "Color Zoom": {"zh": "彩色变焦"}, + "Color adjust:": {"zh": "颜色调整:"}, + "Color corrections": {"zh": "色彩校正"}, + "Color to Alpha": {"zh": "颜色阿尔法"}, + "Color to alpha": {"zh": "颜色阿尔法"}, + "Color:": {"zh": "颜色:"}, + "Colorize": {"zh": "上色"}, + "Colors:": {"zh": "颜色:"}, + "Composite": {"zh": "综合"}, + "Composition:": {"zh": "组成:"}, + "Contrast:": {"zh": "对比:"}, + "Copy selection": {"zh": "选择复制"}, + "Courier": {"zh": "信使"}, + "Crop": {"zh": "作物"}, + "Crop Selection": {"zh": "作物选择"}, + "Curve": {"zh": "曲线"}, + "Custom": {"zh": "习俗"}, + "Cut selection": {"zh": "剪切选择"}, + "Decrease color depth": {"zh": "减小色深"}, + "Decrease colors": {"zh": "减少颜色"}, + "Default": {"zh": "默认"}, + "Del": {"zh": "德尔"}, + "Delete": {"zh": "删除"}, + "Delete selection": {"zh": "删除选择"}, + "Denoise": {"zh": "降噪"}, + "Desaturate": {"zh": "去色"}, + "Desaturation:": {"zh": "饱和度:"}, + "Description:": {"zh": "描述:"}, + "Differences": {"zh": "差异"}, + "Differences Down": {"zh": "差异下跌"}, + "Dither": {"zh": "抖动"}, + "Dithering:": {"zh": "抖动:"}, + "Dot Screen": {"zh": "点屏幕"}, + "Down": {"zh": "下"}, + "Downloaded": {"zh": "下载"}, + "Draw circle": {"zh": "绘制圆"}, + "Draw letters": {"zh": "绘制文字"}, + "Draw line": {"zh": "绘制线"}, + "Draw rectangle": {"zh": "绘制矩形"}, + "Duplicate": {"zh": "重复"}, + "Duplicate layer": {"zh": "复制层"}, + "Dusts level:": {"zh": "粉尘等级:"}, + "Edge": {"zh": "边缘"}, + "Edit": {"zh": "编辑"}, + "Effects": {"zh": "效果"}, + "Email:": {"zh": "电子邮件:"}, + "Emboss": {"zh": "拷花"}, + "Empty data": {"zh": "空数据"}, + "English": {"zh": "英语"}, + "Enrich": {"zh": "丰富"}, + "Enter angle (0-360):": {"zh": "输入角度(0-360):"}, + "Erase": {"zh": "抹去"}, + "Error": {"zh": "错误"}, + "Error:": {"zh": "错误:"}, + "Español": {"zh": "西班牙语"}, + "Exponent:": {"zh": "指数:"}, + "Exposure level:": {"zh": "曝光量:"}, + "Factor:": {"zh": "因子:"}, + "File": {"zh": "文件"}, + "File name:": {"zh": "文件名:"}, + "Fill": {"zh": "填"}, + "Fill style:": {"zh": "填充样式:"}, + "Fit": {"zh": "适合"}, + "Fit window": {"zh": "适合窗口"}, + "Flatten Image": {"zh": "拼合图像"}, + "Flip": {"zh": "翻动"}, + "Font family:": {"zh": "字体系列:"}, + "Font style:": {"zh": "字体样式:"}, + "French": {"zh": "法国"}, + "Full HD, 1080p": {"zh": "全高清1080p"}, + "Fur": {"zh": "毛皮"}, + "Gap:": {"zh": "间隙:"}, + "German": {"zh": "德语"}, + "GitHub:": {"zh": "Github上:"}, + "Gradient": {"zh": "梯度"}, + "Gradient Radius:": {"zh": "渐变半径:"}, + "Grains": {"zh": "谷物"}, + "Grains level:": {"zh": "谷物等级:"}, + "Gray": {"zh": "灰色"}, + "GrayScale": {"zh": "灰度"}, + "Green": {"zh": "绿色"}, + "Green channel:": {"zh": "绿色通道:"}, + "Greyscale:": {"zh": "灰度:"}, + "Grid": {"zh": "格"}, + "Grid on/off": {"zh": "格的开/关"}, + "Grouped": {"zh": "分组"}, + "H Radius:": {"zh": "^ h半径:"}, + "Heatmap": {"zh": "热图"}, + "Height (%):": {"zh": "高度(%):"}, + "Height (pixels):": {"zh": "高度(像素):"}, + "Height:": {"zh": "高度:"}, + "Help": {"zh": "帮帮我"}, + "Helvetica": {"zh": "黑体"}, + "Hermite": {"zh": "埃尔米特"}, + "Histogram": {"zh": "柱状图"}, + "Histogram:": {"zh": "柱状图:"}, + "Horizontal": {"zh": "横"}, + "Horizontal gap:": {"zh": "水平的差距:"}, + "Hue:": {"zh": "色调:"}, + "Image": {"zh": "图片"}, + "Impact": {"zh": "碰撞"}, + "Information": {"zh": "信息"}, + "Italiano": {"zh": "意大利语"}, + "Italic": {"zh": "斜体"}, + "JPG - JPG/JPEG Format": {"zh": "Jpg - jpg / jpeg格式"}, + "JPG Compression": {"zh": "Jpg压缩"}, + "JSON - Full layers data": {"zh": "Json - 全层的数据"}, + "Japanese": {"zh": "日本"}, + "Key-points": {"zh": "关键点"}, + "Keyboard Shortcuts": {"zh": "键盘快捷键"}, + "Korean": {"zh": "朝鲜的"}, + "Language": {"zh": "语言"}, + "Last modified": {"zh": "上一次更改"}, + "Layer": {"zh": "层"}, + "Layers": {"zh": "层"}, + "Left": {"zh": "剩下"}, + "Level:": {"zh": "水平:"}, + "Levels:": {"zh": "级别:"}, + "Lietuvių": {"zh": "立陶宛ų"}, + "Light leak:": {"zh": "漏光:"}, + "Limit:": {"zh": "限制:"}, + "Luminance:": {"zh": "亮度:"}, + "Luminosity:": {"zh": "亮度:"}, + "Magic Wand Tool": {"zh": "魔术棒工具"}, + "Merge": {"zh": "合并"}, + "Merge Down": {"zh": "向下合并"}, + "Mode:": {"zh": "模式:"}, + "Mosaic": {"zh": "镶嵌"}, + "Mouse:": {"zh": "老鼠:"}, + "Move": {"zh": "移动"}, + "Move active layer": {"zh": "移动有源层"}, + "Move down": {"zh": "下移"}, + "Move up": {"zh": "提升"}, + "Multi-line": {"zh": "多线"}, + "Name:": {"zh": "名称:"}, + "Negative": {"zh": "负"}, + "New": {"zh": "新"}, + "New file...": {"zh": "新的文件..."}, + "New layer": {"zh": "新建图层"}, + "No": {"zh": "没有"}, + "Normal": {"zh": "正常"}, + "Notice": {"zh": "注意"}, + "Notice:": {"zh": "注意:"}, + "Oil": {"zh": "油"}, + "Ok": {"zh": "好"}, + "Online image editor": {"zh": "在线图像编辑器"}, + "Opacity": {"zh": "不透明度"}, + "Open": {"zh": "打开"}, + "Original size": {"zh": "原始尺寸"}, + "PNG - Portable Network Graphics": {"zh": "Png - 便携式网络图形"}, + "Paste": {"zh": "糊"}, + "Paste selection": {"zh": "粘贴选择"}, + "Pencil": {"zh": "铅笔"}, + "Perspective": {"zh": "透视"}, + "Pick Color": {"zh": "挑选颜色"}, + "Pixels:": {"zh": "像素:"}, + "Portuguese": {"zh": "葡萄牙语"}, + "Power:": {"zh": "功率:"}, + "Pre-Blur:": {"zh": "预模糊:"}, + "Preview": {"zh": "预习"}, + "Print": {"zh": "打印"}, + "Quality (jpeg):": {"zh": "质量(jpeg):"}, + "Quality:": {"zh": "质量:"}, + "Quick load": {"zh": "快速负载"}, + "Quick save": {"zh": "快速保存"}, + "Radial": {"zh": "径向"}, + "Radius:": {"zh": "半径:"}, + "Range:": {"zh": "范围:"}, + "Reason:": {"zh": "原因:"}, + "Recover alpha": {"zh": "阿尔法恢复"}, + "Red": {"zh": "红"}, + "Red channel:": {"zh": "红色通道:"}, + "Rename": {"zh": "改名"}, + "Rename layer": {"zh": "重命名层"}, + "Replace Color": {"zh": "更换颜色"}, + "Replace color": {"zh": "更换颜色"}, + "Replacement:": {"zh": "替代:"}, + "Resample - Hermite": {"zh": "重新取样 - 埃尔米特"}, + "Reset zoom level": {"zh": "复位缩放级别"}, + "Resize": {"zh": "调整"}, + "Resolution:": {"zh": "解析度:"}, + "Restore alpha": {"zh": "恢复阿尔法"}, + "Right": {"zh": "对"}, + "Rotate": {"zh": "旋转"}, + "Rotate left": {"zh": "向左旋转"}, + "Rotation": {"zh": "回转"}, + "Russian": {"zh": "俄语"}, + "Saturation:": {"zh": "饱和:"}, + "Save": {"zh": "保存"}, + "Save as": {"zh": "另存为"}, + "Save as type:": {"zh": "保存类型:"}, + "Save layers:": {"zh": "保存层:"}, + "Save resolution:": {"zh": "保存分辨率:"}, + "Select all": {"zh": "全选"}, + "Select area first": {"zh": "选择区第一"}, + "Select area tool": {"zh": "选择区域工具"}, + "Select color": {"zh": "选择颜色"}, + "Select object tool": {"zh": "对象选择工具"}, + "Selected": {"zh": "选"}, + "Sensitivity:": {"zh": "灵敏度:"}, + "Sepia": {"zh": "乌贼"}, + "Shaded": {"zh": "阴影"}, + "Shadow blur:": {"zh": "阴影模糊:"}, + "Shadow color:": {"zh": "阴影颜色:"}, + "Shadow:": {"zh": "阴影:"}, + "Sharpen": {"zh": "磨"}, + "Sharpen tool": {"zh": "锐化工具"}, + "Sharpen:": {"zh": "锐化:"}, + "Show / Hide": {"zh": "显示隐藏"}, + "Simple": {"zh": "简单"}, + "Size": {"zh": "尺寸"}, + "Size:": {"zh": "尺寸:"}, + "Sketchy": {"zh": "略"}, + "Solarize": {"zh": "曝光过度"}, + "Sorry": {"zh": "抱歉"}, + "Sorry, image is too big, max 5 MB.": {"zh": "对不起,图片太大,最大为5 mb。"}, + "Source is empty, right click on image first.": {"zh": "资料来源是空的,用鼠标右键点击图片第一。"}, + "Sprites": {"zh": "精灵"}, + "Square": {"zh": "广场"}, + "Strength:": {"zh": "强度:"}, + "Strict": {"zh": "严格"}, + "Stroke": {"zh": "行程"}, + "Stroke size:": {"zh": "笔触大小:"}, + "Target:": {"zh": "目标:"}, + "Text": {"zh": "文本"}, + "Text:": {"zh": "文本:"}, + "The image could not be loaded.": {"zh": "图像无法加载。"}, + "This can not be last layer": {"zh": "这不可能是最后一层"}, + "This can not be last layer.": {"zh": "这不可能是最后一层。"}, + "Tilt Shift": {"zh": "倾斜移位"}, + "Times New Roman": {"zh": "英语字体格式一种"}, + "To paste from clipboard, use Ctrl-V.": {"zh": "若要从剪贴板粘贴使用ctrl-v。"}, + "Tools": {"zh": "工具"}, + "Top-left": {"zh": "左上角"}, + "Top-right": {"zh": "右上"}, + "Total pixels:": {"zh": "总像素:"}, + "Translate error, can not find dictionary:": {"zh": "翻译错误,找不到词典:"}, + "Transparency #1:": {"zh": "透明#1:"}, + "Transparency #2:": {"zh": "透明#2:"}, + "Transparent:": {"zh": "透明:"}, + "Trim": {"zh": "修剪"}, + "Trim:": {"zh": "修剪:"}, + "Turkish": {"zh": "土耳其"}, + "Undo": {"zh": "解开"}, + "Unique colors:": {"zh": "独特的颜色:"}, + "Up": {"zh": "向上"}, + "V Radius:": {"zh": "V半径:"}, + "Verdana": {"zh": "宋体"}, + "Vertical": {"zh": "垂直"}, + "Vertical gap:": {"zh": "垂直间隙:"}, + "Vibrance": {"zh": "鲜艳"}, + "Vignette": {"zh": "小插图"}, + "Vignette amount:": {"zh": "晕影量:"}, + "Vignette size:": {"zh": "晕影大小:"}, + "ViliusL": {"zh": "Viliusl"}, + "Vintage": {"zh": "酿酒"}, + "Visible": {"zh": "可见"}, + "Visible:": {"zh": "可见:"}, + "WEBP - Weppy File Format": {"zh": "Webp - weppy文件格式"}, + "Website": {"zh": "网站"}, + "Width (%):": {"zh": "宽度(%):"}, + "Width (pixels):": {"zh": "宽度(像素):"}, + "Width:": {"zh": "宽度:"}, + "Wrong file type, must be image or json.": {"zh": "错误的文件类型,必须是图像或json。"}, + "X end:": {"zh": "X最终:"}, + "X start:": {"zh": "X起动:"}, + "Y end:": {"zh": "Y结尾:"}, + "Y start:": {"zh": "是开始:"}, + "Yes": {"zh": "是"}, + "Your browser does not support this format.": {"zh": "你的浏览器不支持此格式。"}, + "Your browser doesn't support canvas.": {"zh": "您的浏览器不支持画布。"}, + "Zoom": {"zh": "放大"}, + "Zoom In": {"zh": "放大"}, + "Zoom Out": {"zh": "缩小"}, + "Zoom in": {"zh": "放大"}, + "Zoom out": {"zh": "缩小"}, + "Zoom:": {"zh": "放大:"}, +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/zh.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/zh.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..4dd33fbd727a4ccc9a0f9cf81bbcacd8d081f946 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/languages/zh.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + zh.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs.xml new file mode 100644 index 0000000000000000000000000000000000000000..566d9b5e7eda58c57e4bb077d7ca4ea054f98033 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + libs + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/helpers.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/helpers.js.js new file mode 100644 index 0000000000000000000000000000000000000000..9906cf4679d2e759704e5d7722315566a1f6bf2f --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/helpers.js.js @@ -0,0 +1,294 @@ +/* global WIDTH, HEIGHT, parseInt */ + +var HELPER = new HELPER_CLASS(); + +/** + * various helpers + * + * @author ViliusL + */ +function HELPER_CLASS() { + var time; + + this.timer_init = function () { + time = Date.now(); + }; + + this.timer = function (s, echo) { + var str = "time(" + s + ") = " + (Math.round(Date.now() - time) / 1000) + " s"; + if (echo === true) + return str; + else + console.log(str); + }; + + this.strpos = function (haystack, needle, offset) { + var i = (haystack + '').indexOf(needle, (offset || 0)); + return i === -1 ? false : i; + }; + + this.getCookie = function (NameOfCookie) { + if (document.cookie.length > 0){ + begin = document.cookie.indexOf(NameOfCookie + "="); + if (begin != -1){ + begin += NameOfCookie.length + 1; + end = document.cookie.indexOf(";", begin); + if (end == -1) + end = document.cookie.length; + return unescape(document.cookie.substring(begin, end)); + } + } + return ''; + }; + + this.setCookie = function (NameOfCookie, value, expiredays) { + if(expiredays == undefined) + expiredays = 180; + var ExpireDate = new Date(); + ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000)); + document.cookie = NameOfCookie + "=" + escape(value) + + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()); + }; + + this.delCookie = function (NameOfCookie) { + if (HELPER.getCookie(NameOfCookie)) { + document.cookie = NameOfCookie + "=" + + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; + } + }; + + this.getRandomInt = function (min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; + }; + + this.font_pixel_to_height = function (px) { + return Math.round(px * 0.75); + }; + + this.rgbToHex = function (r, g, b) { + if (r > 255 || g > 255 || b > 255) + throw "Invalid color component"; + return ((r << 16) | (g << 8) | b).toString(16); + }; + + this.rgb2hex_all = function (rgb) { + rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); + return "#" + HELPER.hex(rgb[1]) + HELPER.hex(rgb[2]) + HELPER.hex(rgb[3]); + }; + + this.hex = function (x) { + return ("0" + parseInt(x).toString(16)).slice(-2); + }; + + this.hex2rgb = function (hex) { + if (hex[0] == "#") + hex = hex.substr(1); + if (hex.length == 3) { + var temp = hex; + hex = ''; + temp = /^([a-f0-9])([a-f0-9])([a-f0-9])$/i.exec(temp).slice(1); + for (var i = 0; i < 3; i++) + hex += temp[i] + temp[i]; + } + var triplets = /^([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.exec(hex).slice(1); + return { + r: parseInt(triplets[0], 16), + g: parseInt(triplets[1], 16), + b: parseInt(triplets[2], 16), + a: 255 + }; + }; + + this.remove_selection = function () { + if (window.getSelection) { + if (window.getSelection().empty) // Chrome + window.getSelection().empty(); + else if (window.getSelection().removeAllRanges) // Firefox + window.getSelection().removeAllRanges(); + } + else if (document.selection) // IE? + document.selection.empty(); + }; + + this.get_dimensions = function () { + var theWidth, theHeight; + if (window.innerWidth) { + theWidth = window.innerWidth; + } + else if (document.documentElement && document.documentElement.clientWidth) { + theWidth = document.documentElement.clientWidth; + } + else if (document.body) { + theWidth = document.body.clientWidth; + } + if (window.innerHeight) { + theHeight = window.innerHeight; + } + else if (document.documentElement && document.documentElement.clientHeight) { + theHeight = document.documentElement.clientHeight; + } + else if (document.body) { + theHeight = document.body.clientHeight; + } + return [theWidth, theHeight]; + }; + + //credits: richard maloney 2006 + this.darkenColor = function (color, v) { + if (color.length > 6) { + color = color.substring(1, color.length); + } + var rgb = parseInt(color, 16); + var r = Math.abs(((rgb >> 16) & 0xFF) + v); + if (r > 255) + r = r - (r - 255); + var g = Math.abs(((rgb >> 8) & 0xFF) + v); + if (g > 255) + g = g - (g - 255); + var b = Math.abs((rgb & 0xFF) + v); + if (b > 255) + b = b - (b - 255); + r = Number(r < 0 || isNaN(r)) ? 0 : ((r > 255) ? 255 : r).toString(16); + if (r.length == 1) + r = '0' + r; + g = Number(g < 0 || isNaN(g)) ? 0 : ((g > 255) ? 255 : g).toString(16); + if (g.length == 1) + g = '0' + g; + b = Number(b < 0 || isNaN(b)) ? 0 : ((b > 255) ? 255 : b).toString(16); + if (b.length == 1) + b = '0' + b; + return "#" + r + g + b; + }; + + //IntegraXor Web SCADA - JavaScript Number Formatter, author: KPL, KHL + this.number_format = function (n, decPlaces, thouSeparator, decSeparator) { + var decPlaces = isNaN(decPlaces = Math.abs(decPlaces)) ? 2 : decPlaces; + var decSeparator = decSeparator == undefined ? "." : decSeparator; + var thouSeparator = thouSeparator == undefined ? "," : thouSeparator; + var sign = n < 0 ? "-" : ""; + var i = parseInt(n = Math.abs(+n || 0).toFixed(decPlaces)) + ""; + var j = (j = i.length) > 3 ? j % 3 : 0; + return sign + (j ? i.substr(0, j) + thouSeparator : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thouSeparator) + (decPlaces ? decSeparator + Math.abs(n - i).toFixed(decPlaces).slice(2) : ""); + }; + + this.chech_input_color_support = function (id) { + if (document.getElementById(id).value != undefined && document.getElementById(id).value[0] == '#') + return true; + return false; + }; + + this.b64toBlob = function(b64Data, contentType, sliceSize) { + contentType = contentType || ''; + sliceSize = sliceSize || 512; + + var byteCharacters = atob(b64Data); + var byteArrays = []; + + for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) { + var slice = byteCharacters.slice(offset, offset + sliceSize); + + var byteNumbers = new Array(slice.length); + for (var i = 0; i < slice.length; i++) { + byteNumbers[i] = slice.charCodeAt(i); + } + + var byteArray = new Uint8Array(byteNumbers); + + byteArrays.push(byteArray); + } + + var blob = new Blob(byteArrays, {type: contentType}); + return blob; + }; + this.escapeHtml = function(text){ + return text + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + }; + this.isNumeric = function(n){ + return !isNaN(parseFloat(n)) && isFinite(n); + }; + /** + * Converts an HSL color value to RGB. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes h, s, and l are contained in the set [0, 1] and + * returns r, g, and b in the set [0, 255]. + * + * @param {number} h The hue + * @param {number} s The saturation + * @param {number} l The lightness + * @return {Array} The RGB representation + */ + this.hslToRgb = function (h, s, l) { + var r, g, b; + + if (s == 0) { + r = g = b = l; // achromatic + } + else { + var hue2rgb = function hue2rgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; + }; + + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hue2rgb(p, q, h + 1 / 3); + g = hue2rgb(p, q, h); + b = hue2rgb(p, q, h - 1 / 3); + } + + return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)]; + }; + + /** + * Converts an RGB color value to HSL. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes r, g, and b are contained in the set [0, 255] and + * returns h, s, and l in the set [0, 1]. + * + * @param {number} r red color value + * @param {number} g green color value + * @param {number} b blue color value + * @return {Array} The HSL representation + */ + this.rgbToHsl = function (r, g, b) { + r /= 255, g /= 255, b /= 255; + var max = Math.max(r, g, b), min = Math.min(r, g, b); + var h, s, l = (max + min) / 2; + + if (max == min) { + h = s = 0; // achromatic + } + else { + var d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + switch (max) { + case r: + h = (g - b) / d + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / d + 2; + break; + case b: + h = (r - g) / d + 4; + break; + } + h /= 6; + } + + return [h, s, l]; + }; +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/helpers.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/helpers.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..aaf7cb741d4c29ed9b4ea791d68434e10c19f121 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/helpers.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + helpers.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/popup.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/popup.js.js new file mode 100644 index 0000000000000000000000000000000000000000..c74cf34bf7d939f0f5f947f441713b62619b7eec --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/popup.js.js @@ -0,0 +1,470 @@ +/* global MAIN, HELPER, POP, LAYER, EFFECTS, GUI, HELP */ +/* global canvas_front, WIDTH, HEIGHT, LANG */ + +var POP = new popup(); + +/** + * user dialogs library + * + * @author ViliusL + * + * Usage: + * var POP = new popup(); + * POP.add({name: "param1", title: "value1:" }); + * POP.add(...); + * POP.show('title', main_handler, preview_handler, onload_handler); + * + * POP.add() parameters: + * - name type example + * - --------------------------------------------------------------- + * - name string 'parameter1' + * - title string 'enter value:' + * - type string 'select', 'textarea', 'color' + * - value string '314' + * - values array fo strings ['one', 'two', 'three'] + * - range numbers interval [0, 255] + * - step int/float 1 + * - placeholder text 'enter number here' + * - html html text 'bold' + * - function function 'cutom_function' + * - onchange function 'class.onchange_function()' + */ +function popup() { + this.active = false; + this.handler = ''; + this.preview = false; + this.onload = false; + this.width_mini = 184; + this.height_mini = 195; + this.preview_in_main = false; + this.effects = false; + this.id = 0; + var parameters = []; + var layer_active_small = document.createElement("canvas"); + var layer_active_small_ctx = layer_active_small.getContext("2d"); + + //add parameter + this.add = function (object) { + parameters.push(object); + }; + + /** + * show popup window. + * used strings: "Ok", "Cancel", "Preview" + * + * @param {string} title + * @param {function} handler + * @param {function} preview_handler + * @param {function} onload_handler + */ + this.show = function (title, handler, preview_handler, onload_handler) { + POP.id = HELPER.getRandomInt(0, 999999999); + if (this.active == true) { + this.hide(); + return false; + } + this.active = true; + this.handler = handler; + if (preview_handler != undefined) + this.preview = preview_handler; + if (onload_handler != undefined) + this.onload = onload_handler; + var html = ''; + + var dim = HELPER.get_dimensions(); + popup = document.getElementById('popup'); + popup.style.top = 150 + 'px'; + popup.style.left = Math.round(dim[0] / 2) + 'px'; + + if (this.effects == true) { + var index; + for (var i = 0; i < EFFECTS.FILTERS_LIST.length; i++) { + if (EFFECTS.FILTERS_LIST[i].name == GUI.last_menu) { + index = i; + break; + } + } + var prev_index = index - 1; + if (prev_index < 0) { + prev_index = 0; + } + var next_index = index + 1; + if (next_index > EFFECTS.FILTERS_LIST.length - 1) { + next_index = EFFECTS.FILTERS_LIST.length - 1; + } + html += ''; + html += ' '; + html += ''; + html += ' '; + html += ''; + } + html += ''; + + //preview area + if (this.preview !== false && this.preview_in_main == false) { + html += '
'; + html += ''; + html += ''; + html += '
'; + } + + //settings + html += ''; + for (var i in parameters) { + var parameter = parameters[i]; + + html += ''; + if (title != 'Error' && parameter.title != undefined) + html += ''; + if (parameter.name != undefined) { + if (parameter.values != undefined) { + var onchange = ''; + if (parameter.onchange != undefined) + onchange = ' onchange="' + parameter.onchange + ';" '; + if (parameter.values.length > 10 || parameter.type == 'select') { + //drop down + if (onchange == '' && preview_handler != undefined) + onchange = ' onchange="POP.view();" '; + html += ''; + } + else { + //radio + html += ''; + } + } + else if (parameter.value != undefined) { + //input, range, textarea, color + var step = 1; + if (parameter.step != undefined) + step = parameter.step; + if (parameter.range != undefined) { + //range + var preview_code = ''; + if (this.preview !== false) + preview_code = 'POP.view();'; + html += ''; + html += ''; + } + else if (parameter.type == 'color') { + //color + var preview_code = ''; + if (this.preview !== false) + preview_code = 'POP.view();'; + html += ''; + } + else { + //input or textarea + if (parameter.placeholder == undefined) + parameter.placeholder = ''; + if (parameter.type == 'textarea'){ + html += ''; + } + else{ + var input_type="text"; + if(parameter.placeholder != undefined && parameter.placeholder != '' && !isNaN(parameter.placeholder)) + input_type = 'number'; + if(parameter.value != undefined && typeof parameter.value == 'number') + input_type = 'number'; + + html += ''; + } + } + } + } + else if (parameter.function != undefined) { + //custom function + var result; + if (typeof parameter.function == 'string') + result = window[parameter.function](); + else + result = parameter.function(); + html += ''; + } + else if (parameter.html != undefined) { + //html + html += ''; + } + else if (parameter.title == undefined) { + //gap + html += ''; + } + else { + //locked fields without name + str = "" + parameter.value; + var id_tmp = parameter.title.toLowerCase().replace(/[^\w]+/g, '').replace(/ +/g, '-'); + id_tmp = id_tmp.substring(0, 10); + if (str.length < 40) + html += ''; + else + html += ''; + } + html += ''; + } + html += '
'; + + //action buttons + html += '
'; + html += ''; + html += ''; + if (this.preview_in_main !== false) + html += ''; + html += '
'; + + document.getElementById("popup").innerHTML = html; + document.getElementById("popup").style.display = "block"; + if (parameters.length > 15) + document.getElementById("popup").style.overflowY = "scroll"; + else + document.getElementById("popup").style.overflowY = 'hidden'; + + //onload + if (this.onload != '') { + if (typeof this.onload == "string") + window[this.onload](); + else + this.onload(); + } + + //some events for effects browser + if (this.effects == true) { + document.getElementById('previous_filter').disabled = false; + document.getElementById('next_filter').disabled = false; + if (index == 0) { + document.getElementById('previous_filter').disabled = true; + } + if (index == EFFECTS.FILTERS_LIST.length - 1) { + document.getElementById('next_filter').disabled = true; + } + //previous + document.getElementById('previous_filter').addEventListener('click', function (event) { + POP.hide(); + GUI.last_menu = EFFECTS.FILTERS_LIST[prev_index].name; + call_menu(EFFECTS, EFFECTS.FILTERS_LIST[prev_index].name); + }); + //next + document.getElementById('next_filter').addEventListener('click', function (event) { + POP.hide(); + GUI.last_menu = EFFECTS.FILTERS_LIST[next_index].name; + call_menu(EFFECTS, EFFECTS.FILTERS_LIST[next_index].name); + }); + //onchange + var effect_browser = document.getElementById('effect_browser'); + effect_browser.addEventListener('change', function (event) { + var value = effect_browser.options[effect_browser.selectedIndex].value; + POP.hide(); + GUI.last_menu = EFFECTS.FILTERS_LIST[value].name; + call_menu(EFFECTS, EFFECTS.FILTERS_LIST[value].name); + }); + } + + //load preview? + if (this.preview !== false && this.preview_in_main == false) { + //original + var pop_pre = document.getElementById("pop_pre").getContext("2d"); + pop_pre.rect(0, 0, POP.width_mini, POP.height_mini); + pop_pre.fillStyle = "#ffffff"; + pop_pre.fill(); + GUI.draw_background(pop_pre, POP.width_mini, POP.height_mini, 5); + pop_pre.drawImage(document.getElementById(LAYER.layers[LAYER.layer_active].name), 0, 0, POP.width_mini, POP.height_mini); + + //copy + pop_post = document.getElementById("pop_post").getContext("2d"); + pop_post.rect(0, 0, POP.width_mini, POP.height_mini); + pop_post.fillStyle = "#ffffff"; + pop_post.fill(); + GUI.draw_background(pop_post, POP.width_mini, POP.height_mini, 5); + pop_post.drawImage(document.getElementById(LAYER.layers[LAYER.layer_active].name), 0, 0, POP.width_mini, POP.height_mini); + + //prepare temp canvas + layer_active_small.width = POP.width_mini; + layer_active_small.height = POP.height_mini; + layer_active_small_ctx.drawImage(document.getElementById(LAYER.layers[LAYER.layer_active].name), 0, 0, POP.width_mini, POP.height_mini); + POP.view(); + } + + //call translation again to translate popup + HELP.help_translate(LANG); + }; + + //hide popup + this.hide = function () { + document.getElementById('popup').style.display = 'none'; + parameters = []; + this.handler = ''; + this.active = false; + this.preview = false; + this.onload = false; + this.preview_in_main = false; + this.effects = false; + canvas_front.clearRect(0, 0, WIDTH, HEIGHT); + }; + + //renders preview. If input=range supported, is called on every param update - must be fast... + this.view = function () { + if (this.preview !== false) { + if (this.preview_in_main == false) { + //reset mini view + pop_post.clearRect(0, 0, POP.width_mini, POP.height_mini); + pop_post.drawImage(layer_active_small, 0, 0); + } + + //prepare + var response = {}; + inputs = document.getElementsByTagName('input'); + for (i = 0; i < inputs.length; i++) { + if (inputs[i].id.substr(0, 9) == 'pop_data_') { + var key = inputs[i].id.substr(9); + if (HELPER.strpos(key, "_poptmp") != false) + key = key.substring(0, HELPER.strpos(key, "_poptmp")); + var value = inputs[i].value; + if (inputs[i].type == 'radio') { + if (inputs[i].checked == true) + response[key] = value; + } + else + response[key] = value; + } + } + selects = document.getElementsByTagName('select'); + for (i = 0; i < selects.length; i++) { + if (selects[i].id.substr(0, 9) == 'pop_data_') { + var key = selects[i].id.substr(9); + var value = selects[i].value; + response[key] = value; + } + } + textareas = document.getElementsByTagName('textarea'); + for (i = 0; i < textareas.length; i++) { + if (textareas[i].id.substr(0, 9) == 'pop_data_') { + var key = textareas[i].id.substr(9); + var value = textareas[i].value; + response[key] = value; + } + } + + //call handler + if (this.preview_in_main == false) + this.preview(response, pop_post, POP.width_mini, POP.height_mini); + else + this.preview(response); + } + }; + + //OK pressed - prepare data and call handlers + this.save = function () { + this.active = false; + document.getElementById("popup").style.display = "none"; + var response = {}; + inputs = document.getElementsByTagName('input'); + for (i = 0; i < inputs.length; i++) { + if (inputs[i].id.substr(0, 9) == 'pop_data_') { + var key = inputs[i].id.substr(9); + if (HELPER.strpos(key, "_poptmp") != false) + key = key.substring(0, HELPER.strpos(key, "_poptmp")); + var value = inputs[i].value; + if (inputs[i].type == 'radio') { + if (inputs[i].checked == true) + response[key] = value; + } + else + response[key] = value; + + } + } + selects = document.getElementsByTagName('select'); + for (i = 0; i < selects.length; i++) { + if (selects[i].id.substr(0, 9) == 'pop_data_') { + var key = selects[i].id.substr(9); + var value = selects[i].value; + response[key] = value; + } + } + textareas = document.getElementsByTagName('textarea'); + for (i = 0; i < textareas.length; i++) { + if (textareas[i].id.substr(0, 9) == 'pop_data_') { + var key = textareas[i].id.substr(9); + var value = textareas[i].value; + response[key] = value; + } + } + parameters = []; + this.preview = false; + this.onload = false; + this.preview_in_main = false; + this.effects = false; + if (this.handler != '') { + if (typeof this.handler == "object") + this.handler[0][this.handler[1]](response); + else if (typeof this.handler == "function") + this.handler(response); + else + console.log('error: wrong function type: ' + this.handler); + } + this.handler = ''; + }; + + //validate input field, unless browser supports input=range + this.validate = function (field) { + for (var i in parameters) { + var parameter = parameters[i]; + if ("pop_data_" + parameter.name == field.id && parameter.range != undefined) { + if (field.value == '-' || field.value == '') + return true; + + var value = parseFloat(field.value); + if (isNaN(value) || value != field.value) + field.value = parameter.value; //not number + if (value < parameter.range[0]) + field.value = parameter.range[0]; //less then min + else if (value > parameter.range[1]) + field.value = parameter.range[1]; //more then max + } + } + }; +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/popup.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/popup.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..67568d1e3197dbb92ec906513ff72e6865032f01 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/popup.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + popup.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/sift.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/sift.js.js new file mode 100644 index 0000000000000000000000000000000000000000..be381dd4ef75300f8e2468dff06f50830c3d04c6 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/sift.js.js @@ -0,0 +1,183 @@ +/** + * SIFT: scale-invariant-feature-transform, keypoints + * + * @author ViliusL + */ + +/* global HELPER, IMAGE, ImageFilters, LAYER, canvas_active */ + +var SIFT = new SIFT_CLASS(); + +function SIFT_CLASS() { + /** + * contrast check, smaller - more points, better accuracy, but slower + */ + var avg_offset = 50; + + /** + * how much pixels to check for each side to get average + */ + var avg_step = 4; + + //generate key points for image + this.generate_keypoints = function (canvas, show_points) { + var W = canvas.width; + var H = canvas.height; + HELPER.timer_init(); + + //check whitespace + var trim_details = IMAGE.trim_info(canvas); + W = W - trim_details.left - trim_details.right; + H = H - trim_details.top - trim_details.bottom; + //make copy + var clone = document.createElement("canvas"); + clone.width = W; + clone.height = H; + var ctx = clone.getContext("2d"); + ctx.drawImage(canvas, -trim_details.left, -trim_details.top, canvas.width, canvas.height); + + //greyscale + var imageData = ctx.getImageData(0, 0, W, H); + var filtered = ImageFilters.GrayScale(imageData); //add effect + ctx.putImageData(filtered, 0, 0); + + //make few copies and blur each + var n = 5; + var copies = []; + for (var i = 0; i < n; i++) { + var tmp_canvas = document.createElement("canvas"); + tmp_canvas.width = W; + tmp_canvas.height = H; + var ctx_i = tmp_canvas.getContext("2d"); + ctx_i.drawImage(clone, 0, 0); + + //gausian blur + var imageData = ctx_i.getImageData(0, 0, W, H); + var filtered = ImageFilters.GaussianBlur(imageData, i + 0.5); //add effect + ctx_i.putImageData(filtered, 0, 0); + + copies.push(tmp_canvas); + } + + //find extreme points + var points = []; + var n0 = avg_step * 2 + 1; + for (var c = 1; c < copies.length - 1; c++) { + var imageData = copies[c].getContext("2d").getImageData(0, 0, W, H).data; + var imageData0 = copies[c - 1].getContext("2d").getImageData(0, 0, W, H).data; + var imageData2 = copies[c + 1].getContext("2d").getImageData(0, 0, W, H).data; + for (var j = avg_step; j < H - avg_step; j++) { + for (var i = avg_step; i < W - avg_step; i++) { + var x = (i + j * W) * 4; + if (imageData[x + 3] == 0) + continue; //transparent + if (imageData[x] < imageData[x - 4] || imageData[x] < imageData[x + 4] || imageData[x] > imageData[x - 4] || imageData[x] > imageData[x + 4]) { + var x_pre = (i + (j - 1) * W) * 4; + var x_post = (i + (j + 1) * W) * 4; + //calc average + var area_average = 0; + for (var l = -avg_step; l <= avg_step; l++) { + var avgi = (i + (j - l) * W) * 4; + for (var a = -avg_step; a <= avg_step; a++) { + area_average += imageData[avgi + 4 * a]; + } + } + area_average = area_average / (n0 * n0); + //max + if (imageData[x] + avg_offset < area_average) { + var min = Math.min(imageData[x_pre - 4], imageData[x_pre], imageData[x_pre + 4], imageData[x - 4], imageData[x + 4], imageData[x_post - 4], imageData[x_post], imageData[x_post + 4]); + if (imageData[x] <= min) { + var min0 = Math.min(imageData0[x_pre - 4], imageData0[x_pre], imageData0[x_pre + 4], imageData0[x - 4], imageData0[x + 4], imageData0[x_post - 4], imageData0[x_post], imageData0[x_post + 4]); + if (imageData[x] <= min0) { + var min2 = Math.min(imageData2[x_pre - 4], imageData2[x_pre], imageData2[x_pre + 4], imageData2[x - 4], imageData2[x + 4], imageData2[x_post - 4], imageData2[x_post], imageData2[x_post + 4]); + if (imageData[x] <= min2) + points.push({ + x: i + trim_details.left, + y: j + trim_details.top, + w: Math.round(area_average - imageData[x] - avg_offset) + }); + } + } + continue; + } + //min + if (imageData[x] - avg_offset > area_average) { + var max = Math.max(imageData[x_pre - 4], imageData[x_pre], imageData[x_pre + 4], imageData[x - 4], imageData[x + 4], imageData[x_post - 4], imageData[x_post], imageData[x_post + 4]); + if (imageData[x] >= max) { + var max0 = Math.max(imageData0[x_pre - 4], imageData0[x_pre], imageData0[x_pre + 4], imageData0[x - 4], imageData0[x + 4], imageData0[x_post - 4], imageData0[x_post], imageData0[x_post + 4]); + if (imageData[x] >= max0) { + var max2 = Math.max(imageData2[x_pre - 4], imageData2[x_pre], imageData2[x_pre + 4], imageData2[x - 4], imageData2[x + 4], imageData2[x_post - 4], imageData2[x_post], imageData2[x_post + 4]); + if (imageData[x] >= max2){ + points.push({ + x: i + trim_details.left, + y: j + trim_details.top, + w: Math.round(imageData[x] - area_average - avg_offset) + }); + } + } + } + } + } + } + } + } + //make unique + for (var i = 0; i < points.length; i++) { + for (var j = 0; j < points.length; j++) { + if (i != j && points[i].x == points[j].x && points[i].y == points[j].y) { + points.splice(i, 1); + i--; + break; + } + } + } + + //show points? + if (show_points === true) { + var time = HELPER.timer('', true); + console.log('key points: ' + points.length + ", " + time); + LAYER.layer_add(); + + var size = 3; + canvas_active().fillStyle = "#ff0000"; + for (var i in points) { + var point = points[i]; + canvas_active().beginPath(); + canvas_active().rect(point.x - Math.floor(size / 2) + 1, point.y - Math.floor(size / 2) + 1, size, size); + canvas_active().fill(); + } + } + else { + //sort by weights + points.sort(function (a, b) { + return parseFloat(b.w) - parseFloat(a.w); + }); + return { + points: points, + trim_details: trim_details + }; + } + }; + + //returns average value of requested area from greyscale image + //area = {x, y, w, h} + this.get_area_average = function (area, imageData, i, j, size) { + var imgData = imageData.data; + var sum = 0; + var n = 0; + size = size / 100; //prepare to use 1-100% values + var stop_x = i + Math.round(size * area.x) + Math.round(size * area.w); + var stop_y = j + Math.round(size * area.y) + Math.round(size * area.h); + var img_width4 = imageData.width * 4; + var k0, k; + for (var y = j + Math.round(size * area.y); y < stop_y; y++) { + k0 = y * img_width4; + for (var x = i + Math.round(size * area.x); x < stop_x; x++) { + k = k0 + (x * 4); + sum = sum + imgData[k]; + n++; + } + } + return Math.round(sum / n); + }; +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/sift.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/sift.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..563ff2da62a5bb678263ded5cebdb3eb152fc24f --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/sift.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + sift.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/vintage.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/vintage.js.js new file mode 100644 index 0000000000000000000000000000000000000000..23fee195303f7f08624310fdd340966962e10d72 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/vintage.js.js @@ -0,0 +1,200 @@ +/* global fx, ImageFilters, canvas_active */ + +var VINTAGE = new VINTAGE_CLASS(); + +/** + * adds vintage effect + * + * @author ViliusL + * + * Functions: + * - adjust_color + * - lower_contrast + * - blur + * - light_leak + * - chemicals + * - exposure + * - grains + * - grains_big + * - optics + * - dusts + * + * Usage: VINTAGE.___function___(canvas_ctx, width, height, param1, param2, ...); + * + * libs: + * - imagefilters.js, url: https://github.com/arahaya/ImageFilters.js + * - glfx.js url: http://evanw.github.com/glfx.js/ + */ +function VINTAGE_CLASS() { + var fx_filter = false; + + //increasing red color + this.adjust_color = function (context, W, H, level_red) { //level = [0, 200], default 70 + var param_green = 0; + var param_blue = 0; + var imageData = context.getImageData(0, 0, W, H); + var filtered = ImageFilters.ColorTransformFilter(imageData, 1, 1, 1, 1, level_red, param_green, param_blue, 1); + context.putImageData(filtered, 0, 0); + }; + + //decreasing contrast + this.lower_contrast = function (context, W, H, level) { //level = [0, 50], default 15 + var imageData = context.getImageData(0, 0, W, H); + var filtered = ImageFilters.BrightnessContrastPhotoshop(imageData, 0, -level); + context.putImageData(filtered, 0, 0); + }; + + //adding blur + this.blur = function (context, W, H, level) { //level = [0, 2], default 0 + if (level < 1) + return context; + var imageData = context.getImageData(0, 0, W, H); + var filtered = ImageFilters.GaussianBlur(imageData, level); + context.putImageData(filtered, 0, 0); + }; + + //creating transparent #ffa500 radial gradients + this.light_leak = function (context, W, H, level) { //level = [0, 150], default 90 + var click_x = this.getRandomInt(0, W); + var click_y = this.getRandomInt(0, H); + var distance = Math.min(W, H) * 0.6; + var radgrad = canvas_active().createRadialGradient( + click_x, click_y, distance * level / 255, + click_x, click_y, distance); + radgrad.addColorStop(0, "rgba(255, 165, 0, " + level / 255 + ")"); + radgrad.addColorStop(1, "rgba(255, 255, 255, 0)"); + + context.fillStyle = radgrad; + context.fillRect(0, 0, W, H); + }; + + //de-saturate + this.chemicals = function (context, W, H, level) { //level = [0, 100], default 40 + var imageData = context.getImageData(0, 0, W, H); + var filtered = ImageFilters.HSLAdjustment(imageData, 0, -level, 0); + context.putImageData(filtered, 0, 0); + }; + + //creating transparent vertical black-to-white gradients + this.exposure = function (context, W, H, level) { //level = [0, 150], default 80 + context.rect(0, 0, W, H); + var grd = canvas_active().createLinearGradient(0, 0, 0, H); + if (this.getRandomInt(1, 10) < 5) { + //dark at top + grd.addColorStop(0, "rgba(0, 0, 0, " + level / 255 + ")"); + grd.addColorStop(1, "rgba(255, 255, 255, " + level / 255 + ")"); + } + else { + //bright at top + grd.addColorStop(0, "rgba(255, 255, 255, " + level / 255 + ")"); + grd.addColorStop(1, "rgba(0, 0, 0, " + level / 255 + ")"); + } + context.fillStyle = grd; + context.fill(); + }; + + //add grains, noise + this.grains = function (context, W, H, level) { //level = [0, 50], default 10 + if (level == 0) + return context; + var img = context.getImageData(0, 0, W, H); + var imgData = img.data; + for (var j = 0; j < H; j++) { + for (var i = 0; i < W; i++) { + var x = (i + j * W) * 4; + if (imgData[x + 3] == 0) + continue; //transparent + //increase it's lightness + var delta = this.getRandomInt(0, level); + if (delta == 0) + continue; + + if (imgData[x] - delta < 0) + imgData[x] = -(imgData[x] - delta); + else + imgData[x] = imgData[x] - delta; + if (imgData[x + 1] - delta < 0) + imgData[x + 1] = -(imgData[x + 1] - delta); + else + imgData[x + 1] = imgData[x + 1] - delta; + if (imgData[x + 2] - delta < 0) + imgData[x + 2] = -(imgData[x + 2] - delta); + else + imgData[x + 2] = imgData[x + 2] - delta; + } + } + context.putImageData(img, 0, 0); + }; + + //add big grains, noise + this.grains_big = function (context, W, H, level) { //level = [0, 50], default 20 + if (level == 0) + return context; + var n = W * H / 100 * level; //density + var color = 200; + for (var i = 0; i < n; i++) { + var power = this.getRandomInt(5, 10 + level); + var size = 2; + var x = this.getRandomInt(0, W); + var y = this.getRandomInt(0, H); + context.fillStyle = "rgba(" + color + ", " + color + ", " + color + ", " + power / 255 + ")"; + context.fillRect(x, y, size, size); + } + }; + + //adding vignette effect - blured dark borders + this.optics = function (context, W, H, param1, param2) { //param1 [0, 0.5], param2 [0, 0.7], default 0.3, 0.5 + //make sure FX lib loaded + if(fx_filter == false){ + fx_filter = fx.canvas(); + } + + var texture = fx_filter.texture(context.getImageData(0, 0, W, H)); + fx_filter.draw(texture).vignette(param1, param2).update(); + context.drawImage(fx_filter, 0, 0); + }; + + //add dust and hairs + this.dusts = function (context, W, H, level) { //level = [0, 100], default 70 + var n = level / 100 * (W * H) / 1000; + //add dust + context.fillStyle = "rgba(200, 200, 200, 0.3)"; + for (var i = 0; i < n; i++) { + var x = this.getRandomInt(0, W); + var y = this.getRandomInt(0, H); + var mode = this.getRandomInt(1, 2); + if (mode == 1) { + var w = 1; + var h = this.getRandomInt(1, 3); + } + else if (mode == 2) { + var w = this.getRandomInt(1, 3); + var h = 1; + } + context.beginPath(); + context.rect(x, y, w, h); + context.fill(); + } + + //add hairs + context.strokeStyle = "rgba(200, 200, 200, 0.2)"; + for (var i = 0; i < n / 3; i++) { + var x = this.getRandomInt(0, W); + var y = this.getRandomInt(0, H); + var radius = this.getRandomInt(5, 15); + var start_nr = this.getRandomInt(0, 20) / 10; + var start_angle = Math.PI * start_nr; + var end_angle = Math.PI * (start_nr + this.getRandomInt(7, 15) / 10); + context.beginPath(); + context.arc(x, y, radius, start_angle, end_angle); + context.stroke(); + } + + return context; + }; + + //random number generator + this.getRandomInt = function (min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; + }; +} diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/vintage.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/vintage.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..b4edabe4b83ebebf71f1a4c905eed60a5f79dea8 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/libs/vintage.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + vintage.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles.xml new file mode 100644 index 0000000000000000000000000000000000000000..9dcd1221e3de1a6529baf85c4a81cedc48e8496e --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + styles + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles/styles.css.css b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles/styles.css.css new file mode 100644 index 0000000000000000000000000000000000000000..0096cbbc617f2e53afd08b17be231b12fb1c9451 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles/styles.css.css @@ -0,0 +1,711 @@ +/* +Table of Contents: + 1. General + 2. Header + 2.1 Navigation + 3. Footer + 4. Sidebar + 5. Print + 6. Content +*/ + +/* ========== 1. General ==================================================== */ + +*{ + box-sizing: border-box; +} +body{ + font-size: 75%; /* Resets to 12px */ + font-family: Arial, Helvetica, sans-serif; + color: #000000; + margin: 0px; + padding: 0px; + padding-top: 30px; + background-color:#727272; + font-weight: normal; + overflow: hidden; +} +canvas{ + position: absolute; + outline: none; + /* disable select canvas */ + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: rgba(255, 255, 255, 0); + /* disable antialiasing */ + image-rendering: optimizeSpeed; + image-rendering: -moz-crisp-edges; + image-rendering: -webkit-optimize-contrast; + image-rendering: -o-crisp-edges; + image-rendering: pixelated; + -ms-interpolation-mode: nearest-neighbor; +} +img{ + border: none; +} +td, th{ + vertical-align:top; +} +table{ + border: 0; + margin: 0; + padding: 0; + vertical-align: baseline; + border-collapse: collapse; + border-spacing: 0; + width:100%; +} +input[type="text"], input[type="button"], select, input[type="number"]{ + border:1px solid #393939; + padding:1px 3px; +} +input[type="range"]{ + margin-left:0px; + width:100%; +} +input[type="button"]:disabled{ + visibility:hidden; +} +input[type="button"]{ + background: #dddddd; +} + +/* ========== 2. Header ===================================================== */ + +#logo{ + display: block; + height: 30px; + padding: 5px 5px 5px 36px; + margin: 5px 0 10px 0; + background: url("../miniPaint/img/logo.png") no-repeat 3px 0px; + background-size: auto 30px; + text-decoration: none; + font-weight: bold; + color: #ffffff; + font-size: 13px; +} +#logo:hover{ + animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; +} +@keyframes shake{ + 10%, 90%{ + background-position: 2px 0px; + } + 20%, 80%{ + background-position: 5px 0px; + } + 30%, 50%, 70%{ + background-position: 0px 0px; + } + 40%, 60%{ + background-position: 6px 0px; + } +} + +/* ========== 2.1 Navigation ================================================ */ + +#mobile_menu{ + display:none; + position: absolute; + width:100%; + top: 0; +} +.left_mobile_menu, .right_mobile_menu{ + position:absolute; + background: url('../miniPaint/img/sprites.png') no-repeat -50px -100px; + width:50px; + height:50px; + display:block; + top:0; + z-index:200; +} +.left_mobile_menu{left:0;} +.right_mobile_menu{right:0;} + +.ddsmoothmenu{ + position:fixed; + top:0; + left:0; + width:100%; + font:12px Arial,sans-serif; + background: #2D2D2D; + width: 100%; + padding-left:10px; + z-index:100; +} +.ddsmoothmenu ul{ + z-index:100; + margin: 0; + padding: 0; + list-style-type: none; + height:30px; +} +.ddsmoothmenu ul li{ + position: relative; + display: inline-block; + float: left; + color: #2d2b2b; + height:100%; +} +.ddsmoothmenu ul ul li a{ + width:100%; +} +.ddsmoothmenu .rightarrowclass{ + display:none !important; +} +.ddsmoothmenu ul li a{ + display: inline-block; + color: #2D2D2D; + text-decoration: none; + color: #cccccc; + text-align:center; + padding: 7px 10px 8px 10px !important; +} +.ddsmoothmenu ul li a.selected{ + background-color: #FFFFFF !important; + color: #2d2b2b; +} +.ddsmoothmenu ul li ul li a.selected{ + background-color:#E4EBF8 !important; +} +.ddsmoothmenu ul li a:hover{ + background-color: #E4EBF8; + color: #2D2D2D; +} +.ddsmoothmenu .hide_ul{ + position: absolute; + left: -3000px; + display: none; + visibility: hidden; + border:1px solid #5680C1; + border-top:0px; +} +.ddsmoothmenu ul li ul{ + position: absolute; + left: -3000px; + display: none; + visibility: hidden; + border:1px solid #5680C1; + border-top:0px; + margin-left: -1px; + height:auto; + min-width:140px; + width:auto !important; + top:30px !important; +} +.ddsmoothmenu ul li ul li{ + display: list-item; + background: #ffffff; + float: none; + height:auto; + width:100%; +} +.ddsmoothmenu ul li ul li a{ + text-align:left; +} +.ddsmoothmenu ul li ul li ul{ + top: 0; + border-top:1px solid #5680C1; +} +.ddsmoothmenu ul li ul li a{ + padding-left: 5px; + padding-right:5px; + margin: 0; + color: #2D2D2D; + white-space: nowrap; +} +.ddsmoothmenu ul li ul li ul{ + top:0 !important; +} +* html .ddsmoothmenu{height: 1%;} /*Hack for IE7 and below*/ +.ddsmoothmenu .downarrowclass{ + position: absolute; + top: 12px; + right: 7px; +} + .ddsmoothmenu .ddshadow{ + position: absolute; + left: 0; + top: 0; + width: 0; + height: 0; + background-color: #ccc; +} +.ddsmoothmenu .mid-line{ + background-color:#ff0000; + border-top:1px solid #e5e5e5; + font-size:0; + padding:0 8px 0 8px; +} +.ddsmoothmenu ul li ul li.more > a{ + background-image: url('../miniPaint/img/right.png'); + background-repeat: no-repeat; + background-position: 97% 30%; +} +.ddsmoothmenu ul li ul li ul{ + left: calc(100% + 1px) !important; +} +.ddsmoothmenu .dots::after{ + content: "..."; +} +@media screen and (max-width:700px){ + #mobile_menu{ + display:block; + } + .left_mobile_menu{ + display:none; + } + .ddsmoothmenu{ + height:50px; + } + .ddsmoothmenu ul{ + width: calc(100% - 50px); + height:50px; + } + .ddsmoothmenu > ul > li > a{ + height:50px; + padding-top: 15px !important; + } + .ddsmoothmenu ul li ul{ + top:50px !important; + } + .ddsmoothmenu ul li ul li{ + height:auto; + } + .ddsmoothmenu ul li ul li a{ + height:30px; + } +} +@media screen and (max-width:550px){ + .ddsmoothmenu{ + padding-left:0; + } + .ddsmoothmenu ul{ + width: calc(100% - 100px); + margin-left:50px; + } + .ddsmoothmenu > ul > li{ + width: calc(100% / 7); + } + .ddsmoothmenu > ul > li > a{ + width:100%; + padding-left: 3px !important; + padding-right: 3px !important; + overflow: hidden; + } + .left_mobile_menu{ + display:block; + } +} +@media screen and (max-width:400px){ + .ddsmoothmenu{ + background: #666666; + } + .ddsmoothmenu > ul > li{ + width: calc(100% / 7); + } + .ddsmoothmenu .icon{ + width:100%; + max-width:50px; + background-image: url('../miniPaint/img/sprites.png'); + background-position: -91px -88px; + color: transparent !important; + } + .ddsmoothmenu .icon:hover{ + background-color:#727272 !important; + } + .ddsmoothmenu .file{ background-position: -91px -88px; } + .ddsmoothmenu .edit{ background-position: -141px -88px; } + .ddsmoothmenu .image{ background-position: -191px -88px; } + .ddsmoothmenu .layer{ background-position: -241px -88px; } + .ddsmoothmenu .effects{ background-position: -291px -88px; } + .ddsmoothmenu .tools{ background-position: -341px -88px; } + .ddsmoothmenu .help{ background-position: -391px -88px; } +} +@media screen and (max-width:350px){ + .ddsmoothmenu .file{ background-position: -95px -88px; } + .ddsmoothmenu .edit{ background-position: -145px -88px; } + .ddsmoothmenu .image{ background-position: -195px -88px; } + .ddsmoothmenu .layer{ background-position: -245px -88px; } + .ddsmoothmenu .effects{ background-position: -295px -88px; } + .ddsmoothmenu .tools{ background-position: -345px -88px; } + .ddsmoothmenu .help{ background-position: -398px -88px; } +} + +/* ========== 3. Footer ===================================================== */ + +/* ========== 4. Sidebar ==================================================== */ + +#sidebar_left{ + position: absolute; + width: 105px; + z-index: 100; + left:0px; + padding:0 5px 5px 0; + transition: 0.2s; + -webkit-transition: 0.2s; +} +#sidebar_right{ + position: absolute; + width: 152px; + right:0; + top:0; + z-index: 100; + transition: 0.2s; + background-color:#727272; + -webkit-transition: 0.2s; +} +#sidebar_left.active{ + left:0 !important; + background-color: #727272; + box-shadow: 5px 0px 10px 0px rgba(0,0,0,0.75); +} +#sidebar_right.active{ + right:0 !important; + box-shadow: -5px 0px 10px 0px rgba(0,0,0,0.75); +} +#main_color{ + border:1px solid #393939; + background-color:#727272; + margin-top:10px; + width:100%; + height:40px; + margin:0px; + padding:0px; +} +#main_color_alt{ + border:1px solid #393939; + margin-top:10px; + width:100%; + height:40px; +} +#main_color_rgb{ + margin-top:5px; + width:100%; + color:#000000; + text-align:right; +} +#main_color_rgb input{ + width:55px; +} +#main_color_rgb a{ + display: inline-block; + width: 14px; + height: 14px; + border-radius: 7px; + color: transparent; + margin-right: 5px; +} +#main_color_rgb a.red{ background-color:#ff0000; } +#main_color_rgb a.green{ background-color:#00ff00; } +#main_color_rgb a.blue{ background-color:#0000ff; } +#main_color_rgb a.alpha{ background: url('../miniPaint/img/sprites.png') no-repeat -550px -50px; } + +#preview{ + width:150px; + background-color:#989898; + border:1px solid #393939; + margin-bottom: 5px; +} +#preview canvas{ + cursor: pointer; +} +#menu_left_container .active{ + background-color: #5680c1 !important; +} +#menu_left_container a{ + float:left; + border: 1px solid #393939; + background: #989898 url('../img/sprites.png') no-repeat 0px 0px; + width:24px; + height:24px; + margin:0px 1px 1px 0px; + overflow:hidden; + display:block; +} +#action_attributes{ + min-height:20px; + font-size:11px; +} +#mouse_info{ + padding:5px 3px 5px 2px; + font-size:11px; +} +#action_attributes input{ + font-size:12px; + width:100%; +} +#color_hex{ + width: 100%; + border:1px solid #393939; +} +#all_colors{ + margin-top:10px; + padding:3px 0px 3px 3px; +} +#sidebar_right .layer{ + margin-bottom:2px; + border:1px solid #393939; + background-color:#989898; + padding:1px 5px 3px 5px; + border-radius:3px; + font-size:11px; + height:19px; + overflow:hidden; + color:#333333; +} +#layers_base .active{ + background-color:#5680c1; +} +.layers_arrow{ + text-decoration:none; + color:#000000; + display:block; + float:right; + margin-left:5px; + background-color:#727272; + padding:0px 5px 0px 5px; + border:1px solid #393939; + font-size:11px; +} +.layer_title{ + display:block; + float:left; + cursor:pointer; + min-width:85px; + width:10px; + overflow:hidden; +} + +.layer_delete{ + float:right; + cursor:pointer; + padding:0px 3px 0px 3px; + width:12px; + height:12px; + background: url('../img/sprites.png') no-repeat 0px -50px; +} +.layer_visible{ + float:right; + cursor:pointer; + padding:0px 3px 0px 3px; + width:12px; + height:12px; + background: url('../img/sprites.png') no-repeat -100px -50px; +} +.layer_unvisible{ + background: url('../img/sprites.png') no-repeat -50px -50px; +} +.layer_add{ + border:1px solid #393939; + padding:0px 4px 0px 4px; + text-decoration:none; + background-color:#5680c1; + cursor:pointer; +} +.mini-color{ + width:16px; + height:16px; + margin:0px 3px 3px 0px; + float:left; + border:1px solid #393939; +} +.mini-color:hover{ + cursor:pointer; +} +.attribute-area{ + border:1px solid #393939; + background-color:#989898; + margin:5px 5px 5px 5px; + text-align:center; + padding:5px 0px 5px 0px; + cursor:pointer; + /* disable select */ + -webkit-user-select:none; + -moz-user-select:none; +} +.mouse_info_title{ + font-weight:bold; + min-width:38px; + display:block; + float:left; +} +@media screen and (max-width:700px){ + #sidebar_right{ + right: -160px; + } +} +@media screen and (max-width:550px){ + #sidebar_left{ + left: -110px; + } +} + +/* ========== 5. Print ====================================================== */ + +@media print{ + body{ + background:none !important; + background: #fff; + background-color: #fff; + font-family: Arial,Helvetica,Verdana; + width:auto !important; + padding:5px !important; + font-size: 12px; + } + progress, + .menu, + #resize-w,#resize-h, #resize-wh, + #sidebar_left, + #sidebar_right, + #canvas_back, + .ddsmoothmenu{ + display: none; + height: 0; + width: 0; + } + #canvas_wrapper{ + margin:0px; + padding:0px; + } + canvas{ + border:0px; + position: absolute; + top:0px; + left:0px; + } +} + +/* ========== 6. Content ==================================================== */ + +#wrapper{ + margin: 5px; + position:relative; + min-height: 500px; + overflow: hidden; +} +#canvas_wrapper{ + position:relative; + margin: 0 157px 0 105px; + overflow: hidden; + height: calc(100vh - 35px); +} +#canvas_wrapper canvas{ + border: 1px solid #393939; + box-sizing: content-box; +} +#canvas_back{ + position: absolute; + background-color:#ffffff; + outline: none; +} +#layers_base{ + background-color: #989898; + border: 1px solid #393939; + padding: 5px; + margin-bottom: 5px; +} +#resize-w, #resize-h, #resize-wh{ + background-color:#393939; + width:5px; + height:5px; + margin-left:105px; + position:absolute; + top:0; +} +#canvas_grid{ + pointer-events:none; +} +.trn{} +.block{ + border:1px solid #393939; + padding:5px; + margin-top:5px; + background-color:#818181; +} +.error{ + padding:20px; + margin:10px; + border:1px solid #ff0000; + background-color:#ffffff; + width:400px; + font-weight:bold; +} +.group{ + border:1px solid #888888; + margin:5px 0px 5px 0px; + padding:5px; +} +@media screen and (max-width:700px){ + body{ + padding-top:50px; + } + #canvas_wrapper{ + margin-right: 0; + } +} +@media screen and (max-width:550px){ + #canvas_wrapper{ + margin-left: 0px; + } +} + +/* ========== 6.1 Popup ===================================================== */ + +#popup{ + position:fixed; + border:1px solid #000000; + background-color: #bbb; + width:500px; + max-height:550px; + overflow-y:scroll; + margin:0px auto 0px auto; + top:150px; + left: 50%; + margin-left:-250px; + display:none; + padding:10px; + font-size:12px; + color: #333; + z-index: 100; +} +#popup h2{ + margin-top:0px; + cursor:move; +} +#popup td{ + height:20px; +} +#popup textarea{ + color:#000000; + width:100%; + border:1px solid #393939; + padding-left:5px; +} +#popup .button{ + margin-right:5px; + background-color:#5680c1; + min-width:60px; + border:1px solid #000000; + padding: 2px 6px; +} +#popup input[type="text"], #popup input[type="number"], #popup textarea{ + width:100%; +} +label span{ + color:#777777; +} +@media screen and (max-width:400px){ + #popup{ + top: 100px !important; + left: 0 !important; + right: 0 !important; + margin-left: 0; + width: auto; + } +} +/* ========================================================================== */ diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles/styles.css.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles/styles.css.xml new file mode 100644 index 0000000000000000000000000000000000000000..1312f6ba812a5f70d0e99245032cb92344d89bd0 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/styles/styles.css.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + styles.css + + + content_type + text/css + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor.xml new file mode 100644 index 0000000000000000000000000000000000000000..380974aea998ed7ae7f446431ca67b8c0801686f --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + vendor + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif.xml new file mode 100644 index 0000000000000000000000000000000000000000..96b8d2d8bbe2030a32871f61ae442997f5eb776c --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + exif + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.js.js new file mode 100644 index 0000000000000000000000000000000000000000..642d065ed83425f1286bd5606f8138741e6cffef --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.js.js @@ -0,0 +1,806 @@ +//https://github.com/exif-js/exif-js - v2.1.1 +(function() { + + var debug = false; + + var root = this; + + var EXIF = function(obj) { + if (obj instanceof EXIF) return obj; + if (!(this instanceof EXIF)) return new EXIF(obj); + this.EXIFwrapped = obj; + }; + + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = EXIF; + } + exports.EXIF = EXIF; + } else { + root.EXIF = EXIF; + } + + var ExifTags = EXIF.Tags = { + + // version tags + 0x9000 : "ExifVersion", // EXIF version + 0xA000 : "FlashpixVersion", // Flashpix format version + + // colorspace tags + 0xA001 : "ColorSpace", // Color space information tag + + // image configuration + 0xA002 : "PixelXDimension", // Valid width of meaningful image + 0xA003 : "PixelYDimension", // Valid height of meaningful image + 0x9101 : "ComponentsConfiguration", // Information about channels + 0x9102 : "CompressedBitsPerPixel", // Compressed bits per pixel + + // user information + 0x927C : "MakerNote", // Any desired information written by the manufacturer + 0x9286 : "UserComment", // Comments by user + + // related file + 0xA004 : "RelatedSoundFile", // Name of related sound file + + // date and time + 0x9003 : "DateTimeOriginal", // Date and time when the original image was generated + 0x9004 : "DateTimeDigitized", // Date and time when the image was stored digitally + 0x9290 : "SubsecTime", // Fractions of seconds for DateTime + 0x9291 : "SubsecTimeOriginal", // Fractions of seconds for DateTimeOriginal + 0x9292 : "SubsecTimeDigitized", // Fractions of seconds for DateTimeDigitized + + // picture-taking conditions + 0x829A : "ExposureTime", // Exposure time (in seconds) + 0x829D : "FNumber", // F number + 0x8822 : "ExposureProgram", // Exposure program + 0x8824 : "SpectralSensitivity", // Spectral sensitivity + 0x8827 : "ISOSpeedRatings", // ISO speed rating + 0x8828 : "OECF", // Optoelectric conversion factor + 0x9201 : "ShutterSpeedValue", // Shutter speed + 0x9202 : "ApertureValue", // Lens aperture + 0x9203 : "BrightnessValue", // Value of brightness + 0x9204 : "ExposureBias", // Exposure bias + 0x9205 : "MaxApertureValue", // Smallest F number of lens + 0x9206 : "SubjectDistance", // Distance to subject in meters + 0x9207 : "MeteringMode", // Metering mode + 0x9208 : "LightSource", // Kind of light source + 0x9209 : "Flash", // Flash status + 0x9214 : "SubjectArea", // Location and area of main subject + 0x920A : "FocalLength", // Focal length of the lens in mm + 0xA20B : "FlashEnergy", // Strobe energy in BCPS + 0xA20C : "SpatialFrequencyResponse", // + 0xA20E : "FocalPlaneXResolution", // Number of pixels in width direction per FocalPlaneResolutionUnit + 0xA20F : "FocalPlaneYResolution", // Number of pixels in height direction per FocalPlaneResolutionUnit + 0xA210 : "FocalPlaneResolutionUnit", // Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution + 0xA214 : "SubjectLocation", // Location of subject in image + 0xA215 : "ExposureIndex", // Exposure index selected on camera + 0xA217 : "SensingMethod", // Image sensor type + 0xA300 : "FileSource", // Image source (3 == DSC) + 0xA301 : "SceneType", // Scene type (1 == directly photographed) + 0xA302 : "CFAPattern", // Color filter array geometric pattern + 0xA401 : "CustomRendered", // Special processing + 0xA402 : "ExposureMode", // Exposure mode + 0xA403 : "WhiteBalance", // 1 = auto white balance, 2 = manual + 0xA404 : "DigitalZoomRation", // Digital zoom ratio + 0xA405 : "FocalLengthIn35mmFilm", // Equivalent foacl length assuming 35mm film camera (in mm) + 0xA406 : "SceneCaptureType", // Type of scene + 0xA407 : "GainControl", // Degree of overall image gain adjustment + 0xA408 : "Contrast", // Direction of contrast processing applied by camera + 0xA409 : "Saturation", // Direction of saturation processing applied by camera + 0xA40A : "Sharpness", // Direction of sharpness processing applied by camera + 0xA40B : "DeviceSettingDescription", // + 0xA40C : "SubjectDistanceRange", // Distance to subject + + // other tags + 0xA005 : "InteroperabilityIFDPointer", + 0xA420 : "ImageUniqueID" // Identifier assigned uniquely to each image + }; + + var TiffTags = EXIF.TiffTags = { + 0x0100 : "ImageWidth", + 0x0101 : "ImageHeight", + 0x8769 : "ExifIFDPointer", + 0x8825 : "GPSInfoIFDPointer", + 0xA005 : "InteroperabilityIFDPointer", + 0x0102 : "BitsPerSample", + 0x0103 : "Compression", + 0x0106 : "PhotometricInterpretation", + 0x0112 : "Orientation", + 0x0115 : "SamplesPerPixel", + 0x011C : "PlanarConfiguration", + 0x0212 : "YCbCrSubSampling", + 0x0213 : "YCbCrPositioning", + 0x011A : "XResolution", + 0x011B : "YResolution", + 0x0128 : "ResolutionUnit", + 0x0111 : "StripOffsets", + 0x0116 : "RowsPerStrip", + 0x0117 : "StripByteCounts", + 0x0201 : "JPEGInterchangeFormat", + 0x0202 : "JPEGInterchangeFormatLength", + 0x012D : "TransferFunction", + 0x013E : "WhitePoint", + 0x013F : "PrimaryChromaticities", + 0x0211 : "YCbCrCoefficients", + 0x0214 : "ReferenceBlackWhite", + 0x0132 : "DateTime", + 0x010E : "ImageDescription", + 0x010F : "Make", + 0x0110 : "Model", + 0x0131 : "Software", + 0x013B : "Artist", + 0x8298 : "Copyright" + }; + + var GPSTags = EXIF.GPSTags = { + 0x0000 : "GPSVersionID", + 0x0001 : "GPSLatitudeRef", + 0x0002 : "GPSLatitude", + 0x0003 : "GPSLongitudeRef", + 0x0004 : "GPSLongitude", + 0x0005 : "GPSAltitudeRef", + 0x0006 : "GPSAltitude", + 0x0007 : "GPSTimeStamp", + 0x0008 : "GPSSatellites", + 0x0009 : "GPSStatus", + 0x000A : "GPSMeasureMode", + 0x000B : "GPSDOP", + 0x000C : "GPSSpeedRef", + 0x000D : "GPSSpeed", + 0x000E : "GPSTrackRef", + 0x000F : "GPSTrack", + 0x0010 : "GPSImgDirectionRef", + 0x0011 : "GPSImgDirection", + 0x0012 : "GPSMapDatum", + 0x0013 : "GPSDestLatitudeRef", + 0x0014 : "GPSDestLatitude", + 0x0015 : "GPSDestLongitudeRef", + 0x0016 : "GPSDestLongitude", + 0x0017 : "GPSDestBearingRef", + 0x0018 : "GPSDestBearing", + 0x0019 : "GPSDestDistanceRef", + 0x001A : "GPSDestDistance", + 0x001B : "GPSProcessingMethod", + 0x001C : "GPSAreaInformation", + 0x001D : "GPSDateStamp", + 0x001E : "GPSDifferential" + }; + + var StringValues = EXIF.StringValues = { + ExposureProgram : { + 0 : "Not defined", + 1 : "Manual", + 2 : "Normal program", + 3 : "Aperture priority", + 4 : "Shutter priority", + 5 : "Creative program", + 6 : "Action program", + 7 : "Portrait mode", + 8 : "Landscape mode" + }, + MeteringMode : { + 0 : "Unknown", + 1 : "Average", + 2 : "CenterWeightedAverage", + 3 : "Spot", + 4 : "MultiSpot", + 5 : "Pattern", + 6 : "Partial", + 255 : "Other" + }, + LightSource : { + 0 : "Unknown", + 1 : "Daylight", + 2 : "Fluorescent", + 3 : "Tungsten (incandescent light)", + 4 : "Flash", + 9 : "Fine weather", + 10 : "Cloudy weather", + 11 : "Shade", + 12 : "Daylight fluorescent (D 5700 - 7100K)", + 13 : "Day white fluorescent (N 4600 - 5400K)", + 14 : "Cool white fluorescent (W 3900 - 4500K)", + 15 : "White fluorescent (WW 3200 - 3700K)", + 17 : "Standard light A", + 18 : "Standard light B", + 19 : "Standard light C", + 20 : "D55", + 21 : "D65", + 22 : "D75", + 23 : "D50", + 24 : "ISO studio tungsten", + 255 : "Other" + }, + Flash : { + 0x0000 : "Flash did not fire", + 0x0001 : "Flash fired", + 0x0005 : "Strobe return light not detected", + 0x0007 : "Strobe return light detected", + 0x0009 : "Flash fired, compulsory flash mode", + 0x000D : "Flash fired, compulsory flash mode, return light not detected", + 0x000F : "Flash fired, compulsory flash mode, return light detected", + 0x0010 : "Flash did not fire, compulsory flash mode", + 0x0018 : "Flash did not fire, auto mode", + 0x0019 : "Flash fired, auto mode", + 0x001D : "Flash fired, auto mode, return light not detected", + 0x001F : "Flash fired, auto mode, return light detected", + 0x0020 : "No flash function", + 0x0041 : "Flash fired, red-eye reduction mode", + 0x0045 : "Flash fired, red-eye reduction mode, return light not detected", + 0x0047 : "Flash fired, red-eye reduction mode, return light detected", + 0x0049 : "Flash fired, compulsory flash mode, red-eye reduction mode", + 0x004D : "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected", + 0x004F : "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected", + 0x0059 : "Flash fired, auto mode, red-eye reduction mode", + 0x005D : "Flash fired, auto mode, return light not detected, red-eye reduction mode", + 0x005F : "Flash fired, auto mode, return light detected, red-eye reduction mode" + }, + SensingMethod : { + 1 : "Not defined", + 2 : "One-chip color area sensor", + 3 : "Two-chip color area sensor", + 4 : "Three-chip color area sensor", + 5 : "Color sequential area sensor", + 7 : "Trilinear sensor", + 8 : "Color sequential linear sensor" + }, + SceneCaptureType : { + 0 : "Standard", + 1 : "Landscape", + 2 : "Portrait", + 3 : "Night scene" + }, + SceneType : { + 1 : "Directly photographed" + }, + CustomRendered : { + 0 : "Normal process", + 1 : "Custom process" + }, + WhiteBalance : { + 0 : "Auto white balance", + 1 : "Manual white balance" + }, + GainControl : { + 0 : "None", + 1 : "Low gain up", + 2 : "High gain up", + 3 : "Low gain down", + 4 : "High gain down" + }, + Contrast : { + 0 : "Normal", + 1 : "Soft", + 2 : "Hard" + }, + Saturation : { + 0 : "Normal", + 1 : "Low saturation", + 2 : "High saturation" + }, + Sharpness : { + 0 : "Normal", + 1 : "Soft", + 2 : "Hard" + }, + SubjectDistanceRange : { + 0 : "Unknown", + 1 : "Macro", + 2 : "Close view", + 3 : "Distant view" + }, + FileSource : { + 3 : "DSC" + }, + + Components : { + 0 : "", + 1 : "Y", + 2 : "Cb", + 3 : "Cr", + 4 : "R", + 5 : "G", + 6 : "B" + } + }; + + function addEvent(element, event, handler) { + if (element.addEventListener) { + element.addEventListener(event, handler, false); + } else if (element.attachEvent) { + element.attachEvent("on" + event, handler); + } + } + + function imageHasData(img) { + return !!(img.exifdata); + } + + + function base64ToArrayBuffer(base64, contentType) { + contentType = contentType || base64.match(/^data\:([^\;]+)\;base64,/mi)[1] || ''; // e.g. 'data:image/jpeg;base64,...' => 'image/jpeg' + base64 = base64.replace(/^data\:([^\;]+)\;base64,/gmi, ''); + var binary = atob(base64); + var len = binary.length; + var buffer = new ArrayBuffer(len); + var view = new Uint8Array(buffer); + for (var i = 0; i < len; i++) { + view[i] = binary.charCodeAt(i); + } + return buffer; + } + + function objectURLToBlob(url, callback) { + var http = new XMLHttpRequest(); + http.open("GET", url, true); + http.responseType = "blob"; + http.onload = function(e) { + if (this.status == 200 || this.status === 0) { + callback(this.response); + } + }; + http.send(); + } + + function getImageData(img, callback) { + function handleBinaryFile(binFile) { + var data = findEXIFinJPEG(binFile); + var iptcdata = findIPTCinJPEG(binFile); + img.exifdata = data || {}; + img.iptcdata = iptcdata || {}; + if (callback) { + callback.call(img); + } + } + + if (img.src) { + if (/^data\:/i.test(img.src)) { // Data URI + var arrayBuffer = base64ToArrayBuffer(img.src); + handleBinaryFile(arrayBuffer); + + } else if (/^blob\:/i.test(img.src)) { // Object URL + var fileReader = new FileReader(); + fileReader.onload = function(e) { + handleBinaryFile(e.target.result); + }; + objectURLToBlob(img.src, function (blob) { + fileReader.readAsArrayBuffer(blob); + }); + } else { + var http = new XMLHttpRequest(); + http.onload = function() { + if (this.status == 200 || this.status === 0) { + handleBinaryFile(http.response); + } else { + throw "Could not load image"; + } + http = null; + }; + http.open("GET", img.src, true); + http.responseType = "arraybuffer"; + http.send(null); + } + } else if (window.FileReader && (img instanceof window.Blob || img instanceof window.File)) { + var fileReader = new FileReader(); + fileReader.onload = function(e) { + if (debug) console.log("Got file of length " + e.target.result.byteLength); + handleBinaryFile(e.target.result); + }; + + fileReader.readAsArrayBuffer(img); + } + } + + function findEXIFinJPEG(file) { + var dataView = new DataView(file); + + if (debug) console.log("Got file of length " + file.byteLength); + if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) { + if (debug) console.log("Not a valid JPEG"); + return false; // not a valid jpeg + } + + var offset = 2, + length = file.byteLength, + marker; + + while (offset < length) { + if (dataView.getUint8(offset) != 0xFF) { + if (debug) console.log("Not a valid marker at offset " + offset + ", found: " + dataView.getUint8(offset)); + return false; // not a valid marker, something is wrong + } + + marker = dataView.getUint8(offset + 1); + if (debug) console.log(marker); + + // we could implement handling for other markers here, + // but we're only looking for 0xFFE1 for EXIF data + + if (marker == 225) { + if (debug) console.log("Found 0xFFE1 marker"); + + return readEXIFData(dataView, offset + 4, dataView.getUint16(offset + 2) - 2); + + // offset += 2 + file.getShortAt(offset+2, true); + + } else { + offset += 2 + dataView.getUint16(offset+2); + } + + } + + } + + function findIPTCinJPEG(file) { + var dataView = new DataView(file); + + if (debug) console.log("Got file of length " + file.byteLength); + if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) { + if (debug) console.log("Not a valid JPEG"); + return false; // not a valid jpeg + } + + var offset = 2, + length = file.byteLength; + + + var isFieldSegmentStart = function(dataView, offset){ + return ( + dataView.getUint8(offset) === 0x38 && + dataView.getUint8(offset+1) === 0x42 && + dataView.getUint8(offset+2) === 0x49 && + dataView.getUint8(offset+3) === 0x4D && + dataView.getUint8(offset+4) === 0x04 && + dataView.getUint8(offset+5) === 0x04 + ); + }; + + while (offset < length) { + + if ( isFieldSegmentStart(dataView, offset )){ + + // Get the length of the name header (which is padded to an even number of bytes) + var nameHeaderLength = dataView.getUint8(offset+7); + if(nameHeaderLength % 2 !== 0) nameHeaderLength += 1; + // Check for pre photoshop 6 format + if(nameHeaderLength === 0) { + // Always 4 + nameHeaderLength = 4; + } + + var startOffset = offset + 8 + nameHeaderLength; + var sectionLength = dataView.getUint16(offset + 6 + nameHeaderLength); + + return readIPTCData(file, startOffset, sectionLength); + + break; + + } + + + // Not the marker, continue searching + offset++; + + } + + } + var IptcFieldMap = { + 0x78 : 'caption', + 0x6E : 'credit', + 0x19 : 'keywords', + 0x37 : 'dateCreated', + 0x50 : 'byline', + 0x55 : 'bylineTitle', + 0x7A : 'captionWriter', + 0x69 : 'headline', + 0x74 : 'copyright', + 0x0F : 'category' + }; + function readIPTCData(file, startOffset, sectionLength){ + var dataView = new DataView(file); + var data = {}; + var fieldValue, fieldName, dataSize, segmentType, segmentSize; + var segmentStartPos = startOffset; + while(segmentStartPos < startOffset+sectionLength) { + if(dataView.getUint8(segmentStartPos) === 0x1C && dataView.getUint8(segmentStartPos+1) === 0x02){ + segmentType = dataView.getUint8(segmentStartPos+2); + if(segmentType in IptcFieldMap) { + dataSize = dataView.getInt16(segmentStartPos+3); + segmentSize = dataSize + 5; + fieldName = IptcFieldMap[segmentType]; + fieldValue = getStringFromDB(dataView, segmentStartPos+5, dataSize); + // Check if we already stored a value with this name + if(data.hasOwnProperty(fieldName)) { + // Value already stored with this name, create multivalue field + if(data[fieldName] instanceof Array) { + data[fieldName].push(fieldValue); + } + else { + data[fieldName] = [data[fieldName], fieldValue]; + } + } + else { + data[fieldName] = fieldValue; + } + } + + } + segmentStartPos++; + } + return data; + } + + + + function readTags(file, tiffStart, dirStart, strings, bigEnd) { + var entries = file.getUint16(dirStart, !bigEnd), + tags = {}, + entryOffset, tag, + i; + + for (i=0;i 4 ? valueOffset : (entryOffset + 8); + vals = []; + for (n=0;n 4 ? valueOffset : (entryOffset + 8); + return getStringFromDB(file, offset, numValues-1); + + case 3: // short, 16 bit int + if (numValues == 1) { + return file.getUint16(entryOffset + 8, !bigEnd); + } else { + offset = numValues > 2 ? valueOffset : (entryOffset + 8); + vals = []; + for (n=0;n + + + + + + + + + __name__ + exif.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.min.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.min.js.js new file mode 100644 index 0000000000000000000000000000000000000000..4da2141d42cae5270d9c2a2c747c4d64959f0329 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.min.js.js @@ -0,0 +1,2 @@ +//https://github.com/exif-js/exif-js - v2.1.1 +(function(){function e(e){return!!e.exifdata}function t(e,t){t=t||e.match(/^data\:([^\;]+)\;base64,/im)[1]||"",e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var n=atob(e),r=n.length,o=new ArrayBuffer(r),i=new Uint8Array(o),a=0;r>a;a++)i[a]=n.charCodeAt(a);return o}function r(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){(200==this.status||0===this.status)&&t(this.response)},n.send()}function o(e,n){function o(t){var r=i(t),o=a(t);e.exifdata=r||{},e.iptcdata=o||{},n&&n.call(e)}if(e.src)if(/^data\:/i.test(e.src)){var s=t(e.src);o(s)}else if(/^blob\:/i.test(e.src)){var l=new FileReader;l.onload=function(e){o(e.target.result)},r(e.src,function(e){l.readAsArrayBuffer(e)})}else{var u=new XMLHttpRequest;u.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";o(u.response),u=null},u.open("GET",e.src,!0),u.responseType="arraybuffer",u.send(null)}else if(window.FileReader&&(e instanceof window.Blob||e instanceof window.File)){var l=new FileReader;l.onload=function(e){f&&console.log("Got file of length "+e.target.result.byteLength),o(e.target.result)},l.readAsArrayBuffer(e)}}function i(e){var t=new DataView(e);if(f&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return f&&console.log("Not a valid JPEG"),!1;for(var n,r=2,o=e.byteLength;o>r;){if(255!=t.getUint8(r))return f&&console.log("Not a valid marker at offset "+r+", found: "+t.getUint8(r)),!1;if(n=t.getUint8(r+1),f&&console.log(n),225==n)return f&&console.log("Found 0xFFE1 marker"),c(t,r+4,t.getUint16(r+2)-2);r+=2+t.getUint16(r+2)}}function a(e){var t=new DataView(e);if(f&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return f&&console.log("Not a valid JPEG"),!1;for(var n=2,r=e.byteLength,o=function(e,t){return 56===e.getUint8(t)&&66===e.getUint8(t+1)&&73===e.getUint8(t+2)&&77===e.getUint8(t+3)&&4===e.getUint8(t+4)&&4===e.getUint8(t+5)};r>n;){if(o(t,n)){var i=t.getUint8(n+7);i%2!==0&&(i+=1),0===i&&(i=4);var a=n+8+i,l=t.getUint16(n+6+i);return s(e,a,l)}n++}}function s(e,t,n){for(var r,o,i,a,s,l=new DataView(e),u={},c=t;t+n>c;)28===l.getUint8(c)&&2===l.getUint8(c+1)&&(a=l.getUint8(c+2),a in F&&(i=l.getInt16(c+3),s=i+5,o=F[a],r=d(l,c+5,i),u.hasOwnProperty(o)?u[o]instanceof Array?u[o].push(r):u[o]=[u[o],r]:u[o]=r)),c++;return u}function l(e,t,n,r,o){var i,a,s,l=e.getUint16(n,!o),d={};for(s=0;l>s;s++)i=n+12*s+2,a=r[e.getUint16(i,!o)],!a&&f&&console.log("Unknown tag: "+e.getUint16(i,!o)),d[a]=u(e,i,t,n,o);return d}function u(e,t,n,r,o){var i,a,s,l,u,c,f=e.getUint16(t+2,!o),g=e.getUint32(t+4,!o),h=e.getUint32(t+8,!o)+n;switch(f){case 1:case 7:if(1==g)return e.getUint8(t+8,!o);for(i=g>4?h:t+8,a=[],l=0;g>l;l++)a[l]=e.getUint8(i+l);return a;case 2:return i=g>4?h:t+8,d(e,i,g-1);case 3:if(1==g)return e.getUint16(t+8,!o);for(i=g>2?h:t+8,a=[],l=0;g>l;l++)a[l]=e.getUint16(i+2*l,!o);return a;case 4:if(1==g)return e.getUint32(t+8,!o);for(a=[],l=0;g>l;l++)a[l]=e.getUint32(h+4*l,!o);return a;case 5:if(1==g)return u=e.getUint32(h,!o),c=e.getUint32(h+4,!o),s=new Number(u/c),s.numerator=u,s.denominator=c,s;for(a=[],l=0;g>l;l++)u=e.getUint32(h+8*l,!o),c=e.getUint32(h+4+8*l,!o),a[l]=new Number(u/c),a[l].numerator=u,a[l].denominator=c;return a;case 9:if(1==g)return e.getInt32(t+8,!o);for(a=[],l=0;g>l;l++)a[l]=e.getInt32(h+4*l,!o);return a;case 10:if(1==g)return e.getInt32(h,!o)/e.getInt32(h+4,!o);for(a=[],l=0;g>l;l++)a[l]=e.getInt32(h+8*l,!o)/e.getInt32(h+4+8*l,!o);return a}}function d(e,t,r){var o="";for(n=t;nu)return f&&console.log("Not valid TIFF data! (First offset less than 8)",e.getUint32(s+4,!n)),!1;if(r=l(e,s,s+u,p,n),r.ExifIFDPointer){i=l(e,s,s+r.ExifIFDPointer,m,n);for(o in i){switch(o){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":i[o]=P[o][i[o]];break;case"ExifVersion":case"FlashpixVersion":i[o]=String.fromCharCode(i[o][0],i[o][1],i[o][2],i[o][3]);break;case"ComponentsConfiguration":i[o]=P.Components[i[o][0]]+P.Components[i[o][1]]+P.Components[i[o][2]]+P.Components[i[o][3]]}r[o]=i[o]}}if(r.GPSInfoIFDPointer){a=l(e,s,s+r.GPSInfoIFDPointer,S,n);for(o in a){switch(o){case"GPSVersionID":a[o]=a[o][0]+"."+a[o][1]+"."+a[o][2]+"."+a[o][3]}r[o]=a[o]}}return r}var f=!1,g=this,h=function(e){return e instanceof h?e:this instanceof h?void(this.EXIFwrapped=e):new h(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports.EXIF=h):g.EXIF=h;var m=h.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},p=h.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},S=h.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},P=h.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}},F={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};h.getData=function(t,n){return(t instanceof Image||t instanceof HTMLImageElement)&&!t.complete?!1:(e(t)?n&&n.call(t):o(t,n),!0)},h.getTag=function(t,n){return e(t)?t.exifdata[n]:void 0},h.getAllTags=function(t){if(!e(t))return{};var n,r=t.exifdata,o={};for(n in r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o},h.pretty=function(t){if(!e(t))return"";var n,r=t.exifdata,o="";for(n in r)r.hasOwnProperty(n)&&(o+="object"==typeof r[n]?r[n]instanceof Number?n+" : "+r[n]+" ["+r[n].numerator+"/"+r[n].denominator+"]\r\n":n+" : ["+r[n].length+" values]\r\n":n+" : "+r[n]+"\r\n");return o},h.readFromBinaryFile=function(e){return i(e)},"function"==typeof define&&define.amd&&define("exif-js",[],function(){return h})}).call(this); \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.min.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.min.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b8d2c0b622de1d3fd9c612c2a8ae8394bd18b07 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/exif/exif.min.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + exif.min.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver.xml new file mode 100644 index 0000000000000000000000000000000000000000..685ddd2f07870ef59c0fa91bbb58f9d5a55b05ff --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + file-saver + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/FileSaver.min.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/FileSaver.min.js.js new file mode 100644 index 0000000000000000000000000000000000000000..e720d0316579221ece71fe50e65a811e9bd434af --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/FileSaver.min.js.js @@ -0,0 +1,2 @@ +// https://github.com/eligrey/FileSaver.js - 1.3.2 +var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/constructor/i.test(e.HTMLElement),f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},d="application/octet-stream",s=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,s)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(i){u(i)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,s){if(!s){t=p(t)}var v=this,w=t.type,m=w===d,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&a)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;i(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define([],function(){return saveAs})} \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/FileSaver.min.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/FileSaver.min.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..f0dacd6e7d83f31391267dee319decced210bac3 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/FileSaver.min.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + FileSaver.min.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/canvas-toBlob.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/canvas-toBlob.js.js new file mode 100644 index 0000000000000000000000000000000000000000..2266eb156ab579b59354a22608b069cc5bb1281b --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/canvas-toBlob.js.js @@ -0,0 +1,2 @@ +//https://github.com/eligrey/canvas-toBlob.js - 2016-05-26 +!function(t){"use strict";var o,e=t.Uint8Array,n=t.HTMLCanvasElement,i=n&&n.prototype,s=/\s*;\s*base64\s*(?:;|$)/i,a="toDataURL",l=function(t){for(var n,i,s,a=t.length,l=new e(a/4*3|0),r=0,b=0,d=[0,0],f=0,B=0;a--;)i=t.charCodeAt(r++),n=o[i-43],255!==n&&n!==s&&(d[1]=d[0],d[0]=i,B=B<<6|n,f++,4===f&&(l[b++]=B>>>16,61!==d[1]&&(l[b++]=B>>>8),61!==d[0]&&(l[b++]=B),f=0));return l};e&&(o=new e([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])),!n||i.toBlob&&i.toBlobHD||(i.toBlob||(i.toBlob=function(t,o){if(o||(o="image/png"),this.mozGetAsFile)return void t(this.mozGetAsFile("canvas",o));if(this.msToBlob&&/^\s*image\/png\s*(?:$|;)/i.test(o))return void t(this.msToBlob());var n,i=Array.prototype.slice.call(arguments,1),r=this[a].apply(this,i),b=r.indexOf(","),d=r.substring(b+1),f=s.test(r.substring(0,b));Blob.fake?(n=new Blob,f?n.encoding="base64":n.encoding="URI",n.data=d,n.size=d.length):e&&(n=f?new Blob([l(d)],{type:o}):new Blob([decodeURIComponent(d)],{type:o})),t(n)}),!i.toBlobHD&&i.toDataURLHD?i.toBlobHD=function(){a="toDataURLHD";var t=this.toBlob();return a="toDataURL",t}:i.toBlobHD=i.toBlob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this); \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/canvas-toBlob.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/canvas-toBlob.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..33985d3b3c2ace4074dd87b9e6531b3bfbbf835f --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/file-saver/canvas-toBlob.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + canvas-toBlob.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/glfx.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/glfx.xml new file mode 100644 index 0000000000000000000000000000000000000000..e791e59b7ec636a2ef18600189ad9553598cd657 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/glfx.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + glfx + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/glfx/glfx.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/glfx/glfx.js.js new file mode 100644 index 0000000000000000000000000000000000000000..8be2a0b8493e8a51ef32b091a98cf14bf567b397 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/glfx/glfx.js.js @@ -0,0 +1,59 @@ +/* + * glfx.js + * http://evanw.github.com/glfx.js/ + * + * Copyright 2011 Evan Wallace + * Released under the MIT license + */ +var fx=function(){function q(a,d,c){return Math.max(a,Math.min(d,c))}function w(b){return{_:b,loadContentsOf:function(b){a=this._.gl;this._.loadContentsOf(b)},destroy:function(){a=this._.gl;this._.destroy()}}}function A(a){return w(r.fromElement(a))}function B(b,d){var c=a.UNSIGNED_BYTE;if(a.getExtension("OES_texture_float")&&a.getExtension("OES_texture_float_linear")){var e=new r(100,100,a.RGBA,a.FLOAT);try{e.drawTo(function(){c=a.FLOAT})}catch(g){}e.destroy()}this._.texture&&this._.texture.destroy(); +this._.spareTexture&&this._.spareTexture.destroy();this.width=b;this.height=d;this._.texture=new r(b,d,a.RGBA,c);this._.spareTexture=new r(b,d,a.RGBA,c);this._.extraTexture=this._.extraTexture||new r(0,0,a.RGBA,c);this._.flippedShader=this._.flippedShader||new h(null,"uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,vec2(texCoord.x,1.0-texCoord.y));}");this._.isInitialized=!0}function C(a,d,c){this._.isInitialized&& +a._.width==this.width&&a._.height==this.height||B.call(this,d?d:a._.width,c?c:a._.height);a._.use();this._.texture.drawTo(function(){h.getDefaultShader().drawRect()});return this}function D(){this._.texture.use();this._.flippedShader.drawRect();return this}function f(a,d,c,e){(c||this._.texture).use();this._.spareTexture.drawTo(function(){a.uniforms(d).drawRect()});this._.spareTexture.swapWith(e||this._.texture)}function E(a){a.parentNode.insertBefore(this,a);a.parentNode.removeChild(a);return this} +function F(){var b=new r(this._.texture.width,this._.texture.height,a.RGBA,a.UNSIGNED_BYTE);this._.texture.use();b.drawTo(function(){h.getDefaultShader().drawRect()});return w(b)}function G(){var b=this._.texture.width,d=this._.texture.height,c=new Uint8Array(4*b*d);this._.texture.drawTo(function(){a.readPixels(0,0,b,d,a.RGBA,a.UNSIGNED_BYTE,c)});return c}function k(b){return function(){a=this._.gl;return b.apply(this,arguments)}}function x(a,d,c,e,g,l,n,p){var m=c-g,h=e-l,f=n-g,k=p-l;g=a-c+g-n;l= +d-e+l-p;var q=m*k-f*h,f=(g*k-f*l)/q,m=(m*l-g*h)/q;return[c-a+f*c,e-d+f*e,f,n-a+m*n,p-d+m*p,m,a,d,1]}function y(a){var d=a[0],c=a[1],e=a[2],g=a[3],l=a[4],n=a[5],p=a[6],m=a[7];a=a[8];var f=d*l*a-d*n*m-c*g*a+c*n*p+e*g*m-e*l*p;return[(l*a-n*m)/f,(e*m-c*a)/f,(c*n-e*l)/f,(n*p-g*a)/f,(d*a-e*p)/f,(e*g-d*n)/f,(g*m-l*p)/f,(c*p-d*m)/f,(d*l-c*g)/f]}function z(a){var d=a.length;this.xa=[];this.ya=[];this.u=[];this.y2=[];a.sort(function(a,b){return a[0]-b[0]});for(var c=0;c0.0){color.rgb=(color.rgb-0.5)/(1.0-contrast)+0.5;}else{color.rgb=(color.rgb-0.5)*(1.0+contrast)+0.5;}gl_FragColor=color;}"); +f.call(this,a.brightnessContrast,{brightness:q(-1,b,1),contrast:q(-1,d,1)});return this}function t(a){a=new z(a);for(var d=[],c=0;256>c;c++)d.push(q(0,Math.floor(256*a.interpolate(c/255)),255));return d}function I(b,d,c){b=t(b);1==arguments.length?d=c=b:(d=t(d),c=t(c));for(var e=[],g=0;256>g;g++)e.splice(e.length,0,b[g],d[g],c[g],255);this._.extraTexture.initFromBytes(256,1,e);this._.extraTexture.use(1);a.curves=a.curves||new h(null,"uniform sampler2D texture;uniform sampler2D map;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.r=texture2D(map,vec2(color.r)).r;color.g=texture2D(map,vec2(color.g)).g;color.b=texture2D(map,vec2(color.b)).b;gl_FragColor=color;}"); +a.curves.textures({map:1});f.call(this,a.curves,{});return this}function J(b){a.denoise=a.denoise||new h(null,"uniform sampler2D texture;uniform float exponent;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;void main(){vec4 center=texture2D(texture,texCoord);vec4 color=vec4(0.0);float total=0.0;for(float x=-4.0;x<=4.0;x+=1.0){for(float y=-4.0;y<=4.0;y+=1.0){vec4 sample=texture2D(texture,texCoord+vec2(x,y)/texSize);float weight=1.0-abs(dot(sample.rgb-center.rgb,vec3(0.25)));weight=pow(weight,exponent);color+=sample*weight;total+=weight;}}gl_FragColor=color/total;}"); +for(var d=0;2>d;d++)f.call(this,a.denoise,{exponent:Math.max(0,b),texSize:[this.width,this.height]});return this}function K(b,d){a.hueSaturation=a.hueSaturation||new h(null,"uniform sampler2D texture;uniform float hue;uniform float saturation;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float angle=hue*3.14159265;float s=sin(angle),c=cos(angle);vec3 weights=(vec3(2.0*c,-sqrt(3.0)*s-c,sqrt(3.0)*s-c)+1.0)/3.0;float len=length(color.rgb);color.rgb=vec3(dot(color.rgb,weights.xyz),dot(color.rgb,weights.zxy),dot(color.rgb,weights.yzx));float average=(color.r+color.g+color.b)/3.0;if(saturation>0.0){color.rgb+=(average-color.rgb)*(1.0-1.0/(1.001-saturation));}else{color.rgb+=(average-color.rgb)*(-saturation);}gl_FragColor=color;}"); +f.call(this,a.hueSaturation,{hue:q(-1,b,1),saturation:q(-1,d,1)});return this}function L(b){a.noise=a.noise||new h(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;float rand(vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}void main(){vec4 color=texture2D(texture,texCoord);float diff=(rand(texCoord)-0.5)*amount;color.r+=diff;color.g+=diff;color.b+=diff;gl_FragColor=color;}"); +f.call(this,a.noise,{amount:q(0,b,1)});return this}function M(b){a.sepia=a.sepia||new h(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float r=color.r;float g=color.g;float b=color.b;color.r=min(1.0,(r*(1.0-(0.607*amount)))+(g*(0.769*amount))+(b*(0.189*amount)));color.g=min(1.0,(r*0.349*amount)+(g*(1.0-(0.314*amount)))+(b*0.168*amount));color.b=min(1.0,(r*0.272*amount)+(g*0.534*amount)+(b*(1.0-(0.869*amount))));gl_FragColor=color;}"); +f.call(this,a.sepia,{amount:q(0,b,1)});return this}function N(b,d){a.unsharpMask=a.unsharpMask||new h(null,"uniform sampler2D blurredTexture;uniform sampler2D originalTexture;uniform float strength;uniform float threshold;varying vec2 texCoord;void main(){vec4 blurred=texture2D(blurredTexture,texCoord);vec4 original=texture2D(originalTexture,texCoord);gl_FragColor=mix(blurred,original,1.0+strength);}"); +this._.extraTexture.ensureFormat(this._.texture);this._.texture.use();this._.extraTexture.drawTo(function(){h.getDefaultShader().drawRect()});this._.extraTexture.use(1);this.triangleBlur(b);a.unsharpMask.textures({originalTexture:1});f.call(this,a.unsharpMask,{strength:d});this._.extraTexture.unuse(1);return this}function O(b){a.vibrance=a.vibrance||new h(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;float mx=max(color.r,max(color.g,color.b));float amt=(mx-average)*(-amount*3.0);color.rgb=mix(color.rgb,vec3(mx),amt);gl_FragColor=color;}"); +f.call(this,a.vibrance,{amount:q(-1,b,1)});return this}function P(b,d){a.vignette=a.vignette||new h(null,"uniform sampler2D texture;uniform float size;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float dist=distance(texCoord,vec2(0.5,0.5));color.rgb*=smoothstep(0.8,size*0.799,dist*(amount+size));gl_FragColor=color;}"); +f.call(this,a.vignette,{size:q(0,b,1),amount:q(0,d,1)});return this}function Q(b,d,c){a.lensBlurPrePass=a.lensBlurPrePass||new h(null,"uniform sampler2D texture;uniform float power;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color=pow(color,vec4(power));gl_FragColor=vec4(color);}");var e="uniform sampler2D texture0;uniform sampler2D texture1;uniform vec2 delta0;uniform vec2 delta1;uniform float power;varying vec2 texCoord;"+ +s+"vec4 sample(vec2 delta){float offset=random(vec3(delta,151.7182),0.0);vec4 color=vec4(0.0);float total=0.0;for(float t=0.0;t<=30.0;t++){float percent=(t+offset)/30.0;color+=texture2D(texture0,texCoord+delta*percent);total+=1.0;}return color/total;}"; +a.lensBlur0=a.lensBlur0||new h(null,e+"void main(){gl_FragColor=sample(delta0);}");a.lensBlur1=a.lensBlur1||new h(null,e+"void main(){gl_FragColor=(sample(delta0)+sample(delta1))*0.5;}");a.lensBlur2=a.lensBlur2||(new h(null,e+"void main(){vec4 color=(sample(delta0)+2.0*texture2D(texture1,texCoord))/3.0;gl_FragColor=pow(color,vec4(power));}")).textures({texture1:1});for(var e= +[],g=0;3>g;g++){var l=c+2*g*Math.PI/3;e.push([b*Math.sin(l)/this.width,b*Math.cos(l)/this.height])}b=Math.pow(10,q(-1,d,1));f.call(this,a.lensBlurPrePass,{power:b});this._.extraTexture.ensureFormat(this._.texture);f.call(this,a.lensBlur0,{delta0:e[0]},this._.texture,this._.extraTexture);f.call(this,a.lensBlur1,{delta0:e[1],delta1:e[2]},this._.extraTexture,this._.extraTexture);f.call(this,a.lensBlur0,{delta0:e[1]});this._.extraTexture.use(1);f.call(this,a.lensBlur2,{power:1/b,delta0:e[2]});return this} +function R(b,d,c,e,g,l){a.tiltShift=a.tiltShift||new h(null,"uniform sampler2D texture;uniform float blurRadius;uniform float gradientRadius;uniform vec2 start;uniform vec2 end;uniform vec2 delta;uniform vec2 texSize;varying vec2 texCoord;"+s+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);vec2 normal=normalize(vec2(start.y-end.y,end.x-start.x));float radius=smoothstep(0.0,1.0,abs(dot(texCoord*texSize-start,normal))/gradientRadius)*blurRadius;for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta/texSize*percent*radius);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"); +var n=c-b,p=e-d,m=Math.sqrt(n*n+p*p);f.call(this,a.tiltShift,{blurRadius:g,gradientRadius:l,start:[b,d],end:[c,e],delta:[n/m,p/m],texSize:[this.width,this.height]});f.call(this,a.tiltShift,{blurRadius:g,gradientRadius:l,start:[b,d],end:[c,e],delta:[-p/m,n/m],texSize:[this.width,this.height]});return this}function S(b){a.triangleBlur=a.triangleBlur||new h(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+s+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta*percent);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"); +f.call(this,a.triangleBlur,{delta:[b/this.width,0]});f.call(this,a.triangleBlur,{delta:[0,b/this.height]});return this}function T(b,d,c){a.zoomBlur=a.zoomBlur||new h(null,"uniform sampler2D texture;uniform vec2 center;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;"+s+"void main(){vec4 color=vec4(0.0);float total=0.0;vec2 toCenter=center-texCoord*texSize;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=0.0;t<=40.0;t++){float percent=(t+offset)/40.0;float weight=4.0*(percent-percent*percent);vec4 sample=texture2D(texture,texCoord+toCenter*percent*strength/texSize);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"); +f.call(this,a.zoomBlur,{center:[b,d],strength:c,texSize:[this.width,this.height]});return this}function U(b,d,c,e){a.colorHalftone=a.colorHalftone||new h(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(float angle){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);vec3 cmy=1.0-color.rgb;float k=min(cmy.x,min(cmy.y,cmy.z));cmy=(cmy-k)/(1.0-k);cmy=clamp(cmy*10.0-3.0+vec3(pattern(angle+0.26179),pattern(angle+1.30899),pattern(angle)),0.0,1.0);k=clamp(k*10.0-5.0+pattern(angle+0.78539),0.0,1.0);gl_FragColor=vec4(1.0-cmy-k,color.a);}"); +f.call(this,a.colorHalftone,{center:[b,d],angle:c,scale:Math.PI/e,texSize:[this.width,this.height]});return this}function V(b,d,c,e){a.dotScreen=a.dotScreen||new h(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;gl_FragColor=vec4(vec3(average*10.0-5.0+pattern()),color.a);}"); +f.call(this,a.dotScreen,{center:[b,d],angle:c,scale:Math.PI/e,texSize:[this.width,this.height]});return this}function W(b){a.edgeWork1=a.edgeWork1||new h(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+s+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec3 sample=texture2D(texture,texCoord+delta*percent).rgb;float average=(sample.r+sample.g+sample.b)/3.0;color.x+=average*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=average*weight;total.y+=weight;}}gl_FragColor=vec4(color/total,0.0,1.0);}"); +a.edgeWork2=a.edgeWork2||new h(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+s+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec2 sample=texture2D(texture,texCoord+delta*percent).xy;color.x+=sample.x*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=sample.y*weight;total.y+=weight;}}float c=clamp(10000.0*(color.y/total.y-color.x/total.x)+0.5,0.0,1.0);gl_FragColor=vec4(c,c,c,1.0);}"); +f.call(this,a.edgeWork1,{delta:[b/this.width,0]});f.call(this,a.edgeWork2,{delta:[0,b/this.height]});return this}function X(b,d,c){a.hexagonalPixelate=a.hexagonalPixelate||new h(null,"uniform sampler2D texture;uniform vec2 center;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 tex=(texCoord*texSize-center)/scale;tex.y/=0.866025404;tex.x-=tex.y*0.5;vec2 a;if(tex.x+tex.y-floor(tex.x)-floor(tex.y)<1.0)a=vec2(floor(tex.x),floor(tex.y));else a=vec2(ceil(tex.x),ceil(tex.y));vec2 b=vec2(ceil(tex.x),floor(tex.y));vec2 c=vec2(floor(tex.x),ceil(tex.y));vec3 TEX=vec3(tex.x,tex.y,1.0-tex.x-tex.y);vec3 A=vec3(a.x,a.y,1.0-a.x-a.y);vec3 B=vec3(b.x,b.y,1.0-b.x-b.y);vec3 C=vec3(c.x,c.y,1.0-c.x-c.y);float alen=length(TEX-A);float blen=length(TEX-B);float clen=length(TEX-C);vec2 choice;if(alen0.0){coord*=mix(1.0,smoothstep(0.0,radius/distance,percent),strength*0.75);}else{coord*=mix(1.0,pow(percent,1.0+strength*0.75)*radius/distance,1.0-percent);}}coord+=center;"); +f.call(this,a.bulgePinch,{radius:c,strength:q(-1,e,1),center:[b,d],texSize:[this.width,this.height]});return this}function $(b,d,c){a.matrixWarp=a.matrixWarp||u("uniform mat3 matrix;uniform bool useTextureSpace;","if(useTextureSpace)coord=coord/texSize*2.0-1.0;vec3 warp=matrix*vec3(coord,1.0);coord=warp.xy/warp.z;if(useTextureSpace)coord=(coord*0.5+0.5)*texSize;");b=Array.prototype.concat.apply([],b);if(4==b.length)b= +[b[0],b[1],0,b[2],b[3],0,0,0,1];else if(9!=b.length)throw"can only warp with 2x2 or 3x3 matrix";f.call(this,a.matrixWarp,{matrix:d?y(b):b,texSize:[this.width,this.height],useTextureSpace:c|0});return this}function aa(a,d){var c=x.apply(null,d),e=x.apply(null,a),c=y(c);return this.matrixWarp([c[0]*e[0]+c[1]*e[3]+c[2]*e[6],c[0]*e[1]+c[1]*e[4]+c[2]*e[7],c[0]*e[2]+c[1]*e[5]+c[2]*e[8],c[3]*e[0]+c[4]*e[3]+c[5]*e[6],c[3]*e[1]+c[4]*e[4]+c[5]*e[7],c[3]*e[2]+c[4]*e[5]+c[5]*e[8],c[6]*e[0]+c[7]*e[3]+c[8]*e[6], +c[6]*e[1]+c[7]*e[4]+c[8]*e[7],c[6]*e[2]+c[7]*e[5]+c[8]*e[8]])}function ba(b,d,c,e){a.swirl=a.swirl||u("uniform float radius;uniform float angle;uniform vec2 center;","coord-=center;float distance=length(coord);if(distance>1;this.xa[e]>a?c=e:d=e}var e=this.xa[c]- +this.xa[d],g=(this.xa[c]-a)/e;a=(a-this.xa[d])/e;return g*this.ya[d]+a*this.ya[c]+((g*g*g-g)*this.y2[d]+(a*a*a-a)*this.y2[c])*e*e/6};var r=function(){function b(b,c,d,f){this.gl=a;this.id=a.createTexture();this.width=b;this.height=c;this.format=d;this.type=f;a.bindTexture(a.TEXTURE_2D,this.id);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D, +a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);b&&c&&a.texImage2D(a.TEXTURE_2D,0,this.format,b,c,0,this.format,this.type,null)}function d(a){null==c&&(c=document.createElement("canvas"));c.width=a.width;c.height=a.height;a=c.getContext("2d");a.clearRect(0,0,c.width,c.height);return a}b.fromElement=function(c){var d=new b(0,0,a.RGBA,a.UNSIGNED_BYTE);d.loadContentsOf(c);return d};b.prototype.loadContentsOf=function(b){this.width=b.width||b.videoWidth;this.height=b.height||b.videoHeight;a.bindTexture(a.TEXTURE_2D, +this.id);a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,b)};b.prototype.initFromBytes=function(b,c,d){this.width=b;this.height=c;this.format=a.RGBA;this.type=a.UNSIGNED_BYTE;a.bindTexture(a.TEXTURE_2D,this.id);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,b,c,0,a.RGBA,this.type,new Uint8Array(d))};b.prototype.destroy=function(){a.deleteTexture(this.id);this.id=null};b.prototype.use=function(b){a.activeTexture(a.TEXTURE0+(b||0));a.bindTexture(a.TEXTURE_2D,this.id)};b.prototype.unuse=function(b){a.activeTexture(a.TEXTURE0+ +(b||0));a.bindTexture(a.TEXTURE_2D,null)};b.prototype.ensureFormat=function(b,c,d,f){if(1==arguments.length){var h=arguments[0];b=h.width;c=h.height;d=h.format;f=h.type}if(b!=this.width||c!=this.height||d!=this.format||f!=this.type)this.width=b,this.height=c,this.format=d,this.type=f,a.bindTexture(a.TEXTURE_2D,this.id),a.texImage2D(a.TEXTURE_2D,0,this.format,b,c,0,this.format,this.type,null)};b.prototype.drawTo=function(b){a.framebuffer=a.framebuffer||a.createFramebuffer();a.bindFramebuffer(a.FRAMEBUFFER, +a.framebuffer);a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,this.id,0);if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw Error("incomplete framebuffer");a.viewport(0,0,this.width,this.height);b();a.bindFramebuffer(a.FRAMEBUFFER,null)};var c=null;b.prototype.fillUsingCanvas=function(b){b(d(this));this.format=a.RGBA;this.type=a.UNSIGNED_BYTE;a.bindTexture(a.TEXTURE_2D,this.id);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,c);return this}; +b.prototype.toImage=function(b){this.use();h.getDefaultShader().drawRect();var f=4*this.width*this.height,k=new Uint8Array(f),n=d(this),p=n.createImageData(this.width,this.height);a.readPixels(0,0,this.width,this.height,a.RGBA,a.UNSIGNED_BYTE,k);for(var m=0;m + + + + + + + + + __name__ + glfx.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony.xml new file mode 100644 index 0000000000000000000000000000000000000000..3370d1f71aba7526dfbb1af05b84f3741cbba3f0 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + harmony + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.js.js new file mode 100644 index 0000000000000000000000000000000000000000..21b2a5bbac6dee71d5fc0160c63b35e1a4af8417 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.js.js @@ -0,0 +1,130 @@ +//http://ricardocabello.com/blog/post/689 +var sketchy_brush = { + context: null, + prevMouseX: null, + prevMouseY: null, + points: null, + count: null, + init: function (a) { + this.context = a; + this.context.globalCompositeOperation = "source-over"; + this.points = new Array(); + this.count = 0 + }, + destroy: function () { + }, + strokeStart: function (b, a) { + this.prevMouseX = b; + this.prevMouseY = a + }, + stroke: function (color_rgb, f, c, size) { + var e, b, a, g; + this.points.push([f, c]); + this.context.strokeStyle = "rgba(" + color_rgb.r + ', ' + color_rgb.g + ', ' + color_rgb.b + ", 0.1)"; + this.context.beginPath(); + this.context.moveTo(this.prevMouseX, this.prevMouseY); + this.context.lineTo(f, c); + this.context.stroke(); + this.context.strokeStyle = "rgba(" + color_rgb.r + ', ' + color_rgb.g + ', ' + color_rgb.b + ", 0.1 )"; + for (e = 0; e < this.points.length; e++) { + b = this.points[e][0] - this.points[this.count][0]; + a = this.points[e][1] - this.points[this.count][1]; + g = b * b + a * a; + if (g < 800 * size && Math.random() > g / (400 * size)) { + this.context.beginPath(); + this.context.moveTo(this.points[this.count][0] + (b * 0.3), this.points[this.count][1] + (a * 0.3)); + this.context.lineTo(this.points[e][0] - (b * 0.3), this.points[e][1] - (a * 0.3)); + this.context.stroke(); + } + } + this.prevMouseX = f; + this.prevMouseY = c; + this.count++ + }, + strokeEnd: function (b, a) { + } +}; +var shaded_brush = { + context: null, + prevMouseX: null, + prevMouseY: null, + points: null, + count: null, + init: function (a) { + this.context = a; + this.context.globalCompositeOperation = "source-over"; + this.points = new Array(); + this.count = 0 + }, + destroy: function () { + }, + strokeStart: function (b, a) { + this.prevMouseX = b; + this.prevMouseY = a + }, + stroke: function (color_rgb, f, c, size) { + var e, b, a, g; + this.points.push([f, c]); + for (e = 0; e < this.points.length; e++) { + b = this.points[e][0] - this.points[this.count][0]; + a = this.points[e][1] - this.points[this.count][1]; + g = b * b + a * a; + if (g < 200 * size) { + this.context.strokeStyle = "rgba(" + color_rgb.r + ', ' + color_rgb.g + ', ' + color_rgb.b + ", " + ((1 - (g / (200 * size))) * 0.1) + " )"; + this.context.beginPath(); + this.context.moveTo(this.points[this.count][0], this.points[this.count][1]); + this.context.lineTo(this.points[e][0], this.points[e][1]); + this.context.stroke() + } + } + this.prevMouseX = f; + this.prevMouseY = c; + this.count++ + }, + strokeEnd: function (b, a) { + } +}; +var chrome_brush = { + context: null, + prevMouseX: null, + prevMouseY: null, + points: null, + count: null, + init: function (a) { + this.context = a; + this.points = new Array(); + this.count = 0 + }, + destroy: function () { + }, + strokeStart: function (b, a) { + this.prevMouseX = b; + this.prevMouseY = a + }, + stroke: function (color_rgb, f, c, size) { + var e, b, a, g; + this.points.push([f, c]); + this.context.strokeStyle = "rgba(" + color_rgb.r + ', ' + color_rgb.g + ', ' + color_rgb.b + ", 0.1)"; + this.context.beginPath(); + this.context.moveTo(this.prevMouseX, this.prevMouseY); + this.context.lineTo(f, c); + this.context.stroke(); + for (e = 0; e < this.points.length; e++) { + b = this.points[e][0] - this.points[this.count][0]; + a = this.points[e][1] - this.points[this.count][1]; + g = b * b + a * a; + if (g < 200 * size) { + this.context.strokeStyle = "rgba(" + Math.floor(Math.random() * 255) + ", " + Math.floor(Math.random() * 255) + ", " + Math.floor(Math.random() * 255) + ", 0.1 )"; + this.context.beginPath(); + this.context.moveTo(this.points[this.count][0] + (b * 0.2), this.points[this.count][1] + (a * 0.2)); + this.context.lineTo(this.points[e][0] - (b * 0.2), this.points[e][1] - (a * 0.2)); + this.context.stroke() + } + } + this.prevMouseX = f; + this.prevMouseY = c; + this.count++ + }, + strokeEnd: function (b, a) { + } +}; diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..74916fc929ef601b07e5cc4d86640581cdc85f25 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + harmony.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.min.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.min.js.js new file mode 100644 index 0000000000000000000000000000000000000000..56981ac3095c8b2e44e95808eeecc85b7c02b3ef --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/harmony/harmony.min.js.js @@ -0,0 +1,2 @@ +//http://ricardocabello.com/blog/post/689 +var sketchy_brush={context:null,prevMouseX:null,prevMouseY:null,points:null,count:null,init:function(a){this.context=a,this.context.globalCompositeOperation="source-over",this.points=new Array,this.count=0},destroy:function(){},strokeStart:function(a,b){this.prevMouseX=a,this.prevMouseY=b},stroke:function(a,b,c,d){var e,f,g,h;for(this.points.push([b,c]),this.context.strokeStyle="rgba("+a.r+", "+a.g+", "+a.b+", 0.1)",this.context.beginPath(),this.context.moveTo(this.prevMouseX,this.prevMouseY),this.context.lineTo(b,c),this.context.stroke(),this.context.strokeStyle="rgba("+a.r+", "+a.g+", "+a.b+", 0.1 )",e=0;eh/(400*d)&&(this.context.beginPath(),this.context.moveTo(this.points[this.count][0]+.3*f,this.points[this.count][1]+.3*g),this.context.lineTo(this.points[e][0]-.3*f,this.points[e][1]-.3*g),this.context.stroke());this.prevMouseX=b,this.prevMouseY=c,this.count++},strokeEnd:function(a,b){}},shaded_brush={context:null,prevMouseX:null,prevMouseY:null,points:null,count:null,init:function(a){this.context=a,this.context.globalCompositeOperation="source-over",this.points=new Array,this.count=0},destroy:function(){},strokeStart:function(a,b){this.prevMouseX=a,this.prevMouseY=b},stroke:function(a,b,c,d){var e,f,g,h;for(this.points.push([b,c]),e=0;e + + + + + + + + + __name__ + harmony.min.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize.xml new file mode 100644 index 0000000000000000000000000000000000000000..bbfcbb25c0ae73b1a542f84c51e2120f061199e7 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + hermite-resize + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize/hermite.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize/hermite.js.js new file mode 100644 index 0000000000000000000000000000000000000000..5b9d1befdf9749ec169b33f799acf636ccc577ef --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize/hermite.js.js @@ -0,0 +1,5 @@ +//Hermite resize - fast image resize/resample using Hermite filter. +//Author: ViliusL +//https://github.com/viliusle/Hermite-resize +//http://viliusle.github.io/miniPaint/ +function Hermite_class(){var a,c,b=[];this.init=function(){a=navigator.hardwareConcurrency||4}(),this.getCores=function(){return a},this.resample_auto=function(a,b,c,d,e){var f=this.getCores();window.Worker&&f>1?this.resample(a,b,c,d,e):(this.resample_single(a,b,c,!0),e())},this.resize_image=function(a,b,c,d,e){var f=document.getElementById(a),g=document.createElement("canvas");g.width=f.width,g.height=f.height;var h=g.getContext("2d");if(h.drawImage(f,0,0),void 0==b&&void 0==c&&void 0!=d&&(b=f.width/100*d,c=f.height/100*d),void 0==c){var i=f.width/b;c=f.height/i}b=Math.round(b),c=Math.round(c);var j=function(){var a=g.toDataURL();f.width=b,f.height=c,f.src=a,delete a,delete g};void 0==e||1==e?this.resample(g,b,c,!0,j):(this.resample_single(g,b,c,!0),j())},this.resample=function(d,e,f,g,h){var i=d.width,j=d.height;e=Math.round(e),f=Math.round(f);var k=Math.ceil(j/f/2);if(b.length>0)for(var l=0;lj&&(q=j-p),q<1||(n[l]=m.getImageData(0,p,i,q),p=Math.ceil(f/a)*l,q=Math.ceil(f/a),p+q>f&&(q=f-p),q<1||(o[l]=!0))}g===!0?(d.width=e,d.height=f):m.clearRect(0,0,i,j);for(var r=0,l=0;l=m||H<0))for(var I=Math.abs(C-(H+.5))/k,J=(t+.5)*h,K=I*I,L=F;L=1)){v=2*N*N*N-3*N*N+1;var O=4*(L+H*d);B+=v*l[O+3],x+=v,l[O+3]<255&&(v=v*l[O+3]/250),y+=v*l[O],z+=v*l[O+1],A+=v*l[O+2],w+=v}}p[u]=y/w,p[u+1]=z/w,p[u+2]=A/w,p[u+3]=B/x}var P={core:b,target:p};postMessage(P,[p.buffer])}}.toString(),")()"],{type:"application/javascript"})),this.resample_single=function(a,b,c,d){var e=a.width,f=a.height;b=Math.round(b),c=Math.round(c);for(var g=e/b,h=f/c,i=Math.ceil(g/2),j=Math.ceil(h/2),k=a.getContext("2d"),l=k.getImageData(0,0,e,f),m=k.createImageData(b,c),n=l.data,o=m.data,p=0;p=1)){s=2*K*K*K-3*K*K+1;var L=4*(I+C*e);y+=s*n[L+3],u+=s,n[L+3]<255&&(s=s*n[L+3]/250),v+=s*n[L],w+=s*n[L+1],x+=s*n[L+2],t+=s}}o[r]=v/t,o[r+1]=w/t,o[r+2]=x/t,o[r+3]=y/u}d===!0?(a.width=b,a.height=c):k.clearRect(0,0,e,f),k.putImageData(m,0,0)}} \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize/hermite.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize/hermite.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..90df55faff91ecc5ef19cae0f252795a69ffe630 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hermite-resize/hermite.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + hermite.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ce1ba35157133b89714f01a269fabd829592f01 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + hqx + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.js.js new file mode 100644 index 0000000000000000000000000000000000000000..dfe99277fee4c430d36a84b0d31f5fb4f57933d3 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.js.js @@ -0,0 +1,11876 @@ +// ==ClosureCompiler== +// @compilation_level SIMPLE_OPTIMIZATIONS +// ==/ClosureCompiler== + +/* + * Copyright (C) 2003 Maxim Stepin ( maxst@hiend3d.com ) + * + * Copyright (C) 2010 Cameron Zemek ( grom@zeminvaders.net ) + * + * Copyright (C) 2010 Dominic Szablewski ( mail@phoboslab.org ) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +(function(window){ + +"use strict"; // strict will be optimized on engines (https://developer.mozilla.org/en/JavaScript/Strict_mode) + +var + _src = null, + _dest = null, + + _MASK_2 = 0x00FF00, + _MASK_13 = 0xFF00FF, + + _Ymask = 0x00FF0000, + _Umask = 0x0000FF00, + _Vmask = 0x000000FF, + + _trY = 0x00300000, + _trU = 0x00000700, + _trV = 0x00000006; + +var _Math = window.Math; // global to local. SHALL NOT cache abs directly (http://jsperf.com/math-vs-global/2) + +var _RGBtoYUV = function( c ) { + var r = (c & 0xFF0000) >> 16; + var g = (c & 0x00FF00) >> 8; + var b = c & 0x0000FF; + return ((/*y=*/(0.299*r + 0.587*g + 0.114*b) | 0) << 16) + + ((/*u=*/((-0.169*r - 0.331*g + 0.5*b) + 128) | 0) << 8) + + (/*v=*/((0.5*r - 0.419*g - 0.081*b) + 128) | 0); +}; + +var _Diff = function( w1, w2 ) { + // Mask against RGB_MASK to discard the alpha channel + var YUV1 = _RGBtoYUV(w1); + var YUV2 = _RGBtoYUV(w2); + return ((_Math.abs((YUV1 & _Ymask) - (YUV2 & _Ymask)) > _trY ) || + ( _Math.abs((YUV1 & _Umask) - (YUV2 & _Umask)) > _trU ) || + ( _Math.abs((YUV1 & _Vmask) - (YUV2 & _Vmask)) > _trV ) ); +}; + +/* Interpolate functions */ + +var _Interp1 = function( pc, c1, c2 ) { + //*pc = (c1*3+c2) >> 2; + if (c1 === c2) { + _dest[pc] = c1; + return; + } + _dest[pc] = ((((c1 & _MASK_2) * 3 + (c2 & _MASK_2)) >> 2) & _MASK_2) + + ((((c1 & _MASK_13) * 3 + (c2 & _MASK_13)) >> 2) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp2 = function( pc, c1, c2, c3 ) { + //*pc = (c1*2+c2+c3) >> 2; + _dest[pc] = (((((c1 & _MASK_2) << 1) + (c2 & _MASK_2) + (c3 & _MASK_2)) >> 2) & _MASK_2) + + (((((c1 & _MASK_13) << 1) + (c2 & _MASK_13) + (c3 & _MASK_13)) >> 2) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp3 = function( pc, c1, c2 ) { + //*pc = (c1*7+c2)/8; + if (c1 === c2) { + _dest[pc] = c1; + return; + } + _dest[pc] = ((((c1 & _MASK_2) * 7 + (c2 & _MASK_2)) >> 3) & _MASK_2) + + ((((c1 & _MASK_13) * 7 + (c2 & _MASK_13)) >> 3) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp4 = function( pc, c1, c2, c3 ) { + //*pc = (c1*2+(c2+c3)*7)/16; + _dest[pc] = (((((c1 & _MASK_2) << 1) + (c2 & _MASK_2) * 7 + (c3 & _MASK_2) * 7) >> 4) & _MASK_2) + + (((((c1 & _MASK_13) << 1) + (c2 & _MASK_13) * 7 + (c3 & _MASK_13) * 7) >> 4) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp5 = function( pc, c1, c2 ) { + //*pc = (c1+c2) >> 1; + if (c1 === c2) { + _dest[pc] = c1; + return; + } + _dest[pc] = ((((c1 & _MASK_2) + (c2 & _MASK_2)) >> 1) & _MASK_2) + + ((((c1 & _MASK_13) + (c2 & _MASK_13)) >> 1) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp6 = function( pc, c1, c2, c3 ) { + //*pc = (c1*5+c2*2+c3)/8; + _dest[pc] = ((((c1 & _MASK_2) * 5 + ((c2 & _MASK_2) << 1) + (c3 & _MASK_2)) >> 3) & _MASK_2) + + ((((c1 & _MASK_13) * 5 + ((c2 & _MASK_13) << 1) + (c3 & _MASK_13)) >> 3) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp7 = function( pc, c1, c2, c3 ) { + //*pc = (c1*6+c2+c3)/8; + _dest[pc] = ((((c1 & _MASK_2) * 6 + (c2 & _MASK_2) + (c3 & _MASK_2)) >> 3) & _MASK_2) + + ((((c1 & _MASK_13) * 6 + (c2 & _MASK_13) + (c3 & _MASK_13)) >> 3) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp8 = function( pc, c1, c2 ) { + //*pc = (c1*5+c2*3)/8; + if (c1 === c2) { + _dest[pc] = c1; + return; + } + _dest[pc] = ((((c1 & _MASK_2) * 5 + (c2 & _MASK_2) * 3) >> 3) & _MASK_2) + + ((((c1 & _MASK_13) * 5 + (c2 & _MASK_13) * 3) >> 3) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp9 = function( pc, c1, c2, c3 ) { + //*pc = (c1*2+(c2+c3)*3)/8; + _dest[pc] = (((((c1 & _MASK_2) << 1) + (c2 & _MASK_2) * 3 + (c3 & _MASK_2) * 3) >> 3) & _MASK_2) + + (((((c1 & _MASK_13) << 1) + (c2 & _MASK_13) * 3 + (c3 & _MASK_13) * 3) >> 3) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + +var _Interp10 = function( pc, c1, c2, c3 ) { + //*pc = (c1*14+c2+c3)/16; + _dest[pc] = ((((c1 & _MASK_2) * 14 + (c2 & _MASK_2) + (c3 & _MASK_2)) >> 4) & _MASK_2) + + ((((c1 & _MASK_13) * 14 + (c2 & _MASK_13) + (c3 & _MASK_13)) >> 4) & _MASK_13); + + _dest[pc] |= (c1 & 0xFF000000); +}; + + +var getVendorAttribute = function( el, attr ) { + var uc = attr.charAt(0).toUpperCase() + attr.substr(1); + return el[attr] || el['ms'+uc] || el['moz'+uc] || el['webkit'+uc] || el['o'+uc]; +}; + + +// This function normalizes getImageData to extract the real, actual +// pixels from an image. The naive method recently failed on retina +// devices with a backgingStoreRatio != 1 +var getImagePixels = function( image, x, y, width, height ) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + + var ratio = getVendorAttribute( ctx, 'backingStorePixelRatio' ) || 1; + ctx.getImageDataHD = getVendorAttribute( ctx, 'getImageDataHD' ); + + var realWidth = image.width / ratio, + realHeight = image.height / ratio; + + canvas.width = Math.ceil( realWidth ); + canvas.height = Math.ceil( realHeight ); + + ctx.drawImage( image, 0, 0, realWidth, realHeight ); + + return (ratio === 1) + ? ctx.getImageData( x, y, width, height ) + : ctx.getImageDataHD( x, y, width, height ); +}; + + +window.hqx = function( img, scale ) { + // We can only scale with a factor of 2, 3 or 4 + if( [2,3,4].indexOf(scale) === -1 ) { + return img; + } + + var orig, origCtx, scaled, origPixels; + if (img instanceof HTMLCanvasElement){ + orig = img; + origCtx = orig.getContext('2d'); + scaled = orig; + origPixels = origCtx.getImageData(0, 0, orig.width, orig.height).data; + } else { + origPixels = getImagePixels( img, 0, 0, img.width, img.height ).data; + scaled = document.createElement('canvas'); + } + + + // pack RGBA colors into integers + var count = img.width * img.height; + var src = _src = new Array(count); + var dest = _dest = new Array(count*scale*scale); + var index; + for(var i = 0; i < count; i++) { + src[i] = (origPixels[(index = i << 2)+3] << 24) + + (origPixels[index+2] << 16) + + (origPixels[index+1] << 8) + + origPixels[index]; + } + + // This is where the magic happens + if( scale === 2 ) hq2x( img.width, img.height ); + else if( scale === 3 ) hq3x( img.width, img.height ); + else if( scale === 4 ) hq4x( img.width, img.height ); + // alternative: window['hq'+scale+'x']( img.width, img.height ); + + scaled.width = img.width * scale; + scaled.height = img.height * scale; + + var scaledCtx = scaled.getContext('2d'); + var scaledPixels = scaledCtx.getImageData( 0, 0, scaled.width, scaled.height ); + var scaledPixelsData = scaledPixels.data; + + // unpack integers to RGBA + var c, a, destLength = dest.length; + for( var j = 0; j < destLength; j++ ) { + a = ((c = dest[j]) & 0xFF000000) >> 24; + scaledPixelsData[(index = j << 2)+3] = a < 0 ? a + 256 : 0; // signed/unsigned :/ + scaledPixelsData[index+2] = (c & 0x00FF0000) >> 16; + scaledPixelsData[index+1] = (c & 0x0000FF00) >> 8; + scaledPixelsData[index] = c & 0x000000FF; + } + _src = src = null; + _dest = dest = null; + //scaledCtx.putImageData( scaledPixels, 0, 0 ); + //return scaled; + + return scaledPixels; +}; + + + + + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// hq 2x + +var hq2x = function( width, height ) { + var + i, j, k, + prevline, nextline, + w = [], + //dpL = width * 2, optimized + dpL = width << 1, + + dp = 0, + sp = 0; + + // internal to local optimization + var + Diff = _Diff, + Math = _Math, + RGBtoYUV = _RGBtoYUV, + Interp1 = _Interp1, + Interp2 = _Interp2, + Interp3 = _Interp3, + Interp4 = _Interp4, + Interp5 = _Interp5, + Interp6 = _Interp6, + Interp7 = _Interp7, + Interp8 = _Interp8, + Interp9 = _Interp9, + Interp10 = _Interp10, + src = _src, + dest = _dest, + MASK_2 = _MASK_2, + MASK_13 = _MASK_13, + Ymask = _Ymask, + Umask = _Umask, + Vmask = _Vmask, + trY = _trY, + trU = _trU, + trV = _trV, + YUV1, YUV2; + + + // +----+----+----+ + // | | | | + // | w1 | w2 | w3 | + // +----+----+----+ + // | | | | + // | w4 | w5 | w6 | + // +----+----+----+ + // | | | | + // | w7 | w8 | w9 | + // +----+----+----+ + + for (j=0; j0 ? -width : 0; + nextline = j0) + { + w[1] = src[sp + prevline - 1]; + w[4] = src[sp - 1]; + w[7] = src[sp + nextline - 1]; + } + else + { + w[1] = w[2]; + w[4] = w[5]; + w[7] = w[8]; + } + + if (i trY ) || + ( Math.abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( Math.abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ) + pattern |= flag; + } + flag <<= 1; + } + + switch (pattern) + { + case 0: + case 1: + case 4: + case 32: + case 128: + case 5: + case 132: + case 160: + case 33: + case 129: + case 36: + case 133: + case 164: + case 161: + case 37: + case 165: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 2: + case 34: + case 130: + case 162: + { + Interp2(dp, w[5], w[1], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 16: + case 17: + case 48: + case 49: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 64: + case 65: + case 68: + case 69: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 8: + case 12: + case 136: + case 140: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 3: + case 35: + case 131: + case 163: + { + Interp1(dp, w[5], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 6: + case 38: + case 134: + case 166: + { + Interp2(dp, w[5], w[1], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 20: + case 21: + case 52: + case 53: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 144: + case 145: + case 176: + case 177: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 192: + case 193: + case 196: + case 197: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 96: + case 97: + case 100: + case 101: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 40: + case 44: + case 168: + case 172: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 9: + case 13: + case 137: + case 141: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 18: + case 50: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 80: + case 81: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp2(dp+dpL, w[5], w[7], w[4]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 72: + case 76: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 10: + case 138: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 66: + { + Interp2(dp, w[5], w[1], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 24: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 7: + case 39: + case 135: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 148: + case 149: + case 180: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 224: + case 228: + case 225: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 41: + case 169: + case 45: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 22: + case 54: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 208: + case 209: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp2(dp+dpL, w[5], w[7], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 104: + case 108: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 11: + case 139: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 19: + case 51: + { + if (Diff(w[2], w[6])) + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp6(dp, w[5], w[2], w[4]); + Interp9(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 146: + case 178: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + Interp1(dp+dpL+1, w[5], w[8]); + } + else + { + Interp9(dp+1, w[5], w[2], w[6]); + Interp6(dp+dpL+1, w[5], w[6], w[8]); + } + Interp2(dp+dpL, w[5], w[8], w[4]); + break; + } + case 84: + case 85: + { + Interp2(dp, w[5], w[4], w[2]); + if (Diff(w[6], w[8])) + { + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp6(dp+1, w[5], w[6], w[2]); + Interp9(dp+dpL+1, w[5], w[6], w[8]); + } + Interp2(dp+dpL, w[5], w[7], w[4]); + break; + } + case 112: + case 113: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp6(dp+dpL, w[5], w[8], w[4]); + Interp9(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 200: + case 204: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + Interp1(dp+dpL+1, w[5], w[6]); + } + else + { + Interp9(dp+dpL, w[5], w[8], w[4]); + Interp6(dp+dpL+1, w[5], w[8], w[6]); + } + break; + } + case 73: + case 77: + { + if (Diff(w[8], w[4])) + { + Interp1(dp, w[5], w[2]); + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp6(dp, w[5], w[4], w[2]); + Interp9(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+1, w[5], w[2], w[6]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 42: + case 170: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + Interp1(dp+dpL, w[5], w[8]); + } + else + { + Interp9(dp, w[5], w[4], w[2]); + Interp6(dp+dpL, w[5], w[4], w[8]); + } + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 14: + case 142: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + } + else + { + Interp9(dp, w[5], w[4], w[2]); + Interp6(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 67: + { + Interp1(dp, w[5], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 70: + { + Interp2(dp, w[5], w[1], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 28: + { + Interp2(dp, w[5], w[1], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 152: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 194: + { + Interp2(dp, w[5], w[1], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 98: + { + Interp2(dp, w[5], w[1], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 56: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 25: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 26: + case 31: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 82: + case 214: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 88: + case 248: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 74: + case 107: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp2(dp+1, w[5], w[3], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 27: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[3]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 86: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 216: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp1(dp+dpL, w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 106: + { + Interp1(dp, w[5], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 30: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 210: + { + Interp2(dp, w[5], w[1], w[4]); + Interp1(dp+1, w[5], w[3]); + Interp2(dp+dpL, w[5], w[7], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 120: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 75: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp2(dp+1, w[5], w[3], w[6]); + Interp1(dp+dpL, w[5], w[7]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 29: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 198: + { + Interp2(dp, w[5], w[1], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 184: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp1(dp+dpL, w[5], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 99: + { + Interp1(dp, w[5], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 57: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 71: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 156: + { + Interp2(dp, w[5], w[1], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 226: + { + Interp2(dp, w[5], w[1], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 60: + { + Interp2(dp, w[5], w[1], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 195: + { + Interp1(dp, w[5], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 102: + { + Interp2(dp, w[5], w[1], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 153: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 58: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 83: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[4]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 92: + { + Interp2(dp, w[5], w[1], w[2]); + Interp1(dp+1, w[5], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 202: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + Interp2(dp+1, w[5], w[3], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 78: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 154: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 114: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 89: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 90: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 55: + case 23: + { + if (Diff(w[2], w[6])) + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + } + else + { + Interp6(dp, w[5], w[2], w[4]); + Interp9(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 182: + case 150: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + Interp1(dp+dpL+1, w[5], w[8]); + } + else + { + Interp9(dp+1, w[5], w[2], w[6]); + Interp6(dp+dpL+1, w[5], w[6], w[8]); + } + Interp2(dp+dpL, w[5], w[8], w[4]); + break; + } + case 213: + case 212: + { + Interp2(dp, w[5], w[4], w[2]); + if (Diff(w[6], w[8])) + { + Interp1(dp+1, w[5], w[2]); + dest[dp+dpL+1] = w[5]; + } + else + { + Interp6(dp+1, w[5], w[6], w[2]); + Interp9(dp+dpL+1, w[5], w[6], w[8]); + } + Interp2(dp+dpL, w[5], w[7], w[4]); + break; + } + case 241: + case 240: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + else + { + Interp6(dp+dpL, w[5], w[8], w[4]); + Interp9(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 236: + case 232: + { + Interp2(dp, w[5], w[1], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + Interp1(dp+dpL+1, w[5], w[6]); + } + else + { + Interp9(dp+dpL, w[5], w[8], w[4]); + Interp6(dp+dpL+1, w[5], w[8], w[6]); + } + break; + } + case 109: + case 105: + { + if (Diff(w[8], w[4])) + { + Interp1(dp, w[5], w[2]); + dest[dp+dpL] = w[5]; + } + else + { + Interp6(dp, w[5], w[4], w[2]); + Interp9(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+1, w[5], w[2], w[6]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 171: + case 43: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + Interp1(dp+dpL, w[5], w[8]); + } + else + { + Interp9(dp, w[5], w[4], w[2]); + Interp6(dp+dpL, w[5], w[4], w[8]); + } + Interp2(dp+1, w[5], w[3], w[6]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 143: + case 15: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + Interp1(dp+1, w[5], w[6]); + } + else + { + Interp9(dp, w[5], w[4], w[2]); + Interp6(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 124: + { + Interp2(dp, w[5], w[1], w[2]); + Interp1(dp+1, w[5], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 203: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp2(dp+1, w[5], w[3], w[6]); + Interp1(dp+dpL, w[5], w[7]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 62: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 211: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[3]); + Interp2(dp+dpL, w[5], w[7], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 118: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 217: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp1(dp+dpL, w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 110: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 155: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[3]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 188: + { + Interp2(dp, w[5], w[1], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 185: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + Interp1(dp+dpL, w[5], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 61: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 157: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 103: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 227: + { + Interp1(dp, w[5], w[4]); + Interp2(dp+1, w[5], w[3], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 230: + { + Interp2(dp, w[5], w[1], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 199: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp2(dp+dpL, w[5], w[7], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 220: + { + Interp2(dp, w[5], w[1], w[2]); + Interp1(dp+1, w[5], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 158: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 234: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + Interp2(dp+1, w[5], w[3], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 242: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 59: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 121: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 87: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[7], w[4]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 79: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 122: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 94: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 218: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 91: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 229: + { + Interp2(dp, w[5], w[4], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 167: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 173: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 181: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 186: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 115: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 93: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 206: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 205: + case 201: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+dpL, w[5], w[7]); + } + else + { + Interp7(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 174: + case 46: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[4]); + } + else + { + Interp7(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[6]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 179: + case 147: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+1, w[5], w[3]); + } + else + { + Interp7(dp+1, w[5], w[2], w[6]); + } + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 117: + case 116: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL+1, w[5], w[9]); + } + else + { + Interp7(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 189: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 231: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 126: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 219: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[3]); + Interp1(dp+dpL, w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 125: + { + if (Diff(w[8], w[4])) + { + Interp1(dp, w[5], w[2]); + dest[dp+dpL] = w[5]; + } + else + { + Interp6(dp, w[5], w[4], w[2]); + Interp9(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 221: + { + Interp1(dp, w[5], w[2]); + if (Diff(w[6], w[8])) + { + Interp1(dp+1, w[5], w[2]); + dest[dp+dpL+1] = w[5]; + } + else + { + Interp6(dp+1, w[5], w[6], w[2]); + Interp9(dp+dpL+1, w[5], w[6], w[8]); + } + Interp1(dp+dpL, w[5], w[7]); + break; + } + case 207: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + Interp1(dp+1, w[5], w[6]); + } + else + { + Interp9(dp, w[5], w[4], w[2]); + Interp6(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[7]); + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 238: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + Interp1(dp+dpL+1, w[5], w[6]); + } + else + { + Interp9(dp+dpL, w[5], w[8], w[4]); + Interp6(dp+dpL+1, w[5], w[8], w[6]); + } + break; + } + case 190: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + Interp1(dp+dpL+1, w[5], w[8]); + } + else + { + Interp9(dp+1, w[5], w[2], w[6]); + Interp6(dp+dpL+1, w[5], w[6], w[8]); + } + Interp1(dp+dpL, w[5], w[8]); + break; + } + case 187: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + Interp1(dp+dpL, w[5], w[8]); + } + else + { + Interp9(dp, w[5], w[4], w[2]); + Interp6(dp+dpL, w[5], w[4], w[8]); + } + Interp1(dp+1, w[5], w[3]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 243: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[3]); + if (Diff(w[6], w[8])) + { + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + else + { + Interp6(dp+dpL, w[5], w[8], w[4]); + Interp9(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 119: + { + if (Diff(w[2], w[6])) + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + } + else + { + Interp6(dp, w[5], w[2], w[4]); + Interp9(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 237: + case 233: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[2], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp1(dp+dpL, w[5], w[7]);0 + } + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 175: + case 47: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]);0 + } + Interp1(dp+1, w[5], w[6]); + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[6], w[8]); + break; + } + case 183: + case 151: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp1(dp+1, w[5], w[3]);0 + } + Interp2(dp+dpL, w[5], w[8], w[4]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 245: + case 244: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp1(dp+dpL+1, w[5], w[9]);0 + } + break; + } + case 250: + { + Interp1(dp, w[5], w[4]); + Interp1(dp+1, w[5], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 123: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 95: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[7]); + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 222: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 252: + { + Interp2(dp, w[5], w[1], w[2]); + Interp1(dp+1, w[5], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp1(dp+dpL+1, w[5], w[9]);0 + } + break; + } + case 249: + { + Interp1(dp, w[5], w[2]); + Interp2(dp+1, w[5], w[3], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp1(dp+dpL, w[5], w[7]);0 + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 235: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp2(dp+1, w[5], w[3], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp1(dp+dpL, w[5], w[7]);0 + } + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 111: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]);0 + } + Interp1(dp+1, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp2(dp+dpL+1, w[5], w[9], w[6]); + break; + } + case 63: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]);0 + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[8]); + Interp2(dp+dpL+1, w[5], w[9], w[8]); + break; + } + case 159: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp1(dp+1, w[5], w[3]);0 + } + Interp2(dp+dpL, w[5], w[7], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 215: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp1(dp+1, w[5], w[3]);0 + } + Interp2(dp+dpL, w[5], w[7], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 246: + { + Interp2(dp, w[5], w[1], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp1(dp+dpL+1, w[5], w[9]);0 + } + break; + } + case 254: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp1(dp+dpL+1, w[5], w[9]);0 + } + break; + } + case 253: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp1(dp+dpL, w[5], w[7]);0 + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp1(dp+dpL+1, w[5], w[9]);0 + } + break; + } + case 251: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + Interp1(dp+1, w[5], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp1(dp+dpL, w[5], w[7]);0 + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 239: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]);0 + } + Interp1(dp+1, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp1(dp+dpL, w[5], w[7]);0 + } + Interp1(dp+dpL+1, w[5], w[6]); + break; + } + case 127: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]);0 + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp2(dp+1, w[5], w[2], w[6]); + } + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp+dpL, w[5], w[8], w[4]); + } + Interp1(dp+dpL+1, w[5], w[9]); + break; + } + case 191: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]);0 + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp1(dp+1, w[5], w[3]);0 + } + Interp1(dp+dpL, w[5], w[8]); + Interp1(dp+dpL+1, w[5], w[8]); + break; + } + case 223: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp1(dp+1, w[5], w[3]);0 + } + Interp1(dp+dpL, w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp2(dp+dpL+1, w[5], w[6], w[8]); + } + break; + } + case 247: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp1(dp+1, w[5], w[3]);0 + } + Interp1(dp+dpL, w[5], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp1(dp+dpL+1, w[5], w[9]);0 + } + break; + } + case 255: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]);0 + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + } + else + { + Interp1(dp+1, w[5], w[3]);0 + } + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + } + else + { + Interp1(dp+dpL, w[5], w[7]);0 + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+1] = w[5]; + } + else + { + Interp1(dp+dpL+1, w[5], w[9]);0 + } + break; + } + } + sp++; + dp += 2; + } + dp += dpL; + } +}; + + + + + + + + + + + + + + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// hq 3x + + +var hq3x = function( width, height ) { + var + i, j, k, + prevline, nextline, + w = [], + dpL = width * 3, + + dp = 0, + sp = 0; + + // internal to local optimization + var + Diff = _Diff, + Math = _Math, + RGBtoYUV = _RGBtoYUV, + Interp1 = _Interp1, + Interp2 = _Interp2, + Interp3 = _Interp3, + Interp4 = _Interp4, + Interp5 = _Interp5, + Interp6 = _Interp6, + Interp7 = _Interp7, + Interp8 = _Interp8, + Interp9 = _Interp9, + Interp10 = _Interp10, + src = _src, + dest = _dest, + MASK_2 = _MASK_2, + MASK_13 = _MASK_13, + Ymask = _Ymask, + Umask = _Umask, + Vmask = _Vmask, + trY = _trY, + trU = _trU, + trV = _trV, + YUV1, YUV2; + + // +----+----+----+ + // | | | | + // | w1 | w2 | w3 | + // +----+----+----+ + // | | | | + // | w4 | w5 | w6 | + // +----+----+----+ + // | | | | + // | w7 | w8 | w9 | + // +----+----+----+ + + for (j=0; j0 ? -width : 0; + nextline = j0) + { + w[1] = src[sp + prevline - 1]; + w[4] = src[sp - 1]; + w[7] = src[sp + nextline - 1]; + } + else + { + w[1] = w[2]; + w[4] = w[5]; + w[7] = w[8]; + } + + if (i trY ) || + ( Math.abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( Math.abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ) + pattern |= flag; + } + flag <<= 1; + } + + switch (pattern) + { + case 0: + case 1: + case 4: + case 32: + case 128: + case 5: + case 132: + case 160: + case 33: + case 129: + case 36: + case 133: + case 164: + case 161: + case 37: + case 165: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 2: + case 34: + case 130: + case 162: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 16: + case 17: + case 48: + case 49: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 64: + case 65: + case 68: + case 69: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 8: + case 12: + case 136: + case 140: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 3: + case 35: + case 131: + case 163: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 6: + case 38: + case 134: + case 166: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 20: + case 21: + case 52: + case 53: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 144: + case 145: + case 176: + case 177: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 192: + case 193: + case 196: + case 197: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 96: + case 97: + case 100: + case 101: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 40: + case 44: + case 168: + case 172: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 9: + case 13: + case 137: + case 141: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 18: + case 50: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 80: + case 81: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 72: + case 76: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 10: + case 138: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 66: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 24: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 7: + case 39: + case 135: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 148: + case 149: + case 180: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 224: + case 228: + case 225: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 41: + case 169: + case 45: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 22: + case 54: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 208: + case 209: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 104: + case 108: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 11: + case 139: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 19: + case 51: + { + if (Diff(w[2], w[6])) + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+2] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp5(dp+2, w[2], w[6]); + Interp1(dp+dpL+2, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 146: + case 178: + { + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + } + else + { + Interp1(dp+1, w[5], w[2]); + Interp5(dp+2, w[2], w[6]); + Interp1(dp+dpL+2, w[6], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + Interp1(dp, w[5], w[1]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + break; + } + case 84: + case 85: + { + if (Diff(w[6], w[8])) + { + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL+2, w[6], w[5]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+2, w[6], w[8]); + } + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + break; + } + case 112: + case 113: + { + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[8], w[5]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+2, w[6], w[8]); + } + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + break; + } + case 200: + case 204: + { + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + } + else + { + Interp1(dp+dpL, w[5], w[4]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[8], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + break; + } + case 73: + case 77: + { + if (Diff(w[8], w[4])) + { + Interp1(dp, w[5], w[2]); + dest[dp+dpL] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+dpL, w[4], w[5]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 42: + case 170: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + } + else + { + Interp5(dp, w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[4], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 14: + case 142: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[4], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + } + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 67: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 70: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 28: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 152: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 194: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 98: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 56: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 25: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 26: + case 31: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 82: + case 214: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 88: + case 248: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 74: + case 107: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 27: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 86: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 216: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 106: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 30: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 210: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 120: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 75: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 29: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 198: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 184: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 99: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 57: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 71: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 156: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 226: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 60: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 195: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 102: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 153: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 58: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 83: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 92: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 202: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 78: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 154: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 114: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 89: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 90: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 55: + case 23: + { + if (Diff(w[2], w[6])) + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp5(dp+2, w[2], w[6]); + Interp1(dp+dpL+2, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 182: + case 150: + { + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + } + else + { + Interp1(dp+1, w[5], w[2]); + Interp5(dp+2, w[2], w[6]); + Interp1(dp+dpL+2, w[6], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + Interp1(dp, w[5], w[1]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + break; + } + case 213: + case 212: + { + if (Diff(w[6], w[8])) + { + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL+2, w[6], w[5]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+2, w[6], w[8]); + } + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + break; + } + case 241: + case 240: + { + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[8], w[5]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+2, w[6], w[8]); + } + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + break; + } + case 236: + case 232: + { + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + } + else + { + Interp1(dp+dpL, w[5], w[4]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[8], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + break; + } + case 109: + case 105: + { + if (Diff(w[8], w[4])) + { + Interp1(dp, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+dpL, w[4], w[5]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 171: + case 43: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + } + else + { + Interp5(dp, w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[4], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 143: + case 15: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[4], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + } + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 124: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 203: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 62: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 211: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 118: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 217: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 110: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 155: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 188: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 185: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 61: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 157: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 103: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 227: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 230: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 199: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 220: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 158: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 234: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 242: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 59: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 121: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 87: + { + Interp1(dp, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 79: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 122: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 94: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 218: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 91: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 229: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 167: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 173: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 181: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 186: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 115: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 93: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 206: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 205: + case 201: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 174: + case 46: + { + if (Diff(w[4], w[2])) + { + Interp1(dp, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 179: + case 147: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 117: + case 116: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 189: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 231: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 126: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 219: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 125: + { + if (Diff(w[8], w[4])) + { + Interp1(dp, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+dpL, w[4], w[5]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 221: + { + if (Diff(w[6], w[8])) + { + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL+2, w[6], w[5]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+2, w[6], w[8]); + } + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + break; + } + case 207: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[4], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[4]); + } + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 238: + { + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + } + else + { + Interp1(dp+dpL, w[5], w[4]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[8], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + break; + } + case 190: + { + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + } + else + { + Interp1(dp+1, w[5], w[2]); + Interp5(dp+2, w[2], w[6]); + Interp1(dp+dpL+2, w[6], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + Interp1(dp, w[5], w[1]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + break; + } + case 187: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + } + else + { + Interp5(dp, w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[4], w[5]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 243: + { + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp1(dp+dpL+2, w[5], w[6]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[8], w[5]); + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+2, w[6], w[8]); + } + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + break; + } + case 119: + { + if (Diff(w[2], w[6])) + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp5(dp+2, w[2], w[6]); + Interp1(dp+dpL+2, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 237: + case 233: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 175: + case 47: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + break; + } + case 183: + case 151: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 245: + case 244: + { + Interp2(dp, w[5], w[4], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 250: + { + Interp1(dp, w[5], w[1]); + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 123: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 95: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 222: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 252: + { + Interp1(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 249: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 235: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 111: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 63: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 159: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 215: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 246: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 254: + { + Interp1(dp, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp4(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 253: + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+2, w[5], w[2]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 251: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + } + Interp1(dp+2, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+dpL] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp3(dp+dpL, w[5], w[4]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + dest[dp+dpL+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+dpL+2, w[5], w[6]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 239: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + Interp1(dp+2, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp1(dp+dpL+2, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + break; + } + case 127: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + Interp3(dp+1, w[5], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp4(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + } + else + { + Interp4(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + break; + } + case 191: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + break; + } + case 223: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp4(dp, w[5], w[4], w[2]); + Interp3(dp+dpL, w[5], w[4]); + } + if (Diff(w[2], w[6])) + { + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + dest[dp+dpL+2] = w[5]; + } + else + { + Interp3(dp+1, w[5], w[2]); + Interp2(dp+2, w[5], w[2], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + } + dest[dp+dpL+1] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp4(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 247: + { + Interp1(dp, w[5], w[4]); + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + case 255: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[4], w[2]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + } + else + { + Interp2(dp+2, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8], w[4]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + } + break; + } + } + sp++; + dp += 3; + } + //dp += (dpL * 2); optimized + dp += (dpL << 1); + } +}; + + + + + + + + + + + + + + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// hq 4x + +var hq4x = function( width, height ) { + var + i, j, k, + prevline, nextline, + w = [], + //dpL = width * 4, optimized + dpL = width << 2, + + dp = 0, + sp = 0; + + // internal to local optimization + var + Diff = _Diff, + Math = _Math, + RGBtoYUV = _RGBtoYUV, + Interp1 = _Interp1, + Interp2 = _Interp2, + Interp3 = _Interp3, + Interp4 = _Interp4, + Interp5 = _Interp5, + Interp6 = _Interp6, + Interp7 = _Interp7, + Interp8 = _Interp8, + Interp9 = _Interp9, + Interp10 = _Interp10, + src = _src, + dest = _dest, + MASK_2 = _MASK_2, + MASK_13 = _MASK_13, + Ymask = _Ymask, + Umask = _Umask, + Vmask = _Vmask, + trY = _trY, + trU = _trU, + trV = _trV, + YUV1, YUV2; + + // +----+----+----+ + // | | | | + // | w1 | w2 | w3 | + // +----+----+----+ + // | | | | + // | w4 | w5 | w6 | + // +----+----+----+ + // | | | | + // | w7 | w8 | w9 | + // +----+----+----+ + + for (j=0; j0 ? -width : 0; + nextline = j0) + { + w[1] = src[sp + prevline - 1]; + w[4] = src[sp - 1]; + w[7] = src[sp + nextline - 1]; + } + else + { + w[1] = w[2]; + w[4] = w[5]; + w[7] = w[8]; + } + + if (i trY ) || + ( Math.abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( Math.abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ) + pattern |= flag; + } + flag <<= 1; + } + + switch (pattern) + { + case 0: + case 1: + case 4: + case 32: + case 128: + case 5: + case 132: + case 160: + case 33: + case 129: + case 36: + case 133: + case 164: + case 161: + case 37: + case 165: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 2: + case 34: + case 130: + case 162: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 16: + case 17: + case 48: + case 49: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 64: + case 65: + case 68: + case 69: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 8: + case 12: + case 136: + case 140: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 3: + case 35: + case 131: + case 163: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 6: + case 38: + case 134: + case 166: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 20: + case 21: + case 52: + case 53: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 144: + case 145: + case 176: + case 177: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 192: + case 193: + case 196: + case 197: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 96: + case 97: + case 100: + case 101: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 40: + case 44: + case 168: + case 172: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 9: + case 13: + case 137: + case 141: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 18: + case 50: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 80: + case 81: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 72: + case 76: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 10: + case 138: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + dest[dp+dpL+1] = w[5]; + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 66: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 24: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 7: + case 39: + case 135: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 148: + case 149: + case 180: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 224: + case 228: + case 225: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 41: + case 169: + case 45: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 22: + case 54: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 208: + case 209: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 104: + case 108: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 11: + case 139: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 19: + case 51: + { + if (Diff(w[2], w[6])) + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp8(dp+2, w[2], w[6]); + Interp5(dp+3, w[2], w[6]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp2(dp+dpL+3, w[6], w[5], w[2]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 146: + case 178: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + } + else + { + Interp2(dp+2, w[2], w[5], w[6]); + Interp5(dp+3, w[2], w[6]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp8(dp+dpL+3, w[6], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp1(dp+(dpL * 3)+3, w[5], w[6]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + break; + } + case 84: + case 85: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp8(dp+2, w[5], w[2]); + if (Diff(w[6], w[8])) + { + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + Interp1(dp+3, w[5], w[6]); + Interp1(dp+dpL+3, w[6], w[5]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[8]); + Interp2(dp+(dpL * 3)+2, w[8], w[5], w[6]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 112: + case 113: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5], w[8]); + Interp1(dp+(dpL * 3), w[5], w[8]); + Interp1(dp+(dpL * 3)+1, w[8], w[5]); + Interp8(dp+(dpL * 3)+2, w[8], w[6]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + break; + } + case 200: + case 204: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp8(dp+(dpL * 3)+1, w[8], w[4]); + Interp1(dp+(dpL * 3)+2, w[8], w[5]); + Interp1(dp+(dpL * 3)+3, w[5], w[8]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + break; + } + case 73: + case 77: + { + if (Diff(w[8], w[4])) + { + Interp8(dp, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp, w[5], w[4]); + Interp1(dp+dpL, w[4], w[5]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp2(dp+(dpL * 3)+1, w[8], w[5], w[4]); + } + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 42: + case 170: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + } + else + { + Interp5(dp, w[2], w[4]); + Interp2(dp+1, w[2], w[5], w[4]); + Interp8(dp+dpL, w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp1(dp+(dpL * 3), w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 14: + case 142: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp5(dp, w[2], w[4]); + Interp8(dp+1, w[2], w[4]); + Interp1(dp+2, w[2], w[5]); + Interp1(dp+3, w[5], w[2]); + Interp2(dp+dpL, w[4], w[5], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + } + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 67: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 70: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 28: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 152: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 194: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 98: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 56: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 25: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 26: + case 31: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 82: + case 214: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 88: + case 248: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + break; + } + case 74: + case 107: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 27: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 86: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 216: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 106: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 30: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 210: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 120: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 75: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 29: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 198: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 184: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 99: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 57: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 71: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 156: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 226: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 60: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 195: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 102: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 153: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 58: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 83: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 92: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 202: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 78: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 154: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 114: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + break; + } + case 89: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 90: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 55: + case 23: + { + if (Diff(w[2], w[6])) + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp8(dp+2, w[2], w[6]); + Interp5(dp+3, w[2], w[6]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp2(dp+dpL+3, w[6], w[5], w[2]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 182: + case 150: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + } + else + { + Interp2(dp+2, w[2], w[5], w[6]); + Interp5(dp+3, w[2], w[6]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp8(dp+dpL+3, w[6], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp1(dp+(dpL * 3)+3, w[5], w[6]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + break; + } + case 213: + case 212: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp8(dp+2, w[5], w[2]); + if (Diff(w[6], w[8])) + { + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp1(dp+3, w[5], w[6]); + Interp1(dp+dpL+3, w[6], w[5]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[8]); + Interp2(dp+(dpL * 3)+2, w[8], w[5], w[6]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 241: + case 240: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5], w[8]); + Interp1(dp+(dpL * 3), w[5], w[8]); + Interp1(dp+(dpL * 3)+1, w[8], w[5]); + Interp8(dp+(dpL * 3)+2, w[8], w[6]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + break; + } + case 236: + case 232: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp8(dp+(dpL * 3)+1, w[8], w[4]); + Interp1(dp+(dpL * 3)+2, w[8], w[5]); + Interp1(dp+(dpL * 3)+3, w[5], w[8]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + break; + } + case 109: + case 105: + { + if (Diff(w[8], w[4])) + { + Interp8(dp, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]); + Interp1(dp+dpL, w[4], w[5]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp2(dp+(dpL * 3)+1, w[8], w[5], w[4]); + } + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 171: + case 43: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + } + else + { + Interp5(dp, w[2], w[4]); + Interp2(dp+1, w[2], w[5], w[4]); + Interp8(dp+dpL, w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp1(dp+(dpL * 3), w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 143: + case 15: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp8(dp+1, w[2], w[4]); + Interp1(dp+2, w[2], w[5]); + Interp1(dp+3, w[5], w[2]); + Interp2(dp+dpL, w[4], w[5], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + } + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 124: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 203: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 62: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 211: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 118: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 217: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 110: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 155: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 188: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 185: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 61: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 157: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 103: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 227: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 230: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 199: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 220: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + break; + } + case 158: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 234: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 242: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + break; + } + case 59: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + dest[dp+dpL+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 121: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 87: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + dest[dp+dpL+2] = w[5]; + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 79: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 122: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 94: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 218: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + break; + } + case 91: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + dest[dp+dpL+1] = w[5]; + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 229: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 167: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 173: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 181: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 186: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 115: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + break; + } + case 93: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 206: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 205: + case 201: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + if (Diff(w[8], w[4])) + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + } + else + { + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp1(dp+(dpL * 3)+1, w[5], w[8]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 174: + case 46: + { + if (Diff(w[4], w[2])) + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + } + else + { + Interp2(dp, w[5], w[2], w[4]); + Interp1(dp+1, w[5], w[2]); + Interp1(dp+dpL, w[5], w[4]); + dest[dp+dpL+1] = w[5]; + } + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 179: + case 147: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + if (Diff(w[2], w[6])) + { + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + } + else + { + Interp1(dp+2, w[5], w[2]); + Interp2(dp+3, w[5], w[2], w[6]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+dpL+3, w[5], w[6]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 117: + case 116: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + if (Diff(w[6], w[8])) + { + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + } + else + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp1(dp+(dpL * 3)+2, w[5], w[8]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + break; + } + case 189: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 231: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 126: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 219: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 125: + { + if (Diff(w[8], w[4])) + { + Interp8(dp, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp1(dp, w[5], w[4]); + Interp1(dp+dpL, w[4], w[5]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp2(dp+(dpL * 3)+1, w[8], w[5], w[4]); + } + Interp8(dp+1, w[5], w[2]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 221: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp8(dp+2, w[5], w[2]); + if (Diff(w[6], w[8])) + { + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp1(dp+3, w[5], w[6]); + Interp1(dp+dpL+3, w[6], w[5]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[8]); + Interp2(dp+(dpL * 3)+2, w[8], w[5], w[6]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 207: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp8(dp+1, w[2], w[4]); + Interp1(dp+2, w[2], w[5]); + Interp1(dp+3, w[5], w[2]); + Interp2(dp+dpL, w[4], w[5], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + } + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 238: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + } + else + { + Interp2(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp8(dp+(dpL * 3)+1, w[8], w[4]); + Interp1(dp+(dpL * 3)+2, w[8], w[5]); + Interp1(dp+(dpL * 3)+3, w[5], w[8]); + } + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + break; + } + case 190: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + } + else + { + Interp2(dp+2, w[2], w[5], w[6]); + Interp5(dp+3, w[2], w[6]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp8(dp+dpL+3, w[6], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp1(dp+(dpL * 3)+3, w[5], w[6]); + } + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + break; + } + case 187: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + } + else + { + Interp5(dp, w[2], w[4]); + Interp2(dp+1, w[2], w[5], w[4]); + Interp8(dp+dpL, w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp1(dp+(dpL * 3), w[5], w[4]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 243: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp2(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5], w[8]); + Interp1(dp+(dpL * 3), w[5], w[8]); + Interp1(dp+(dpL * 3)+1, w[8], w[5]); + Interp8(dp+(dpL * 3)+2, w[8], w[6]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + break; + } + case 119: + { + if (Diff(w[2], w[6])) + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp1(dp, w[5], w[2]); + Interp1(dp+1, w[2], w[5]); + Interp8(dp+2, w[2], w[6]); + Interp5(dp+3, w[2], w[6]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp2(dp+dpL+3, w[6], w[5], w[2]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 237: + case 233: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[6]); + Interp2(dp+3, w[5], w[2], w[6]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp7(dp+dpL+2, w[5], w[6], w[2]); + Interp6(dp+dpL+3, w[5], w[6], w[2]); + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL * 3)] = w[5]; + } + else + { + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + } + dest[dp+(dpL * 3)+1] = w[5]; + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 175: + case 47: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[2], w[4]); + } + dest[dp+1] = w[5]; + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6], w[8]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[6]); + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + break; + } + case 183: + case 151: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + dest[dp+2] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+3] = w[5]; + } + else + { + Interp2(dp+3, w[5], w[2], w[6]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[8]); + Interp7(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[4]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 245: + case 244: + { + Interp2(dp, w[5], w[2], w[4]); + Interp6(dp+1, w[5], w[2], w[4]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp6(dp+dpL, w[5], w[4], w[2]); + Interp7(dp+dpL+1, w[5], w[4], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + dest[dp+(dpL * 3)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 250: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + break; + } + case 123: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 95: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 222: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 252: + { + Interp8(dp, w[5], w[1]); + Interp6(dp+1, w[5], w[2], w[1]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 249: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp6(dp+2, w[5], w[2], w[3]); + Interp8(dp+3, w[5], w[3]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + if (Diff(w[8], w[4])) + { + dest[dp+(dpL * 3)] = w[5]; + } + else + { + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + } + dest[dp+(dpL * 3)+1] = w[5]; + break; + } + case 235: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp6(dp+dpL+3, w[5], w[6], w[3]); + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL * 3)] = w[5]; + } + else + { + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + } + dest[dp+(dpL * 3)+1] = w[5]; + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 111: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[2], w[4]); + } + dest[dp+1] = w[5]; + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp6(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 63: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[2], w[4]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp6(dp+(dpL * 3)+2, w[5], w[8], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 159: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + dest[dp+2] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+3] = w[5]; + } + else + { + Interp2(dp+3, w[5], w[2], w[6]); + } + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp6(dp+(dpL * 3)+1, w[5], w[8], w[7]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 215: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + dest[dp+2] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+3] = w[5]; + } + else + { + Interp2(dp+3, w[5], w[2], w[6]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + Interp6(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 246: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp6(dp+dpL, w[5], w[4], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + dest[dp+(dpL * 3)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 254: + { + Interp8(dp, w[5], w[1]); + Interp1(dp+1, w[5], w[1]); + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + Interp1(dp+dpL, w[5], w[1]); + Interp3(dp+dpL+1, w[5], w[1]); + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 253: + { + Interp8(dp, w[5], w[2]); + Interp8(dp+1, w[5], w[2]); + Interp8(dp+2, w[5], w[2]); + Interp8(dp+3, w[5], w[2]); + Interp3(dp+dpL, w[5], w[2]); + Interp3(dp+dpL+1, w[5], w[2]); + Interp3(dp+dpL+2, w[5], w[2]); + Interp3(dp+dpL+3, w[5], w[2]); + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL * 3)] = w[5]; + } + else + { + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + } + dest[dp+(dpL * 3)+1] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 251: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + Interp1(dp+2, w[5], w[3]); + Interp8(dp+3, w[5], w[3]); + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[3]); + Interp1(dp+dpL+3, w[5], w[3]); + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + if (Diff(w[8], w[4])) + { + dest[dp+(dpL * 3)] = w[5]; + } + else + { + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + } + dest[dp+(dpL * 3)+1] = w[5]; + break; + } + case 239: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[2], w[4]); + } + dest[dp+1] = w[5]; + Interp3(dp+2, w[5], w[6]); + Interp8(dp+3, w[5], w[6]); + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + Interp3(dp+dpL+2, w[5], w[6]); + Interp8(dp+dpL+3, w[5], w[6]); + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[6]); + Interp8(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[6]); + if (Diff(w[8], w[4])) + { + dest[dp+(dpL * 3)] = w[5]; + } + else + { + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + } + dest[dp+(dpL * 3)+1] = w[5]; + Interp3(dp+(dpL * 3)+2, w[5], w[6]); + Interp8(dp+(dpL * 3)+3, w[5], w[6]); + break; + } + case 127: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[2], w[4]); + } + dest[dp+1] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+2] = w[5]; + dest[dp+3] = w[5]; + dest[dp+dpL+3] = w[5]; + } + else + { + Interp5(dp+2, w[2], w[5]); + Interp5(dp+3, w[2], w[6]); + Interp5(dp+dpL+3, w[6], w[5]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL * 3)] = w[5]; + dest[dp+(dpL * 3)+1] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/), w[4], w[5]); + Interp5(dp+(dpL * 3), w[8], w[4]); + Interp5(dp+(dpL * 3)+1, w[8], w[5]); + } + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[9]); + Interp1(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[9]); + Interp1(dp+(dpL * 3)+2, w[5], w[9]); + Interp8(dp+(dpL * 3)+3, w[5], w[9]); + break; + } + case 191: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[2], w[4]); + } + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+3] = w[5]; + } + else + { + Interp2(dp+3, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + Interp3(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+2, w[5], w[8]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+3, w[5], w[8]); + Interp8(dp+(dpL * 3), w[5], w[8]); + Interp8(dp+(dpL * 3)+1, w[5], w[8]); + Interp8(dp+(dpL * 3)+2, w[5], w[8]); + Interp8(dp+(dpL * 3)+3, w[5], w[8]); + break; + } + case 223: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + dest[dp+1] = w[5]; + dest[dp+dpL] = w[5]; + } + else + { + Interp5(dp, w[2], w[4]); + Interp5(dp+1, w[2], w[5]); + Interp5(dp+dpL, w[4], w[5]); + } + dest[dp+2] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+3] = w[5]; + } + else + { + Interp2(dp+3, w[5], w[2], w[6]); + } + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + Interp1(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[7]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[7]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp5(dp+(dpL << 1 /*==dpL * 2*/)+3, w[6], w[5]); + Interp5(dp+(dpL * 3)+2, w[8], w[5]); + Interp5(dp+(dpL * 3)+3, w[8], w[6]); + } + Interp8(dp+(dpL * 3), w[5], w[7]); + Interp1(dp+(dpL * 3)+1, w[5], w[7]); + break; + } + case 247: + { + Interp8(dp, w[5], w[4]); + Interp3(dp+1, w[5], w[4]); + dest[dp+2] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+3] = w[5]; + } + else + { + Interp2(dp+3, w[5], w[2], w[6]); + } + Interp8(dp+dpL, w[5], w[4]); + Interp3(dp+dpL+1, w[5], w[4]); + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + Interp8(dp+(dpL << 1 /*==dpL * 2*/), w[5], w[4]); + Interp3(dp+(dpL << 1 /*==dpL * 2*/)+1, w[5], w[4]); + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + Interp8(dp+(dpL * 3), w[5], w[4]); + Interp3(dp+(dpL * 3)+1, w[5], w[4]); + dest[dp+(dpL * 3)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + case 255: + { + if (Diff(w[4], w[2])) + { + dest[dp] = w[5]; + } + else + { + Interp2(dp, w[5], w[2], w[4]); + } + dest[dp+1] = w[5]; + dest[dp+2] = w[5]; + if (Diff(w[2], w[6])) + { + dest[dp+3] = w[5]; + } + else + { + Interp2(dp+3, w[5], w[2], w[6]); + } + dest[dp+dpL] = w[5]; + dest[dp+dpL+1] = w[5]; + dest[dp+dpL+2] = w[5]; + dest[dp+dpL+3] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+1] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+2] = w[5]; + dest[dp+(dpL << 1 /*==dpL * 2*/)+3] = w[5]; + if (Diff(w[8], w[4])) + { + dest[dp+(dpL * 3)] = w[5]; + } + else + { + Interp2(dp+(dpL * 3), w[5], w[8], w[4]); + } + dest[dp+(dpL * 3)+1] = w[5]; + dest[dp+(dpL * 3)+2] = w[5]; + if (Diff(w[6], w[8])) + { + dest[dp+(dpL * 3)+3] = w[5]; + } + else + { + Interp2(dp+(dpL * 3)+3, w[5], w[8], w[6]); + } + break; + } + } + sp++; + dp += 4; + } + dp += (dpL * 3); + } +} + +})(this); \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..0bca8512af3f78740cf8804f3bb526ed9eed8605 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + hqx.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.min.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.min.js.js new file mode 100644 index 0000000000000000000000000000000000000000..bbbb6288c79269e153ba102fe49c6941cfb425cc --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.min.js.js @@ -0,0 +1,12 @@ +/* Copyright: + * Maxim Stepin - maxst@hiend3d.com + * Cameron Zemek - grom@zeminvaders.net + * Dominic Szablewski - mail@phoboslab.org + * https://github.com/phoboslab/js-hqx + * GNU Lesser General Public License. + */ +!function(a){"use strict";var e=null,c=null,s=65280,r=16711935,b=16711680,k=65280,t=255,n=3145728,i=1792,o=6,h=a.Math,u=function(a){var e=(16711680&a)>>16,c=(65280&a)>>8,s=255&a;return((.299*e+.587*c+.114*s|0)<<16)+((-.169*e-.331*c+.5*s+128|0)<<8)+(.5*e-.419*c-.081*s+128|0)},f=function(a,e){var c=u(a),s=u(e);return h.abs((c&b)-(s&b))>n||h.abs((c&k)-(s&k))>i||h.abs((c&t)-(s&t))>o},d=function(a,e,b){return e===b?void(c[a]=e):(c[a]=(3*(e&s)+(b&s)>>2&s)+(3*(e&r)+(b&r)>>2&r),void(c[a]|=4278190080&e))},g=function(a,e,b,k){c[a]=(((e&s)<<1)+(b&s)+(k&s)>>2&s)+(((e&r)<<1)+(b&r)+(k&r)>>2&r),c[a]|=4278190080&e},v=function(a,e,b){return e===b?void(c[a]=e):(c[a]=(7*(e&s)+(b&s)>>3&s)+(7*(e&r)+(b&r)>>3&r),void(c[a]|=4278190080&e))},w=function(a,e,b,k){c[a]=(((e&s)<<1)+7*(b&s)+7*(k&s)>>4&s)+(((e&r)<<1)+7*(b&r)+7*(k&r)>>4&r),c[a]|=4278190080&e},l=function(a,e,b){return e===b?void(c[a]=e):(c[a]=((e&s)+(b&s)>>1&s)+((e&r)+(b&r)>>1&r),void(c[a]|=4278190080&e))},m=function(a,e,b,k){c[a]=(5*(e&s)+((b&s)<<1)+(k&s)>>3&s)+(5*(e&r)+((b&r)<<1)+(k&r)>>3&r),c[a]|=4278190080&e},D=function(a,e,b,k){c[a]=(6*(e&s)+(b&s)+(k&s)>>3&s)+(6*(e&r)+(b&r)+(k&r)>>3&r),c[a]|=4278190080&e},I=function(a,e,b){return e===b?void(c[a]=e):(c[a]=(5*(e&s)+3*(b&s)>>3&s)+(5*(e&r)+3*(b&r)>>3&r),void(c[a]|=4278190080&e))},x=function(a,e,b,k){c[a]=(((e&s)<<1)+3*(b&s)+3*(k&s)>>3&s)+(((e&r)<<1)+3*(b&r)+3*(k&r)>>3&r),c[a]|=4278190080&e},C=function(a,e){var c=e.charAt(0).toUpperCase()+e.substr(1);return a[e]||a["ms"+c]||a["moz"+c]||a["webkit"+c]||a["o"+c]},H=function(a,e,c,s,r){var b=document.createElement("canvas"),k=b.getContext("2d"),t=C(k,"backingStorePixelRatio")||1;k.getImageDataHD=C(k,"getImageDataHD");var n=a.width/t,i=a.height/t;return b.width=Math.ceil(n),b.height=Math.ceil(i),k.drawImage(a,0,0,n,i),1===t?k.getImageData(e,c,s,r):k.getImageDataHD(e,c,s,r)};a.hqx=function(a,s){if(-1===[2,3,4].indexOf(s))return a;var r,b,k,t;a instanceof HTMLCanvasElement?(r=a,b=r.getContext("2d"),k=r,t=b.getImageData(0,0,r.width,r.height).data):(t=H(a,0,0,a.width,a.height).data,k=document.createElement("canvas"));for(var n,i=a.width*a.height,o=e=new Array(i),h=c=new Array(i*s*s),u=0;i>u;u++)o[u]=(t[(n=u<<2)+3]<<24)+(t[n+2]<<16)+(t[n+1]<<8)+t[n];2===s?M(a.width,a.height):3===s?A(a.width,a.height):4===s&&E(a.width,a.height),k.width=a.width*s,k.height=a.height*s;for(var f,d,g=k.getContext("2d"),v=g.getImageData(0,0,k.width,k.height),w=v.data,l=h.length,m=0;l>m;m++)d=(4278190080&(f=h[m]))>>24,w[(n=m<<2)+3]=0>d?d+256:0,w[n+2]=(16711680&f)>>16,w[n+1]=(65280&f)>>8,w[n]=255&f;return e=o=null,c=h=null,v};var M=function(a,s){var r,v,w,l,I,C,H,M=[],A=a<<1,E=0,p=0,y=f,q=h,z=u,L=d,O=g,P=m,R=D,S=x,T=e,U=c,j=b,B=k,F=t,G=n,J=i,K=o;for(v=0;s>v;v++){for(l=v>0?-a:0,I=s-1>v?a:0,r=0;a>r;r++){M[2]=T[p+l],M[5]=T[p],M[8]=T[p+I],r>0?(M[1]=T[p+l-1],M[4]=T[p-1],M[7]=T[p+I-1]):(M[1]=M[2],M[4]=M[5],M[7]=M[8]),a-1>r?(M[3]=T[p+l+1],M[6]=T[p+1],M[9]=T[p+I+1]):(M[3]=M[2],M[6]=M[5],M[9]=M[8]);var N=0,Q=1;for(C=z(M[5]),w=1;10>w;w++)5!==w&&(M[w]!==M[5]&&(H=z(M[w]),(q.abs((C&j)-(H&j))>G||q.abs((C&B)-(H&B))>J||q.abs((C&F)-(H&F))>K)&&(N|=Q)),Q<<=1);switch(N){case 0:case 1:case 4:case 32:case 128:case 5:case 132:case 160:case 33:case 129:case 36:case 133:case 164:case 161:case 37:case 165:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[6],M[8]);break;case 2:case 34:case 130:case 162:O(E,M[5],M[1],M[4]),O(E+1,M[5],M[3],M[6]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[6],M[8]);break;case 16:case 17:case 48:case 49:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[2]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[8]);break;case 64:case 65:case 68:case 69:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 8:case 12:case 136:case 140:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 3:case 35:case 131:case 163:L(E,M[5],M[4]),O(E+1,M[5],M[3],M[6]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[6],M[8]);break;case 6:case 38:case 134:case 166:O(E,M[5],M[1],M[4]),L(E+1,M[5],M[6]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[6],M[8]);break;case 20:case 21:case 52:case 53:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[8]);break;case 144:case 145:case 176:case 177:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[2]),O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[8]);break;case 192:case 193:case 196:case 197:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[4]),L(E+A+1,M[5],M[6]);break;case 96:case 97:case 100:case 101:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 40:case 44:case 168:case 172:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 9:case 13:case 137:case 141:L(E,M[5],M[2]),O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 18:case 50:O(E,M[5],M[1],M[4]),y(M[2],M[6])?L(E+1,M[5],M[3]):O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[8]);break;case 80:case 81:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[2]),O(E+A,M[5],M[7],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):O(E+A+1,M[5],M[6],M[8]);break;case 72:case 76:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 10:case 138:y(M[4],M[2])?L(E,M[5],M[4]):O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[6]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 66:O(E,M[5],M[1],M[4]),O(E+1,M[5],M[3],M[6]),O(E+A,M[5],M[7],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 24:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[3],M[2]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 7:case 39:case 135:L(E,M[5],M[4]),L(E+1,M[5],M[6]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[6],M[8]);break;case 148:case 149:case 180:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[8]);break;case 224:case 228:case 225:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[4]),L(E+A+1,M[5],M[6]);break;case 41:case 169:case 45:L(E,M[5],M[2]),O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 22:case 54:O(E,M[5],M[1],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[8]);break;case 208:case 209:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[2]),O(E+A,M[5],M[7],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 104:case 108:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 11:case 139:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[6]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 19:case 51:y(M[2],M[6])?(L(E,M[5],M[4]),L(E+1,M[5],M[3])):(P(E,M[5],M[2],M[4]),S(E+1,M[5],M[2],M[6])),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[8]);break;case 146:case 178:O(E,M[5],M[1],M[4]),y(M[2],M[6])?(L(E+1,M[5],M[3]),L(E+A+1,M[5],M[8])):(S(E+1,M[5],M[2],M[6]),P(E+A+1,M[5],M[6],M[8])),O(E+A,M[5],M[8],M[4]);break;case 84:case 85:O(E,M[5],M[4],M[2]),y(M[6],M[8])?(L(E+1,M[5],M[2]),L(E+A+1,M[5],M[9])):(P(E+1,M[5],M[6],M[2]),S(E+A+1,M[5],M[6],M[8])),O(E+A,M[5],M[7],M[4]);break;case 112:case 113:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[2]),y(M[6],M[8])?(L(E+A,M[5],M[4]),L(E+A+1,M[5],M[9])):(P(E+A,M[5],M[8],M[4]),S(E+A+1,M[5],M[6],M[8]));break;case 200:case 204:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?(L(E+A,M[5],M[7]),L(E+A+1,M[5],M[6])):(S(E+A,M[5],M[8],M[4]),P(E+A+1,M[5],M[8],M[6]));break;case 73:case 77:y(M[8],M[4])?(L(E,M[5],M[2]),L(E+A,M[5],M[7])):(P(E,M[5],M[4],M[2]),S(E+A,M[5],M[8],M[4])),O(E+1,M[5],M[2],M[6]),O(E+A+1,M[5],M[9],M[6]);break;case 42:case 170:y(M[4],M[2])?(L(E,M[5],M[4]),L(E+A,M[5],M[8])):(S(E,M[5],M[4],M[2]),P(E+A,M[5],M[4],M[8])),O(E+1,M[5],M[3],M[6]),O(E+A+1,M[5],M[6],M[8]);break;case 14:case 142:y(M[4],M[2])?(L(E,M[5],M[4]),L(E+1,M[5],M[6])):(S(E,M[5],M[4],M[2]),P(E+1,M[5],M[2],M[6])),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 67:L(E,M[5],M[4]),O(E+1,M[5],M[3],M[6]),O(E+A,M[5],M[7],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 70:O(E,M[5],M[1],M[4]),L(E+1,M[5],M[6]),O(E+A,M[5],M[7],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 28:O(E,M[5],M[1],M[2]),L(E+1,M[5],M[2]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 152:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[3],M[2]),O(E+A,M[5],M[7],M[8]),L(E+A+1,M[5],M[8]);break;case 194:O(E,M[5],M[1],M[4]),O(E+1,M[5],M[3],M[6]),O(E+A,M[5],M[7],M[4]),L(E+A+1,M[5],M[6]);break;case 98:O(E,M[5],M[1],M[4]),O(E+1,M[5],M[3],M[6]),L(E+A,M[5],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 56:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[3],M[2]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 25:L(E,M[5],M[2]),O(E+1,M[5],M[3],M[2]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 26:case 31:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 82:case 214:O(E,M[5],M[1],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 88:case 248:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[3],M[2]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 74:case 107:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 27:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[3]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 86:O(E,M[5],M[1],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[4]),L(E+A+1,M[5],M[9]);break;case 216:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[3],M[2]),L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 106:L(E,M[5],M[4]),O(E+1,M[5],M[3],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 30:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 210:O(E,M[5],M[1],M[4]),L(E+1,M[5],M[3]),O(E+A,M[5],M[7],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 120:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[3],M[2]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[9]);break;case 75:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[6]),L(E+A,M[5],M[7]),O(E+A+1,M[5],M[9],M[6]);break;case 29:L(E,M[5],M[2]),L(E+1,M[5],M[2]),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 198:O(E,M[5],M[1],M[4]),L(E+1,M[5],M[6]),O(E+A,M[5],M[7],M[4]),L(E+A+1,M[5],M[6]);break;case 184:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[3],M[2]),L(E+A,M[5],M[8]),L(E+A+1,M[5],M[8]);break;case 99:L(E,M[5],M[4]),O(E+1,M[5],M[3],M[6]),L(E+A,M[5],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 57:L(E,M[5],M[2]),O(E+1,M[5],M[3],M[2]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 71:L(E,M[5],M[4]),L(E+1,M[5],M[6]),O(E+A,M[5],M[7],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 156:O(E,M[5],M[1],M[2]),L(E+1,M[5],M[2]),O(E+A,M[5],M[7],M[8]),L(E+A+1,M[5],M[8]);break;case 226:O(E,M[5],M[1],M[4]),O(E+1,M[5],M[3],M[6]),L(E+A,M[5],M[4]),L(E+A+1,M[5],M[6]);break;case 60:O(E,M[5],M[1],M[2]),L(E+1,M[5],M[2]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 195:L(E,M[5],M[4]),O(E+1,M[5],M[3],M[6]),O(E+A,M[5],M[7],M[4]),L(E+A+1,M[5],M[6]);break;case 102:O(E,M[5],M[1],M[4]),L(E+1,M[5],M[6]),L(E+A,M[5],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 153:L(E,M[5],M[2]),O(E+1,M[5],M[3],M[2]),O(E+A,M[5],M[7],M[8]),L(E+A+1,M[5],M[8]);break;case 58:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 83:L(E,M[5],M[4]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 92:O(E,M[5],M[1],M[2]),L(E+1,M[5],M[2]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 202:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[6]);break;case 78:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),L(E+1,M[5],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 154:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[8]),L(E+A+1,M[5],M[8]);break;case 114:O(E,M[5],M[1],M[4]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 89:L(E,M[5],M[2]),O(E+1,M[5],M[3],M[2]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 90:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 55:case 23:y(M[2],M[6])?(L(E,M[5],M[4]),U[E+1]=M[5]):(P(E,M[5],M[2],M[4]),S(E+1,M[5],M[2],M[6])),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[8]);break;case 182:case 150:O(E,M[5],M[1],M[4]),y(M[2],M[6])?(U[E+1]=M[5],L(E+A+1,M[5],M[8])):(S(E+1,M[5],M[2],M[6]),P(E+A+1,M[5],M[6],M[8])),O(E+A,M[5],M[8],M[4]);break;case 213:case 212:O(E,M[5],M[4],M[2]),y(M[6],M[8])?(L(E+1,M[5],M[2]),U[E+A+1]=M[5]):(P(E+1,M[5],M[6],M[2]),S(E+A+1,M[5],M[6],M[8])),O(E+A,M[5],M[7],M[4]);break;case 241:case 240:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[2]),y(M[6],M[8])?(L(E+A,M[5],M[4]),U[E+A+1]=M[5]):(P(E+A,M[5],M[8],M[4]),S(E+A+1,M[5],M[6],M[8]));break;case 236:case 232:O(E,M[5],M[1],M[2]),O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?(U[E+A]=M[5],L(E+A+1,M[5],M[6])):(S(E+A,M[5],M[8],M[4]),P(E+A+1,M[5],M[8],M[6]));break;case 109:case 105:y(M[8],M[4])?(L(E,M[5],M[2]),U[E+A]=M[5]):(P(E,M[5],M[4],M[2]),S(E+A,M[5],M[8],M[4])),O(E+1,M[5],M[2],M[6]),O(E+A+1,M[5],M[9],M[6]);break;case 171:case 43:y(M[4],M[2])?(U[E]=M[5],L(E+A,M[5],M[8])):(S(E,M[5],M[4],M[2]),P(E+A,M[5],M[4],M[8])),O(E+1,M[5],M[3],M[6]),O(E+A+1,M[5],M[6],M[8]);break;case 143:case 15:y(M[4],M[2])?(U[E]=M[5],L(E+1,M[5],M[6])):(S(E,M[5],M[4],M[2]),P(E+1,M[5],M[2],M[6])),O(E+A,M[5],M[7],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 124:O(E,M[5],M[1],M[2]),L(E+1,M[5],M[2]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[9]);break;case 203:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[6]),L(E+A,M[5],M[7]),L(E+A+1,M[5],M[6]);break;case 62:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 211:L(E,M[5],M[4]),L(E+1,M[5],M[3]),O(E+A,M[5],M[7],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 118:O(E,M[5],M[1],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[4]),L(E+A+1,M[5],M[9]);break;case 217:L(E,M[5],M[2]),O(E+1,M[5],M[3],M[2]),L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 110:L(E,M[5],M[4]),L(E+1,M[5],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 155:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[3]),O(E+A,M[5],M[7],M[8]),L(E+A+1,M[5],M[8]);break;case 188:O(E,M[5],M[1],M[2]),L(E+1,M[5],M[2]),L(E+A,M[5],M[8]),L(E+A+1,M[5],M[8]);break;case 185:L(E,M[5],M[2]),O(E+1,M[5],M[3],M[2]),L(E+A,M[5],M[8]),L(E+A+1,M[5],M[8]);break;case 61:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 157:L(E,M[5],M[2]),L(E+1,M[5],M[2]),O(E+A,M[5],M[7],M[8]),L(E+A+1,M[5],M[8]);break;case 103:L(E,M[5],M[4]),L(E+1,M[5],M[6]),L(E+A,M[5],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 227:L(E,M[5],M[4]),O(E+1,M[5],M[3],M[6]),L(E+A,M[5],M[4]),L(E+A+1,M[5],M[6]);break;case 230:O(E,M[5],M[1],M[4]),L(E+1,M[5],M[6]),L(E+A,M[5],M[4]),L(E+A+1,M[5],M[6]);break;case 199:L(E,M[5],M[4]),L(E+1,M[5],M[6]),O(E+A,M[5],M[7],M[4]),L(E+A+1,M[5],M[6]);break;case 220:O(E,M[5],M[1],M[2]),L(E+1,M[5],M[2]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 158:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[8]),L(E+A+1,M[5],M[8]);break;case 234:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[6]);break;case 242:O(E,M[5],M[1],M[4]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 59:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 121:L(E,M[5],M[2]),O(E+1,M[5],M[3],M[2]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 87:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[7],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 79:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 122:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 94:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 218:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 91:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 229:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[4]),L(E+A+1,M[5],M[6]);break;case 167:L(E,M[5],M[4]),L(E+1,M[5],M[6]),O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[6],M[8]);break;case 173:L(E,M[5],M[2]),O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 181:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[8]);break;case 186:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[8]),L(E+A+1,M[5],M[8]);break;case 115:L(E,M[5],M[4]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 93:L(E,M[5],M[2]),L(E+1,M[5],M[2]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 206:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),L(E+1,M[5],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[6]);break;case 205:case 201:L(E,M[5],M[2]),O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?L(E+A,M[5],M[7]):R(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[6]);break;case 174:case 46:y(M[4],M[2])?L(E,M[5],M[4]):R(E,M[5],M[4],M[2]),L(E+1,M[5],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 179:case 147:L(E,M[5],M[4]),y(M[2],M[6])?L(E+1,M[5],M[3]):R(E+1,M[5],M[2],M[6]),O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[8]);break;case 117:case 116:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+A,M[5],M[4]),y(M[6],M[8])?L(E+A+1,M[5],M[9]):R(E+A+1,M[5],M[6],M[8]);break;case 189:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+A,M[5],M[8]),L(E+A+1,M[5],M[8]);break;case 231:L(E,M[5],M[4]),L(E+1,M[5],M[6]),L(E+A,M[5],M[4]),L(E+A+1,M[5],M[6]);break;case 126:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[9]);break;case 219:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[3]),L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 125:y(M[8],M[4])?(L(E,M[5],M[2]),U[E+A]=M[5]):(P(E,M[5],M[4],M[2]),S(E+A,M[5],M[8],M[4])),L(E+1,M[5],M[2]),L(E+A+1,M[5],M[9]);break;case 221:L(E,M[5],M[2]),y(M[6],M[8])?(L(E+1,M[5],M[2]),U[E+A+1]=M[5]):(P(E+1,M[5],M[6],M[2]),S(E+A+1,M[5],M[6],M[8])),L(E+A,M[5],M[7]);break;case 207:y(M[4],M[2])?(U[E]=M[5],L(E+1,M[5],M[6])):(S(E,M[5],M[4],M[2]),P(E+1,M[5],M[2],M[6])),L(E+A,M[5],M[7]),L(E+A+1,M[5],M[6]);break;case 238:L(E,M[5],M[4]),L(E+1,M[5],M[6]),y(M[8],M[4])?(U[E+A]=M[5],L(E+A+1,M[5],M[6])):(S(E+A,M[5],M[8],M[4]),P(E+A+1,M[5],M[8],M[6]));break;case 190:L(E,M[5],M[4]),y(M[2],M[6])?(U[E+1]=M[5],L(E+A+1,M[5],M[8])):(S(E+1,M[5],M[2],M[6]),P(E+A+1,M[5],M[6],M[8])),L(E+A,M[5],M[8]);break;case 187:y(M[4],M[2])?(U[E]=M[5],L(E+A,M[5],M[8])):(S(E,M[5],M[4],M[2]),P(E+A,M[5],M[4],M[8])),L(E+1,M[5],M[3]),L(E+A+1,M[5],M[8]);break;case 243:L(E,M[5],M[4]),L(E+1,M[5],M[3]),y(M[6],M[8])?(L(E+A,M[5],M[4]),U[E+A+1]=M[5]):(P(E+A,M[5],M[8],M[4]),S(E+A+1,M[5],M[6],M[8]));break;case 119:y(M[2],M[6])?(L(E,M[5],M[4]),U[E+1]=M[5]):(P(E,M[5],M[2],M[4]),S(E+1,M[5],M[2],M[6])),L(E+A,M[5],M[4]),L(E+A+1,M[5],M[9]);break;case 237:case 233:L(E,M[5],M[2]),O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?U[E+A]=M[5]:L(E+A,M[5],M[7]),L(E+A+1,M[5],M[6]);break;case 175:case 47:y(M[4],M[2])?U[E]=M[5]:L(E,M[5],M[4]),L(E+1,M[5],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[6],M[8]);break;case 183:case 151:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:L(E+1,M[5],M[3]),O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[8]);break;case 245:case 244:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+A,M[5],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:L(E+A+1,M[5],M[9]);break;case 250:L(E,M[5],M[4]),L(E+1,M[5],M[3]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 123:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[3]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[9]);break;case 95:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[7]),L(E+A+1,M[5],M[9]);break;case 222:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 252:O(E,M[5],M[1],M[2]),L(E+1,M[5],M[2]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:L(E+A+1,M[5],M[9]);break;case 249:L(E,M[5],M[2]),O(E+1,M[5],M[3],M[2]),y(M[8],M[4])?U[E+A]=M[5]:L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 235:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),O(E+1,M[5],M[3],M[6]),y(M[8],M[4])?U[E+A]=M[5]:L(E+A,M[5],M[7]),L(E+A+1,M[5],M[6]);break;case 111:y(M[4],M[2])?U[E]=M[5]:L(E,M[5],M[4]),L(E+1,M[5],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),O(E+A+1,M[5],M[9],M[6]);break;case 63:y(M[4],M[2])?U[E]=M[5]:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[8]),O(E+A+1,M[5],M[9],M[8]);break;case 159:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),y(M[2],M[6])?U[E+1]=M[5]:L(E+1,M[5],M[3]),O(E+A,M[5],M[7],M[8]),L(E+A+1,M[5],M[8]);break;case 215:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:L(E+1,M[5],M[3]),O(E+A,M[5],M[7],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 246:O(E,M[5],M[1],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),L(E+A,M[5],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:L(E+A+1,M[5],M[9]);break;case 254:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:L(E+A+1,M[5],M[9]);break;case 253:L(E,M[5],M[2]),L(E+1,M[5],M[2]),y(M[8],M[4])?U[E+A]=M[5]:L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:L(E+A+1,M[5],M[9]);break;case 251:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[3]),y(M[8],M[4])?U[E+A]=M[5]:L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 239:y(M[4],M[2])?U[E]=M[5]:L(E,M[5],M[4]),L(E+1,M[5],M[6]),y(M[8],M[4])?U[E+A]=M[5]:L(E+A,M[5],M[7]),L(E+A+1,M[5],M[6]);break;case 127:y(M[4],M[2])?U[E]=M[5]:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:O(E+1,M[5],M[2],M[6]),y(M[8],M[4])?U[E+A]=M[5]:O(E+A,M[5],M[8],M[4]),L(E+A+1,M[5],M[9]);break;case 191:y(M[4],M[2])?U[E]=M[5]:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:L(E+1,M[5],M[3]),L(E+A,M[5],M[8]),L(E+A+1,M[5],M[8]);break;case 223:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),y(M[2],M[6])?U[E+1]=M[5]:L(E+1,M[5],M[3]),L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:O(E+A+1,M[5],M[6],M[8]);break;case 247:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:L(E+1,M[5],M[3]),L(E+A,M[5],M[4]),y(M[6],M[8])?U[E+A+1]=M[5]:L(E+A+1,M[5],M[9]);break;case 255:y(M[4],M[2])?U[E]=M[5]:L(E,M[5],M[4]),y(M[2],M[6])?U[E+1]=M[5]:L(E+1,M[5],M[3]),y(M[8],M[4])?U[E+A]=M[5]:L(E+A,M[5],M[7]),y(M[6],M[8])?U[E+A+1]=M[5]:L(E+A+1,M[5],M[9])}p++,E+=2}E+=A}},A=function(a,s){var r,m,D,I,x,C,H,M=[],A=3*a,E=0,p=0,y=f,q=h,z=u,L=d,O=g,P=v,R=w,S=l,T=e,U=c,j=b,B=k,F=t,G=n,J=i,K=o;for(m=0;s>m;m++){for(I=m>0?-a:0,x=s-1>m?a:0,r=0;a>r;r++){M[2]=T[p+I],M[5]=T[p],M[8]=T[p+x],r>0?(M[1]=T[p+I-1],M[4]=T[p-1],M[7]=T[p+x-1]):(M[1]=M[2],M[4]=M[5],M[7]=M[8]),a-1>r?(M[3]=T[p+I+1],M[6]=T[p+1],M[9]=T[p+x+1]):(M[3]=M[2],M[6]=M[5],M[9]=M[8]);var N=0,Q=1;for(C=z(M[5]),D=1;10>D;D++)5!==D&&(M[D]!==M[5]&&(H=z(M[D]),(q.abs((C&j)-(H&j))>G||q.abs((C&B)-(H&B))>J||q.abs((C&F)-(H&F))>K)&&(N|=Q)),Q<<=1);switch(N){case 0:case 1:case 4:case 32:case 128:case 5:case 132:case 160:case 33:case 129:case 36:case 133:case 164:case 161:case 37:case 165:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 2:case 34:case 130:case 162:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 16:case 17:case 48:case 49:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 64:case 65:case 68:case 69:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 8:case 12:case 136:case 140:L(E,M[5],M[1]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 3:case 35:case 131:case 163:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 6:case 38:case 134:case 166:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 20:case 21:case 52:case 53:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 144:case 145:case 176:case 177:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 192:case 193:case 196:case 197:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 96:case 97:case 100:case 101:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 40:case 44:case 168:case 172:L(E,M[5],M[1]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 9:case 13:case 137:case 141:L(E,M[5],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 18:case 50:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],L(E+2,M[5],M[3]),U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 80:case 81:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9])):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 72:case 76:L(E,M[5],M[1]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?(U[E+A]=M[5],L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 10:case 138:y(M[4],M[2])?(L(E,M[5],M[1]),U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 66:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 24:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 7:case 39:case 135:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 148:case 149:case 180:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 224:case 228:case 225:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 41:case 169:case 45:L(E,M[5],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 22:case 54:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 208:case 209:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 104:case 108:L(E,M[5],M[1]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 11:case 139:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 19:case 51:y(M[2],M[6])?(L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[3]),U[E+A+2]=M[5]):(O(E,M[5],M[4],M[2]),L(E+1,M[2],M[5]),S(E+2,M[2],M[6]),L(E+A+2,M[5],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 146:case 178:y(M[2],M[6])?(U[E+1]=M[5],L(E+2,M[5],M[3]),U[E+A+2]=M[5],L(E+(A<<1)+2,M[5],M[8])):(L(E+1,M[5],M[2]),S(E+2,M[2],M[6]),L(E+A+2,M[6],M[5]),O(E+(A<<1)+2,M[5],M[6],M[8])),L(E,M[5],M[1]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]);break;case 84:case 85:y(M[6],M[8])?(L(E+2,M[5],M[2]),U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9])):(O(E+2,M[5],M[2],M[6]),L(E+A+2,M[6],M[5]),L(E+(A<<1)+1,M[5],M[8]),S(E+(A<<1)+2,M[6],M[8])),O(E,M[5],M[4],M[2]), +L(E+1,M[5],M[2]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]);break;case 112:case 113:y(M[6],M[8])?(U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9])):(L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[8],M[5]),S(E+(A<<1)+2,M[6],M[8])),O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5];break;case 200:case 204:y(M[8],M[4])?(U[E+A]=M[5],L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6])):(L(E+A,M[5],M[4]),S(E+(A<<1),M[8],M[4]),L(E+(A<<1)+1,M[8],M[5]),O(E+(A<<1)+2,M[5],M[6],M[8])),L(E,M[5],M[1]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]);break;case 73:case 77:y(M[8],M[4])?(L(E,M[5],M[2]),U[E+A]=M[5],L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5]):(O(E,M[5],M[4],M[2]),L(E+A,M[4],M[5]),S(E+(A<<1),M[8],M[4]),L(E+(A<<1)+1,M[5],M[8])),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1)+2,M[5],M[9]);break;case 42:case 170:y(M[4],M[2])?(L(E,M[5],M[1]),U[E+1]=M[5],U[E+A]=M[5],L(E+(A<<1),M[5],M[8])):(S(E,M[4],M[2]),L(E+1,M[5],M[2]),L(E+A,M[4],M[5]),O(E+(A<<1),M[5],M[8],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 14:case 142:y(M[4],M[2])?(L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5]):(S(E,M[4],M[2]),L(E+1,M[2],M[5]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4])),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 67:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 70:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 28:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 152:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 194:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 98:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 56:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 25:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 26:case 31:y(M[4],M[2])?(U[E]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+A,M[5],M[4])),U[E+1]=M[5],y(M[2],M[6])?(U[E+2]=M[5],U[E+A+2]=M[5]):(R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 82:case 214:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 88:case 248:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A+1]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4])),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 74:case 107:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2])),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?(U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 27:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 86:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 216:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 106:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 30:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A]=M[5],U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 210:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 120:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 75:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 29:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 198:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 184:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 99:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 57:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 71:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 156:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 226:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 60:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 195:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 102:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 153:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 58:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 83:L(E,M[5],M[4]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 92:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 202:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 78:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 154:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 114:L(E,M[5],M[1]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 89:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 90:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 55:case 23:y(M[2],M[6])?(L(E,M[5],M[4]),U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(O(E,M[5],M[4],M[2]),L(E+1,M[2],M[5]),S(E+2,M[2],M[6]),L(E+A+2,M[5],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 182:case 150:y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5],L(E+(A<<1)+2,M[5],M[8])):(L(E+1,M[5],M[2]),S(E+2,M[2],M[6]),L(E+A+2,M[6],M[5]),O(E+(A<<1)+2,M[5],M[6],M[8])),L(E,M[5],M[1]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]);break;case 213:case 212:y(M[6],M[8])?(L(E+2,M[5],M[2]),U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(O(E+2,M[5],M[2],M[6]),L(E+A+2,M[6],M[5]),L(E+(A<<1)+1,M[5],M[8]),S(E+(A<<1)+2,M[6],M[8])),O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]);break;case 241:case 240:y(M[6],M[8])?(U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[8],M[5]),S(E+(A<<1)+2,M[6],M[8])),O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5];break;case 236:case 232:y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6])):(L(E+A,M[5],M[4]),S(E+(A<<1),M[8],M[4]),L(E+(A<<1)+1,M[8],M[5]),O(E+(A<<1)+2,M[5],M[6],M[8])),L(E,M[5],M[1]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]);break;case 109:case 105:y(M[8],M[4])?(L(E,M[5],M[2]),U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(O(E,M[5],M[4],M[2]),L(E+A,M[4],M[5]),S(E+(A<<1),M[8],M[4]),L(E+(A<<1)+1,M[5],M[8])),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1)+2,M[5],M[9]);break;case 171:case 43:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5],L(E+(A<<1),M[5],M[8])):(S(E,M[4],M[2]),L(E+1,M[5],M[2]),L(E+A,M[4],M[5]),O(E+(A<<1),M[5],M[8],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 143:case 15:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5]):(S(E,M[4],M[2]),L(E+1,M[2],M[5]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4])),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 124:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 203:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 62:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A]=M[5],U[E+A+1]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 211:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 118:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 217:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 110:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 155:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 188:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 185:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 61:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 157:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 103:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 227:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 230:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 199:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 220:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 158:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A]=M[5],U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 234:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[6]);break;case 242:L(E,M[5],M[1]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[4]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 59:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 121:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 87:L(E,M[5],M[4]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 79:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),L(E+2,M[5],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 122:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 94:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A]=M[5],U[E+A+1]=M[5],y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 218:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 91:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 229:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 167:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 173:L(E,M[5],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 181:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 186:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 115:L(E,M[5],M[4]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 93:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 206:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 205:case 201:L(E,M[5],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?L(E+(A<<1),M[5],M[7]):O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 174:case 46:y(M[4],M[2])?L(E,M[5],M[1]):O(E,M[5],M[4],M[2]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 179:case 147:L(E,M[5],M[4]),U[E+1]=M[5],y(M[2],M[6])?L(E+2,M[5],M[3]):O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 117:case 116:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?L(E+(A<<1)+2,M[5],M[9]):O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 189:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 231:L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 126:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A+1]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 219:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 125:y(M[8],M[4])?(L(E,M[5],M[2]),U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(O(E,M[5],M[4],M[2]),L(E+A,M[4],M[5]),S(E+(A<<1),M[8],M[4]),L(E+(A<<1)+1,M[5],M[8])),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 221:y(M[6],M[8])?(L(E+2,M[5],M[2]),U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(O(E+2,M[5],M[2],M[6]),L(E+A+2,M[6],M[5]),L(E+(A<<1)+1,M[5],M[8]),S(E+(A<<1)+2,M[6],M[8])),L(E,M[5],M[2]),L(E+1,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]);break;case 207:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5]):(S(E,M[4],M[2]),L(E+1,M[2],M[5]),O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4])),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 238:y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6])):(L(E+A,M[5],M[4]),S(E+(A<<1),M[8],M[4]),L(E+(A<<1)+1,M[8],M[5]),O(E+(A<<1)+2,M[5],M[6],M[8])),L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A+1]=M[5],L(E+A+2,M[5],M[6]);break;case 190:y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5],L(E+(A<<1)+2,M[5],M[8])):(L(E+1,M[5],M[2]),S(E+2,M[2],M[6]),L(E+A+2,M[6],M[5]),O(E+(A<<1)+2,M[5],M[6],M[8])),L(E,M[5],M[1]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]);break;case 187:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5],L(E+(A<<1),M[5],M[8])):(S(E,M[4],M[2]),L(E+1,M[5],M[2]),L(E+A,M[4],M[5]),O(E+(A<<1),M[5],M[8],M[4])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 243:y(M[6],M[8])?(U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(L(E+A+2,M[5],M[6]),O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[8],M[5]),S(E+(A<<1)+2,M[6],M[8])),L(E,M[5],M[4]),U[E+1]=M[5],L(E+2,M[5],M[3]),L(E+A,M[5],M[4]),U[E+A+1]=M[5];break;case 119:y(M[2],M[6])?(L(E,M[5],M[4]),U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(O(E,M[5],M[4],M[2]),L(E+1,M[2],M[5]),S(E+2,M[2],M[6]),L(E+A+2,M[5],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 237:case 233:L(E,M[5],M[2]),L(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?U[E+(A<<1)]=M[5]:O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 175:case 47:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 183:case 151:L(E,M[5],M[4]),U[E+1]=M[5],y(M[2],M[6])?U[E+2]=M[5]:O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],O(E+(A<<1),M[5],M[8],M[4]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 245:case 244:O(E,M[5],M[4],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?U[E+(A<<1)+2]=M[5]:O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 250:L(E,M[5],M[1]),U[E+1]=M[5],L(E+2,M[5],M[3]),U[E+A+1]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4])),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 123:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2])),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?(U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 95:y(M[4],M[2])?(U[E]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+A,M[5],M[4])),U[E+1]=M[5],y(M[2],M[6])?(U[E+2]=M[5],U[E+A+2]=M[5]):(R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[9]);break;case 222:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6])),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 252:L(E,M[5],M[1]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4])),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?U[E+(A<<1)+2]=M[5]:O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 249:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],y(M[8],M[4])?U[E+(A<<1)]=M[5]:O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 235:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2])),L(E+2,M[5],M[3]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?U[E+(A<<1)]=M[5]:O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 111:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?(U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 63:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?(U[E+2]=M[5],U[E+A+2]=M[5]):(R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A]=M[5],U[E+A+1]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[9]);break;case 159:y(M[4],M[2])?(U[E]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+A,M[5],M[4])),U[E+1]=M[5],y(M[2],M[6])?U[E+2]=M[5]:O(E+2,M[5],M[2],M[6]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 215:L(E,M[5],M[4]),U[E+1]=M[5],y(M[2],M[6])?U[E+2]=M[5]:O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 246:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6])),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?U[E+(A<<1)+2]=M[5]:O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 254:L(E,M[5],M[1]),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5]):(P(E+1,M[5],M[2]),R(E+2,M[5],M[2],M[6])),U[E+A+1]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5]):(P(E+A,M[5],M[4]),R(E+(A<<1),M[5],M[8],M[4])),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),P(E+(A<<1)+1,M[5],M[8]),O(E+(A<<1)+2,M[5],M[6],M[8]));break;case 253:L(E,M[5],M[2]),L(E+1,M[5],M[2]),L(E+2,M[5],M[2]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?U[E+(A<<1)]=M[5]:O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?U[E+(A<<1)+2]=M[5]:O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 251:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5]):(R(E,M[5],M[4],M[2]),P(E+1,M[5],M[2])),L(E+2,M[5],M[3]),U[E+A+1]=M[5],y(M[8],M[4])?(U[E+A]=M[5],U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(P(E+A,M[5],M[4]),O(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),y(M[6],M[8])?(U[E+A+2]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+A+2,M[5],M[6]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 239:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),U[E+1]=M[5],L(E+2,M[5],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],L(E+A+2,M[5],M[6]),y(M[8],M[4])?U[E+(A<<1)]=M[5]:O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],L(E+(A<<1)+2,M[5],M[6]);break;case 127:y(M[4],M[2])?(U[E]=M[5],U[E+1]=M[5],U[E+A]=M[5]):(O(E,M[5],M[4],M[2]),P(E+1,M[5],M[2]),P(E+A,M[5],M[4])),y(M[2],M[6])?(U[E+2]=M[5],U[E+A+2]=M[5]):(R(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A+1]=M[5],y(M[8],M[4])?(U[E+(A<<1)]=M[5],U[E+(A<<1)+1]=M[5]):(R(E+(A<<1),M[5],M[8],M[4]),P(E+(A<<1)+1,M[5],M[8])),L(E+(A<<1)+2,M[5],M[9]);break;case 191:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?U[E+2]=M[5]:O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[8]),L(E+(A<<1)+1,M[5],M[8]),L(E+(A<<1)+2,M[5],M[8]);break;case 223:y(M[4],M[2])?(U[E]=M[5],U[E+A]=M[5]):(R(E,M[5],M[4],M[2]),P(E+A,M[5],M[4])),y(M[2],M[6])?(U[E+1]=M[5],U[E+2]=M[5],U[E+A+2]=M[5]):(P(E+1,M[5],M[2]),O(E+2,M[5],M[2],M[6]),P(E+A+2,M[5],M[6])),U[E+A+1]=M[5],L(E+(A<<1),M[5],M[7]),y(M[6],M[8])?(U[E+(A<<1)+1]=M[5],U[E+(A<<1)+2]=M[5]):(P(E+(A<<1)+1,M[5],M[8]),R(E+(A<<1)+2,M[5],M[6],M[8]));break;case 247:L(E,M[5],M[4]),U[E+1]=M[5],y(M[2],M[6])?U[E+2]=M[5]:O(E+2,M[5],M[2],M[6]),L(E+A,M[5],M[4]),U[E+A+1]=M[5],U[E+A+2]=M[5],L(E+(A<<1),M[5],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?U[E+(A<<1)+2]=M[5]:O(E+(A<<1)+2,M[5],M[6],M[8]);break;case 255:y(M[4],M[2])?U[E]=M[5]:O(E,M[5],M[4],M[2]),U[E+1]=M[5],y(M[2],M[6])?U[E+2]=M[5]:O(E+2,M[5],M[2],M[6]),U[E+A]=M[5],U[E+A+1]=M[5],U[E+A+2]=M[5],y(M[8],M[4])?U[E+(A<<1)]=M[5]:O(E+(A<<1),M[5],M[8],M[4]),U[E+(A<<1)+1]=M[5],y(M[6],M[8])?U[E+(A<<1)+2]=M[5]:O(E+(A<<1)+2,M[5],M[6],M[8])}p++,E+=3}E+=A<<1}},E=function(a,s){ +var r,w,x,C,H,M,A,E=[],p=a<<2,y=0,q=0,z=f,L=h,O=u,P=d,R=g,S=v,T=l,U=m,j=D,B=I,F=e,G=c,J=b,K=k,N=t,Q=n,V=i,W=o;for(w=0;s>w;w++){for(C=w>0?-a:0,H=s-1>w?a:0,r=0;a>r;r++){E[2]=F[q+C],E[5]=F[q],E[8]=F[q+H],r>0?(E[1]=F[q+C-1],E[4]=F[q-1],E[7]=F[q+H-1]):(E[1]=E[2],E[4]=E[5],E[7]=E[8]),a-1>r?(E[3]=F[q+C+1],E[6]=F[q+1],E[9]=F[q+H+1]):(E[3]=E[2],E[6]=E[5],E[9]=E[8]);var X=0,Y=1;for(M=O(E[5]),x=1;10>x;x++)5!==x&&(E[x]!==E[5]&&(A=O(E[x]),(L.abs((M&J)-(A&J))>Q||L.abs((M&K)-(A&K))>V||L.abs((M&N)-(A&N))>W)&&(X|=Y)),Y<<=1);switch(X){case 0:case 1:case 4:case 32:case 128:case 5:case 132:case 160:case 33:case 129:case 36:case 133:case 164:case 161:case 37:case 165:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 2:case 34:case 130:case 162:B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 16:case 17:case 48:case 49:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 64:case 65:case 68:case 69:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 8:case 12:case 136:case 140:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 3:case 35:case 131:case 163:B(y,E[5],E[4]),S(y+1,E[5],E[4]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 6:case 38:case 134:case 166:B(y,E[5],E[1]),P(y+1,E[5],E[1]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 20:case 21:case 52:case 53:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 144:case 145:case 176:case 177:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 192:case 193:case 196:case 197:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 96:case 97:case 100:case 101:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 40:case 44:case 168:case 172:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 9:case 13:case 137:case 141:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 18:case 50:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),G[y+p+2]=E[5],T(y+p+3,E[6],E[5])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 80:case 81:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 72:case 76:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(T(y+(p<<1),E[4],E[5]),G[y+(p<<1)+1]=E[5],T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 10:case 138:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5]),G[y+p+1]=E[5]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 66:B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 24:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 7:case 39:case 135:B(y,E[5],E[4]),S(y+1,E[5],E[4]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 148:case 149:case 180:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 224:case 228:case 225:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 41:case 169:case 45:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 22:case 54:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 208:case 209:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 104:case 108:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 11:case 139:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 19:case 51:z(E[2],E[6])?(B(y,E[5],E[4]),S(y+1,E[5],E[4]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y,E[5],E[2]),P(y+1,E[2],E[5]),B(y+2,E[2],E[6]),T(y+3,E[2],E[6]),j(y+p+2,E[5],E[6],E[2]),R(y+p+3,E[6],E[5],E[2])),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 146:case 178:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p+3,E[5],E[8])):(R(y+2,E[2],E[5],E[6]),T(y+3,E[2],E[6]),j(y+p+2,E[5],E[6],E[2]),B(y+p+3,E[6],E[2]),P(y+(p<<1)+3,E[6],E[5]),P(y+3*p+3,E[5],E[6])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),B(y+3*p+2,E[5],E[8]);break;case 84:case 85:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),B(y+2,E[5],E[2]),z(E[6],E[8])?(B(y+3,E[5],E[2]),S(y+p+3,E[5],E[2]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(P(y+3,E[5],E[6]),P(y+p+3,E[6],E[5]),j(y+(p<<1)+2,E[5],E[6],E[8]),B(y+(p<<1)+3,E[6],E[8]),R(y+3*p+2,E[8],E[5],E[6]),T(y+3*p+3,E[8],E[6])),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[2]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 112:case 113:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(j(y+(p<<1)+2,E[5],E[6],E[8]),R(y+(p<<1)+3,E[6],E[5],E[8]),P(y+3*p,E[5],E[8]),P(y+3*p+1,E[8],E[5]),B(y+3*p+2,E[8],E[6]),T(y+3*p+3,E[8],E[6]));break;case 200:case 204:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6])):(R(y+(p<<1),E[4],E[5],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),T(y+3*p,E[8],E[4]),B(y+3*p+1,E[8],E[4]),P(y+3*p+2,E[8],E[5]),P(y+3*p+3,E[5],E[8])),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]);break;case 73:case 77:z(E[8],E[4])?(B(y,E[5],E[2]),S(y+p,E[5],E[2]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y,E[5],E[4]),P(y+p,E[4],E[5]),B(y+(p<<1),E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),T(y+3*p,E[8],E[4]),R(y+3*p+1,E[8],E[5],E[4])),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),S(y+p+1,E[5],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 42:case 170:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+(p<<1),E[5],E[8]),B(y+3*p,E[5],E[8])):(T(y,E[2],E[4]),R(y+1,E[2],E[5],E[4]),B(y+p,E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),P(y+(p<<1),E[4],E[5]),P(y+3*p,E[5],E[4])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),S(y+(p<<1)+1,E[5],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 14:case 142:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(T(y,E[2],E[4]),B(y+1,E[2],E[4]),P(y+2,E[2],E[5]),P(y+3,E[5],E[2]),R(y+p,E[4],E[5],E[2]),j(y+p+1,E[5],E[4],E[2])),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 67:B(y,E[5],E[4]),S(y+1,E[5],E[4]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 70:B(y,E[5],E[1]),P(y+1,E[5],E[1]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 28:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 152:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 194:B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 98:B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 56:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 25:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 26:case 31:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),G[y+p+1]=E[5],G[y+p+2]=E[5],P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 82:case 214:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 88:case 248:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6]));break;case 74:case 107:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 27:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 86:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 216:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 106:B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 30:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 210:B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 120:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 75:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 29:B(y,E[5],E[2]),B(y+1,E[5],E[2]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 198:B(y,E[5],E[1]),P(y+1,E[5],E[1]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 184:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 99:B(y,E[5],E[4]),S(y+1,E[5],E[4]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 57:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 71:B(y,E[5],E[4]),S(y+1,E[5],E[4]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 156:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 226:B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 60:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 195:B(y,E[5],E[4]),S(y+1,E[5],E[4]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 102:B(y,E[5],E[1]),P(y+1,E[5],E[1]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 153:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 58:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 83:B(y,E[5],E[4]),S(y+1,E[5],E[4]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 92:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6]));break;case 202:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 78:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 154:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 114:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6])),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]);break;case 89:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6]));break;case 90:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]), +P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6]));break;case 55:case 23:z(E[2],E[6])?(B(y,E[5],E[4]),S(y+1,E[5],E[4]),G[y+2]=E[5],G[y+3]=E[5],G[y+p+2]=E[5],G[y+p+3]=E[5]):(P(y,E[5],E[2]),P(y+1,E[2],E[5]),B(y+2,E[2],E[6]),T(y+3,E[2],E[6]),j(y+p+2,E[5],E[6],E[2]),R(y+p+3,E[6],E[5],E[2])),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 182:case 150:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+2]=E[5],G[y+p+3]=E[5],S(y+(p<<1)+3,E[5],E[8]),B(y+3*p+3,E[5],E[8])):(R(y+2,E[2],E[5],E[6]),T(y+3,E[2],E[6]),j(y+p+2,E[5],E[6],E[2]),B(y+p+3,E[6],E[2]),P(y+(p<<1)+3,E[6],E[5]),P(y+3*p+3,E[5],E[6])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),B(y+3*p+2,E[5],E[8]);break;case 213:case 212:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),B(y+2,E[5],E[2]),z(E[6],E[8])?(B(y+3,E[5],E[2]),S(y+p+3,E[5],E[2]),G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(P(y+3,E[5],E[6]),P(y+p+3,E[6],E[5]),j(y+(p<<1)+2,E[5],E[6],E[8]),B(y+(p<<1)+3,E[6],E[8]),R(y+3*p+2,E[8],E[5],E[6]),T(y+3*p+3,E[8],E[6])),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[2]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 241:case 240:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),z(E[6],E[8])?(G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(j(y+(p<<1)+2,E[5],E[6],E[8]),R(y+(p<<1)+3,E[6],E[5],E[8]),P(y+3*p,E[5],E[8]),P(y+3*p+1,E[8],E[5]),B(y+3*p+2,E[8],E[6]),T(y+3*p+3,E[8],E[6]));break;case 236:case 232:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5],S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6])):(R(y+(p<<1),E[4],E[5],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),T(y+3*p,E[8],E[4]),B(y+3*p+1,E[8],E[4]),P(y+3*p+2,E[8],E[5]),P(y+3*p+3,E[5],E[8])),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]);break;case 109:case 105:z(E[8],E[4])?(B(y,E[5],E[2]),S(y+p,E[5],E[2]),G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(P(y,E[5],E[4]),P(y+p,E[4],E[5]),B(y+(p<<1),E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),T(y+3*p,E[8],E[4]),R(y+3*p+1,E[8],E[5],E[4])),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),S(y+p+1,E[5],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 171:case 43:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5],G[y+p+1]=E[5],S(y+(p<<1),E[5],E[8]),B(y+3*p,E[5],E[8])):(T(y,E[2],E[4]),R(y+1,E[2],E[5],E[4]),B(y+p,E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),P(y+(p<<1),E[4],E[5]),P(y+3*p,E[5],E[4])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),S(y+(p<<1)+1,E[5],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 143:case 15:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),G[y+p]=E[5],G[y+p+1]=E[5]):(T(y,E[2],E[4]),B(y+1,E[2],E[4]),P(y+2,E[2],E[5]),P(y+3,E[5],E[2]),R(y+p,E[4],E[5],E[2]),j(y+p+1,E[5],E[4],E[2])),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 124:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 203:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 62:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 211:B(y,E[5],E[4]),S(y+1,E[5],E[4]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 118:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 217:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 110:B(y,E[5],E[1]),P(y+1,E[5],E[1]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 155:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 188:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 185:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 61:B(y,E[5],E[2]),B(y+1,E[5],E[2]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 157:B(y,E[5],E[2]),B(y+1,E[5],E[2]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 103:B(y,E[5],E[4]),S(y+1,E[5],E[4]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 227:B(y,E[5],E[4]),S(y+1,E[5],E[4]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 230:B(y,E[5],E[1]),P(y+1,E[5],E[1]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 199:B(y,E[5],E[4]),S(y+1,E[5],E[4]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 220:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6]));break;case 158:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),G[y+p+2]=E[5],P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 234:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 242:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]);break;case 59:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),G[y+p+1]=E[5],S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 121:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6]));break;case 87:B(y,E[5],E[4]),S(y+1,E[5],E[4]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),G[y+p+2]=E[5],U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 79:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),G[y+p+1]=E[5],S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 122:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6]));break;case 94:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),G[y+p+2]=E[5],z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6]));break;case 218:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6]));break;case 91:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),G[y+p+1]=E[5],z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6]));break;case 229:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 167:B(y,E[5],E[4]),S(y+1,E[5],E[4]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 173:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 181:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 186:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 115:B(y,E[5],E[4]),S(y+1,E[5],E[4]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6])),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]);break;case 93:B(y,E[5],E[2]),B(y+1,E[5],E[2]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6]));break;case 206:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 205:case 201:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),z(E[8],E[4])?(P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7])):(P(y+(p<<1),E[5],E[4]),G[y+(p<<1)+1]=E[5],R(y+3*p,E[5],E[8],E[4]),P(y+3*p+1,E[5],E[8])),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 174:case 46:z(E[4],E[2])?(B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1])):(R(y,E[5],E[2],E[4]),P(y+1,E[5],E[2]),P(y+p,E[5],E[4]),G[y+p+1]=E[5]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 179:case 147:B(y,E[5],E[4]),S(y+1,E[5],E[4]),z(E[2],E[6])?(P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3])):(P(y+2,E[5],E[2]),R(y+3,E[5],E[2],E[6]),G[y+p+2]=E[5],P(y+p+3,E[5],E[6])),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 117:case 116:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),z(E[6],E[8])?(S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9])):(G[y+(p<<1)+2]=E[5],P(y+(p<<1)+3,E[5],E[6]),P(y+3*p+2,E[5],E[8]),R(y+3*p+3,E[5],E[8],E[6])),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]);break;case 189:B(y,E[5],E[2]),B(y+1,E[5],E[2]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 231:B(y,E[5],E[4]),S(y+1,E[5],E[4]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 126:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 219:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 125:z(E[8],E[4])?(B(y,E[5],E[2]),S(y+p,E[5],E[2]),G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(P(y,E[5],E[4]),P(y+p,E[4],E[5]),B(y+(p<<1),E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),T(y+3*p,E[8],E[4]),R(y+3*p+1,E[8],E[5],E[4])),B(y+1,E[5],E[2]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 221:B(y,E[5],E[2]),B(y+1,E[5],E[2]),B(y+2,E[5],E[2]),z(E[6],E[8])?(B(y+3,E[5],E[2]),S(y+p+3,E[5],E[2]),G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(P(y+3,E[5],E[6]),P(y+p+3,E[6],E[5]),j(y+(p<<1)+2,E[5],E[6],E[8]),B(y+(p<<1)+3,E[6],E[8]),R(y+3*p+2,E[8],E[5],E[6]),T(y+3*p+3,E[8],E[6])),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[2]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 207:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),G[y+p]=E[5],G[y+p+1]=E[5]):(T(y,E[2],E[4]),B(y+1,E[2],E[4]),P(y+2,E[2],E[5]),P(y+3,E[5],E[2]),R(y+p,E[4],E[5],E[2]),j(y+p+1,E[5],E[4],E[2])),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 238:B(y,E[5],E[1]),P(y+1,E[5],E[1]),S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5],S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6])):(R(y+(p<<1),E[4],E[5],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),T(y+3*p,E[8],E[4]),B(y+3*p+1,E[8],E[4]),P(y+3*p+2,E[8],E[5]),P(y+3*p+3,E[5],E[8])),S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]);break;case 190:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+2]=E[5],G[y+p+3]=E[5],S(y+(p<<1)+3,E[5],E[8]),B(y+3*p+3,E[5],E[8])):(R(y+2,E[2],E[5],E[6]),T(y+3,E[2],E[6]),j(y+p+2,E[5],E[6],E[2]),B(y+p+3,E[6],E[2]),P(y+(p<<1)+3,E[6],E[5]),P(y+3*p+3,E[5],E[6])),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),B(y+3*p+2,E[5],E[8]);break;case 187:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5],G[y+p+1]=E[5],S(y+(p<<1),E[5],E[8]),B(y+3*p,E[5],E[8])):(T(y,E[2],E[4]),R(y+1,E[2],E[5],E[4]),B(y+p,E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),P(y+(p<<1),E[4],E[5]),P(y+3*p,E[5],E[4])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p+1,E[5],E[8]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 243:B(y,E[5],E[4]),S(y+1,E[5],E[4]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),z(E[6],E[8])?(G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(j(y+(p<<1)+2,E[5],E[6],E[8]),R(y+(p<<1)+3,E[6],E[5],E[8]),P(y+3*p,E[5],E[8]),P(y+3*p+1,E[8],E[5]),B(y+3*p+2,E[8],E[6]),T(y+3*p+3,E[8],E[6]));break;case 119:z(E[2],E[6])?(B(y,E[5],E[4]),S(y+1,E[5],E[4]),G[y+2]=E[5],G[y+3]=E[5],G[y+p+2]=E[5],G[y+p+3]=E[5]):(P(y,E[5],E[2]),P(y+1,E[2],E[5]),B(y+2,E[2],E[6]),T(y+3,E[2],E[6]),j(y+p+2,E[5],E[6],E[2]),R(y+p+3,E[6],E[5],E[2])),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 237:case 233:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[6]),R(y+3,E[5],E[2],E[6]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),j(y+p+2,E[5],E[6],E[2]),U(y+p+3,E[5],E[6],E[2]),G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),z(E[8],E[4])?G[y+3*p]=E[5]:R(y+3*p,E[5],E[8],E[4]),G[y+3*p+1]=E[5],S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 175:case 47:z(E[4],E[2])?G[y]=E[5]:R(y,E[5],E[2],E[4]),G[y+1]=E[5],S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),G[y+p]=E[5],G[y+p+1]=E[5],S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),j(y+(p<<1)+2,E[5],E[6],E[8]),U(y+(p<<1)+3,E[5],E[6],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[6]),R(y+3*p+3,E[5],E[8],E[6]);break;case 183:case 151:B(y,E[5],E[4]),S(y+1,E[5],E[4]),G[y+2]=E[5],z(E[2],E[6])?G[y+3]=E[5]:R(y+3,E[5],E[2],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),G[y+p+2]=E[5],G[y+p+3]=E[5],U(y+(p<<1),E[5],E[4],E[8]),j(y+(p<<1)+1,E[5],E[4],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),R(y+3*p,E[5],E[8],E[4]),U(y+3*p+1,E[5],E[8],E[4]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 245:case 244:R(y,E[5],E[2],E[4]),U(y+1,E[5],E[2],E[4]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),U(y+p,E[5],E[4],E[2]),j(y+p+1,E[5],E[4],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),G[y+3*p+2]=E[5],z(E[6],E[8])?G[y+3*p+3]=E[5]:R(y+3*p+3,E[5],E[8],E[6]);break;case 250:B(y,E[5],E[1]),P(y+1,E[5],E[1]),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6]));break;case 123:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 95:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),G[y+p+1]=E[5],G[y+p+2]=E[5],P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 222:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 252:B(y,E[5],E[1]),U(y+1,E[5],E[2],E[1]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],z(E[6],E[8])?G[y+3*p+3]=E[5]:R(y+3*p+3,E[5],E[8],E[6]);break;case 249:B(y,E[5],E[2]),B(y+1,E[5],E[2]),U(y+2,E[5],E[2],E[3]),B(y+3,E[5],E[3]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),z(E[8],E[4])?G[y+3*p]=E[5]:R(y+3*p,E[5],E[8],E[4]),G[y+3*p+1]=E[5];break;case 235:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),U(y+p+3,E[5],E[6],E[3]),G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),z(E[8],E[4])?G[y+3*p]=E[5]:R(y+3*p,E[5],E[8],E[4]),G[y+3*p+1]=E[5],S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 111:z(E[4],E[2])?G[y]=E[5]:R(y,E[5],E[2],E[4]),G[y+1]=E[5],S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),G[y+p]=E[5],G[y+p+1]=E[5],S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]), +z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),U(y+(p<<1)+3,E[5],E[6],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 63:z(E[4],E[2])?G[y]=E[5]:R(y,E[5],E[2],E[4]),G[y+1]=E[5],z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),G[y+p]=E[5],G[y+p+1]=E[5],G[y+p+2]=E[5],S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),U(y+3*p+2,E[5],E[8],E[9]),B(y+3*p+3,E[5],E[9]);break;case 159:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),G[y+2]=E[5],z(E[2],E[6])?G[y+3]=E[5]:R(y+3,E[5],E[2],E[6]),G[y+p+1]=E[5],G[y+p+2]=E[5],G[y+p+3]=E[5],P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[7]),U(y+3*p+1,E[5],E[8],E[7]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 215:B(y,E[5],E[4]),S(y+1,E[5],E[4]),G[y+2]=E[5],z(E[2],E[6])?G[y+3]=E[5]:R(y+3,E[5],E[2],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),G[y+p+2]=E[5],G[y+p+3]=E[5],U(y+(p<<1),E[5],E[4],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 246:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),U(y+p,E[5],E[4],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),G[y+3*p+2]=E[5],z(E[6],E[8])?G[y+3*p+3]=E[5]:R(y+3*p+3,E[5],E[8],E[6]);break;case 254:B(y,E[5],E[1]),P(y+1,E[5],E[1]),z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),P(y+p,E[5],E[1]),S(y+p+1,E[5],E[1]),G[y+p+2]=E[5],z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],z(E[6],E[8])?G[y+3*p+3]=E[5]:R(y+3*p+3,E[5],E[8],E[6]);break;case 253:B(y,E[5],E[2]),B(y+1,E[5],E[2]),B(y+2,E[5],E[2]),B(y+3,E[5],E[2]),S(y+p,E[5],E[2]),S(y+p+1,E[5],E[2]),S(y+p+2,E[5],E[2]),S(y+p+3,E[5],E[2]),G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],z(E[8],E[4])?G[y+3*p]=E[5]:R(y+3*p,E[5],E[8],E[4]),G[y+3*p+1]=E[5],G[y+3*p+2]=E[5],z(E[6],E[8])?G[y+3*p+3]=E[5]:R(y+3*p+3,E[5],E[8],E[6]);break;case 251:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),P(y+2,E[5],E[3]),B(y+3,E[5],E[3]),G[y+p+1]=E[5],S(y+p+2,E[5],E[3]),P(y+p+3,E[5],E[3]),G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),z(E[8],E[4])?G[y+3*p]=E[5]:R(y+3*p,E[5],E[8],E[4]),G[y+3*p+1]=E[5];break;case 239:z(E[4],E[2])?G[y]=E[5]:R(y,E[5],E[2],E[4]),G[y+1]=E[5],S(y+2,E[5],E[6]),B(y+3,E[5],E[6]),G[y+p]=E[5],G[y+p+1]=E[5],S(y+p+2,E[5],E[6]),B(y+p+3,E[5],E[6]),G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[6]),B(y+(p<<1)+3,E[5],E[6]),z(E[8],E[4])?G[y+3*p]=E[5]:R(y+3*p,E[5],E[8],E[4]),G[y+3*p+1]=E[5],S(y+3*p+2,E[5],E[6]),B(y+3*p+3,E[5],E[6]);break;case 127:z(E[4],E[2])?G[y]=E[5]:R(y,E[5],E[2],E[4]),G[y+1]=E[5],z(E[2],E[6])?(G[y+2]=E[5],G[y+3]=E[5],G[y+p+3]=E[5]):(T(y+2,E[2],E[5]),T(y+3,E[2],E[6]),T(y+p+3,E[6],E[5])),G[y+p]=E[5],G[y+p+1]=E[5],G[y+p+2]=E[5],z(E[8],E[4])?(G[y+(p<<1)]=E[5],G[y+3*p]=E[5],G[y+3*p+1]=E[5]):(T(y+(p<<1),E[4],E[5]),T(y+3*p,E[8],E[4]),T(y+3*p+1,E[8],E[5])),G[y+(p<<1)+1]=E[5],S(y+(p<<1)+2,E[5],E[9]),P(y+(p<<1)+3,E[5],E[9]),P(y+3*p+2,E[5],E[9]),B(y+3*p+3,E[5],E[9]);break;case 191:z(E[4],E[2])?G[y]=E[5]:R(y,E[5],E[2],E[4]),G[y+1]=E[5],G[y+2]=E[5],z(E[2],E[6])?G[y+3]=E[5]:R(y+3,E[5],E[2],E[6]),G[y+p]=E[5],G[y+p+1]=E[5],G[y+p+2]=E[5],G[y+p+3]=E[5],S(y+(p<<1),E[5],E[8]),S(y+(p<<1)+1,E[5],E[8]),S(y+(p<<1)+2,E[5],E[8]),S(y+(p<<1)+3,E[5],E[8]),B(y+3*p,E[5],E[8]),B(y+3*p+1,E[5],E[8]),B(y+3*p+2,E[5],E[8]),B(y+3*p+3,E[5],E[8]);break;case 223:z(E[4],E[2])?(G[y]=E[5],G[y+1]=E[5],G[y+p]=E[5]):(T(y,E[2],E[4]),T(y+1,E[2],E[5]),T(y+p,E[4],E[5])),G[y+2]=E[5],z(E[2],E[6])?G[y+3]=E[5]:R(y+3,E[5],E[2],E[6]),G[y+p+1]=E[5],G[y+p+2]=E[5],G[y+p+3]=E[5],P(y+(p<<1),E[5],E[7]),S(y+(p<<1)+1,E[5],E[7]),G[y+(p<<1)+2]=E[5],z(E[6],E[8])?(G[y+(p<<1)+3]=E[5],G[y+3*p+2]=E[5],G[y+3*p+3]=E[5]):(T(y+(p<<1)+3,E[6],E[5]),T(y+3*p+2,E[8],E[5]),T(y+3*p+3,E[8],E[6])),B(y+3*p,E[5],E[7]),P(y+3*p+1,E[5],E[7]);break;case 247:B(y,E[5],E[4]),S(y+1,E[5],E[4]),G[y+2]=E[5],z(E[2],E[6])?G[y+3]=E[5]:R(y+3,E[5],E[2],E[6]),B(y+p,E[5],E[4]),S(y+p+1,E[5],E[4]),G[y+p+2]=E[5],G[y+p+3]=E[5],B(y+(p<<1),E[5],E[4]),S(y+(p<<1)+1,E[5],E[4]),G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],B(y+3*p,E[5],E[4]),S(y+3*p+1,E[5],E[4]),G[y+3*p+2]=E[5],z(E[6],E[8])?G[y+3*p+3]=E[5]:R(y+3*p+3,E[5],E[8],E[6]);break;case 255:z(E[4],E[2])?G[y]=E[5]:R(y,E[5],E[2],E[4]),G[y+1]=E[5],G[y+2]=E[5],z(E[2],E[6])?G[y+3]=E[5]:R(y+3,E[5],E[2],E[6]),G[y+p]=E[5],G[y+p+1]=E[5],G[y+p+2]=E[5],G[y+p+3]=E[5],G[y+(p<<1)]=E[5],G[y+(p<<1)+1]=E[5],G[y+(p<<1)+2]=E[5],G[y+(p<<1)+3]=E[5],z(E[8],E[4])?G[y+3*p]=E[5]:R(y+3*p,E[5],E[8],E[4]),G[y+3*p+1]=E[5],G[y+3*p+2]=E[5],z(E[6],E[8])?G[y+3*p+3]=E[5]:R(y+3*p+3,E[5],E[8],E[6])}q++,y+=4}y+=3*p}}}(this); \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.min.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.min.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..ebdeedca64135f461888396db0a4244910e3c97c --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/hqx/hqx.min.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + hqx.min.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters.xml new file mode 100644 index 0000000000000000000000000000000000000000..1f70c69e30e49ccb0ed4af944f1f404e8f7008bd --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + imagefilters + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.js.js new file mode 100644 index 0000000000000000000000000000000000000000..7e7962d61c2a3303b659cae375ff49a4ba4b2b01 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.js.js @@ -0,0 +1,2005 @@ +//about - A Javascript Image filter library for the HTML5 Canvas tag. +//author - https://github.com/arahaya/ImageFilters.js +//demo - http://www.arahaya.com/imagefilters/ + +var ImageFilters = {}; +ImageFilters.utils = { + initSampleCanvas: function () { + var _canvas = document.createElement('canvas'), + _context = _canvas.getContext('2d'); + + _canvas.width = 0; + _canvas.height = 0; + + this.getSampleCanvas = function () { + return _canvas; + }; + this.getSampleContext = function () { + return _context; + }; + this.createImageData = (_context.createImageData) ? function (w, h) { + return _context.createImageData(w, h); + } : function (w, h) { + return new ImageData(w, h); + }; + }, + getSampleCanvas: function () { + this.initSampleCanvas(); + return this.getSampleCanvas(); + }, + getSampleContext: function () { + this.initSampleCanvas(); + return this.getSampleContext(); + }, + createImageData: function (w, h) { + this.initSampleCanvas(); + return this.createImageData(w, h); + }, + clamp: function (value) { + return value > 255 ? 255 : value < 0 ? 0 : value; + }, + buildMap: function (f) { + for (var m = [], k = 0, v; k < 256; k += 1) { + m[k] = (v = f(k)) > 255 ? 255 : v < 0 ? 0 : v | 0; + } + return m; + }, + applyMap: function (src, dst, map) { + for (var i = 0, l = src.length; i < l; i += 4) { + dst[i] = map[src[i]]; + dst[i + 1] = map[src[i + 1]]; + dst[i + 2] = map[src[i + 2]]; + dst[i + 3] = src[i + 3]; + } + }, + mapRGB: function (src, dst, func) { + this.applyMap(src, dst, this.buildMap(func)); + }, + getPixelIndex: function (x, y, width, height, edge) { + if (x < 0 || x >= width || y < 0 || y >= height) { + switch (edge) { + case 1: // clamp + x = x < 0 ? 0 : x >= width ? width - 1 : x; + y = y < 0 ? 0 : y >= height ? height - 1 : y; + break; + case 2: // wrap + x = (x %= width) < 0 ? x + width : x; + y = (y %= height) < 0 ? y + height : y; + break; + default: // transparent + return null; + } + } + return (y * width + x) << 2; + }, + getPixel: function (src, x, y, width, height, edge) { + if (x < 0 || x >= width || y < 0 || y >= height) { + switch (edge) { + case 1: // clamp + x = x < 0 ? 0 : x >= width ? width - 1 : x; + y = y < 0 ? 0 : y >= height ? height - 1 : y; + break; + case 2: // wrap + x = (x %= width) < 0 ? x + width : x; + y = (y %= height) < 0 ? y + height : y; + break; + default: // transparent + return 0; + } + } + + var i = (y * width + x) << 2; + + // ARGB + return src[i + 3] << 24 | src[i] << 16 | src[i + 1] << 8 | src[i + 2]; + }, + getPixelByIndex: function (src, i) { + return src[i + 3] << 24 | src[i] << 16 | src[i + 1] << 8 | src[i + 2]; + }, + /** + * one of the most important functions in this library. + * I want to make this as fast as possible. + */ + copyBilinear: function (src, x, y, width, height, dst, dstIndex, edge) { + var fx = x < 0 ? x - 1 | 0 : x | 0, // Math.floor(x) + fy = y < 0 ? y - 1 | 0 : y | 0, // Math.floor(y) + wx = x - fx, + wy = y - fy, + i, + nw = 0, ne = 0, sw = 0, se = 0, + cx, cy, + r, g, b, a; + + if (fx >= 0 && fx < (width - 1) && fy >= 0 && fy < (height - 1)) { + // in bounds, no edge actions required + i = (fy * width + fx) << 2; + + if (wx || wy) { + nw = src[i + 3] << 24 | src[i] << 16 | src[i + 1] << 8 | src[i + 2]; + + i += 4; + ne = src[i + 3] << 24 | src[i] << 16 | src[i + 1] << 8 | src[i + 2]; + + i = (i - 8) + (width << 2); + sw = src[i + 3] << 24 | src[i] << 16 | src[i + 1] << 8 | src[i + 2]; + + i += 4; + se = src[i + 3] << 24 | src[i] << 16 | src[i + 1] << 8 | src[i + 2]; + } else { + // no interpolation required + dst[dstIndex] = src[i]; + dst[dstIndex + 1] = src[i + 1]; + dst[dstIndex + 2] = src[i + 2]; + dst[dstIndex + 3] = src[i + 3]; + return; + } + } else { + // edge actions required + nw = this.getPixel(src, fx, fy, width, height, edge); + + if (wx || wy) { + ne = this.getPixel(src, fx + 1, fy, width, height, edge); + sw = this.getPixel(src, fx, fy + 1, width, height, edge); + se = this.getPixel(src, fx + 1, fy + 1, width, height, edge); + } else { + // no interpolation required + dst[dstIndex] = nw >> 16 & 0xFF; + dst[dstIndex + 1] = nw >> 8 & 0xFF; + dst[dstIndex + 2] = nw & 0xFF; + dst[dstIndex + 3] = nw >> 24 & 0xFF; + return; + } + } + + cx = 1 - wx; + cy = 1 - wy; + r = ((nw >> 16 & 0xFF) * cx + (ne >> 16 & 0xFF) * wx) * cy + ((sw >> 16 & 0xFF) * cx + (se >> 16 & 0xFF) * wx) * wy; + g = ((nw >> 8 & 0xFF) * cx + (ne >> 8 & 0xFF) * wx) * cy + ((sw >> 8 & 0xFF) * cx + (se >> 8 & 0xFF) * wx) * wy; + b = ((nw & 0xFF) * cx + (ne & 0xFF) * wx) * cy + ((sw & 0xFF) * cx + (se & 0xFF) * wx) * wy; + a = ((nw >> 24 & 0xFF) * cx + (ne >> 24 & 0xFF) * wx) * cy + ((sw >> 24 & 0xFF) * cx + (se >> 24 & 0xFF) * wx) * wy; + + dst[dstIndex] = r > 255 ? 255 : r < 0 ? 0 : r | 0; + dst[dstIndex + 1] = g > 255 ? 255 : g < 0 ? 0 : g | 0; + dst[dstIndex + 2] = b > 255 ? 255 : b < 0 ? 0 : b | 0; + dst[dstIndex + 3] = a > 255 ? 255 : a < 0 ? 0 : a | 0; + }, + /** + * @param r 0 <= n <= 255 + * @param g 0 <= n <= 255 + * @param b 0 <= n <= 255 + * @return Array(h, s, l) + */ + rgbToHsl: function (r, g, b) { + r /= 255; + g /= 255; + b /= 255; + +// var max = Math.max(r, g, b), +// min = Math.min(r, g, b), + var max = (r > g) ? (r > b) ? r : b : (g > b) ? g : b, + min = (r < g) ? (r < b) ? r : b : (g < b) ? g : b, + chroma = max - min, + h = 0, + s = 0, + // Lightness + l = (min + max) / 2; + + if (chroma !== 0) { + // Hue + if (r === max) { + h = (g - b) / chroma + ((g < b) ? 6 : 0); + } else if (g === max) { + h = (b - r) / chroma + 2; + } else { + h = (r - g) / chroma + 4; + } + h /= 6; + + // Saturation + s = (l > 0.5) ? chroma / (2 - max - min) : chroma / (max + min); + } + + return [h, s, l]; + }, + /** + * @param h 0.0 <= n <= 1.0 + * @param s 0.0 <= n <= 1.0 + * @param l 0.0 <= n <= 1.0 + * @return Array(r, g, b) + */ + hslToRgb: function (h, s, l) { + var m1, m2, hue, + r, g, b, + rgb = []; + + if (s === 0) { + r = g = b = l * 255 + 0.5 | 0; + rgb = [r, g, b]; + } else { + if (l <= 0.5) { + m2 = l * (s + 1); + } else { + m2 = l + s - l * s; + } + + m1 = l * 2 - m2; + hue = h + 1 / 3; + + var tmp; + for (var i = 0; i < 3; i += 1) { + if (hue < 0) { + hue += 1; + } else if (hue > 1) { + hue -= 1; + } + + if (6 * hue < 1) { + tmp = m1 + (m2 - m1) * hue * 6; + } else if (2 * hue < 1) { + tmp = m2; + } else if (3 * hue < 2) { + tmp = m1 + (m2 - m1) * (2 / 3 - hue) * 6; + } else { + tmp = m1; + } + + rgb[i] = tmp * 255 + 0.5 | 0; + + hue -= 1 / 3; + } + } + + return rgb; + } +}; + + +ImageFilters.Translate = function (srcImageData, x, y, interpolation) { + +}; +ImageFilters.Scale = function (srcImageData, scaleX, scaleY, interpolation) { + +}; +ImageFilters.Rotate = function (srcImageData, originX, originY, angle, resize, interpolation) { + +}; +ImageFilters.Affine = function (srcImageData, matrix, resize, interpolation) { + +}; +ImageFilters.UnsharpMask = function (srcImageData, level) { + +}; + +ImageFilters.ConvolutionFilter = function (srcImageData, matrixX, matrixY, matrix, divisor, bias, preserveAlpha, clamp, color, alpha) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + divisor = divisor || 1; + bias = bias || 0; + + // default true + (preserveAlpha !== false) && (preserveAlpha = true); + (clamp !== false) && (clamp = true); + + color = color || 0; + alpha = alpha || 0; + + var index = 0, + rows = matrixX >> 1, + cols = matrixY >> 1, + clampR = color >> 16 & 0xFF, + clampG = color >> 8 & 0xFF, + clampB = color & 0xFF, + clampA = alpha * 0xFF; + + for (var y = 0; y < srcHeight; y += 1) { + for (var x = 0; x < srcWidth; x += 1, index += 4) { + var r = 0, + g = 0, + b = 0, + a = 0, + replace = false, + mIndex = 0, + v; + + for (var row = -rows; row <= rows; row += 1) { + var rowIndex = y + row, + offset; + + if (0 <= rowIndex && rowIndex < srcHeight) { + offset = rowIndex * srcWidth; + } else if (clamp) { + offset = y * srcWidth; + } else { + replace = true; + } + + for (var col = -cols; col <= cols; col += 1) { + var m = matrix[mIndex++]; + + if (m !== 0) { + var colIndex = x + col; + + if (!(0 <= colIndex && colIndex < srcWidth)) { + if (clamp) { + colIndex = x; + } else { + replace = true; + } + } + + if (replace) { + r += m * clampR; + g += m * clampG; + b += m * clampB; + a += m * clampA; + } else { + var p = (offset + colIndex) << 2; + r += m * srcPixels[p]; + g += m * srcPixels[p + 1]; + b += m * srcPixels[p + 2]; + a += m * srcPixels[p + 3]; + } + } + } + } + + dstPixels[index] = (v = r / divisor + bias) > 255 ? 255 : v < 0 ? 0 : v | 0; + dstPixels[index + 1] = (v = g / divisor + bias) > 255 ? 255 : v < 0 ? 0 : v | 0; + dstPixels[index + 2] = (v = b / divisor + bias) > 255 ? 255 : v < 0 ? 0 : v | 0; + dstPixels[index + 3] = preserveAlpha ? srcPixels[index + 3] : (v = a / divisor + bias) > 255 ? 255 : v < 0 ? 0 : v | 0; + } + } + + return dstImageData; +}; + +/** + * @param threshold 0.0 <= n <= 1.0 + */ +ImageFilters.Binarize = function (srcImageData, threshold) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + if (isNaN(threshold)) { + threshold = 0.5; + } + + threshold *= 255; + + for (var i = 0; i < srcLength; i += 4) { + var avg = srcPixels[i] + srcPixels[i + 1] + srcPixels[i + 2] / 3; + + dstPixels[i] = dstPixels[i + 1] = dstPixels[i + 2] = avg <= threshold ? 0 : 255; + dstPixels[i + 3] = 255; + } + + return dstImageData; +}; + +ImageFilters.BlendAdd = function (srcImageData, blendImageData, dx, dy) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data, + blendPixels = blendImageData.data; + + var v; + + for (var i = 0; i < srcLength; i += 4) { + dstPixels[i] = ((v = srcPixels[i] + blendPixels[i]) > 255) ? 255 : v; + dstPixels[i + 1] = ((v = srcPixels[i + 1] + blendPixels[i + 1]) > 255) ? 255 : v; + dstPixels[i + 2] = ((v = srcPixels[i + 2] + blendPixels[i + 2]) > 255) ? 255 : v; + dstPixels[i + 3] = 255; + } + + return dstImageData; +}; + +ImageFilters.BlendSubtract = function (srcImageData, blendImageData, dx, dy) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data, + blendPixels = blendImageData.data; + + var v; + + for (var i = 0; i < srcLength; i += 4) { + dstPixels[i] = ((v = srcPixels[i] - blendPixels[i]) < 0) ? 0 : v; + dstPixels[i + 1] = ((v = srcPixels[i + 1] - blendPixels[i + 1]) < 0) ? 0 : v; + dstPixels[i + 2] = ((v = srcPixels[i + 2] - blendPixels[i + 2]) < 0) ? 0 : v; + dstPixels[i + 3] = 255; + } + + return dstImageData; +}; + +/** + * Algorithm based on BoxBlurFilter.java by Huxtable.com + * @see http://www.jhlabs.com/ip/blurring.html + * Copyright 2005 Huxtable.com. All rights reserved. + */ +ImageFilters.BoxBlur = (function () { + var blur = function (src, dst, width, height, radius) { + var tableSize = radius * 2 + 1; + var radiusPlus1 = radius + 1; + var widthMinus1 = width - 1; + + var r, g, b, a; + + var srcIndex = 0; + var dstIndex; + var p, next, prev; + var i, l, x, y, + nextIndex, prevIndex; + + var sumTable = []; + for (i = 0, l = 256 * tableSize; i < l; i += 1) { + sumTable[i] = i / tableSize | 0; + } + + for (y = 0; y < height; y += 1) { + r = g = b = a = 0; + dstIndex = y; + + p = srcIndex << 2; + r += radiusPlus1 * src[p]; + g += radiusPlus1 * src[p + 1]; + b += radiusPlus1 * src[p + 2]; + a += radiusPlus1 * src[p + 3]; + + for (i = 1; i <= radius; i += 1) { + p = (srcIndex + (i < width ? i : widthMinus1)) << 2; + r += src[p]; + g += src[p + 1]; + b += src[p + 2]; + a += src[p + 3]; + } + + for (x = 0; x < width; x += 1) { + p = dstIndex << 2; + dst[p] = sumTable[r]; + dst[p + 1] = sumTable[g]; + dst[p + 2] = sumTable[b]; + dst[p + 3] = sumTable[a]; + + nextIndex = x + radiusPlus1; + if (nextIndex > widthMinus1) { + nextIndex = widthMinus1; + } + + prevIndex = x - radius; + if (prevIndex < 0) { + prevIndex = 0; + } + + next = (srcIndex + nextIndex) << 2; + prev = (srcIndex + prevIndex) << 2; + + r += src[next] - src[prev]; + g += src[next + 1] - src[prev + 1]; + b += src[next + 2] - src[prev + 2]; + a += src[next + 3] - src[prev + 3]; + + dstIndex += height; + } + srcIndex += width; + } + }; + + return function (srcImageData, hRadius, vRadius, quality) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data, + tmpImageData = this.utils.createImageData(srcWidth, srcHeight), + tmpPixels = tmpImageData.data; + + for (var i = 0; i < quality; i += 1) { + // only use the srcPixels on the first loop + blur(i ? dstPixels : srcPixels, tmpPixels, srcWidth, srcHeight, hRadius); + blur(tmpPixels, dstPixels, srcHeight, srcWidth, vRadius); + } + + return dstImageData; + }; +}()); + +/** + * @ param strength 1 <= n <= 4 + */ +ImageFilters.GaussianBlur = function (srcImageData, strength) { + var size, matrix, divisor; + + switch (strength) { + case 2: + size = 5; + matrix = [ + 1, 1, 2, 1, 1, + 1, 2, 4, 2, 1, + 2, 4, 8, 4, 2, + 1, 2, 4, 2, 1, + 1, 1, 2, 1, 1 + ]; + divisor = 52; + break; + case 3: + size = 7; + matrix = [ + 1, 1, 2, 2, 2, 1, 1, + 1, 2, 2, 4, 2, 2, 1, + 2, 2, 4, 8, 4, 2, 2, + 2, 4, 8, 16, 8, 4, 2, + 2, 2, 4, 8, 4, 2, 2, + 1, 2, 2, 4, 2, 2, 1, + 1, 1, 2, 2, 2, 1, 1 + ]; + divisor = 140; + break; + case 4: + size = 15; + matrix = [ + 2, 2, 3, 4, 5, 5, 6, 6, 6, 5, 5, 4, 3, 2, 2, + 2, 3, 4, 5, 7, 7, 8, 8, 8, 7, 7, 5, 4, 3, 2, + 3, 4, 6, 7, 9, 10, 10, 11, 10, 10, 9, 7, 6, 4, 3, + 4, 5, 7, 9, 10, 12, 13, 13, 13, 12, 10, 9, 7, 5, 4, + 5, 7, 9, 11, 13, 14, 15, 16, 15, 14, 13, 11, 9, 7, 5, + 5, 7, 10, 12, 14, 16, 17, 18, 17, 16, 14, 12, 10, 7, 5, + 6, 8, 10, 13, 15, 17, 19, 19, 19, 17, 15, 13, 10, 8, 6, + 6, 8, 11, 13, 16, 18, 19, 20, 19, 18, 16, 13, 11, 8, 6, + 6, 8, 10, 13, 15, 17, 19, 19, 19, 17, 15, 13, 10, 8, 6, + 5, 7, 10, 12, 14, 16, 17, 18, 17, 16, 14, 12, 10, 7, 5, + 5, 7, 9, 11, 13, 14, 15, 16, 15, 14, 13, 11, 9, 7, 5, + 4, 5, 7, 9, 10, 12, 13, 13, 13, 12, 10, 9, 7, 5, 4, + 3, 4, 6, 7, 9, 10, 10, 11, 10, 10, 9, 7, 6, 4, 3, + 2, 3, 4, 5, 7, 7, 8, 8, 8, 7, 7, 5, 4, 3, 2, + 2, 2, 3, 4, 5, 5, 6, 6, 6, 5, 5, 4, 3, 2, 2 + ]; + divisor = 2044; + break; + default: + size = 3; + matrix = [ + 1, 2, 1, + 2, 4, 2, + 1, 2, 1 + ]; + divisor = 16; + break; + } + return this.ConvolutionFilter(srcImageData, size, size, matrix, divisor, 0, false); +}; + +/** + * Stack Blur Algorithm by Mario Klingemann + * @see http://incubator.quasimondo.com/processing/fast_blur_deluxe.php + */ +/* + Copyright (c) 2010 Mario Klingemann + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + */ +ImageFilters.StackBlur = (function () { + var mul_table = [ + 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, + 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, + 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, + 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, + 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, + 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, + 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, + 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, + 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, + 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, + 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, + 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, + 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, + 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, + 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, + 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259]; + + + var shg_table = [ + 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, + 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24]; + + function BlurStack() { + this.r = 0; + this.g = 0; + this.b = 0; + this.a = 0; + this.next = null; + } + + return function (srcImageData, radius) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.Clone(srcImageData), + dstPixels = dstImageData.data; + + var x, y, i, p, yp, yi, yw, + r_sum, g_sum, b_sum, a_sum, + r_out_sum, g_out_sum, b_out_sum, a_out_sum, + r_in_sum, g_in_sum, b_in_sum, a_in_sum, + pr, pg, pb, pa, rbs, + div = radius + radius + 1, + w4 = srcWidth << 2, + widthMinus1 = srcWidth - 1, + heightMinus1 = srcHeight - 1, + radiusPlus1 = radius + 1, + sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2, + stackStart = new BlurStack(), + stack = stackStart, + stackIn, stackOut, stackEnd, + mul_sum = mul_table[radius], + shg_sum = shg_table[radius]; + + for (i = 1; i < div; i += 1) { + stack = stack.next = new BlurStack(); + if (i == radiusPlus1) { + stackEnd = stack; + } + } + + stack.next = stackStart; + yw = yi = 0; + + for (y = 0; y < srcHeight; y += 1) { + r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0; + + r_out_sum = radiusPlus1 * (pr = dstPixels[yi]); + g_out_sum = radiusPlus1 * (pg = dstPixels[yi + 1]); + b_out_sum = radiusPlus1 * (pb = dstPixels[yi + 2]); + a_out_sum = radiusPlus1 * (pa = dstPixels[yi + 3]); + + r_sum += sumFactor * pr; + g_sum += sumFactor * pg; + b_sum += sumFactor * pb; + a_sum += sumFactor * pa; + + stack = stackStart; + + for (i = 0; i < radiusPlus1; i += 1) { + stack.r = pr; + stack.g = pg; + stack.b = pb; + stack.a = pa; + stack = stack.next; + } + + for (i = 1; i < radiusPlus1; i += 1) { + p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2); + r_sum += (stack.r = (pr = dstPixels[p])) * (rbs = radiusPlus1 - i); + g_sum += (stack.g = (pg = dstPixels[p + 1])) * rbs; + b_sum += (stack.b = (pb = dstPixels[p + 2])) * rbs; + a_sum += (stack.a = (pa = dstPixels[p + 3])) * rbs; + + r_in_sum += pr; + g_in_sum += pg; + b_in_sum += pb; + a_in_sum += pa; + + stack = stack.next; + } + + stackIn = stackStart; + stackOut = stackEnd; + + for (x = 0; x < srcWidth; x += 1) { + dstPixels[yi] = (r_sum * mul_sum) >> shg_sum; + dstPixels[yi + 1] = (g_sum * mul_sum) >> shg_sum; + dstPixels[yi + 2] = (b_sum * mul_sum) >> shg_sum; + dstPixels[yi + 3] = (a_sum * mul_sum) >> shg_sum; + + r_sum -= r_out_sum; + g_sum -= g_out_sum; + b_sum -= b_out_sum; + a_sum -= a_out_sum; + + r_out_sum -= stackIn.r; + g_out_sum -= stackIn.g; + b_out_sum -= stackIn.b; + a_out_sum -= stackIn.a; + + p = (yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1)) << 2; + + r_in_sum += (stackIn.r = dstPixels[p]); + g_in_sum += (stackIn.g = dstPixels[p + 1]); + b_in_sum += (stackIn.b = dstPixels[p + 2]); + a_in_sum += (stackIn.a = dstPixels[p + 3]); + + r_sum += r_in_sum; + g_sum += g_in_sum; + b_sum += b_in_sum; + a_sum += a_in_sum; + + stackIn = stackIn.next; + + r_out_sum += (pr = stackOut.r); + g_out_sum += (pg = stackOut.g); + b_out_sum += (pb = stackOut.b); + a_out_sum += (pa = stackOut.a); + + r_in_sum -= pr; + g_in_sum -= pg; + b_in_sum -= pb; + a_in_sum -= pa; + + stackOut = stackOut.next; + + yi += 4; + } + + yw += srcWidth; + } + + for (x = 0; x < srcWidth; x += 1) { + g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0; + + yi = x << 2; + r_out_sum = radiusPlus1 * (pr = dstPixels[yi]); + g_out_sum = radiusPlus1 * (pg = dstPixels[yi + 1]); + b_out_sum = radiusPlus1 * (pb = dstPixels[yi + 2]); + a_out_sum = radiusPlus1 * (pa = dstPixels[yi + 3]); + + r_sum += sumFactor * pr; + g_sum += sumFactor * pg; + b_sum += sumFactor * pb; + a_sum += sumFactor * pa; + + stack = stackStart; + + for (i = 0; i < radiusPlus1; i += 1) { + stack.r = pr; + stack.g = pg; + stack.b = pb; + stack.a = pa; + stack = stack.next; + } + + yp = srcWidth; + + for (i = 1; i <= radius; i += 1) { + yi = (yp + x) << 2; + + r_sum += (stack.r = (pr = dstPixels[yi])) * (rbs = radiusPlus1 - i); + g_sum += (stack.g = (pg = dstPixels[yi + 1])) * rbs; + b_sum += (stack.b = (pb = dstPixels[yi + 2])) * rbs; + a_sum += (stack.a = (pa = dstPixels[yi + 3])) * rbs; + + r_in_sum += pr; + g_in_sum += pg; + b_in_sum += pb; + a_in_sum += pa; + + stack = stack.next; + + if (i < heightMinus1) { + yp += srcWidth; + } + } + + yi = x; + stackIn = stackStart; + stackOut = stackEnd; + + for (y = 0; y < srcHeight; y += 1) { + p = yi << 2; + dstPixels[p] = (r_sum * mul_sum) >> shg_sum; + dstPixels[p + 1] = (g_sum * mul_sum) >> shg_sum; + dstPixels[p + 2] = (b_sum * mul_sum) >> shg_sum; + dstPixels[p + 3] = (a_sum * mul_sum) >> shg_sum; + + r_sum -= r_out_sum; + g_sum -= g_out_sum; + b_sum -= b_out_sum; + a_sum -= a_out_sum; + + r_out_sum -= stackIn.r; + g_out_sum -= stackIn.g; + b_out_sum -= stackIn.b; + a_out_sum -= stackIn.a; + + p = (x + (((p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1) * srcWidth)) << 2; + + r_sum += (r_in_sum += (stackIn.r = dstPixels[p])); + g_sum += (g_in_sum += (stackIn.g = dstPixels[p + 1])); + b_sum += (b_in_sum += (stackIn.b = dstPixels[p + 2])); + a_sum += (a_in_sum += (stackIn.a = dstPixels[p + 3])); + + stackIn = stackIn.next; + + r_out_sum += (pr = stackOut.r); + g_out_sum += (pg = stackOut.g); + b_out_sum += (pb = stackOut.b); + a_out_sum += (pa = stackOut.a); + + r_in_sum -= pr; + g_in_sum -= pg; + b_in_sum -= pb; + a_in_sum -= pa; + + stackOut = stackOut.next; + + yi += srcWidth; + } + } + + return dstImageData; + } +}()); + +/** + * TV based algorithm + */ +ImageFilters.Brightness = function (srcImageData, brightness) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + this.utils.mapRGB(srcPixels, dstPixels, function (value) { + value += brightness; + return (value > 255) ? 255 : value; + }); + + return dstImageData; +}; + +/** + * GIMP algorithm modified. pretty close to fireworks + * @param brightness -100 <= n <= 100 + * @param contrast -100 <= n <= 100 + */ +ImageFilters.BrightnessContrastGimp = function (srcImageData, brightness, contrast) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data, + p4 = Math.PI / 4; + + // fix to -1 <= n <= 1 + brightness /= 100; + + // fix to -99 <= n <= 99 + contrast *= 0.99; + // fix to -1 < n < 1 + contrast /= 100; + // apply GIMP formula + contrast = Math.tan((contrast + 1) * p4); + + // get the average color + for (var avg = 0, i = 0; i < srcLength; i += 4) { + avg += (srcPixels[i] * 19595 + srcPixels[i + 1] * 38470 + srcPixels[i + 2] * 7471) >> 16; + } + avg = avg / (srcLength / 4); + + this.utils.mapRGB(srcPixels, dstPixels, function (value) { + if (brightness < 0) { + value = value * (1 + brightness); + } else if (brightness > 0) { + value = value + ((255 - value) * brightness); + } + //value += brightness; + + if (contrast !== 0) { + value = (value - avg) * contrast + avg; + } + return value + 0.5 | 0; + }); + return dstImageData; +}; + +/** + * more like the new photoshop algorithm + * @param brightness -100 <= n <= 100 + * @param contrast -100 <= n <= 100 + */ +ImageFilters.BrightnessContrastPhotoshop = function (srcImageData, brightness, contrast) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + // fix to 0 <= n <= 2; + brightness = (brightness + 100) / 100; + contrast = (contrast + 100) / 100; + + this.utils.mapRGB(srcPixels, dstPixels, function (value) { + value *= brightness; + value = (value - 127.5) * contrast + 127.5; + return value + 0.5 | 0; + }); + return dstImageData; +}; + +ImageFilters.Channels = function (srcImageData, channel) { + var matrix; + + switch (channel) { + case 2: // green + matrix = [ + 0, 1, 0, 0, 0, + 0, 1, 0, 0, 0, + 0, 1, 0, 0, 0, + 0, 0, 0, 1, 0 + ]; + break; + case 3: // blue + matrix = [ + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 1, 0 + ]; + break; + default: // red + matrix = [ + 1, 0, 0, 0, 0, + 1, 0, 0, 0, 0, + 1, 0, 0, 0, 0, + 0, 0, 0, 1, 0 + ]; + break; + + } + + return this.ColorMatrixFilter(srcImageData, matrix); +}; + +ImageFilters.Clone = function (srcImageData) { + return this.Copy(srcImageData, this.utils.createImageData(srcImageData.width, srcImageData.height)); +}; + +/** + * slower + */ +ImageFilters.CloneBuiltin = function (srcImageData) { + var srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + canvas = this.utils.getSampleCanvas(), + context = this.utils.getSampleContext(), + dstImageData; + + canvas.width = srcWidth; + canvas.height = srcHeight; + + context.putImageData(srcImageData, 0, 0); + dstImageData = context.getImageData(0, 0, srcWidth, srcHeight); + + canvas.width = 0; + canvas.height = 0; + + return dstImageData; +}; + +ImageFilters.ColorMatrixFilter = function (srcImageData, matrix) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + var m0 = matrix[0], + m1 = matrix[1], + m2 = matrix[2], + m3 = matrix[3], + m4 = matrix[4], + m5 = matrix[5], + m6 = matrix[6], + m7 = matrix[7], + m8 = matrix[8], + m9 = matrix[9], + m10 = matrix[10], + m11 = matrix[11], + m12 = matrix[12], + m13 = matrix[13], + m14 = matrix[14], + m15 = matrix[15], + m16 = matrix[16], + m17 = matrix[17], + m18 = matrix[18], + m19 = matrix[19]; + + var value, i, r, g, b, a; + for (i = 0; i < srcLength; i += 4) { + r = srcPixels[i]; + g = srcPixels[i + 1]; + b = srcPixels[i + 2]; + a = srcPixels[i + 3]; + + dstPixels[i] = (value = r * m0 + g * m1 + b * m2 + a * m3 + m4) > 255 ? 255 : value < 0 ? 0 : value | 0; + dstPixels[i + 1] = (value = r * m5 + g * m6 + b * m7 + a * m8 + m9) > 255 ? 255 : value < 0 ? 0 : value | 0; + dstPixels[i + 2] = (value = r * m10 + g * m11 + b * m12 + a * m13 + m14) > 255 ? 255 : value < 0 ? 0 : value | 0; + dstPixels[i + 3] = (value = r * m15 + g * m16 + b * m17 + a * m18 + m19) > 255 ? 255 : value < 0 ? 0 : value | 0; + } + + return dstImageData; +}; + +ImageFilters.ColorTransformFilter = function ( + srcImageData, redMultiplier, greenMultiplier, blueMultiplier, alphaMultiplier, + redOffset, greenOffset, blueOffset, alphaOffset) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + var i, v; + for (i = 0; i < srcLength; i += 4) { + dstPixels[i] = (v = srcPixels[i] * redMultiplier + redOffset) > 255 ? 255 : v < 0 ? 0 : v; + dstPixels[i + 1] = (v = srcPixels[i + 1] * greenMultiplier + greenOffset) > 255 ? 255 : v < 0 ? 0 : v; + dstPixels[i + 2] = (v = srcPixels[i + 2] * blueMultiplier + blueOffset) > 255 ? 255 : v < 0 ? 0 : v; + dstPixels[i + 3] = (v = srcPixels[i + 3] * alphaMultiplier + alphaOffset) > 255 ? 255 : v < 0 ? 0 : v; + } + + return dstImageData; +}; + +ImageFilters.Copy = function (srcImageData, dstImageData) { + var srcPixels = srcImageData.data, + srcLength = srcPixels.length, + dstPixels = dstImageData.data; + + while (srcLength--) { + dstPixels[srcLength] = srcPixels[srcLength]; + } + + return dstImageData; +}; + +ImageFilters.Crop = function (srcImageData, x, y, width, height) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(width, height), + dstPixels = dstImageData.data; + + var srcLeft = Math.max(x, 0), + srcTop = Math.max(y, 0), + srcRight = Math.min(x + width, srcWidth), + srcBottom = Math.min(y + height, srcHeight), + dstLeft = srcLeft - x, + dstTop = srcTop - y, + srcRow, srcCol, srcIndex, dstIndex; + + for (srcRow = srcTop, dstRow = dstTop; srcRow < srcBottom; srcRow += 1, dstRow += 1) { + for (srcCol = srcLeft, dstCol = dstLeft; srcCol < srcRight; srcCol += 1, dstCol += 1) { + srcIndex = (srcRow * srcWidth + srcCol) << 2; + dstIndex = (dstRow * width + dstCol) << 2; + dstPixels[dstIndex] = srcPixels[srcIndex]; + dstPixels[dstIndex + 1] = srcPixels[srcIndex + 1]; + dstPixels[dstIndex + 2] = srcPixels[srcIndex + 2]; + dstPixels[dstIndex + 3] = srcPixels[srcIndex + 3]; + } + } + + return dstImageData; +}; + +ImageFilters.CropBuiltin = function (srcImageData, x, y, width, height) { + var srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + canvas = this.utils.getSampleCanvas(), + context = this.utils.getSampleContext(); + + canvas.width = srcWidth; + canvas.height = srcHeight; + context.putImageData(srcImageData, 0, 0); + var result = context.getImageData(x, y, width, height); + + canvas.width = 0; + canvas.height = 0; + + return result; +}; + +/** + * sets to the average of the highest and lowest contrast + */ +ImageFilters.Desaturate = function (srcImageData) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + for (var i = 0; i < srcLength; i += 4) { + var r = srcPixels[i], + g = srcPixels[i + 1], + b = srcPixels[i + 2], + max = (r > g) ? (r > b) ? r : b : (g > b) ? g : b, + min = (r < g) ? (r < b) ? r : b : (g < b) ? g : b, + avg = ((max + min) / 2) + 0.5 | 0; + + dstPixels[i] = dstPixels[i + 1] = dstPixels[i + 2] = avg; + dstPixels[i + 3] = srcPixels[i + 3]; + } + + return dstImageData; +}; + +ImageFilters.DisplacementMapFilter = function (srcImageData, mapImageData, mapX, mapY, componentX, componentY, scaleX, scaleY, mode) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = ImageFilters.Clone(srcImageData), + dstPixels = dstImageData.data; + + mapX || (mapX = 0); + mapY || (mapY = 0); + componentX || (componentX = 0); // red? + componentY || (componentY = 0); + scaleX || (scaleX = 0); + scaleY || (scaleY = 0); + mode || (mode = 2); // wrap + + var mapWidth = mapImageData.width, + mapHeight = mapImageData.height, + mapPixels = mapImageData.data, + mapRight = mapWidth + mapX, + mapBottom = mapHeight + mapY, + dstIndex, srcIndex, mapIndex, + cx, cy, tx, ty, x, y; + + for (x = 0; x < srcWidth; x += 1) { + for (y = 0; y < srcHeight; y += 1) { + + dstIndex = (y * srcWidth + x) << 2; + + if (x < mapX || y < mapY || x >= mapRight || y >= mapBottom) { + // out of the map bounds + // copy src to dst + srcIndex = dstIndex; + } else { + // apply map + mapIndex = ((y - mapY) * mapWidth + (x - mapX)) << 2; + + // tx = x + ((componentX(x, y) - 128) * scaleX) / 256 + cx = mapPixels[mapIndex + componentX]; + tx = x + (((cx - 128) * scaleX) >> 8); + + // tx = y + ((componentY(x, y) - 128) * scaleY) / 256 + cy = mapPixels[mapIndex + componentY]; + ty = y + (((cy - 128) * scaleY) >> 8); + + srcIndex = ImageFilters.utils.getPixelIndex(tx + 0.5 | 0, ty + 0.5 | 0, srcWidth, srcHeight, mode); + if (srcIndex === null) { + // if mode == ignore and (tx,ty) is out of src bounds + // then copy (x,y) to dst + srcIndex = dstIndex; + } + } + + dstPixels[dstIndex] = srcPixels[srcIndex]; + dstPixels[dstIndex + 1] = srcPixels[srcIndex + 1]; + dstPixels[dstIndex + 2] = srcPixels[srcIndex + 2]; + dstPixels[dstIndex + 3] = srcPixels[srcIndex + 3]; + } + } + + return dstImageData; +}; + +/** + * Floyd-Steinberg algorithm + * @param levels 2 <= n <= 255 + */ +ImageFilters.Dither = function (srcImageData, levels) { + var srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + dstImageData = this.Clone(srcImageData), + dstPixels = dstImageData.data; + + levels = levels < 2 ? 2 : levels > 255 ? 255 : levels; + + // Build a color map using the same algorithm as the posterize filter. + var posterize, + levelMap = [], + levelsMinus1 = levels - 1, + j = 0, + k = 0, + i; + + for (i = 0; i < levels; i += 1) { + levelMap[i] = (255 * i) / levelsMinus1; + } + + posterize = this.utils.buildMap(function (value) { + var ret = levelMap[j]; + + k += levels; + + if (k > 255) { + k -= 255; + j += 1; + } + + return ret; + }); + + // Apply the dithering algorithm to each pixel + var x, y, + index, + old_r, old_g, old_b, + new_r, new_g, new_b, + err_r, err_g, err_b, + nbr_r, nbr_g, nbr_b, + srcWidthMinus1 = srcWidth - 1, + srcHeightMinus1 = srcHeight - 1, + A = 7 / 16, + B = 3 / 16, + C = 5 / 16, + D = 1 / 16; + + for (y = 0; y < srcHeight; y += 1) { + for (x = 0; x < srcWidth; x += 1) { + // Get the current pixel. + index = (y * srcWidth + x) << 2; + + old_r = dstPixels[index]; + old_g = dstPixels[index + 1]; + old_b = dstPixels[index + 2]; + + // Quantize using the color map + new_r = posterize[old_r]; + new_g = posterize[old_g]; + new_b = posterize[old_b]; + + // Set the current pixel. + dstPixels[index] = new_r; + dstPixels[index + 1] = new_g; + dstPixels[index + 2] = new_b; + + // Quantization errors + err_r = old_r - new_r; + err_g = old_g - new_g; + err_b = old_b - new_b; + + // Apply the matrix. + // x + 1, y + index += 1 << 2; + if (x < srcWidthMinus1) { + nbr_r = dstPixels[index] + A * err_r; + nbr_g = dstPixels[index + 1] + A * err_g; + nbr_b = dstPixels[index + 2] + A * err_b; + + dstPixels[index] = nbr_r > 255 ? 255 : nbr_r < 0 ? 0 : nbr_r | 0; + dstPixels[index + 1] = nbr_g > 255 ? 255 : nbr_g < 0 ? 0 : nbr_g | 0; + dstPixels[index + 2] = nbr_b > 255 ? 255 : nbr_b < 0 ? 0 : nbr_b | 0; + } + + // x - 1, y + 1 + index += (srcWidth - 2) << 2; + if (x > 0 && y < srcHeightMinus1) { + nbr_r = dstPixels[index] + B * err_r; + nbr_g = dstPixels[index + 1] + B * err_g; + nbr_b = dstPixels[index + 2] + B * err_b; + + dstPixels[index] = nbr_r > 255 ? 255 : nbr_r < 0 ? 0 : nbr_r | 0; + dstPixels[index + 1] = nbr_g > 255 ? 255 : nbr_g < 0 ? 0 : nbr_g | 0; + dstPixels[index + 2] = nbr_b > 255 ? 255 : nbr_b < 0 ? 0 : nbr_b | 0; + } + + // x, y + 1 + index += 1 << 2; + if (y < srcHeightMinus1) { + nbr_r = dstPixels[index] + C * err_r; + nbr_g = dstPixels[index + 1] + C * err_g; + nbr_b = dstPixels[index + 2] + C * err_b; + + dstPixels[index] = nbr_r > 255 ? 255 : nbr_r < 0 ? 0 : nbr_r | 0; + dstPixels[index + 1] = nbr_g > 255 ? 255 : nbr_g < 0 ? 0 : nbr_g | 0; + dstPixels[index + 2] = nbr_b > 255 ? 255 : nbr_b < 0 ? 0 : nbr_b | 0; + } + + // x + 1, y + 1 + index += 1 << 2; + if (x < srcWidthMinus1 && y < srcHeightMinus1) { + nbr_r = dstPixels[index] + D * err_r; + nbr_g = dstPixels[index + 1] + D * err_g; + nbr_b = dstPixels[index + 2] + D * err_b; + + dstPixels[index] = nbr_r > 255 ? 255 : nbr_r < 0 ? 0 : nbr_r | 0; + dstPixels[index + 1] = nbr_g > 255 ? 255 : nbr_g < 0 ? 0 : nbr_g | 0; + dstPixels[index + 2] = nbr_b > 255 ? 255 : nbr_b < 0 ? 0 : nbr_b | 0; + } + } + } + + return dstImageData; +}; + +ImageFilters.Edge = function (srcImageData) { + //pretty close to Fireworks 'Find Edges' effect + return this.ConvolutionFilter(srcImageData, 3, 3, [ + -1, -1, -1, + -1, 8, -1, + -1, -1, -1 + ]); +}; + +ImageFilters.Emboss = function (srcImageData) { + return this.ConvolutionFilter(srcImageData, 3, 3, [ + -2, -1, 0, + -1, 1, 1, + 0, 1, 2 + ]); +}; + +ImageFilters.Enrich = function (srcImageData) { + return this.ConvolutionFilter(srcImageData, 3, 3, [ + 0, -2, 0, + -2, 20, -2, + 0, -2, 0 + ], 10, -40); +}; + +ImageFilters.Flip = function (srcImageData, vertical) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + var x, y, srcIndex, dstIndex, i; + + for (y = 0; y < srcHeight; y += 1) { + for (x = 0; x < srcWidth; x += 1) { + srcIndex = (y * srcWidth + x) << 2; + if (vertical) { + dstIndex = ((srcHeight - y - 1) * srcWidth + x) << 2; + } else { + dstIndex = (y * srcWidth + (srcWidth - x - 1)) << 2; + } + + dstPixels[dstIndex] = srcPixels[srcIndex]; + dstPixels[dstIndex + 1] = srcPixels[srcIndex + 1]; + dstPixels[dstIndex + 2] = srcPixels[srcIndex + 2]; + dstPixels[dstIndex + 3] = srcPixels[srcIndex + 3]; + } + } + + return dstImageData; +}; + +ImageFilters.Gamma = function (srcImageData, gamma) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + this.utils.mapRGB(srcPixels, dstPixels, function (value) { + value = (255 * Math.pow(value / 255, 1 / gamma) + 0.5); + return value > 255 ? 255 : value + 0.5 | 0; + }); + + return dstImageData; +}; + +ImageFilters.GrayScale = function (srcImageData) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + for (var i = 0; i < srcLength; i += 4) { + var intensity = (srcPixels[i] * 19595 + srcPixels[i + 1] * 38470 + srcPixels[i + 2] * 7471) >> 16; + //var intensity = (srcPixels[i] * 0.3086 + srcPixels[i + 1] * 0.6094 + srcPixels[i + 2] * 0.0820) | 0; + dstPixels[i] = dstPixels[i + 1] = dstPixels[i + 2] = intensity; + dstPixels[i + 3] = srcPixels[i + 3]; + } + + return dstImageData; +}; + +/** + * @param hueDelta -180 <= n <= 180 + * @param satDelta -100 <= n <= 100 + * @param lightness -100 <= n <= 100 + */ +ImageFilters.HSLAdjustment = function (srcImageData, hueDelta, satDelta, lightness) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + hueDelta /= 360; + satDelta /= 100; + lightness /= 100; + + var rgbToHsl = this.utils.rgbToHsl; + var hslToRgb = this.utils.hslToRgb; + var h, s, l, hsl, rgb, i; + + for (i = 0; i < srcLength; i += 4) { + // convert to HSL + hsl = rgbToHsl(srcPixels[i], srcPixels[i + 1], srcPixels[i + 2]); + + // hue + h = hsl[0] + hueDelta; + while (h < 0) { + h += 1; + } + while (h > 1) { + h -= 1; + } + + // saturation + s = hsl[1] + hsl[1] * satDelta; + if (s < 0) { + s = 0; + } else if (s > 1) { + s = 1; + } + + // lightness + l = hsl[2]; + if (lightness > 0) { + l += (1 - l) * lightness; + } else if (lightness < 0) { + l += l * lightness; + } + + // convert back to rgb + rgb = hslToRgb(h, s, l); + + dstPixels[i] = rgb[0]; + dstPixels[i + 1] = rgb[1]; + dstPixels[i + 2] = rgb[2]; + dstPixels[i + 3] = srcPixels[i + 3]; + } + + return dstImageData; +}; + +ImageFilters.Invert = function (srcImageData) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + this.utils.mapRGB(srcPixels, dstPixels, function (value) { + return 255 - value; + }); + + return dstImageData; +}; + +ImageFilters.Mosaic = function (srcImageData, blockSize) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + var cols = Math.ceil(srcWidth / blockSize), + rows = Math.ceil(srcHeight / blockSize), + row, col, + x_start, x_end, y_start, y_end, + x, y, yIndex, index, size, + r, g, b, a; + + for (row = 0; row < rows; row += 1) { + y_start = row * blockSize; + y_end = y_start + blockSize; + + if (y_end > srcHeight) { + y_end = srcHeight; + } + + for (col = 0; col < cols; col += 1) { + x_start = col * blockSize; + x_end = x_start + blockSize; + + if (x_end > srcWidth) { + x_end = srcWidth; + } + + // get the average color from the src + r = g = b = a = 0; + size = (x_end - x_start) * (y_end - y_start); + + for (y = y_start; y < y_end; y += 1) { + yIndex = y * srcWidth; + + for (x = x_start; x < x_end; x += 1) { + index = (yIndex + x) << 2; + r += srcPixels[index]; + g += srcPixels[index + 1]; + b += srcPixels[index + 2]; + a += srcPixels[index + 3]; + } + } + + r = (r / size) + 0.5 | 0; + g = (g / size) + 0.5 | 0; + b = (b / size) + 0.5 | 0; + a = (a / size) + 0.5 | 0; + + // fill the dst with that color + for (y = y_start; y < y_end; y += 1) { + yIndex = y * srcWidth; + + for (x = x_start; x < x_end; x += 1) { + index = (yIndex + x) << 2; + dstPixels[index] = r; + dstPixels[index + 1] = g; + dstPixels[index + 2] = b; + dstPixels[index + 3] = a; + } + } + } + } + + return dstImageData; +}; + +/** + * @param range 1 <= n <= 5 + * @param levels 1 <= n <= 256 + */ +ImageFilters.Oil = function (srcImageData, range, levels) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + var index = 0, + rh = [], + gh = [], + bh = [], + rt = [], + gt = [], + bt = [], + x, y, i, row, col, + rowIndex, colIndex, offset, srcIndex, + sr, sg, sb, ri, gi, bi, + r, g, b; + + for (y = 0; y < srcHeight; y += 1) { + for (x = 0; x < srcWidth; x += 1) { + for (i = 0; i < levels; i += 1) { + rh[i] = gh[i] = bh[i] = rt[i] = gt[i] = bt[i] = 0; + } + + for (row = -range; row <= range; row += 1) { + rowIndex = y + row; + + if (rowIndex < 0 || rowIndex >= srcHeight) { + continue; + } + + offset = rowIndex * srcWidth; + + for (col = -range; col <= range; col += 1) { + colIndex = x + col; + if (colIndex < 0 || colIndex >= srcWidth) { + continue; + } + + srcIndex = (offset + colIndex) << 2; + sr = srcPixels[srcIndex]; + sg = srcPixels[srcIndex + 1]; + sb = srcPixels[srcIndex + 2]; + ri = (sr * levels) >> 8; + gi = (sg * levels) >> 8; + bi = (sb * levels) >> 8; + rt[ri] += sr; + gt[gi] += sg; + bt[bi] += sb; + rh[ri] += 1; + gh[gi] += 1; + bh[bi] += 1; + } + } + + r = g = b = 0; + for (i = 1; i < levels; i += 1) { + if (rh[i] > rh[r]) { + r = i; + } + if (gh[i] > gh[g]) { + g = i; + } + if (bh[i] > bh[b]) { + b = i; + } + } + + dstPixels[index] = rt[r] / rh[r] | 0; + dstPixels[index + 1] = gt[g] / gh[g] | 0; + dstPixels[index + 2] = bt[b] / bh[b] | 0; + dstPixels[index + 3] = srcPixels[index + 3]; + index += 4; + } + } + + return dstImageData; +}; + +ImageFilters.OpacityFilter = function (srcImageData, opacity) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + for (var i = 0; i < srcLength; i += 4) { + dstPixels[i] = srcPixels[i]; + dstPixels[i + 1] = srcPixels[i + 1]; + dstPixels[i + 2] = srcPixels[i + 2]; + dstPixels[i + 3] = opacity; + } + + return dstImageData; +}; + +/** + * @param levels 2 <= n <= 255 + */ +ImageFilters.Posterize = function (srcImageData, levels) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + levels = levels < 2 ? 2 : levels > 255 ? 255 : levels; + + var levelMap = [], + levelsMinus1 = levels - 1, + j = 0, + k = 0, + i; + + for (i = 0; i < levels; i += 1) { + levelMap[i] = (255 * i) / levelsMinus1; + } + + this.utils.mapRGB(srcPixels, dstPixels, function (value) { + var ret = levelMap[j]; + + k += levels; + + if (k > 255) { + k -= 255; + j += 1; + } + + return ret; + }); + + return dstImageData; +}; + +/** + * @param scale 0.0 <= n <= 5.0 + */ +ImageFilters.Rescale = function (srcImageData, scale) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + this.utils.mapRGB(srcPixels, dstPixels, function (value) { + value *= scale; + return (value > 255) ? 255 : value + 0.5 | 0; + }); + + return dstImageData; +}; + +/** + * Nearest neighbor + */ +ImageFilters.ResizeNearestNeighbor = function (srcImageData, width, height) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(width, height), + dstPixels = dstImageData.data; + + var xFactor = srcWidth / width, + yFactor = srcHeight / height, + dstIndex = 0, srcIndex, + x, y, offset; + + for (y = 0; y < height; y += 1) { + offset = ((y * yFactor) | 0) * srcWidth; + + for (x = 0; x < width; x += 1) { + srcIndex = (offset + x * xFactor) << 2; + + dstPixels[dstIndex] = srcPixels[srcIndex]; + dstPixels[dstIndex + 1] = srcPixels[srcIndex + 1]; + dstPixels[dstIndex + 2] = srcPixels[srcIndex + 2]; + dstPixels[dstIndex + 3] = srcPixels[srcIndex + 3]; + dstIndex += 4; + } + } + + return dstImageData; +}; + +/** + * Bilinear + */ +ImageFilters.Resize = function (srcImageData, width, height) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(width, height), + dstPixels = dstImageData.data; + + var xFactor = srcWidth / width, + yFactor = srcHeight / height, + dstIndex = 0, + x, y; + + for (y = 0; y < height; y += 1) { + for (x = 0; x < width; x += 1) { + this.utils.copyBilinear(srcPixels, x * xFactor, y * yFactor, srcWidth, srcHeight, dstPixels, dstIndex, 0); + dstIndex += 4; + } + } + + return dstImageData; +}; + + +/** + * faster resizing using the builtin context.scale() + * the resizing algorithm may be different between browsers + * this might not work if the image is transparent. + * to fix that we probably need two contexts + */ +ImageFilters.ResizeBuiltin = function (srcImageData, width, height) { + var srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + canvas = this.utils.getSampleCanvas(), + context = this.utils.getSampleContext(), + dstImageData; + + canvas.width = Math.max(srcWidth, width); + canvas.height = Math.max(srcHeight, height); + context.save(); + + context.putImageData(srcImageData, 0, 0); + context.scale(width / srcWidth, height / srcHeight); + context.drawImage(canvas, 0, 0); + + dstImageData = context.getImageData(0, 0, width, height); + + context.restore(); + canvas.width = 0; + canvas.height = 0; + + return dstImageData; +}; + +ImageFilters.Sepia = function (srcImageData) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + var r, g, b, i, value; + + for (i = 0; i < srcLength; i += 4) { + r = srcPixels[i]; + g = srcPixels[i + 1]; + b = srcPixels[i + 2]; + + dstPixels[i] = (value = r * 0.393 + g * 0.769 + b * 0.189) > 255 ? 255 : value < 0 ? 0 : value + 0.5 | 0; + dstPixels[i + 1] = (value = r * 0.349 + g * 0.686 + b * 0.168) > 255 ? 255 : value < 0 ? 0 : value + 0.5 | 0; + dstPixels[i + 2] = (value = r * 0.272 + g * 0.534 + b * 0.131) > 255 ? 255 : value < 0 ? 0 : value + 0.5 | 0; + dstPixels[i + 3] = srcPixels[i + 3]; + } + + return dstImageData; +}; + +/** + * @param factor 1 <= n + */ +ImageFilters.Sharpen = function (srcImageData, factor) { + //Convolution formula from VIGRA + return this.ConvolutionFilter(srcImageData, 3, 3, [ + -factor / 16, -factor / 8, -factor / 16, + -factor / 8, factor * 0.75 + 1, -factor / 8, + -factor / 16, -factor / 8, -factor / 16 + ]); +}; + +ImageFilters.Solarize = function (srcImageData) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + this.utils.mapRGB(srcPixels, dstPixels, function (value) { + return value > 127 ? (value - 127.5) * 2 : (127.5 - value) * 2; + }); + + return dstImageData; +}; + +ImageFilters.Transpose = function (srcImageData) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcHeight, srcWidth), + dstPixels = dstImageData.data; + + var srcIndex, dstIndex; + + for (y = 0; y < srcHeight; y += 1) { + for (x = 0; x < srcWidth; x += 1) { + srcIndex = (y * srcWidth + x) << 2; + dstIndex = (x * srcHeight + y) << 2; + + dstPixels[dstIndex] = srcPixels[srcIndex]; + dstPixels[dstIndex + 1] = srcPixels[srcIndex + 1]; + dstPixels[dstIndex + 2] = srcPixels[srcIndex + 2]; + dstPixels[dstIndex + 3] = srcPixels[srcIndex + 3]; + } + } + + return dstImageData; +}; + +/** + * @param centerX 0.0 <= n <= 1.0 + * @param centerY 0.0 <= n <= 1.0 + * @param radius + * @param angle(degree) + * @param smooth + */ +ImageFilters.Twril = function (srcImageData, centerX, centerY, radius, angle, edge, smooth) { + var srcPixels = srcImageData.data, + srcWidth = srcImageData.width, + srcHeight = srcImageData.height, + srcLength = srcPixels.length, + dstImageData = this.utils.createImageData(srcWidth, srcHeight), + dstPixels = dstImageData.data; + + //convert position to px + centerX = srcWidth * centerX; + centerY = srcHeight * centerY; + + // degree to radian + angle *= (Math.PI / 180); + + var radius2 = radius * radius, + max_y = srcHeight - 1, + max_x = srcWidth - 1, + dstIndex = 0, + x, y, dx, dy, distance, a, tx, ty, srcIndex, pixel, i; + + for (y = 0; y < srcHeight; y += 1) { + for (x = 0; x < srcWidth; x += 1) { + dx = x - centerX; + dy = y - centerY; + distance = dx * dx + dy * dy; + + if (distance > radius2) { + // out of the effected area. just copy the pixel + dstPixels[dstIndex] = srcPixels[dstIndex]; + dstPixels[dstIndex + 1] = srcPixels[dstIndex + 1]; + dstPixels[dstIndex + 2] = srcPixels[dstIndex + 2]; + dstPixels[dstIndex + 3] = srcPixels[dstIndex + 3]; + } else { + // main formula + distance = Math.sqrt(distance); + a = Math.atan2(dy, dx) + (angle * (radius - distance)) / radius; + tx = centerX + distance * Math.cos(a); + ty = centerY + distance * Math.sin(a); + + // copy target pixel + if (smooth) { + // bilinear + this.utils.copyBilinear(srcPixels, tx, ty, srcWidth, srcHeight, dstPixels, dstIndex, edge); + } else { + // nearest neighbor + // round tx, ty + srcIndex = ((ty + 0.5 | 0) * srcWidth + (tx + 0.5 | 0)) << 2; + dstPixels[dstIndex] = srcPixels[srcIndex]; + dstPixels[dstIndex + 1] = srcPixels[srcIndex + 1]; + dstPixels[dstIndex + 2] = srcPixels[srcIndex + 2]; + dstPixels[dstIndex + 3] = srcPixels[srcIndex + 3]; + } + } + + dstIndex += 4; + } + } + + return dstImageData; +}; + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..e1fb52a78c4b41ead2fe0709abf453a42540ab67 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + imagefilters.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.min.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.min.js.js new file mode 100644 index 0000000000000000000000000000000000000000..9c31af83efb105e51fc27936ed0e06eaa24c3e6d --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.min.js.js @@ -0,0 +1,4 @@ +//about - A Javascript Image filter library for the HTML5 Canvas tag. +//author - https://github.com/arahaya/ImageFilters.js +//demo - http://www.arahaya.com/imagefilters/ +var ImageFilters={};ImageFilters.utils={initSampleCanvas:function(){var t=document.createElement("canvas"),a=t.getContext("2d");t.width=0,t.height=0,this.getSampleCanvas=function(){return t},this.getSampleContext=function(){return a},this.createImageData=a.createImageData?function(t,e){return a.createImageData(t,e)}:function(t,a){return new ImageData(t,a)}},getSampleCanvas:function(){return this.initSampleCanvas(),this.getSampleCanvas()},getSampleContext:function(){return this.initSampleCanvas(),this.getSampleContext()},createImageData:function(t,a){return this.initSampleCanvas(),this.createImageData(t,a)},clamp:function(t){return t>255?255:0>t?0:t},buildMap:function(t){for(var a,e=[],i=0;256>i;i+=1)e[i]=(a=t(i))>255?255:0>a?0:0|a;return e},applyMap:function(t,a,e){for(var i=0,r=t.length;r>i;i+=4)a[i]=e[t[i]],a[i+1]=e[t[i+1]],a[i+2]=e[t[i+2]],a[i+3]=t[i+3]},mapRGB:function(t,a,e){this.applyMap(t,a,this.buildMap(e))},getPixelIndex:function(t,a,e,i,r){if(0>t||t>=e||0>a||a>=i)switch(r){case 1:t=0>t?0:t>=e?e-1:t,a=0>a?0:a>=i?i-1:a;break;case 2:t=(t%=e)<0?t+e:t,a=(a%=i)<0?a+i:a;break;default:return null}return a*e+t<<2},getPixel:function(t,a,e,i,r,n){if(0>a||a>=i||0>e||e>=r)switch(n){case 1:a=0>a?0:a>=i?i-1:a,e=0>e?0:e>=r?r-1:e;break;case 2:a=(a%=i)<0?a+i:a,e=(e%=r)<0?e+r:e;break;default:return 0}var h=e*i+a<<2;return t[h+3]<<24|t[h]<<16|t[h+1]<<8|t[h+2]},getPixelByIndex:function(t,a){return t[a+3]<<24|t[a]<<16|t[a+1]<<8|t[a+2]},copyBilinear:function(t,a,e,i,r,n,h,s){var l,u,o,g,f,c,d,m=0>a?a-1|0:0|a,I=0>e?e-1|0:0|e,v=a-m,F=e-I,p=0,w=0,D=0,x=0;if(m>=0&&i-1>m&&I>=0&&r-1>I){if(l=I*i+m<<2,!v&&!F)return n[h]=t[l],n[h+1]=t[l+1],n[h+2]=t[l+2],void(n[h+3]=t[l+3]);p=t[l+3]<<24|t[l]<<16|t[l+1]<<8|t[l+2],l+=4,w=t[l+3]<<24|t[l]<<16|t[l+1]<<8|t[l+2],l=l-8+(i<<2),D=t[l+3]<<24|t[l]<<16|t[l+1]<<8|t[l+2],l+=4,x=t[l+3]<<24|t[l]<<16|t[l+1]<<8|t[l+2]}else{if(p=this.getPixel(t,m,I,i,r,s),!v&&!F)return n[h]=p>>16&255,n[h+1]=p>>8&255,n[h+2]=255&p,void(n[h+3]=p>>24&255);w=this.getPixel(t,m+1,I,i,r,s),D=this.getPixel(t,m,I+1,i,r,s),x=this.getPixel(t,m+1,I+1,i,r,s)}u=1-v,o=1-F,g=((p>>16&255)*u+(w>>16&255)*v)*o+((D>>16&255)*u+(x>>16&255)*v)*F,f=((p>>8&255)*u+(w>>8&255)*v)*o+((D>>8&255)*u+(x>>8&255)*v)*F,c=((255&p)*u+(255&w)*v)*o+((255&D)*u+(255&x)*v)*F,d=((p>>24&255)*u+(w>>24&255)*v)*o+((D>>24&255)*u+(x>>24&255)*v)*F,n[h]=g>255?255:0>g?0:0|g,n[h+1]=f>255?255:0>f?0:0|f,n[h+2]=c>255?255:0>c?0:0|c,n[h+3]=d>255?255:0>d?0:0|d},rgbToHsl:function(t,a,e){t/=255,a/=255,e/=255;var i=t>a?t>e?t:e:a>e?a:e,r=a>t?e>t?t:e:e>a?a:e,n=i-r,h=0,s=0,l=(r+i)/2;return 0!==n&&(h=t===i?(a-e)/n+(e>a?6:0):a===i?(e-t)/n+2:(t-a)/n+4,h/=6,s=l>.5?n/(2-i-r):n/(i+r)),[h,s,l]},hslToRgb:function(t,a,e){var i,r,n,h,s,l,u=[];if(0===a)h=s=l=255*e+.5|0,u=[h,s,l];else{r=.5>=e?e*(a+1):e+a-e*a,i=2*e-r,n=t+1/3;for(var o,g=0;3>g;g+=1)0>n?n+=1:n>1&&(n-=1),o=1>6*n?i+(r-i)*n*6:1>2*n?r:2>3*n?i+(r-i)*(2/3-n)*6:i,u[g]=255*o+.5|0,n-=1/3}return u}},ImageFilters.Translate=function(t,a,e,i){},ImageFilters.Scale=function(t,a,e,i){},ImageFilters.Rotate=function(t,a,e,i,r,n){},ImageFilters.Affine=function(t,a,e,i){},ImageFilters.UnsharpMask=function(t,a){},ImageFilters.ConvolutionFilter=function(t,a,e,i,r,n,h,s,l,u){var o=t.data,g=t.width,f=t.height,c=(o.length,this.utils.createImageData(g,f)),d=c.data;r=r||1,n=n||0,h!==!1&&(h=!0),s!==!1&&(s=!0),l=l||0,u=u||0;for(var m=0,I=a>>1,v=e>>1,F=l>>16&255,p=l>>8&255,w=255&l,D=255*u,x=0;f>x;x+=1)for(var C=0;g>C;C+=1,m+=4){for(var b,B=0,M=0,S=0,R=0,y=!1,G=0,P=-I;I>=P;P+=1){var k,T=x+P;T>=0&&f>T?k=T*g:s?k=x*g:y=!0;for(var z=-v;v>=z;z+=1){var E=i[G++];if(0!==E){var N=C+z;if(N>=0&&g>N||(s?N=C:y=!0),y)B+=E*F,M+=E*p,S+=E*w,R+=E*D;else{var A=k+N<<2;B+=E*o[A],M+=E*o[A+1],S+=E*o[A+2],R+=E*o[A+3]}}}}d[m]=(b=B/r+n)>255?255:0>b?0:0|b,d[m+1]=(b=M/r+n)>255?255:0>b?0:0|b,d[m+2]=(b=S/r+n)>255?255:0>b?0:0|b,d[m+3]=h?o[m+3]:(b=R/r+n)>255?255:0>b?0:0|b}return c},ImageFilters.Binarize=function(t,a){var e=t.data,i=t.width,r=t.height,n=e.length,h=this.utils.createImageData(i,r),s=h.data;isNaN(a)&&(a=.5),a*=255;for(var l=0;n>l;l+=4){var u=e[l]+e[l+1]+e[l+2]/3;s[l]=s[l+1]=s[l+2]=a>=u?0:255,s[l+3]=255}return h},ImageFilters.BlendAdd=function(t,a,e,i){for(var r,n=t.data,h=t.width,s=t.height,l=n.length,u=this.utils.createImageData(h,s),o=u.data,g=a.data,f=0;l>f;f+=4)o[f]=(r=n[f]+g[f])>255?255:r,o[f+1]=(r=n[f+1]+g[f+1])>255?255:r,o[f+2]=(r=n[f+2]+g[f+2])>255?255:r,o[f+3]=255;return u},ImageFilters.BlendSubtract=function(t,a,e,i){for(var r,n=t.data,h=t.width,s=t.height,l=n.length,u=this.utils.createImageData(h,s),o=u.data,g=a.data,f=0;l>f;f+=4)o[f]=(r=n[f]-g[f])<0?0:r,o[f+1]=(r=n[f+1]-g[f+1])<0?0:r,o[f+2]=(r=n[f+2]-g[f+2])<0?0:r,o[f+3]=255;return u},ImageFilters.BoxBlur=function(){var t=function(t,a,e,i,r){var n,h,s,l,u,o,g,f,c,d,m,I,v,F,p=2*r+1,w=r+1,D=e-1,x=0,C=[];for(c=0,d=256*p;d>c;c+=1)C[c]=c/p|0;for(I=0;i>I;I+=1){for(n=h=s=l=0,u=I,o=x<<2,n+=w*t[o],h+=w*t[o+1],s+=w*t[o+2],l+=w*t[o+3],c=1;r>=c;c+=1)o=x+(e>c?c:D)<<2,n+=t[o],h+=t[o+1],s+=t[o+2],l+=t[o+3];for(m=0;e>m;m+=1)o=u<<2,a[o]=C[n],a[o+1]=C[h],a[o+2]=C[s],a[o+3]=C[l],v=m+w,v>D&&(v=D),F=m-r,0>F&&(F=0),g=x+v<<2,f=x+F<<2,n+=t[g]-t[f],h+=t[g+1]-t[f+1],s+=t[g+2]-t[f+2],l+=t[g+3]-t[f+3],u+=i;x+=e}};return function(a,e,i,r){for(var n=a.data,h=a.width,s=a.height,l=(n.length,this.utils.createImageData(h,s)),u=l.data,o=this.utils.createImageData(h,s),g=o.data,f=0;r>f;f+=1)t(f?u:n,g,h,s,e),t(g,u,s,h,i);return l}}(),ImageFilters.GaussianBlur=function(t,a){var e,i,r;switch(a){case 2:e=5,i=[1,1,2,1,1,1,2,4,2,1,2,4,8,4,2,1,2,4,2,1,1,1,2,1,1],r=52;break;case 3:e=7,i=[1,1,2,2,2,1,1,1,2,2,4,2,2,1,2,2,4,8,4,2,2,2,4,8,16,8,4,2,2,2,4,8,4,2,2,1,2,2,4,2,2,1,1,1,2,2,2,1,1],r=140;break;case 4:e=15,i=[2,2,3,4,5,5,6,6,6,5,5,4,3,2,2,2,3,4,5,7,7,8,8,8,7,7,5,4,3,2,3,4,6,7,9,10,10,11,10,10,9,7,6,4,3,4,5,7,9,10,12,13,13,13,12,10,9,7,5,4,5,7,9,11,13,14,15,16,15,14,13,11,9,7,5,5,7,10,12,14,16,17,18,17,16,14,12,10,7,5,6,8,10,13,15,17,19,19,19,17,15,13,10,8,6,6,8,11,13,16,18,19,20,19,18,16,13,11,8,6,6,8,10,13,15,17,19,19,19,17,15,13,10,8,6,5,7,10,12,14,16,17,18,17,16,14,12,10,7,5,5,7,9,11,13,14,15,16,15,14,13,11,9,7,5,4,5,7,9,10,12,13,13,13,12,10,9,7,5,4,3,4,6,7,9,10,10,11,10,10,9,7,6,4,3,2,3,4,5,7,7,8,8,8,7,7,5,4,3,2,2,2,3,4,5,5,6,6,6,5,5,4,3,2,2],r=2044;break;default:e=3,i=[1,2,1,2,4,2,1,2,1],r=16}return this.ConvolutionFilter(t,e,e,i,r,0,!1)},ImageFilters.StackBlur=function(){function t(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var a=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];return function(i,r){var n,h,s,l,u,o,g,f,c,d,m,I,v,F,p,w,D,x,C,b,B,M,S,R,y,G,P,k=i.data,T=i.width,z=i.height,E=(k.length,this.Clone(i)),N=E.data,A=r+r+1,H=T-1,O=z-1,j=r+1,q=j*(j+1)/2,L=new t,U=L,J=a[r],K=e[r];for(s=1;A>s;s+=1)U=U.next=new t,s==j&&(P=U);for(U.next=L,g=o=0,h=0;z>h;h+=1){for(w=D=x=C=f=c=d=m=0,I=j*(b=N[o]),v=j*(B=N[o+1]),F=j*(M=N[o+2]),p=j*(S=N[o+3]),f+=q*b,c+=q*B,d+=q*M,m+=q*S,U=L,s=0;j>s;s+=1)U.r=b,U.g=B,U.b=M,U.a=S,U=U.next;for(s=1;j>s;s+=1)l=o+((s>H?H:s)<<2),f+=(U.r=b=N[l])*(R=j-s),c+=(U.g=B=N[l+1])*R,d+=(U.b=M=N[l+2])*R,m+=(U.a=S=N[l+3])*R,w+=b,D+=B,x+=M,C+=S,U=U.next;for(y=L,G=P,n=0;T>n;n+=1)N[o]=f*J>>K,N[o+1]=c*J>>K,N[o+2]=d*J>>K,N[o+3]=m*J>>K,f-=I,c-=v,d-=F,m-=p,I-=y.r,v-=y.g,F-=y.b,p-=y.a,l=g+((l=n+r+1)n;n+=1){for(D=x=C=w=c=d=m=f=0,o=n<<2,I=j*(b=N[o]),v=j*(B=N[o+1]),F=j*(M=N[o+2]),p=j*(S=N[o+3]),f+=q*b,c+=q*B,d+=q*M,m+=q*S,U=L,s=0;j>s;s+=1)U.r=b,U.g=B,U.b=M,U.a=S,U=U.next;for(u=T,s=1;r>=s;s+=1)o=u+n<<2,f+=(U.r=b=N[o])*(R=j-s),c+=(U.g=B=N[o+1])*R,d+=(U.b=M=N[o+2])*R,m+=(U.a=S=N[o+3])*R,w+=b,D+=B,x+=M,C+=S,U=U.next,O>s&&(u+=T);for(o=n,y=L,G=P,h=0;z>h;h+=1)l=o<<2,N[l]=f*J>>K,N[l+1]=c*J>>K,N[l+2]=d*J>>K,N[l+3]=m*J>>K,f-=I,c-=v,d-=F,m-=p,I-=y.r,v-=y.g,F-=y.b,p-=y.a,l=n+((l=h+j)255?255:t}),n},ImageFilters.BrightnessContrastGimp=function(t,a,e){var i=t.data,r=t.width,n=t.height,h=i.length,s=this.utils.createImageData(r,n),l=s.data,u=Math.PI/4;a/=100,e*=.99,e/=100,e=Math.tan((e+1)*u);for(var o=0,g=0;h>g;g+=4)o+=19595*i[g]+38470*i[g+1]+7471*i[g+2]>>16;return o/=h/4,this.utils.mapRGB(i,l,function(t){return 0>a?t*=1+a:a>0&&(t+=(255-t)*a),0!==e&&(t=(t-o)*e+o),t+.5|0}),s},ImageFilters.BrightnessContrastPhotoshop=function(t,a,e){var i=t.data,r=t.width,n=t.height,h=(i.length,this.utils.createImageData(r,n)),s=h.data;return a=(a+100)/100,e=(e+100)/100,this.utils.mapRGB(i,s,function(t){return t*=a,t=(t-127.5)*e+127.5,t+.5|0}),h},ImageFilters.Channels=function(t,a){var e;switch(a){case 2:e=[0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0];break;case 3:e=[0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0];break;default:e=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0]}return this.ColorMatrixFilter(t,e)},ImageFilters.Clone=function(t){return this.Copy(t,this.utils.createImageData(t.width,t.height))},ImageFilters.CloneBuiltin=function(t){var a,e=t.width,i=t.height,r=this.utils.getSampleCanvas(),n=this.utils.getSampleContext();return r.width=e,r.height=i,n.putImageData(t,0,0),a=n.getImageData(0,0,e,i),r.width=0,r.height=0,a},ImageFilters.ColorMatrixFilter=function(t,a){var e,i,r,n,h,s,l=t.data,u=t.width,o=t.height,g=l.length,f=this.utils.createImageData(u,o),c=f.data,d=a[0],m=a[1],I=a[2],v=a[3],F=a[4],p=a[5],w=a[6],D=a[7],x=a[8],C=a[9],b=a[10],B=a[11],M=a[12],S=a[13],R=a[14],y=a[15],G=a[16],P=a[17],k=a[18],T=a[19];for(i=0;g>i;i+=4)r=l[i],n=l[i+1],h=l[i+2],s=l[i+3],c[i]=(e=r*d+n*m+h*I+s*v+F)>255?255:0>e?0:0|e,c[i+1]=(e=r*p+n*w+h*D+s*x+C)>255?255:0>e?0:0|e,c[i+2]=(e=r*b+n*B+h*M+s*S+R)>255?255:0>e?0:0|e,c[i+3]=(e=r*y+n*G+h*P+s*k+T)>255?255:0>e?0:0|e;return f},ImageFilters.ColorTransformFilter=function(t,a,e,i,r,n,h,s,l){var u,o,g=t.data,f=t.width,c=t.height,d=g.length,m=this.utils.createImageData(f,c),I=m.data;for(u=0;d>u;u+=4)I[u]=(o=g[u]*a+n)>255?255:0>o?0:o,I[u+1]=(o=g[u+1]*e+h)>255?255:0>o?0:o,I[u+2]=(o=g[u+2]*i+s)>255?255:0>o?0:o,I[u+3]=(o=g[u+3]*r+l)>255?255:0>o?0:o;return m},ImageFilters.Copy=function(t,a){for(var e=t.data,i=e.length,r=a.data;i--;)r[i]=e[i];return a},ImageFilters.Crop=function(t,a,e,i,r){var n,h,s,l,u=t.data,o=t.width,g=t.height,f=(u.length,this.utils.createImageData(i,r)),c=f.data,d=Math.max(a,0),m=Math.max(e,0),I=Math.min(a+i,o),v=Math.min(e+r,g),F=d-a,p=m-e;for(n=m,dstRow=p;v>n;n+=1,dstRow+=1)for(h=d,dstCol=F;I>h;h+=1,dstCol+=1)s=n*o+h<<2,l=dstRow*i+dstCol<<2,c[l]=u[s],c[l+1]=u[s+1],c[l+2]=u[s+2],c[l+3]=u[s+3];return f},ImageFilters.CropBuiltin=function(t,a,e,i,r){var n=t.width,h=t.height,s=this.utils.getSampleCanvas(),l=this.utils.getSampleContext();s.width=n,s.height=h,l.putImageData(t,0,0);var u=l.getImageData(a,e,i,r);return s.width=0,s.height=0,u},ImageFilters.Desaturate=function(t){for(var a=t.data,e=t.width,i=t.height,r=a.length,n=this.utils.createImageData(e,i),h=n.data,s=0;r>s;s+=4){var l=a[s],u=a[s+1],o=a[s+2],g=l>u?l>o?l:o:u>o?u:o,f=u>l?o>l?l:o:o>u?u:o,c=(g+f)/2+.5|0;h[s]=h[s+1]=h[s+2]=c,h[s+3]=a[s+3]}return n},ImageFilters.DisplacementMapFilter=function(t,a,e,i,r,n,h,s,l){var u=t.data,o=t.width,g=t.height,f=(u.length,ImageFilters.Clone(t)),c=f.data;e||(e=0),i||(i=0),r||(r=0),n||(n=0),h||(h=0),s||(s=0),l||(l=2);var d,m,I,v,F,p,w,D,x,C=a.width,b=a.height,B=a.data,M=C+e,S=b+i;for(D=0;o>D;D+=1)for(x=0;g>x;x+=1)d=x*o+D<<2,e>D||i>x||D>=M||x>=S?m=d:(I=(x-i)*C+(D-e)<<2,v=B[I+r],p=D+((v-128)*h>>8),F=B[I+n],w=x+((F-128)*s>>8),m=ImageFilters.utils.getPixelIndex(p+.5|0,w+.5|0,o,g,l),null===m&&(m=d)),c[d]=u[m],c[d+1]=u[m+1],c[d+2]=u[m+2],c[d+3]=u[m+3];return f},ImageFilters.Dither=function(t,a){var e=t.width,i=t.height,r=this.Clone(t),n=r.data;a=2>a?2:a>255?255:a;var h,s,l=[],u=a-1,o=0,g=0;for(s=0;a>s;s+=1)l[s]=255*s/u;h=this.utils.buildMap(function(t){var e=l[o];return g+=a,g>255&&(g-=255,o+=1),e});var f,c,d,m,I,v,F,p,w,D,x,C,b,B,M,S=e-1,R=i-1,y=7/16,G=3/16,P=5/16,k=1/16;for(c=0;i>c;c+=1)for(f=0;e>f;f+=1)d=c*e+f<<2,m=n[d],I=n[d+1],v=n[d+2],F=h[m],p=h[I],w=h[v],n[d]=F,n[d+1]=p,n[d+2]=w,D=m-F,x=I-p,C=v-w,d+=4,S>f&&(b=n[d]+y*D,B=n[d+1]+y*x,M=n[d+2]+y*C,n[d]=b>255?255:0>b?0:0|b,n[d+1]=B>255?255:0>B?0:0|B,n[d+2]=M>255?255:0>M?0:0|M),d+=e-2<<2,f>0&&R>c&&(b=n[d]+G*D,B=n[d+1]+G*x,M=n[d+2]+G*C,n[d]=b>255?255:0>b?0:0|b,n[d+1]=B>255?255:0>B?0:0|B,n[d+2]=M>255?255:0>M?0:0|M),d+=4,R>c&&(b=n[d]+P*D,B=n[d+1]+P*x,M=n[d+2]+P*C,n[d]=b>255?255:0>b?0:0|b,n[d+1]=B>255?255:0>B?0:0|B,n[d+2]=M>255?255:0>M?0:0|M),d+=4,S>f&&R>c&&(b=n[d]+k*D,B=n[d+1]+k*x,M=n[d+2]+k*C,n[d]=b>255?255:0>b?0:0|b,n[d+1]=B>255?255:0>B?0:0|B,n[d+2]=M>255?255:0>M?0:0|M);return r},ImageFilters.Edge=function(t){return this.ConvolutionFilter(t,3,3,[-1,-1,-1,-1,8,-1,-1,-1,-1])},ImageFilters.Emboss=function(t){return this.ConvolutionFilter(t,3,3,[-2,-1,0,-1,1,1,0,1,2])},ImageFilters.Enrich=function(t){return this.ConvolutionFilter(t,3,3,[0,-2,0,-2,20,-2,0,-2,0],10,-40)},ImageFilters.Flip=function(t,a){var e,i,r,n,h=t.data,s=t.width,l=t.height,u=(h.length,this.utils.createImageData(s,l)),o=u.data;for(i=0;l>i;i+=1)for(e=0;s>e;e+=1)r=i*s+e<<2,n=a?(l-i-1)*s+e<<2:i*s+(s-e-1)<<2,o[n]=h[r],o[n+1]=h[r+1],o[n+2]=h[r+2],o[n+3]=h[r+3];return u},ImageFilters.Gamma=function(t,a){var e=t.data,i=t.width,r=t.height,n=(e.length,this.utils.createImageData(i,r)),h=n.data;return this.utils.mapRGB(e,h,function(t){return t=255*Math.pow(t/255,1/a)+.5,t>255?255:t+.5|0}),n},ImageFilters.GrayScale=function(t){for(var a=t.data,e=t.width,i=t.height,r=a.length,n=this.utils.createImageData(e,i),h=n.data,s=0;r>s;s+=4){var l=19595*a[s]+38470*a[s+1]+7471*a[s+2]>>16;h[s]=h[s+1]=h[s+2]=l,h[s+3]=a[s+3]}return n},ImageFilters.HSLAdjustment=function(t,a,e,i){var r=t.data,n=t.width,h=t.height,s=r.length,l=this.utils.createImageData(n,h),u=l.data;a/=360,e/=100,i/=100;var o,g,f,c,d,m,I=this.utils.rgbToHsl,v=this.utils.hslToRgb;for(m=0;s>m;m+=4){for(c=I(r[m],r[m+1],r[m+2]),o=c[0]+a;0>o;)o+=1;for(;o>1;)o-=1;g=c[1]+c[1]*e,0>g?g=0:g>1&&(g=1),f=c[2],i>0?f+=(1-f)*i:0>i&&(f+=f*i),d=v(o,g,f),u[m]=d[0],u[m+1]=d[1],u[m+2]=d[2],u[m+3]=r[m+3]}return l},ImageFilters.Invert=function(t){var a=t.data,e=t.width,i=t.height,r=(a.length,this.utils.createImageData(e,i)),n=r.data;return this.utils.mapRGB(a,n,function(t){return 255-t}),r},ImageFilters.Mosaic=function(t,a){var e,i,r,n,h,s,l,u,o,g,f,c,d,m,I,v=t.data,F=t.width,p=t.height,w=(v.length,this.utils.createImageData(F,p)),D=w.data,x=Math.ceil(F/a),C=Math.ceil(p/a);for(e=0;C>e;e+=1)for(h=e*a,s=h+a,s>p&&(s=p),i=0;x>i;i+=1){for(r=i*a,n=r+a,n>F&&(n=F),c=d=m=I=0,f=(n-r)*(s-h),u=h;s>u;u+=1)for(o=u*F,l=r;n>l;l+=1)g=o+l<<2,c+=v[g],d+=v[g+1],m+=v[g+2],I+=v[g+3];for(c=c/f+.5|0,d=d/f+.5|0,m=m/f+.5|0,I=I/f+.5|0,u=h;s>u;u+=1)for(o=u*F,l=r;n>l;l+=1)g=o+l<<2,D[g]=c,D[g+1]=d,D[g+2]=m,D[g+3]=I}return w},ImageFilters.Oil=function(t,a,e){var i,r,n,h,s,l,u,o,g,f,c,d,m,I,v,F,p,w,D=t.data,x=t.width,C=t.height,b=(D.length,this.utils.createImageData(x,C)),B=b.data,M=0,S=[],R=[],y=[],G=[],P=[],k=[];for(r=0;C>r;r+=1)for(i=0;x>i;i+=1){for(n=0;e>n;n+=1)S[n]=R[n]=y[n]=G[n]=P[n]=k[n]=0;for(h=-a;a>=h;h+=1)if(l=r+h,!(0>l||l>=C))for(o=l*x,s=-a;a>=s;s+=1)u=i+s,0>u||u>=x||(g=o+u<<2,f=D[g],c=D[g+1],d=D[g+2],m=f*e>>8,I=c*e>>8,v=d*e>>8,G[m]+=f,P[I]+=c,k[v]+=d,S[m]+=1,R[I]+=1,y[v]+=1);for(F=p=w=0,n=1;e>n;n+=1)S[n]>S[F]&&(F=n),R[n]>R[p]&&(p=n),y[n]>y[w]&&(w=n);B[M]=G[F]/S[F]|0,B[M+1]=P[p]/R[p]|0,B[M+2]=k[w]/y[w]|0,B[M+3]=D[M+3],M+=4}return b},ImageFilters.OpacityFilter=function(t,a){for(var e=t.data,i=t.width,r=t.height,n=e.length,h=this.utils.createImageData(i,r),s=h.data,l=0;n>l;l+=4)s[l]=e[l],s[l+1]=e[l+1],s[l+2]=e[l+2],s[l+3]=a;return h},ImageFilters.Posterize=function(t,a){var e=t.data,i=t.width,r=t.height,n=(e.length,this.utils.createImageData(i,r)),h=n.data;a=2>a?2:a>255?255:a;var s,l=[],u=a-1,o=0,g=0;for(s=0;a>s;s+=1)l[s]=255*s/u;return this.utils.mapRGB(e,h,function(t){var e=l[o];return g+=a,g>255&&(g-=255,o+=1),e}),n},ImageFilters.Rescale=function(t,a){var e=t.data,i=t.width,r=t.height,n=(e.length,this.utils.createImageData(i,r)),h=n.data;return this.utils.mapRGB(e,h,function(t){return t*=a,t>255?255:t+.5|0}),n},ImageFilters.ResizeNearestNeighbor=function(t,a,e){var i,r,n,h,s=t.data,l=t.width,u=t.height,o=(s.length,this.utils.createImageData(a,e)),g=o.data,f=l/a,c=u/e,d=0;for(n=0;e>n;n+=1)for(h=(n*c|0)*l,r=0;a>r;r+=1)i=h+r*f<<2,g[d]=s[i],g[d+1]=s[i+1],g[d+2]=s[i+2],g[d+3]=s[i+3],d+=4;return o},ImageFilters.Resize=function(t,a,e){var i,r,n=t.data,h=t.width,s=t.height,l=(n.length,this.utils.createImageData(a,e)),u=l.data,o=h/a,g=s/e,f=0;for(r=0;e>r;r+=1)for(i=0;a>i;i+=1)this.utils.copyBilinear(n,i*o,r*g,h,s,u,f,0),f+=4;return l},ImageFilters.ResizeBuiltin=function(t,a,e){var i,r=t.width,n=t.height,h=this.utils.getSampleCanvas(),s=this.utils.getSampleContext();return h.width=Math.max(r,a),h.height=Math.max(n,e),s.save(),s.putImageData(t,0,0),s.scale(a/r,e/n),s.drawImage(h,0,0),i=s.getImageData(0,0,a,e),s.restore(),h.width=0,h.height=0,i},ImageFilters.Sepia=function(t){var a,e,i,r,n,h=t.data,s=t.width,l=t.height,u=h.length,o=this.utils.createImageData(s,l),g=o.data;for(r=0;u>r;r+=4)a=h[r],e=h[r+1],i=h[r+2],g[r]=(n=.393*a+.769*e+.189*i)>255?255:0>n?0:n+.5|0,g[r+1]=(n=.349*a+.686*e+.168*i)>255?255:0>n?0:n+.5|0,g[r+2]=(n=.272*a+.534*e+.131*i)>255?255:0>n?0:n+.5|0,g[r+3]=h[r+3];return o},ImageFilters.Sharpen=function(t,a){return this.ConvolutionFilter(t,3,3,[-a/16,-a/8,-a/16,-a/8,.75*a+1,-a/8,-a/16,-a/8,-a/16])},ImageFilters.Solarize=function(t){var a=t.data,e=t.width,i=t.height,r=(a.length,this.utils.createImageData(e,i)),n=r.data;return this.utils.mapRGB(a,n,function(t){return t>127?2*(t-127.5):2*(127.5-t)}),r},ImageFilters.Transpose=function(t){var a,e,i=t.data,r=t.width,n=t.height,h=(i.length,this.utils.createImageData(n,r)),s=h.data;for(y=0;yc;c+=1)for(f=0;l>f;f+=1)d=f-a,m=c-e,I=d*d+m*m,I>D?(g[x]=s[x],g[x+1]=s[x+1],g[x+2]=s[x+2],g[x+3]=s[x+3]):(I=Math.sqrt(I),v=Math.atan2(m,d)+r*(i-I)/i,F=a+I*Math.cos(v),p=e+I*Math.sin(v),h?this.utils.copyBilinear(s,F,p,l,u,g,x,n):(w=(p+.5|0)*l+(F+.5|0)<<2,g[x]=s[w],g[x+1]=s[w+1],g[x+2]=s[w+2],g[x+3]=s[w+3])),x+=4;return o}; \ No newline at end of file diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.min.js.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.min.js.xml new file mode 100644 index 0000000000000000000000000000000000000000..737bc50862af10b2a4e016316f937d98ee089d3e --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/imagefilters/imagefilters.min.js.xml @@ -0,0 +1,28 @@ + + + + + + + + + + __name__ + imagefilters.min.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery.xml new file mode 100644 index 0000000000000000000000000000000000000000..0eef93fbd03b6c5c64811159aa15bda1edd5faa5 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + jquery + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery/jquery-migrate.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery/jquery-migrate.js.js new file mode 100644 index 0000000000000000000000000000000000000000..6b0c5a19564440337aec58bc82906c59461c321f --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery/jquery-migrate.js.js @@ -0,0 +1,2 @@ +/*! jQuery Migrate v1.4.1 | (c) jQuery Foundation and other contributors | jquery.org/license */ +"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(a,b,c){function d(c){var d=b.console;f[c]||(f[c]=!0,a.migrateWarnings.push(c),d&&d.warn&&!a.migrateMute&&(d.warn("JQMIGRATE: "+c),a.migrateTrace&&d.trace&&d.trace()))}function e(b,c,e,f){if(Object.defineProperty)try{return void Object.defineProperty(b,c,{configurable:!0,enumerable:!0,get:function(){return d(f),e},set:function(a){d(f),e=a}})}catch(g){}a._definePropertyBroken=!0,b[c]=e}a.migrateVersion="1.4.1";var f={};a.migrateWarnings=[],b.console&&b.console.log,a.migrateTrace===c&&(a.migrateTrace=!0),a.migrateReset=function(){f={},a.migrateWarnings.length=0},"BackCompat"===document.compatMode&&d("jQuery is not compatible with Quirks Mode");var g=a("",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr( props, pass ) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.find,s=a.parseJSON,t=/^\s*)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=w.exec(a.trim(b)))&&g[0]&&(t.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&e.context.nodeType&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):(h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&u.test(a))try{document.querySelector(a)}catch(c){a=a.replace(v,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),d("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){d("Attribute selector with '#' was not fixed: "+b[0])}}return r.apply(this,b)};var x;for(x in r)Object.prototype.hasOwnProperty.call(r,x)&&(a.find[x]=r[x]);a.parseJSON=function(a){return a?s.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var y=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return y=!0,a=d.apply(this,arguments),y=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};y||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var z=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?z.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var A=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||A.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var B=a.event.add,C=a.event.remove,D=a.event.trigger,E=a.fn.toggle,F=a.fn.live,G=a.fn.die,H=a.fn.load,I="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",J=new RegExp("\\b(?:"+I+")\\b"),K=/(?:^|\s)hover(\.\S+|)\b/,L=function(b){return"string"!=typeof b||a.event.special.hover?b:(K.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(K,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&J.test(b)&&d("AJAX events should be attached to document: "+b),B.call(this,a,L(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){C.call(this,a,L(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===c&&"string"==typeof a[0]?H.apply(this,a):(d("jQuery.fn."+c+"() is deprecated"),a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return E.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;g + + + + + + + + + __name__ + jquery-migrate.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery/jquery.js.js b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery/jquery.js.js new file mode 100644 index 0000000000000000000000000000000000000000..c6a843406cb65e293ad56033a062080165534a36 --- /dev/null +++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_theme/miniPaint/vendor/jquery/jquery.js.js @@ -0,0 +1,4 @@ +/*! jQuery v3.0.0 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.0.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return a&&"[object Object]"===k.call(a)?(b=e(a))?(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n):!0:!1},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;d>f;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;return"string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a)?(d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e):void 0},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"===c||r.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\x00-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\x00"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[0>c?c+b:c]}),even:pa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e)}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,e>i&&ya(a.slice(i,e)),f>e&&ya(a=a.slice(e)),f>e&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;d>b;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;d>b;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(f>b)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(1>=b&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){ +return j.call(r(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:X.test(c)?JSON.parse(c):c}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),Z(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=Z(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthf;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ba(d)&&(e[f]=fa(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;g>f;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ga(this,!0)},hide:function(){return ga(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ba(this)?r(this).show():r(this).hide()})}});var ha=/^(?:checkbox|radio)$/i,ia=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;d>c;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var na=/<|&#?\w+;/;function oa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;o>n;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(na.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ia.exec(f)||["",""])[1].toLowerCase(),i=ka[h]||ka._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;cc;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?r(e,this).index(i)>-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ga(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ha.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ha(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;m>l;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,la(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ea),l=0;i>l;l++)j=h[l],ja.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ba,""),k))}return a}function Ia(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(la(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&ma(la(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(xa,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;e>d;d++)Ga(f[d],g[d]);if(b)if(c)for(f=f||la(a),g=g||la(h),d=0,e=f.length;e>d;d++)Fa(f[d],g[d]);else Fa(a,h);return g=la(h,"script"),g.length>0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(la(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(la(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;f>=g;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ja=/^margin/,Ka=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),La=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",pa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,pa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Ma(a,b,c){var d,e,f,g,h=a.style;return c=c||La(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ka.test(g)&&Ja.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Na(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Oa=/^(none|table(?!-c[ea]).+)/,Pa={position:"absolute",visibility:"hidden",display:"block"},Qa={letterSpacing:"0",fontWeight:"400"},Ra=["Webkit","Moz","ms"],Sa=d.createElement("div").style;function Ta(a){if(a in Sa)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ra.length;while(c--)if(a=Ra[c]+b,a in Sa)return a}function Ua(a,b,c){var d=_.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Va(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=r.css(a,c+aa[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+aa[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+aa[f]+"Width",!0,e))):(g+=r.css(a,"padding"+aa[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+aa[f]+"Width",!0,e)));return g}function Wa(a,b,c){var d,e=!0,f=La(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),0>=d||null==d){if(d=Ma(a,b,f),(0>d||null==d)&&(d=a.style[b]),Ka.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Va(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ma(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=_.exec(c))&&e[1]&&(c=da(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Ma(a,b,d)),"normal"===e&&b in Qa&&(e=Qa[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){return c?!Oa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Wa(a,b,d):ca(a,Pa,function(){return Wa(a,b,d)}):void 0},set:function(a,c,d){var e,f=d&&La(a),g=d&&Va(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=_.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ua(a,c,g)}}}),r.cssHooks.marginLeft=Na(o.reliableMarginLeft,function(a,b){return b?(parseFloat(Ma(a,"marginLeft"))||a.getBoundingClientRect().left-ca(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+aa[d]+b]=f[d]||f[d-2]||f[0];return e}},Ja.test(a)||(r.cssHooks[a+b].set=Ua)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=La(a),e=b.length;e>g;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function eb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ba(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],$a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ga([a],!0),j=a.style.display||j,k=r.css(a,"display"),ga([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ga([a],!0),m.done(function(){p||ga([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=db(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function fb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function gb(a,b,c){var d,e,f=0,g=gb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||bb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Ya||bb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(fb(k,j.opts.specialEasing);g>f;f++)if(d=gb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,db,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(gb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return da(c.elem,a,_.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;e>d;d++)c=a[d],gb.tweeners[c]=gb.tweeners[c]||[],gb.tweeners[c].unshift(b)},prefilters:[eb],prefilter:function(a,b){b?gb.prefilters.unshift(a):gb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:e.duration="number"==typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default,null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ba).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=gb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(cb(b,!0),a,d,e)}}),r.each({slideDown:cb("show"),slideUp:cb("hide"),slideToggle:cb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Ya=r.now();b1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c); +}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){return r.isArray(b)?a.checked=r.inArray(r(a).val(),b)>-1:void 0}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?r.event.trigger(a,b,c,!0):void 0}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",0>b&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;return o.cors||Pb&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("