MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / load

Method load

src/loaders/LUT3dlLoader.js:27–54  ·  view source on GitHub ↗

* Loads a LUT. * * @param {String} url - The URL of the 3dl-file. * @param {Function} [onLoad] - A callback that receives the loaded lookup texture. * @param {Function} [onProgress] - A progress callback that receives the XMLHttpRequest instance. * @param {Function} [onError] - An error ca

(url, onLoad = () => {}, onProgress = () => {}, onError = null)

Source from the content-addressed store, hash-verified

25 */
26
27 load(url, onLoad = () => {}, onProgress = () => {}, onError = null) {
28
29 const externalManager = this.manager;
30 const internalManager = new LoadingManager();
31
32 const loader = new FileLoader(internalManager);
33 loader.setPath(this.path);
34 loader.setResponseType("text");
35 externalManager.itemStart(url);
36
37 loader.load(url, (data) => {
38
39 try {
40
41 const result = this.parse(data);
42 externalManager.itemEnd(url);
43 onLoad(result);
44
45 } catch(e) {
46
47 internalManager.onError(url);
48 onError(e);
49
50 }
51
52 }, onProgress);
53
54 }
55
56 /**
57 * Loads a LUT.

Callers 3

loadFunction · 0.95
loadAsyncMethod · 0.95
loadMethod · 0.95

Calls 1

parseMethod · 0.95

Tested by

no test coverage detected