/**
 * pixelEditorUtils.ts — Drawing algorithms for the pixel editor.
 * Bresenham line, midpoint ellipse, flood fill, selection, brush shapes,
 * pressure-aware blending, dithering, gradient, symmetry etc.
 */
export type RGBA = [number, number, number, number];
export type BrushShape = 'square' | 'circle' | 'diamond' | 'spray';
export type SymmetryMode = 'none' | 'h' | 'v' | 'both' | 'radial4';
export interface BrushConfig {
    size: number;
    shape: BrushShape;
    opacity: number;
    flow: number;
    spacing: number;
    pressureSize: boolean;
    pressureOpacity: boolean;
    hardness: number;
}
export declare const DEFAULT_BRUSH: BrushConfig;
/** Read a pixel from ImageData at (x,y). Returns [r,g,b,a]. */
export declare function getPixel(data: ImageData, x: number, y: number): RGBA;
/** Set a pixel in ImageData at (x,y). */
export declare function setPixel(data: ImageData, x: number, y: number, color: RGBA): void;
/** Blend a pixel onto ImageData at (x,y) with alpha compositing. */
export declare function blendPixel(data: ImageData, x: number, y: number, color: RGBA, strength?: number): void;
/** Generate brush mask: returns array of {dx, dy, strength} offsets. */
export declare function getBrushMask(cfg: BrushConfig, pressure?: number): {
    dx: number;
    dy: number;
    strength: number;
}[];
/** Apply brush stamp at (x,y) with all brush settings. */
export declare function applyBrushStamp(data: ImageData, x: number, y: number, color: RGBA, cfg: BrushConfig, pressure?: number, erase?: boolean): void;
/** Get symmetry points for a coordinate. */
export declare function getSymmetryPoints(x: number, y: number, w: number, h: number, mode: SymmetryMode): {
    x: number;
    y: number;
}[];
/** Draw a linear gradient between two points on ImageData. */
export declare function drawGradient(data: ImageData, x0: number, y0: number, x1: number, y1: number, color1: RGBA, color2: RGBA, sel?: {
    x: number;
    y: number;
    w: number;
    h: number;
} | null): void;
/** Apply dithered brush stamp. */
export declare function applyDitherStamp(data: ImageData, x: number, y: number, color: RGBA, size: number, pressure?: number): void;
/** Copy pixels from a selection region. */
export declare function copySelection(data: ImageData, sel: {
    x: number;
    y: number;
    w: number;
    h: number;
}): ImageData;
/** Paste ImageData at position. */
export declare function pasteAt(dst: ImageData, src: ImageData, ox: number, oy: number): void;
/** Clear pixels in selection region. */
export declare function clearSelection(data: ImageData, sel: {
    x: number;
    y: number;
    w: number;
    h: number;
}): void;
/** HSV to RGB conversion. h: 0-360, s: 0-1, v: 0-1. Returns [r,g,b] 0-255. */
export declare function hsvToRgb(h: number, s: number, v: number): [number, number, number];
/** RGB to HSV conversion. r,g,b: 0-255. Returns [h: 0-360, s: 0-1, v: 0-1]. */
export declare function rgbToHsv(r: number, g: number, b: number): [number, number, number];
/** Bresenham line — calls callback for each pixel along the line. */
export declare function bresenhamLine(x0: number, y0: number, x1: number, y1: number, cb: (x: number, y: number) => void): void;
/** Draw a filled rectangle. */
export declare function fillRect(data: ImageData, x0: number, y0: number, x1: number, y1: number, color: RGBA): void;
/** Draw rectangle outline. */
export declare function strokeRect(data: ImageData, x0: number, y0: number, x1: number, y1: number, color: RGBA): void;
/** Midpoint ellipse algorithm — filled. */
export declare function fillEllipse(data: ImageData, cx: number, cy: number, rx: number, ry: number, color: RGBA): void;
/** Midpoint ellipse — outline only. */
export declare function strokeEllipse(data: ImageData, cx: number, cy: number, rx: number, ry: number, color: RGBA): void;
/** Flood fill — fills connected region of same color with new color. */
export declare function floodFill(data: ImageData, startX: number, startY: number, fillColor: RGBA): void;
/** Check if two RGBA colors are equal (with small tolerance for alpha). */
export declare function colorsEqual(a: RGBA, b: RGBA, tolerance?: number): boolean;
/** Parse hex color string to RGBA. */
export declare function hexToRGBA(hex: string, alpha?: number): RGBA;
/** Convert RGBA to hex string. */
export declare function rgbaToHex(c: RGBA): string;
/** Draw checkerboard pattern (for transparency indication). */
export declare function drawCheckerboard(ctx: CanvasRenderingContext2D, width: number, height: number, cellSize: number, color1?: string, color2?: string): void;
/** Generate spritesheet from frames (horizontal strip). */
export declare function generateSpritesheet(frames: ImageData[], cols?: number): {
    canvas: HTMLCanvasElement;
    frameWidth: number;
    frameHeight: number;
    cols: number;
    rows: number;
} | null;
/** Create blank ImageData. */
export declare function createBlankImageData(width: number, height: number): ImageData;
/** Clone ImageData. */
export declare function cloneImageData(src: ImageData): ImageData;
/** Composite two ImageData layers (src over dst), respecting opacity. */
export declare function compositeOver(dst: ImageData, src: ImageData, srcOpacity?: number, offsetX?: number, offsetY?: number): void;
/** Flip ImageData horizontally. */
export declare function flipH(src: ImageData): ImageData;
/** Flip ImageData vertically. */
export declare function flipV(src: ImageData): ImageData;
/** Rotate ImageData 90° clockwise. Returns new ImageData with swapped dimensions. */
export declare function rotateCW(src: ImageData): ImageData;
export type DitheringAlgorithm = 'none' | 'ordered-2x2' | 'ordered-4x4' | 'ordered-8x8' | 'floyd-steinberg' | 'jarvis-judice-ninke' | 'stucki' | 'atkinson' | 'burkes' | 'sierra' | 'sierra-lite' | 'random';
/** Apply ordered dithering with Bayer matrix */
export declare function ditherOrdered(data: ImageData, palette: RGBA[], matrix?: number[][], strength?: number): ImageData;
/** Floyd-Steinberg error diffusion dithering */
export declare function ditherFloydSteinberg(data: ImageData, palette: RGBA[]): ImageData;
/** Jarvis-Judice-Ninke dithering (larger error diffusion kernel) */
export declare function ditherJarvisJudiceNinke(data: ImageData, palette: RGBA[]): ImageData;
/** Atkinson dithering (preserves details better) */
export declare function ditherAtkinson(data: ImageData, palette: RGBA[]): ImageData;
/** Random dithering */
export declare function ditherRandom(data: ImageData, palette: RGBA[], strength?: number): ImageData;
/** Apply dithering with specified algorithm */
export declare function applyDithering(data: ImageData, palette: RGBA[], algorithm: DitheringAlgorithm): ImageData;
/** Generate palette from image using median cut algorithm */
export declare function extractPalette(data: ImageData, maxColors: number): RGBA[];
/** Convert hex palette to RGBA array */
export declare function hexPaletteToRGBA(hexColors: string[]): RGBA[];
export interface ReferenceOverlay {
    image: ImageData;
    x: number;
    y: number;
    opacity: number;
    scale: number;
    locked: boolean;
}
/** Create reference overlay from file */
export declare function createReferenceOverlay(file: File, targetWidth: number, targetHeight: number): Promise<ReferenceOverlay>;
/** Render reference overlay onto canvas */
export declare function renderReferenceOverlay(ctx: CanvasRenderingContext2D, ref: ReferenceOverlay, zoom: number, panX: number, panY: number): void;
