cvmts: replace jpeg-turbo native module with new rust module

This module also does threadpooling internally, so we don't need Piscina anymore (which I'm pretty sure was actually bottlenecking.)
This commit is contained in:
modeco80
2024-06-20 03:20:56 -04:00
parent 39521a4b1d
commit 87a377a10f
17 changed files with 632 additions and 555 deletions

15
jpegturbo-rs/index.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
interface JpegInputArgs {
width: number,
height: number,
stride: number, // The width of your input framebuffer OR your image width (if encoding a full image)
buffer: Buffer
// TODO: Allow different formats, or export a boxed ffi object which can store a format
// (i.e: new JpegEncoder(FORMAT_xxx)).
}
/// Performs JPEG encoding.
export function jpegEncode(input: JpegInputArgs) : Promise<Buffer>;
// TODO: Version that can downscale?