code: function getTexture(gl, src, opts) {
    if (typeof src === 'string') {
      // Url, load the image
      return loadImage(src)
        .then(data => getTextureFromData(gl, data, opts))
        .catch(error => {
          throw new Error(`Could not load texture from ${src}: ${error}`);
        });
    }
    return new Promise(resolve => resolve(getTextureFromData(gl, src, opts)));
  }
docs: /*
  Load image data into luma.gl Texture2D objects
  @param {WebGLContext} gl
  @param {String|Texture2D|HTMLImageElement|Uint8ClampedArray} src - source of image data
  can be url string, Texture2D object, HTMLImageElement or pixel array
  @returns {Promise} resolves to an object with name -> texture mapping