()
| 91 | } |
| 92 | |
| 93 | _getTextureDataFromSource () { |
| 94 | let textureData; |
| 95 | if (this.isFramebufferTexture) { |
| 96 | textureData = this.src.rawTexture(); |
| 97 | } else if (this.isSrcP5Image) { |
| 98 | // param is a p5.Image |
| 99 | textureData = this.src.canvas; |
| 100 | } else if ( |
| 101 | this.isSrcMediaElement || |
| 102 | this.isSrcHTMLElement |
| 103 | ) { |
| 104 | // createCapture elements that are flipped need |
| 105 | // to go through a canvas |
| 106 | if (this.isSrcMediaElement && this.src.flipped) { |
| 107 | this.src._ensureCanvas(); |
| 108 | textureData = this.src.canvas; |
| 109 | } else { |
| 110 | // if param is a video HTML element |
| 111 | if (this.src._checkIfTextureNeedsUpdate) { |
| 112 | this.src._checkIfTextureNeedsUpdate(); |
| 113 | } |
| 114 | textureData = this.src.elt; |
| 115 | } |
| 116 | } else if (this.isSrcP5Graphics || this.isSrcP5Renderer) { |
| 117 | textureData = this.src.canvas; |
| 118 | } else if (this.isImageData) { |
| 119 | textureData = this.src; |
| 120 | } |
| 121 | return textureData; |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * Initializes common texture parameters, creates a gl texture, |
no test coverage detected