/**
 * perspectiveCorrection.ts
 * Perspective correction and transformation utilities for PhotoEditor
 */
/** 2D Point */
export interface Point {
    x: number;
    y: number;
}
/** Quad defined by four corners */
export interface Quad {
    topLeft: Point;
    topRight: Point;
    bottomRight: Point;
    bottomLeft: Point;
}
/** 3x3 Transformation matrix */
export type Matrix3x3 = [
    number,
    number,
    number,
    number,
    number,
    number,
    number,
    number,
    number
];
/** Perspective correction settings */
export interface PerspectiveSettings {
    /** Source quad corners */
    sourceQuad: Quad;
    /** Target quad corners (usually rectangle) */
    targetQuad: Quad;
    /** Interpolation method */
    interpolation: 'nearest' | 'bilinear' | 'bicubic';
    /** Maintain aspect ratio */
    maintainAspect: boolean;
    /** Output width */
    outputWidth: number;
    /** Output height */
    outputHeight: number;
}
/** Corner handle being dragged */
export type CornerHandle = 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft';
/** Preset perspective correction */
export interface PerspectivePreset {
    name: string;
    description: string;
    sourceQuad: Quad;
}
/**
 * Create identity matrix
 */
export declare function identityMatrix(): Matrix3x3;
/**
 * Multiply two 3x3 matrices
 */
export declare function multiplyMatrices(a: Matrix3x3, b: Matrix3x3): Matrix3x3;
/**
 * Invert 3x3 matrix
 */
export declare function invertMatrix(m: Matrix3x3): Matrix3x3 | null;
/**
 * Transform point using matrix
 */
export declare function transformPoint(p: Point, m: Matrix3x3): Point;
/**
 * Calculate perspective transformation matrix from quad to quad
 */
export declare function computePerspectiveTransform(src: Quad, dst: Quad): Matrix3x3;
/**
 * Apply perspective transform to image data
 */
export declare function applyPerspectiveTransform(sourceData: ImageData, settings: PerspectiveSettings): ImageData;
/**
 * Create rectangle quad
 */
export declare function createRectQuad(x: number, y: number, width: number, height: number): Quad;
/**
 * Calculate bounding box of quad
 */
export declare function getQuadBounds(quad: Quad): {
    x: number;
    y: number;
    width: number;
    height: number;
};
/**
 * Check if point is inside quad
 */
export declare function isPointInQuad(point: Point, quad: Quad): boolean;
/**
 * Get nearest corner handle to point
 */
export declare function getNearestCorner(point: Point, quad: Quad, threshold?: number): CornerHandle | null;
/**
 * Move corner of quad
 */
export declare function moveQuadCorner(quad: Quad, corner: CornerHandle, newPos: Point): Quad;
/**
 * Calculate quad area
 */
export declare function getQuadArea(quad: Quad): number;
/**
 * Detect document/paper edges in image
 * Returns suggested quad corners
 */
export declare function detectDocumentEdges(imageData: ImageData, options?: {
    edgeThreshold?: number;
    minArea?: number;
}): Quad | null;
/**
 * Perspective correction presets
 */
export declare const PERSPECTIVE_PRESETS: PerspectivePreset[];
export interface UsePerspectiveCorrectionOptions {
    imageWidth: number;
    imageHeight: number;
}
export declare function usePerspectiveCorrection(options: UsePerspectiveCorrectionOptions): {
    sourceQuad: Quad;
    setSourceQuad: import("react").Dispatch<import("react").SetStateAction<Quad>>;
    interpolation: "nearest" | "bilinear" | "bicubic";
    setInterpolation: import("react").Dispatch<import("react").SetStateAction<"nearest" | "bilinear" | "bicubic">>;
    maintainAspect: boolean;
    setMaintainAspect: import("react").Dispatch<import("react").SetStateAction<boolean>>;
    activeCorner: CornerHandle | null;
    setActiveCorner: import("react").Dispatch<import("react").SetStateAction<CornerHandle | null>>;
    resetQuad: () => void;
    moveCorner: (corner: CornerHandle, newPos: Point) => void;
    applyPreset: (preset: PerspectivePreset) => void;
    getSettings: () => PerspectiveSettings;
};
