(file)
| 461 | |
| 462 | class ImageLayer extends MoveableLayer { |
| 463 | constructor(file) { |
| 464 | super(file); |
| 465 | // assume images are 10 seconds |
| 466 | this.img = new Image(); |
| 467 | |
| 468 | this.reader = new FileReader(); |
| 469 | this.reader.addEventListener("load", (function() { |
| 470 | this.img.src = this.reader.result; |
| 471 | this.img.addEventListener('load', (function() { |
| 472 | this.width = this.img.naturalWidth; |
| 473 | this.height = this.img.naturalHeight; |
| 474 | this.ready = true; |
| 475 | }).bind(this)); |
| 476 | }).bind(this), false); |
| 477 | this.reader.readAsDataURL(file); |
| 478 | } |
| 479 | |
| 480 | render(ctx_out, ref_time) { |
| 481 | if (!this.ready) { |
nothing calls this directly
no outgoing calls
no test coverage detected