Files
collabvm-1.2.ts/jpegturbo-rs/index.d.ts
modeco80 87a377a10f 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.)
2024-06-20 03:20:56 -04:00

16 lines
446 B
TypeScript

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?