import { AcGeBox2d } from '@mlightcad/data-model'; /** * Utility class for converting CAD drawings to PNG format. * * This class provides functionality to export the current CAD drawing * to PNG format and download it as a file. It renders the current view * using WebGLRenderTarget for optimal performance without requiring * preserveDrawingBuffer to be enabled on the renderer. */ export declare class AcApPngConvertor { /** * Converts the current CAD drawing to PNG format and initiates download. * * This method: * - Retrieves the current view, renderer, scene, and camera * - Creates a WebGLRenderTarget for offscreen rendering * - Renders the scene to the render target * - Reads pixel data and flips it vertically to correct WebGL's upside-down rendering * - Creates a canvas with the pixel data * - Exports as PNG and downloads with timestamp-based filename * * @param bounds - Optional world coordinate bounding box to export. * If provided, the camera will zoom to fit this region. * If not provided, exports the current view. * @param longSide - Optional maximum dimension (width or height) in pixels. */ convert(bounds?: AcGeBox2d, longSide?: number): void; /** * Resolves a pixel output size from a long-side target and aspect ratio. */ private resolveOutputSize; /** * Computes render size using source aspect so final target can be center-cropped. */ private resolveRenderSizeForCenterCrop; /** * Center-crops an RGBA pixel buffer from source to destination size. */ private cropPixelsCentered; /** * Returns the world-space aspect ratio of bounds. */ private getBoundsAspect; /** * Flips pixel data vertically to correct WebGL's upside-down rendering. * * WebGL renders images upside down (origin at bottom-left), so the pixel * data needs to be flipped to display correctly in standard image viewers. * * @param pixels - The raw pixel data from WebGL render target * @param width - Width of the image in pixels * @param height - Height of the image in pixels * @returns The vertically flipped pixel data * @private */ private flipPixelsVertically; /** * Creates a canvas element from pixel data. * * @param pixels - The vertically flipped pixel data * @param width - Width of the image in pixels * @param height - Height of the image in pixels * @returns A canvas element containing the image * @private */ private createCanvasFromPixels; /** * Creates a downloadable PNG file and triggers the download. * * This method: * - Exports the canvas to a PNG data URL * - Generates a timestamped filename * - Creates and triggers a download link * * @param canvas - The canvas element containing the image * @private */ private createFileAndDownloadIt; } //# sourceMappingURL=AcApPngConvertor.d.ts.map