/** * Copyright (c) 2019-2025 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose * @author Jesse Liang * @author Sebastian Bittrich * @author Ke Ma * @author Adam Midlik */ import { type BufferRet as JpegBufferRet } from 'jpeg-js'; import { type PNG } from 'pngjs'; import { Canvas3D, Canvas3DProps } from '../../mol-canvas3d/canvas3d.js'; import { ImagePass, ImageProps } from '../../mol-canvas3d/passes/image.js'; import { PostprocessingProps } from '../../mol-canvas3d/passes/postprocessing.js'; import { RuntimeContext } from '../../mol-task/index.js'; export interface ExternalModules { 'gl': typeof import('gl'); 'jpeg-js'?: typeof import('jpeg-js'); 'pngjs'?: typeof import('pngjs'); } export type HeadlessScreenshotHelperOptions = { webgl?: WebGLContextAttributes; canvas?: Partial; imagePass?: Partial; }; export type RawImageData = { data: Uint8ClampedArray; width: number; height: number; }; /** To render Canvas3D when running in Node.js (without DOM) */ export declare class HeadlessScreenshotHelper { readonly externalModules: ExternalModules; readonly canvasSize: { width: number; height: number; }; readonly canvas3d: Canvas3D; readonly imagePass: ImagePass; constructor(externalModules: ExternalModules, canvasSize: { width: number; height: number; }, canvas3d?: Canvas3D, options?: HeadlessScreenshotHelperOptions); private getImageData; getImageRaw(runtime: RuntimeContext, imageSize?: { width: number; height: number; }, postprocessing?: Partial): Promise; getImagePng(runtime: RuntimeContext, imageSize?: { width: number; height: number; }, postprocessing?: Partial): Promise; getImageJpeg(runtime: RuntimeContext, imageSize?: { width: number; height: number; }, postprocessing?: Partial, jpegQuality?: number): Promise; saveImage(runtime: RuntimeContext, outPath: string, imageSize?: { width: number; height: number; }, postprocessing?: Partial, format?: 'png' | 'jpeg', jpegQuality?: number): Promise; } export declare function defaultCanvas3DParams(): Partial; export declare function defaultWebGLAttributes(): WebGLContextAttributes; export declare function defaultImagePassParams(): Partial; export declare const STYLIZED_POSTPROCESSING: Partial;