UNPKG

@kibeo/loaders.gl-textures

Version:

Framework-independent loaders for compressed and super compressed (basis) textures

18 lines (15 loc) 637 B
import {ImageLoader} from '@kibeo/loaders.gl-images'; import {getImageUrls} from './load-image'; import {deepLoad} from './deep-load'; export async function loadImageTextureArray(count, getUrl, options = {}) { const imageUrls = await getImageArrayUrls(count, getUrl, options); return await deepLoad(imageUrls, ImageLoader.parse, options); } export async function getImageArrayUrls(count, getUrl, options = {}) { const promises: Promise<any>[] = []; for (let index = 0; index < count; index++) { const promise = getImageUrls(getUrl, options, {index}); promises.push(promise); } return await Promise.all(promises); }