socketcomputer/jpeg-rs/index.d.ts

16 lines
441 B
TypeScript
Raw Normal View History

2024-07-24 04:47:12 -04:00
//
interface JpegInputArgs {
2024-07-24 04:53:08 -04:00
width: number;
height: number;
stride: number; // The width of your input framebuffer OR your image width (if encoding a full image)
quality: number | undefined;
buffer: Buffer;
2024-07-24 04:47:12 -04:00
// TODO: Allow different formats, or export a boxed ffi object which can store a format
// (i.e: new JpegEncoder(FORMAT_xxx)).
}
/// Performs JPEG encoding.
2024-07-24 04:53:08 -04:00
export function jpegEncode(input: JpegInputArgs): Promise<Buffer>;