ppu-ocv
Version:
A type-safe, modular, chainable image processing library built on top of OpenCV.js with a fluent API leveraging pipeline processing.
36 lines (35 loc) • 1.21 kB
TypeScript
import type { CanvasLike } from "./canvas-factory.js";
import { CanvasToolkitBase } from "./canvas-toolkit.base.js";
/**
* Node.js canvas toolkit with file-system operations.
* Extends CanvasToolkitBase with saveImage() and clearOutput().
*/
export declare class CanvasToolkit extends CanvasToolkitBase {
private static _nodeInstance;
protected constructor();
/** Return the singleton instance of {@link CanvasToolkit}. */
static getInstance(): CanvasToolkit;
/**
* Save a canvas to an image file
* @param options
* @param options.canvas Source canvas
* @param options.filename Filename of the image file
* @param options.path Path to save the image file (default: "out")
* @returns A promise that resolves when the image is saved
* @example
* await CanvasToolkit.getInstance().saveImage({
* canvas: sourceCanvas,
* filename: "output.png",
* });
*/
saveImage(options: {
canvas: CanvasLike;
filename: string;
path: string;
}): Promise<void>;
/**
* Clear the output folder
* @param path Path to the output folder (default: "out")
*/
clearOutput(path?: string): void;
}