drop preview to save memory
This commit is contained in:
parent
22524496dd
commit
153b8cef64
5 changed files with 8 additions and 5 deletions
|
|
@ -92,7 +92,9 @@
|
||||||
range.min = 0;
|
range.min = 0;
|
||||||
range.max = lines.length - 1;
|
range.max = lines.length - 1;
|
||||||
range.oninput = function() {
|
range.oninput = function() {
|
||||||
let lineDV = new DataView(lines[range.value]);
|
let pdata = lines[range.value];
|
||||||
|
if (!pdata) return;
|
||||||
|
let lineDV = new DataView(pdata);
|
||||||
for (let i=0; i<lineDV.byteLength; i++) {
|
for (let i=0; i<lineDV.byteLength; i++) {
|
||||||
imgDV.setUint32(i*4, lineDV.getUint8(i));
|
imgDV.setUint32(i*4, lineDV.getUint8(i));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@
|
||||||
slices.push(lines);
|
slices.push(lines);
|
||||||
// transfer image memory to browser main
|
// transfer image memory to browser main
|
||||||
// it *should* be sampled to save memory
|
// it *should* be sampled to save memory
|
||||||
image = image.buffer;
|
image = image ? image.buffer : undefined;
|
||||||
online({
|
online({
|
||||||
progress: (index / layermax) * part1,
|
progress: (index / layermax) * part1,
|
||||||
message: "image_gen",
|
message: "image_gen",
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@
|
||||||
writePoly(writer, poly);
|
writePoly(writer, poly);
|
||||||
}
|
}
|
||||||
wasm.render(0, imagelen, 0);
|
wasm.render(0, imagelen, 0);
|
||||||
let image = wasm.heap.slice(0, imagelen);
|
let image = wasm.heap;//.slice(0, imagelen);
|
||||||
let lines = [];
|
let lines = [];
|
||||||
for (let x=0; x<width; x++) {
|
for (let x=0; x<width; x++) {
|
||||||
let y_start = 0;
|
let y_start = 0;
|
||||||
|
|
@ -361,7 +361,8 @@
|
||||||
lastv = v;
|
lastv = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return { image, lines };
|
return { lines };
|
||||||
|
// return { image, lines };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.navigator && this.process && this.process.env) {
|
if (!this.navigator && this.process && this.process.env) {
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
||||||
all: kiri-sla.wasm kiri-geo.wasm kiri-ani.wasm
|
all: kiri-sla.wasm kiri-geo.wasm kiri-ani.wasm
|
||||||
|
|
||||||
kiri-sla.wasm: kiri-sla.c
|
kiri-sla.wasm: kiri-sla.c
|
||||||
emcc --no-entry -o kiri-sla.wasm kiri-sla.c -O3 -s ERROR_ON_UNDEFINED_SYMBOLS=0
|
emcc --no-entry -o kiri-sla.wasm kiri-sla.c -O3 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s TOTAL_MEMORY=40mb
|
||||||
|
|
||||||
kiri-geo.wasm: kiri-geo.cpp
|
kiri-geo.wasm: kiri-geo.cpp
|
||||||
emcc --no-entry -o kiri-geo.wasm clipper.cpp kiri-geo.cpp -Oz -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s TOTAL_MEMORY=40mb
|
emcc --no-entry -o kiri-geo.wasm clipper.cpp kiri-geo.cpp -Oz -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s TOTAL_MEMORY=40mb
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue