|
95 | 95 | this.type = 'custom';
|
96 | 96 | this.renderingMode = '3d';
|
97 | 97 | this.overlay = true;
|
| 98 | + this.beginIndex = 0; |
98 | 99 | if (Array.isArray(this.videoParameters)) {
|
99 | 100 | this.videoParameters = smartTimeProcessor(this.interval, this.videoParameters, ['yaw', 'pitch', 'roll', 'x', 'y', 'z', 'extent']);
|
100 | 101 | const timeArr = this.videoParameters.map((item) => {
|
101 | 102 | return item.time;
|
102 | 103 | })
|
| 104 | + this.beginIndex = timeArr[0]; |
103 | 105 | this.finder = new FastRangeSearcher(timeArr);
|
104 | 106 | }
|
105 | 107 | }
|
|
266 | 268 | let srcTri = this.cv.matFromArray(4, 1, this.cv.CV_32FC2,
|
267 | 269 | srcPixelCoords
|
268 | 270 | );
|
269 |
| - that.dsize = that.timeParams[0].dsize; |
270 |
| - let dstTri = that.timeParams[0].dstTri; |
| 271 | + that.dsize = that.timeParams[that.beginIndex].dsize; |
| 272 | + let dstTri = that.timeParams[that.beginIndex].dstTri; |
271 | 273 | let canvas = document.createElement('canvas');
|
272 |
| - let { clipMat, dst1 } = this._updateMask(canvas, that.timeParams[0].realHeight, that.timeParams[0].ratio); |
| 274 | + let { clipMat, dst1 } = this._updateMask(canvas, that.timeParams[that.beginIndex].realHeight, that.timeParams[that.beginIndex].ratio); |
273 | 275 | let count = 0;
|
274 | 276 | const videoEle = this.video.tech().el();
|
275 | 277 | let current = 0;
|
|
319 | 321 | newFrame = new ImageData(new Uint8ClampedArray(dst.data), dst.cols, dst.rows);
|
320 | 322 | } else {
|
321 | 323 | if (that.videoParameters.length > 1) {
|
322 |
| - const res = that._updateMask(canvas, that.timeParams[0].realHeight, that.timeParams[0].ratio); |
| 324 | + const res = that._updateMask(canvas, that.timeParams[that.beginIndex].realHeight, that.timeParams[that.beginIndex].ratio); |
323 | 325 | clipMat = res.clipMat;
|
324 | 326 | dst1 = res.dst1;
|
325 | 327 | }
|
|
378 | 380 | }
|
379 | 381 |
|
380 | 382 | _contain(coord, bounds) {
|
381 |
| - return coord[0] >= bounds[0] && coord[0] <= bounds[2] && coord[1] >= bounds[1] && coord[1] <= bounds[3]; |
| 383 | + return (coord[0] > bounds[0] || Math.abs(coord[0] - bounds[0]) < 0.000001 ) && (coord[0] < bounds[2] || Math.abs(coord[0] - bounds[2]) < 0.000001 ) && (coord[1] > bounds[1] || Math.abs(coord[1] - bounds[1]) < 0.000001) && (coord[1] < bounds[3] || Math.abs(coord[1] - bounds[3]) < 0.000001); |
382 | 384 | }
|
383 | 385 |
|
384 | 386 | /**
|
|
0 commit comments