kfb-view 2.1.9 → 2.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/git_toolbox_prj.xml +5 -0
- package/.idea/workspace.xml +78 -63
- package/config/webpack.dev.conf.js +2 -2
- package/example/index.js +91 -69
- package/lib/kfb-view.js +1 -1
- package/package.json +2 -2
- package/src/components/tailoring/index.js +4 -8
- package/src/index.js +2 -1
- package/src/util/imageData.js +10 -6
|
@@ -11,5 +11,10 @@
|
|
|
11
11
|
<option name="enabled" value="true" />
|
|
12
12
|
</CommitMessageValidationOverride>
|
|
13
13
|
</option>
|
|
14
|
+
<option name="commitMessageValidationEnabledOverride">
|
|
15
|
+
<BoolValueOverride>
|
|
16
|
+
<option name="enabled" value="true" />
|
|
17
|
+
</BoolValueOverride>
|
|
18
|
+
</option>
|
|
14
19
|
</component>
|
|
15
20
|
</project>
|
package/.idea/workspace.xml
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
<component name="ChangeListManager">
|
|
39
39
|
<list default="true" id="55024232-8108-4dc9-9bd3-0fd2aa2f34f8" name="Default Changelist" comment="">
|
|
40
40
|
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
41
|
+
<change beforePath="$PROJECT_DIR$/src/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.js" afterDir="false" />
|
|
41
42
|
</list>
|
|
42
43
|
<option name="SHOW_DIALOG" value="false" />
|
|
43
44
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -60,6 +61,9 @@
|
|
|
60
61
|
</option>
|
|
61
62
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
62
63
|
</component>
|
|
64
|
+
<component name="GitToolBoxStore">
|
|
65
|
+
<option name="projectConfigVersion" value="5" />
|
|
66
|
+
</component>
|
|
63
67
|
<component name="MarkdownSettingsMigration">
|
|
64
68
|
<option name="stateVersion" value="1" />
|
|
65
69
|
</component>
|
|
@@ -68,26 +72,17 @@
|
|
|
68
72
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
69
73
|
<option name="showLibraryContents" value="true" />
|
|
70
74
|
</component>
|
|
71
|
-
<component name="PropertiesComponent">
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<property name="node.js.selected.package.standard" value="" />
|
|
83
|
-
<property name="nodejs_interpreter_path" value="$USER_HOME$/.nvm/versions/node/v10.15.1/bin/node" />
|
|
84
|
-
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
|
85
|
-
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
|
|
86
|
-
<property name="nodejs_package_manager_path" value="npm" />
|
|
87
|
-
<property name="settings.editor.selected.configurable" value="settings.nodejs" />
|
|
88
|
-
<property name="ts.external.directory.path" value="$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/jsLanguageServicesImpl/external" />
|
|
89
|
-
<property name="vue.rearranger.settings.migration" value="true" />
|
|
90
|
-
</component>
|
|
75
|
+
<component name="PropertiesComponent">{
|
|
76
|
+
"keyToString": {
|
|
77
|
+
"WebServerToolWindowFactoryState": "false",
|
|
78
|
+
"dart.analysis.tool.window.visible": "false",
|
|
79
|
+
"last_opened_file_path": "/home/fanqifeng/WebstormProjects/kfb-view",
|
|
80
|
+
"node.js.detected.package.eslint": "true",
|
|
81
|
+
"node.js.selected.package.eslint": "(autodetect)",
|
|
82
|
+
"nodejs_package_manager_path": "yarn",
|
|
83
|
+
"vue.rearranger.settings.migration": "true"
|
|
84
|
+
}
|
|
85
|
+
}</component>
|
|
91
86
|
<component name="RecentsManager">
|
|
92
87
|
<key name="MoveFile.RECENT_KEYS">
|
|
93
88
|
<recent name="$PROJECT_DIR$/src" />
|
|
@@ -111,7 +106,7 @@
|
|
|
111
106
|
<scripts>
|
|
112
107
|
<script value="build:lib" />
|
|
113
108
|
</scripts>
|
|
114
|
-
<node-interpreter value="
|
|
109
|
+
<node-interpreter value="$USER_HOME$/.nvm/versions/node/v10.15.1/bin/node" />
|
|
115
110
|
<package-manager value="npm" />
|
|
116
111
|
<envs />
|
|
117
112
|
<method v="2" />
|
|
@@ -127,24 +122,23 @@
|
|
|
127
122
|
<envs />
|
|
128
123
|
<method v="2" />
|
|
129
124
|
</configuration>
|
|
130
|
-
<configuration name="
|
|
125
|
+
<configuration name="clean:lib" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
|
|
131
126
|
<package-json value="$PROJECT_DIR$/package.json" />
|
|
132
127
|
<command value="run" />
|
|
133
128
|
<scripts>
|
|
134
|
-
<script value="
|
|
129
|
+
<script value="clean:lib" />
|
|
135
130
|
</scripts>
|
|
136
131
|
<node-interpreter value="project" />
|
|
137
132
|
<envs />
|
|
138
133
|
<method v="2" />
|
|
139
134
|
</configuration>
|
|
140
|
-
<configuration name="server
|
|
135
|
+
<configuration name="server" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
|
|
141
136
|
<package-json value="$PROJECT_DIR$/package.json" />
|
|
142
137
|
<command value="run" />
|
|
143
138
|
<scripts>
|
|
144
|
-
<script value="server
|
|
139
|
+
<script value="server" />
|
|
145
140
|
</scripts>
|
|
146
141
|
<node-interpreter value="project" />
|
|
147
|
-
<package-manager value="npm" />
|
|
148
142
|
<envs />
|
|
149
143
|
<method v="2" />
|
|
150
144
|
</configuration>
|
|
@@ -160,19 +154,19 @@
|
|
|
160
154
|
<method v="2" />
|
|
161
155
|
</configuration>
|
|
162
156
|
<list>
|
|
163
|
-
<item itemvalue="npm.server:dev" />
|
|
164
157
|
<item itemvalue="npm.server:hot" />
|
|
165
158
|
<item itemvalue="npm.build:lib" />
|
|
166
159
|
<item itemvalue="npm.build:prod" />
|
|
167
|
-
<item itemvalue="npm.
|
|
160
|
+
<item itemvalue="npm.server" />
|
|
161
|
+
<item itemvalue="npm.clean:lib" />
|
|
168
162
|
</list>
|
|
169
163
|
<recent_temporary>
|
|
170
164
|
<list>
|
|
171
165
|
<item itemvalue="npm.build:lib" />
|
|
166
|
+
<item itemvalue="npm.clean:lib" />
|
|
167
|
+
<item itemvalue="npm.server" />
|
|
172
168
|
<item itemvalue="npm.build:prod" />
|
|
173
169
|
<item itemvalue="npm.server:hot" />
|
|
174
|
-
<item itemvalue="npm.lint" />
|
|
175
|
-
<item itemvalue="npm.server:dev" />
|
|
176
170
|
</list>
|
|
177
171
|
</recent_temporary>
|
|
178
172
|
</component>
|
|
@@ -256,28 +250,21 @@
|
|
|
256
250
|
<workItem from="1641349006244" duration="1011000" />
|
|
257
251
|
<workItem from="1641351835998" duration="596000" />
|
|
258
252
|
<workItem from="1646288182802" duration="1809000" />
|
|
259
|
-
<workItem from="1646290338220" duration="
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
<
|
|
263
|
-
<
|
|
264
|
-
<
|
|
265
|
-
<
|
|
266
|
-
<
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
<
|
|
270
|
-
<
|
|
271
|
-
<
|
|
272
|
-
<
|
|
273
|
-
<
|
|
274
|
-
</task>
|
|
275
|
-
<task id="LOCAL-00003" summary="borad和shape组件重构完成">
|
|
276
|
-
<created>1600935429306</created>
|
|
277
|
-
<option name="number" value="00003" />
|
|
278
|
-
<option name="presentableId" value="LOCAL-00003" />
|
|
279
|
-
<option name="project" value="LOCAL" />
|
|
280
|
-
<updated>1600935429306</updated>
|
|
253
|
+
<workItem from="1646290338220" duration="3020000" />
|
|
254
|
+
<workItem from="1647822528539" duration="6003000" />
|
|
255
|
+
<workItem from="1647829382894" duration="594000" />
|
|
256
|
+
<workItem from="1647836886455" duration="602000" />
|
|
257
|
+
<workItem from="1648018813125" duration="1482000" />
|
|
258
|
+
<workItem from="1648082997200" duration="605000" />
|
|
259
|
+
<workItem from="1648452730691" duration="5266000" />
|
|
260
|
+
<workItem from="1648517192369" duration="589000" />
|
|
261
|
+
<workItem from="1648538452228" duration="597000" />
|
|
262
|
+
<workItem from="1648600000586" duration="2000" />
|
|
263
|
+
<workItem from="1648600228639" duration="615000" />
|
|
264
|
+
<workItem from="1649210756779" duration="440000" />
|
|
265
|
+
<workItem from="1649917532637" duration="802000" />
|
|
266
|
+
<workItem from="1649923434423" duration="255000" />
|
|
267
|
+
<workItem from="1649923736794" duration="58000" />
|
|
281
268
|
</task>
|
|
282
269
|
<task id="LOCAL-00004" summary="borad和shape组件重构完成">
|
|
283
270
|
<created>1600935454439</created>
|
|
@@ -594,19 +581,47 @@
|
|
|
594
581
|
<option name="project" value="LOCAL" />
|
|
595
582
|
<updated>1646293408931</updated>
|
|
596
583
|
</task>
|
|
597
|
-
<
|
|
584
|
+
<task id="LOCAL-00049" summary="2.1.9">
|
|
585
|
+
<created>1646293508969</created>
|
|
586
|
+
<option name="number" value="00049" />
|
|
587
|
+
<option name="presentableId" value="LOCAL-00049" />
|
|
588
|
+
<option name="project" value="LOCAL" />
|
|
589
|
+
<updated>1646293508969</updated>
|
|
590
|
+
</task>
|
|
591
|
+
<task id="LOCAL-00050" summary="增加图像处理操作">
|
|
592
|
+
<created>1647827904359</created>
|
|
593
|
+
<option name="number" value="00050" />
|
|
594
|
+
<option name="presentableId" value="LOCAL-00050" />
|
|
595
|
+
<option name="project" value="LOCAL" />
|
|
596
|
+
<updated>1647827904359</updated>
|
|
597
|
+
</task>
|
|
598
|
+
<task id="LOCAL-00051" summary="2.1.10">
|
|
599
|
+
<created>1648457445389</created>
|
|
600
|
+
<option name="number" value="00051" />
|
|
601
|
+
<option name="presentableId" value="LOCAL-00051" />
|
|
602
|
+
<option name="project" value="LOCAL" />
|
|
603
|
+
<updated>1648457445389</updated>
|
|
604
|
+
</task>
|
|
605
|
+
<task id="LOCAL-00052" summary="2.1.11 截图优化">
|
|
606
|
+
<created>1649917728743</created>
|
|
607
|
+
<option name="number" value="00052" />
|
|
608
|
+
<option name="presentableId" value="LOCAL-00052" />
|
|
609
|
+
<option name="project" value="LOCAL" />
|
|
610
|
+
<updated>1649917728743</updated>
|
|
611
|
+
</task>
|
|
612
|
+
<option name="localTasksCounter" value="53" />
|
|
598
613
|
<servers />
|
|
599
614
|
</component>
|
|
600
615
|
<component name="TypeScriptGeneratedFilesManager">
|
|
601
616
|
<option name="version" value="3" />
|
|
602
617
|
</component>
|
|
603
618
|
<component name="Vcs.Log.History.Properties">
|
|
604
|
-
<option name="
|
|
619
|
+
<option name="COLUMN_ID_ORDER">
|
|
605
620
|
<list>
|
|
606
|
-
<option value="
|
|
607
|
-
<option value="
|
|
608
|
-
<option value="
|
|
609
|
-
<option value="
|
|
621
|
+
<option value="Default.Root" />
|
|
622
|
+
<option value="Default.Author" />
|
|
623
|
+
<option value="Default.Date" />
|
|
624
|
+
<option value="Default.Subject" />
|
|
610
625
|
</list>
|
|
611
626
|
</option>
|
|
612
627
|
</component>
|
|
@@ -636,10 +651,6 @@
|
|
|
636
651
|
<component name="VcsManagerConfiguration">
|
|
637
652
|
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
|
|
638
653
|
<option name="LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN" value="false" />
|
|
639
|
-
<MESSAGE value="导航图优化" />
|
|
640
|
-
<MESSAGE value="gnore" />
|
|
641
|
-
<MESSAGE value="标注信息从shape中移到area" />
|
|
642
|
-
<MESSAGE value="2.0.15" />
|
|
643
654
|
<MESSAGE value="优化代码结构" />
|
|
644
655
|
<MESSAGE value="2.0.16" />
|
|
645
656
|
<MESSAGE value="优化Curve标注,增加是否是闭合曲线参数" />
|
|
@@ -661,7 +672,11 @@
|
|
|
661
672
|
<MESSAGE value="优化,增加部分注释" />
|
|
662
673
|
<MESSAGE value="2.1.8" />
|
|
663
674
|
<MESSAGE value="TerserPlugin" />
|
|
664
|
-
<
|
|
675
|
+
<MESSAGE value="2.1.9" />
|
|
676
|
+
<MESSAGE value="增加图像处理操作" />
|
|
677
|
+
<MESSAGE value="2.1.10" />
|
|
678
|
+
<MESSAGE value="2.1.11 截图优化" />
|
|
679
|
+
<option name="LAST_COMMIT_MESSAGE" value="2.1.11 截图优化" />
|
|
665
680
|
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
|
|
666
681
|
</component>
|
|
667
682
|
<component name="XSLT-Support.FileAssociations.UIState">
|
|
@@ -65,9 +65,9 @@ module.exports = function() {
|
|
|
65
65
|
context: ['/api', '/image.php', '/process.php'],
|
|
66
66
|
// target: 'http://gastric.label.hzztai.com/',
|
|
67
67
|
// target: 'http://192.168.1.91:7007',
|
|
68
|
-
|
|
68
|
+
target: 'http://192.168.1.91',
|
|
69
69
|
// target: 'https://tct.hzztai.com',
|
|
70
|
-
target: 'https://pis-ningbo.hzztai.com',
|
|
70
|
+
// target: 'https://pis-ningbo.hzztai.com',
|
|
71
71
|
secure: false,
|
|
72
72
|
changeOrigin: true,
|
|
73
73
|
},
|
package/example/index.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
import {KfbView,
|
|
1
|
+
import {KfbView, hslToRgb, rgbToHsl, cacheGammaTable} from '../src';
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import {EVENT_TAILORING_SCREENSHOT} from '../src/const/event';
|
|
4
4
|
|
|
5
|
-
const fileName = '/upload/large_file/last/
|
|
5
|
+
const fileName = '/upload/large_file/last/2022/02/21/d31a31bf1ae5b73fca63f72e2affc879/胃镜1.kfb';
|
|
6
6
|
|
|
7
7
|
const instance = axios.create({
|
|
8
8
|
baseURL: '/api',
|
|
9
9
|
timeout: 1000,
|
|
10
|
-
headers: {'Authorization': 'bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
10
|
+
headers: {'Authorization': 'bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjEuOTFcL2FwaVwvYXV0aFwvbG9naW4iLCJpYXQiOjE2NDg0NTQwNjEsImV4cCI6MTY0OTA1ODg2MSwibmJmIjoxNjQ4NDU0MDYxLCJqdGkiOiJ6WXZUNnJXVzhoQTBrUTYzIiwic3ViIjoxLCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIn0.qMTNZvIxSVLGfh8jFTiXKBf7BQXXuz4n2cUj7Ewj6lk'},
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
let cacheImage = {};
|
|
14
|
+
|
|
15
|
+
const debounce = (func, delay) => {
|
|
16
|
+
let timer;
|
|
17
|
+
return function(...args) {
|
|
18
|
+
if (timer) {
|
|
19
|
+
clearTimeout(timer);
|
|
20
|
+
}
|
|
21
|
+
timer = setTimeout(() => {
|
|
22
|
+
// eslint-disable-next-line no-invalid-this,babel/no-invalid-this
|
|
23
|
+
func.apply(this, args);
|
|
24
|
+
}, delay);
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
instance.get(`/slide/info?file=${fileName}`).then(({data}) => {
|
|
14
29
|
let params = {};
|
|
15
30
|
params.file = fileName;
|
|
16
31
|
const kv = new KfbView({
|
|
@@ -31,7 +46,7 @@ instance.get(`/ai/kfb/info?file=${fileName}`).then(({data}) => {
|
|
|
31
46
|
disabled: false,
|
|
32
47
|
height: 200,
|
|
33
48
|
style: 'right: 0;top: 0',
|
|
34
|
-
thumbnail: `/api/
|
|
49
|
+
thumbnail: `/api/slide/getImage?file=${fileName}&type=thumbnail`,
|
|
35
50
|
vestige: true,
|
|
36
51
|
vestigeZoom: .1,
|
|
37
52
|
},
|
|
@@ -78,15 +93,16 @@ instance.get(`/ai/kfb/info?file=${fileName}`).then(({data}) => {
|
|
|
78
93
|
position,
|
|
79
94
|
size,
|
|
80
95
|
initRendered,
|
|
96
|
+
tile,
|
|
81
97
|
} = e;
|
|
82
98
|
let rangeA = document.querySelector('#a').value / 1;
|
|
99
|
+
let rangeS = document.querySelector('#s').value / 1;
|
|
100
|
+
let rangeL = document.querySelector('#l').value / 1;
|
|
101
|
+
let rangeR = document.querySelector('#r').value / 1;
|
|
102
|
+
let rangeG = document.querySelector('#g').value / 1;
|
|
83
103
|
let rangeB = document.querySelector('#b').value / 1;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
position.y = position.y >> 0;
|
|
87
|
-
size.y = size.y >> 0;
|
|
88
|
-
size.x = size.x >> 0;
|
|
89
|
-
if (rangeB === 0 && rangeA === 1 && rangeC === 0) {
|
|
104
|
+
if (rangeB === 0 && rangeA === 1 && rangeS === 0 && rangeL === 0 &&
|
|
105
|
+
rangeR === 0 && rangeG === 0) {
|
|
90
106
|
context.drawImage(
|
|
91
107
|
rendered.canvas,
|
|
92
108
|
0,
|
|
@@ -100,64 +116,67 @@ instance.get(`/ai/kfb/info?file=${fileName}`).then(({data}) => {
|
|
|
100
116
|
);
|
|
101
117
|
return;
|
|
102
118
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
let imageData = undefined;
|
|
108
|
-
let length = isSource ? sourceLength : sizeLength;
|
|
109
|
-
if (isSource) {
|
|
110
|
-
imageData = initRendered.getImageData(0, 0, canvas.width,
|
|
119
|
+
if (!cacheImage[tile.url]) {
|
|
120
|
+
const sourceLength = sourceWidth * sourceHeight;
|
|
121
|
+
const canvas = rendered.canvas;
|
|
122
|
+
let imageData = initRendered.getImageData(0, 0, canvas.width,
|
|
111
123
|
canvas.height);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
124
|
+
for (let i = 0; i < sourceLength; i++) {
|
|
125
|
+
let r = imageData.data[i * 4 + 0];
|
|
126
|
+
let g = imageData.data[i * 4 + 1];
|
|
127
|
+
let b = imageData.data[i * 4 + 2];
|
|
128
|
+
if (rangeR !== 0) {
|
|
129
|
+
r = r * (1 + rangeR);
|
|
130
|
+
r = r > 255 ? 255 : r;
|
|
131
|
+
}
|
|
132
|
+
if (rangeG !== 0) {
|
|
133
|
+
g = g * (1 + rangeG);
|
|
134
|
+
g = g > 255 ? 255 : g;
|
|
135
|
+
}
|
|
136
|
+
if (rangeB !== 0) {
|
|
137
|
+
b = b * (1 + rangeB);
|
|
138
|
+
g = g > 255 ? 255 : g;
|
|
139
|
+
}
|
|
140
|
+
if (rangeS !== 0) {
|
|
141
|
+
let {h, s, l} = rgbToHsl(r, g, b);
|
|
142
|
+
const rgb = hslToRgb(h, s * (1 + rangeS), l);
|
|
143
|
+
r = rgb.r;
|
|
144
|
+
g = rgb.g;
|
|
145
|
+
b = rgb.b;
|
|
146
|
+
}
|
|
147
|
+
if (rangeL !== 0) {
|
|
148
|
+
let {h, s, l} = rgbToHsl(r, g, b);
|
|
149
|
+
const rgb = hslToRgb(h, s, l * (1 + rangeL));
|
|
150
|
+
r = rgb.r;
|
|
151
|
+
g = rgb.g;
|
|
152
|
+
b = rgb.b;
|
|
153
|
+
}
|
|
154
|
+
if (rangeA !== 1) {
|
|
155
|
+
r = cacheGammaTable[rangeA][r >> 0];
|
|
156
|
+
g = cacheGammaTable[rangeA][g >> 0];
|
|
157
|
+
b = cacheGammaTable[rangeA][b >> 0];
|
|
158
|
+
}
|
|
159
|
+
if (r > 255 || g > 255 || b > 255) {
|
|
160
|
+
console.log(r, g, b);
|
|
161
|
+
}
|
|
162
|
+
imageData.data[i * 4 + 0] = r;
|
|
163
|
+
imageData.data[i * 4 + 1] = g;
|
|
164
|
+
imageData.data[i * 4 + 2] = b;
|
|
139
165
|
}
|
|
140
|
-
imageData.data[i * 4 + 0] = r;
|
|
141
|
-
imageData.data[i * 4 + 1] = g;
|
|
142
|
-
imageData.data[i * 4 + 2] = b;
|
|
143
|
-
}
|
|
144
|
-
if (isSource) {
|
|
145
166
|
rendered.putImageData(imageData, 0, 0);
|
|
146
|
-
|
|
147
|
-
canvas,
|
|
148
|
-
0,
|
|
149
|
-
0,
|
|
150
|
-
sourceWidth,
|
|
151
|
-
sourceHeight,
|
|
152
|
-
position.x,
|
|
153
|
-
position.y,
|
|
154
|
-
size.x,
|
|
155
|
-
size.y,
|
|
156
|
-
);
|
|
157
|
-
} else {
|
|
158
|
-
context.putImageData(imageData, position.x, position.y);
|
|
159
|
-
/* context.drawImage(offCanvas, position.x, position.y, size.x, size.y);*/
|
|
167
|
+
cacheImage[tile.url] = canvas;
|
|
160
168
|
}
|
|
169
|
+
context.drawImage(
|
|
170
|
+
cacheImage[tile.url],
|
|
171
|
+
0,
|
|
172
|
+
0,
|
|
173
|
+
sourceWidth,
|
|
174
|
+
sourceHeight,
|
|
175
|
+
position.x,
|
|
176
|
+
position.y,
|
|
177
|
+
size.x,
|
|
178
|
+
size.y,
|
|
179
|
+
);
|
|
161
180
|
},
|
|
162
181
|
});
|
|
163
182
|
/* kv.board.startDraw({
|
|
@@ -165,13 +184,16 @@ instance.get(`/ai/kfb/info?file=${fileName}`).then(({data}) => {
|
|
|
165
184
|
});*/
|
|
166
185
|
console.log(kv);
|
|
167
186
|
let list = [];
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
187
|
+
document.querySelector('#a').onchange = debounce(changeRange, 500);
|
|
188
|
+
document.querySelector('#s').onchange = debounce(changeRange, 500);
|
|
189
|
+
document.querySelector('#l').onchange = debounce(changeRange, 500);
|
|
190
|
+
document.querySelector('#r').onchange = debounce(changeRange, 500);
|
|
191
|
+
document.querySelector('#g').onchange = debounce(changeRange, 500);
|
|
192
|
+
document.querySelector('#b').onchange = debounce(changeRange, 500);
|
|
172
193
|
|
|
173
194
|
// eslint-disable-next-line no-unused-vars
|
|
174
195
|
function changeRange() {
|
|
196
|
+
cacheImage = {};
|
|
175
197
|
kv.viewer.forceRedraw();
|
|
176
198
|
}
|
|
177
199
|
|