Skip to content

Commit 92f249a

Browse files
author
Johan Junik Jo
committed
cover 100%
1 parent f7b58d4 commit 92f249a

13 files changed

+2328
-548
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# vue-image-diff
2-
![Alt Text](example.gif)
2+
![Alt Text](https://github.com/whwnsdlr1/vue-image-diff/blob/master/example/example.gif)
33
vue component for multiple image comparison.
4+
<br />
45
currently supported only 8bit jpg and png format.
56

67
Web-App: [https://github.com/whwnsdlr1/image-diff](https://github.com/whwnsdlr1/image-diff)
78
<br />
89
jsfiddle1: [https://jsfiddle.net/whwnsdlr1/xgz21e95/](https://jsfiddle.net/whwnsdlr1/xgz21e95/)
910
<br />
10-
jsfiddle2: 44
11+
jsfiddle2: [https://jsfiddle.net/whwnsdlr1/84bkq2hy/](https://jsfiddle.net/whwnsdlr1/84bkq2hy/)
1112
<br />
1213

1314
## Usage
15+
### how to include component
1416
in Vue Project
1517
```html
1618
<template>
@@ -40,6 +42,8 @@ in html
4042
...
4143
</body>
4244
```
45+
46+
### arguments structure
4347
data is array of object.
4448
```js
4549
data = [
@@ -90,7 +94,7 @@ options = {
9094
}
9195
```
9296

93-
options is object
97+
optionsToolBar is object
9498
```js
9599
optToolBar = {
96100
show: true, // Bool, (optional)
@@ -113,11 +117,14 @@ optToolBar = {
113117
}
114118
}
115119
```
120+
### functions
121+
- open Control panel: openControlPanel()
122+
![Alt Text](https://github.com/whwnsdlr1/vue-image-diff/blob/master/example/control_panel.png)
116123

117124
### Control
118125
- mouse & touch drag - panning
119126
- mouse wheel & pinch to zoom - zoom in / out
120-
- mouse doubleclick - select reference image for diff
127+
- mouse doubleclick - change reference image for diff
121128

122129
## Browser support - (tested)
123130
- Google Chrome 77+
@@ -151,11 +158,4 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
151158
- babel-eslint
152159
- eslint
153160
- eslint-plugin-vue
154-
<<<<<<< HEAD
155161
- vue-template-compiler
156-
=======
157-
- vue-template-compiler
158-
159-
## TO-DO
160-
- support other image format(bmp, tiff)
161-
>>>>>>> 178c8e43b796b7c6fef2decb6685709138db91fb

dist/vue-image-diff.common.js

Lines changed: 1054 additions & 248 deletions
Large diffs are not rendered by default.

dist/vue-image-diff.common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-image-diff.umd.js

Lines changed: 1054 additions & 248 deletions
Large diffs are not rendered by default.

dist/vue-image-diff.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-image-diff.umd.min.js

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-image-diff.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/control_panel.png

59.7 KB
Loading
File renamed without changes.

src/App.vue

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ export default {
207207
cornerstoneImage = await Vue.$cornerstone.createCornerstoneImageRgba(undefined, image.pixelData, defWidth, defHeight)
208208
resized = false
209209
}
210-
211210
framesData.push({
212211
id: datum.id,
213212
cornerstoneImage,
@@ -408,6 +407,20 @@ export default {
408407
}
409408
410409
if (Vue.state.diff.activate == true) {
410+
if (data.diff.opacity != undefined) {
411+
Vue.state.diff.opacity = data.diff.opacity
412+
}
413+
let isChangeDiffColors = false
414+
if (data.diff.colors != undefined) {
415+
if (data.diff.colors.same != undefined) {
416+
Vue.state.diff.colors.same = data.diff.colors.same
417+
isChangeDiffColors = true
418+
}
419+
if (data.diff.colors.diff != undefined) {
420+
Vue.state.diff.colors.diff = data.diff.colors.diff
421+
isChangeDiffColors = true
422+
}
423+
}
411424
Vue.layer.message = 'check pre-cacluated diff'
412425
await Vue.nextTick()
413426
let framesData = Vue.framesData
@@ -424,6 +437,9 @@ export default {
424437
frameData.cornerstoneImage.height
425438
)
426439
}
440+
if (data.diff.opacity != undefined) {
441+
frameData.diff.opacity = Vue.state.diff.opacity
442+
}
427443
}
428444
if (Vue.diffs == undefined) {
429445
let diffs = {}
@@ -474,7 +490,7 @@ export default {
474490
referenceFrameData.diff.pixelCount = undefined
475491
referenceFrameData.diff.psnr = undefined
476492
}
477-
if (isChangeTolerance || isChangeReference) {
493+
if (isChangeDiffColors || isChangeTolerance || isChangeReference) {
478494
const tolerance = Vue.state.diff.tolerance
479495
const frameId1 = Vue.framesData[Vue.framesData.map(v => v.id).indexOf(Vue.state.diff.reference.id)].id
480496
for (let i2 = 0; i2 < Vue.framesData.length; i2++) {
@@ -521,6 +537,16 @@ export default {
521537
}
522538
}
523539
}
540+
if (data.style != undefined) {
541+
if (data.style.borderWidth != undefined)
542+
Vue.state.style.borderWidth = data.style.borderWidth
543+
if (data.style.borderColor != undefined)
544+
Vue.state.style.borderColor = data.style.borderColor
545+
if (data.style.showOverlayText != undefined)
546+
Vue.state.style.showOverlayText = data.style.showOverlayText
547+
if (data.style.frameRowCount != undefined)
548+
Vue.state.style.frameRowCount = data.style.frameRowCount
549+
}
524550
Vue.layer.active = false
525551
})
526552
},

0 commit comments

Comments
 (0)