/** * Multi-format render presets — the "render every platform at once" matrix. * * Pure dispatcher for `render_multi_format`: given a source resolution and a * preset name, produces the ffmpeg `-vf` filter graph plus the target W×H. * Spawning ffmpeg lives in the tool layer so this module stays trivially * unit-testable. * * Two transform modes: * * - "scale-pad" — letterbox/pillarbox the source into the target frame * without cropping. Used for 16:9-into-16:9 (different * resolution) and any time we want to preserve every * pixel of the source. * * - "centre-crop" — crop the source to the target aspect, then scale to * target resolution. The dumb / mechanical version of * content-aware reframing — for face-tracked re-cropping * the agent should pipe the source through `face_reframe` * or Resolve `smart_reframe` BEFORE calling this tool. */ export type MultiFormat = "youtube-1080p" | "shorts-9x16" | "reels-9x16" | "tiktok-9x16" | "square-1x1" | "instagram-4x5" | "twitter-16x9"; export declare const MULTI_FORMATS: readonly MultiFormat[]; export type MultiFormatTransform = "scale-pad" | "centre-crop"; interface PresetSpec { width: number; height: number; transform: MultiFormatTransform; } export declare function multiFormatSpec(format: MultiFormat): PresetSpec; export interface BuildRenderFilterResult { targetW: number; targetH: number; vf: string; transform: MultiFormatTransform; } export interface BuildRenderFilterOptions { /** * If true, treat the source as already cropped to the target aspect (e.g. * via face_reframe / smart_reframe upstream). Forces a non-cropping * scale-pad regardless of the preset's default transform. */ faceTracked?: boolean; } /** * Build the ffmpeg `-vf` filter for a single (source, preset) pair. * * Pure function — no side effects, no I/O. Used by `render_multi_format` * to compose ffmpeg args, and by the unit tests to lock the filter math. * * Math notes for centre-crop: * * srcAR = srcW/srcH, tgtAR = Wt/Ht. The crop keeps the larger axis full. * * - srcAR > tgtAR ⇒ source is wider than target. Crop width. * cropW = ih * Wt/Ht ; cropH = ih ; x = (iw - cropW)/2 ; y = 0 * - srcAR < tgtAR ⇒ source is taller than target. Crop height. * cropW = iw ; cropH = iw * Ht/Wt ; x = 0 ; y = (ih - cropH)/2 * - srcAR == tgtAR ⇒ no crop needed; emit `scale=Wt:Ht` only. * * Float crop dimensions are passed through to ffmpeg (which accepts them * and rounds internally); the trailing `scale=Wt:Ht` enforces the final * even-dimension target so x264 stays happy. */ export declare function buildRenderFilter(srcW: number, srcH: number, format: MultiFormat, opts?: BuildRenderFilterOptions): BuildRenderFilterResult; export {}; //# sourceMappingURL=multi-format.d.ts.map