|
@@ -47,7 +47,13 @@ class DepthImageSampler extends THREE.EventDispatcher{
|
|
this.canvas.width = img.width
|
|
this.canvas.width = img.width
|
|
this.canvas.height = img.height
|
|
this.canvas.height = img.height
|
|
this.context.drawImage(img, 0, 0)
|
|
this.context.drawImage(img, 0, 0)
|
|
- let data = this.context.getImageData(0, 0, img.width , img.height ).data; //getImageData 1px时 : pc chrome 耗时0.01毫秒左右(排除第一次的50) , 但firefox: 4。但换贴图之后就多达5甚至几十
|
|
|
|
|
|
+ let o = this.context.getImageData(0, 0, img.width , img.height )
|
|
|
|
+ let data = o && o.data; //getImageData 1px时 : pc chrome 耗时0.01毫秒左右(排除第一次的50) , 但firefox: 4。但换贴图之后就多达5甚至几十
|
|
|
|
+ if(!data){
|
|
|
|
+ console.error('getImageData 得不到?!why!')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+
|
|
//console.log('changeImg',pano.id )
|
|
//console.log('changeImg',pano.id )
|
|
//this.img = img
|
|
//this.img = img
|
|
|
|
|