Add a few more mesh types

This commit is contained in:
2026-04-14 08:38:50 -05:00
parent 378227c377
commit 0b570b5fd6
23 changed files with 875 additions and 83 deletions
+3 -3
View File
@@ -11,14 +11,14 @@ const DuskPNG = (() => {
// Encode RGBA pixel data into a PNG Buffer via pngjs.
// Returns a Uint8Array (Buffer) if pngjs is available, otherwise null.
function encode(width, height, rgbaData) {
if (!_pngAvailable()) return null;
if(!_pngAvailable()) return null;
const png = new PNG({ width, height });
const src = rgbaData instanceof Uint8ClampedArray
? rgbaData
: new Uint8ClampedArray(rgbaData);
for (let i = 0; i < src.length; i++) {
for(let i = 0; i < src.length; i++) {
png.data[i] = src[i];
}
@@ -29,7 +29,7 @@ const DuskPNG = (() => {
function download(filename, width, height, rgbaData) {
const buf = encode(width, height, rgbaData);
if (buf) {
if(buf) {
// pngjs path
const blob = new Blob([buf], { type: "image/png" });
_triggerDownload(URL.createObjectURL(blob), filename);