A .tga file loader for Deno. (Forked from tga-js)
Instantiate the TgaLoader
class and pass an Uint8ClampedArray
of image data
to the load()
method before attempting to get the canvas, image data or
header information.
A TgaLoaderReferenceError
will be thrown by TgaLoader.getImageData()
,
TgaLoader.getCanvas()
and TgaLoader.header
if the TGA file has not loaded
prior to the method call.
(Requires read permission.)
import TgaLoader from "https://deno.land/x/targadactyl/mod.ts";
const tga = new TgaLoader();
tga.load(
await tga.open("./test/test.tga"),
);
(Requires network permission.)
import TgaLoader from "https://deno.land/x/targadactyl/mod.ts";
const tga = new TgaLoader();
const src = new URL("https://raw.githubusercontent.com/jasonjgardner/targadactyl/main/test/test.tga");
tga.load(
await tga.fetch(src);
);
🎉
Serving./test/test.tga
via deno.dev