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.
 *
 * The conversion process:
 * 1. Gets the current view and its associated renderer, scene, and camera
 * 2. Creates an offscreen render target for pixel capture
 * 3. Renders the scene to the render target
 * 4. Reads the pixel data and flips it vertically (WebGL renders upside down)
 * 5. Creates a canvas, draws the pixel data, and exports as PNG
 * 6. Triggers a download of the PNG file
 *
 * @example
 * ```typescript
 * const converter = new AcApPngConvertor();
 *
 * // Convert and download current drawing as PNG
 * converter.convert();
 * ```
 */
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 long_side - Optional maximum dimension (width or height) in pixels for the output PNG.
     *                    The other dimension is calculated based on the aspect ratio of bounds.
     *                    If not provided, uses the current view dimensions.
     * @example
     * ```typescript
     * const converter = new AcApPngConvertor();
     * converter.convert(); // Downloads the drawing as PNG
     * ```
     *
     * @example
     * ```typescript
     * // Export a specific region
     * const bounds = new AcGeBox2d(new AcGePoint2d(0, 0), new AcGePoint2d(100, 100));
     * const converter = new AcApPngConvertor();
     * converter.convert(bounds); // Downloads the specified region as PNG
     * ```
     */
    convert(bounds?: AcGeBox2d, long_side?: number): void;
    /**
     * 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