import { SpectrumExpression as SpectrumExpressionPB, SpectrumColorPrimaries as SpectrumColorPrimariesPB, SpectrumTransferFunction as SpectrumTransferFunctionPB, SpectrumVideoRange as SpectrumVideoRangePB } from "@norskvideo/norsk-api/lib/media_pb"; /** Resize interpolation algorithm. * * Note: Lanczos is implemented in the underlying Spectrum engine but * intentionally not exposed here - the current implementation is too slow * for production use. It will be re-exposed once optimised. Use "cubic" * for the best quality/speed trade-off in the meantime. */ export type ResizeAlgorithm = "box" | "linear" | "cubic"; /** Compositing blend mode */ export type BlendMode = "sourceOver" | "destinationOver" | "sourceIn" | "destinationIn" | "sourceOut" | "destinationOut" | "sourceAtop" | "destinationAtop" | "xor" | "plus" | "multiply" | "screen"; /** * Tone mapping algorithm. * * - `"aces"` selects the proper filmic Hable curve with peak-aware white * scaling, driven by `peakNits`. (Historically this was a Narkowicz fit * that was not peak-aware and produced brightness lift and saturation * speckle on real HDR content; the legacy fit is still available as * `"narkowicz"` if desired.) * - `"hable"` is the same curve as `"aces"`. * - `"reinhard"` is the simple global Reinhard operator with parametric * white point. * - `"linear"` is pass-through (no tone mapping). * - `"narkowicz"` is the cheap legacy ACES-lookalike fit. NOT * peak-luminance aware - tune via `exposure`. Suitable for already-graded * SDR-ish content, not for direct HDR sources. */ export type ToneMapMethod = "reinhard" | "aces" | "hable" | "linear" | "narkowicz"; /** Gamut mapping method */ export type GamutMappingMethod = "clamp" | "softClamp" | "chromaticAdaptation"; /** LUT interpolation method */ export type LutInterpolationMethod = "trilinear" | "tetrahedral"; /** Crop fill mode */ export type CropFillMode = "black" | "transparent" | "extend"; /** Frame rate conversion method */ export type FRCMethod = "dropDuplicate"; /** Deinterlace method */ export type DeinterlaceMethod = "bob" | "weave" | "bwdif" | "w3fdif"; /** Field order for interlaced content */ export type FieldOrder = "topFieldFirst" | "bottomFieldFirst" | "progressive"; /** Video range */ export type VideoRange = "auto" | "limited" | "full"; /** * Color primaries. * * Note: sRGB uses the same primaries as BT.709. Use "bt709" for sRGB primaries. * BT.2100 uses the same primaries as BT.2020. Use "bt2020" for BT.2100 primaries. * * "sGamut3" and "sGamut3Cine" are Sony's wide-gamut camera spaces typically * paired with S-Log3 footage (see TransferFunction). H.273 has no code for * either, so re-ingested output arrives tagged as Unspecified primaries. */ export type ColorPrimaries = "bt709" | "bt470m" | "bt470bg" | "smpte170m" | "smpte240m" | "film" | "bt2020" | "dciP3" | "displayP3" | "bt601_525" | "bt601_625" | "sGamut3" | "sGamut3Cine"; /** * Transfer function (OETF/EOTF). * * Note: BT.2100 uses "pq" (HDR10) or "hlg" (HLG) transfer functions with BT.2020 primaries. * Use "gamma26" for DCI-P3 gamma 2.6. * * "slog3" is Sony's scene-referred camera log curve, typically paired with * S-Gamut3 or S-Gamut3.Cine primaries. H.273 has no transfer code for it, * so re-ingested output will arrive tagged as Unspecified and must be * re-declared explicitly. */ export type TransferFunction = "bt709" | "srgb" | "linear" | "bt2020" | "pq" | "hlg" | "bt601" | "smpte240m" | "gamma22" | "gamma28" | "bt1886" | "gamma24" | "gamma26" | "slog3"; /** A layer to be composited on top of the base image */ export interface CompositeLayer { source: SpectrumExpression; x: number; y: number; opacity?: number; blendMode?: BlendMode; name?: string; } /** * Spectrum expression tree describing a video processing pipeline. * Each expression takes a source (another expression) and transforms it. */ export type SpectrumExpression = { type: "source"; name?: string; } | { type: "resize"; source: SpectrumExpression; width: number; height: number; algorithm?: ResizeAlgorithm; name?: string; } | { type: "crop"; source: SpectrumExpression; x: number; y: number; width: number; height: number; maintainAspect?: boolean; fillMode?: CropFillMode; name?: string; } | { type: "compose"; source: SpectrumExpression; overlays: CompositeLayer[]; name?: string; } | { type: "colorGrade"; source: SpectrumExpression; liftR?: number; liftG?: number; liftB?: number; gammaR?: number; gammaG?: number; gammaB?: number; gainR?: number; gainG?: number; gainB?: number; hueShift?: number; saturation?: number; lightness?: number; brightness?: number; contrast?: number; vibrance?: number; shadowsR?: number; shadowsG?: number; shadowsB?: number; highlightsR?: number; highlightsG?: number; highlightsB?: number; midtonesR?: number; midtonesG?: number; midtonesB?: number; name?: string; } | { type: "toneMap"; source: SpectrumExpression; algorithm: ToneMapMethod; peakNits: number; displayNits: number; exposure?: number; contrast?: number; saturation?: number; name?: string; } | { type: "lut"; source: SpectrumExpression; /** Path to a `.cube` LUT file. Resolved and parsed by the engine. */ filename: string; /** Color characteristics of the image AFTER the LUT has been applied. * Set these when the LUT changes color space (e.g. a BT.2020/PQ → * BT.709/SDR LUT) so that downstream operations tag and convert * correctly. If omitted, the source's metadata is preserved. */ outputPrimaries?: ColorPrimaries; outputTransfer?: TransferFunction; outputRange?: VideoRange; interpolationMethod?: LutInterpolationMethod; strength?: number; name?: string; } | { type: "transferFunction"; source: SpectrumExpression; targetTransfer: TransferFunction; /** Controls BT.709 transfer function variant: * - false (default): BT.1886 display-referred (gamma 2.4), matching ffmpeg/zscale. * - true: Piecewise BT.709 OETF (scene-referred, with linear toe). */ sceneReferred?: boolean; name?: string; } | { type: "gamutMap"; source: SpectrumExpression; targetPrimaries: ColorPrimaries; method: GamutMappingMethod; name?: string; } | { type: "frameRateConvert"; source: SpectrumExpression; targetFpsNum: number; targetFpsDen: number; method?: FRCMethod; name?: string; } | { type: "deinterlace"; source: SpectrumExpression; method?: DeinterlaceMethod; fieldOrder?: FieldOrder; name?: string; } | { type: "interlace"; source: SpectrumExpression; fieldOrder?: FieldOrder; name?: string; } | { type: "videoRange"; source: SpectrumExpression; targetRange: VideoRange; sourceRange?: VideoRange; name?: string; } | { type: "pad"; source: SpectrumExpression; top: number; bottom: number; left: number; right: number; fillR?: number; fillG?: number; fillB?: number; name?: string; }; /** Extract all source pin names from a spectrum expression tree. * Source nodes with no name default to "video". */ export declare function extractSourcePins(expr: SpectrumExpression): string[]; export declare function colorPrimariesToProto(cp: ColorPrimaries): SpectrumColorPrimariesPB; /** Reverse-map a protobuf ColorPrimaries enum value to a SDK string type */ export declare function colorPrimariesFromProto(cp: SpectrumColorPrimariesPB): ColorPrimaries; export declare function transferFunctionToProto(tf: TransferFunction): SpectrumTransferFunctionPB; /** Reverse-map a protobuf TransferFunction enum value to a SDK string type */ export declare function transferFunctionFromProto(tf: SpectrumTransferFunctionPB): TransferFunction; /** Reverse-map a protobuf VideoRange enum value to a SDK string type */ export declare function videoRangeFromProto(vr: SpectrumVideoRangePB): VideoRange; export declare function videoRangeToProto(vr: VideoRange): SpectrumVideoRangePB; /** Convert a SpectrumExpression to its protobuf representation */ export declare function spectrumExpressionToProto(expr: SpectrumExpression): SpectrumExpressionPB; //# sourceMappingURL=spectrum.d.ts.map