* Loads a LUT. * * @param {String} url - The URL of the 3dl-file. * @param {Function} [onProgress] - A progress callback that receives the XMLHttpRequest instance. * @return {Promise } A promise that returns the lookup texture.
(url, onProgress = () => {})
| 62 | */ |
| 63 | |
| 64 | loadAsync(url, onProgress = () => {}) { |
| 65 | |
| 66 | const externalManager = this.manager; |
| 67 | const internalManager = new LoadingManager(); |
| 68 | |
| 69 | return new Promise((resolve, reject) => { |
| 70 | |
| 71 | internalManager.onError = (url) => { |
| 72 | |
| 73 | externalManager.itemError(url); |
| 74 | reject(`Failed to load ${url}`); |
| 75 | |
| 76 | }; |
| 77 | |
| 78 | this.load(url, resolve, onProgress); |
| 79 | |
| 80 | }); |
| 81 | |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Parses the given data. |