import { d } from './index'; /** * Relative luminance, ITU-R BT.709 (0.2126, 0.7152, 0.0722). * * Written as component multiply-add rather than `std.dot` so the emitted body is character-identical * to `blend.luminance`'s (see the module header). */ export declare const luma709: import('typegpu').TgpuFn<(rgb: d.Vec3f) => d.F32>; /** * Perceived brightness, ITU-R BT.601 (0.299, 0.587, 0.114) — the "video luma" weights. Kept * distinct from {@link luma709} on purpose; see the module header on D-2. */ export declare const luma601: import('typegpu').TgpuFn<(rgb: d.Vec3f) => d.F32>; /** {@link luma709} spelled as a dot product. Same weights, same result, different WGSL. */ export declare const luma709Dot: import('typegpu').TgpuFn<(rgb: d.Vec3f) => d.F32>; /** {@link luma601} spelled as a dot product. Same weights, same result, different WGSL. */ export declare const luma601Dot: import('typegpu').TgpuFn<(rgb: d.Vec3f) => d.F32>; /** * Contrast about a pivot, clamped to [0, 1]: `clamp((x - pivot) * contrast + pivot, 0, 1)`. * `contrast` of 1 is identity; `pivot` is the value held fixed (0.5 for mid-grey). */ export declare const pivotContrast: import('typegpu').TgpuFn<(x: d.F32, contrast: d.F32, pivot: d.F32) => d.F32>; /** Signed [-1, 1] → unit [0, 1]: `v * 0.5 + 0.5`. The standard noise-to-mask remap. */ export declare const signedToUnit: import('typegpu').TgpuFn<(v: d.F32) => d.F32>; /** * Ridge fold of a signed field: `1 - abs(v)`. Turns the zero crossings of a signed noise into * creases (peaks at 1), the basis of ridged-multifractal terrain and marble veining. */ export declare const ridged: import('typegpu').TgpuFn<(v: d.F32) => d.F32>; /** * Unit-domain, additive contrast, inverted: `1 − clamp((v − 0.5)·(contrast + 1) + 0.5 + balance)`. * * Contrast pivots about mid-grey and is additive, so 0 is the identity — which is why the shaders on * this variant default `contrast` to 0 rather than 1. Balance shifts AFTER the pivot, so it slides * the whole tonal range rather than rotating it. * * The parameter is named `noise01` (not `v`) deliberately: this fn IS `noiseColor.noiseToneKColor`, * which every noise texture already emits, and body parameter names appear in the resolved WGSL. The * name keeps the alias byte-identical so ten shaders' snapshots did not move. */ export declare const toneUnitPivotInverted: import('typegpu').TgpuFn<(noise01: d.F32, contrast: d.F32, balance: d.F32) => d.F32>; /** * Signed-domain, additive contrast, inverted: scale the raw [−1,1] field, offset it, THEN squash to * [0,1] and invert. * * Working on the signed value before the squash is not cosmetic: contrast about zero on a signed * field is contrast about mid-grey on the unit one, but the clamp lands only at the end, so * high-contrast values ride further before they clip. */ export declare const toneSignedInverted: import('typegpu').TgpuFn<(v: d.F32, contrast: d.F32, balance: d.F32) => d.F32>; /** * Unit-domain, multiplicative contrast, not inverted: expand [0,1] to signed, scale by contrast, * offset by balance, squash back. * * Multiplicative contrast makes 1 the identity, so this variant's `contrast` prop is a gain (0.25…4) * rather than an offset. Otherwise the same shape as {@link toneSignedInverted}. */ export declare const toneUnitMultiplicative: import('typegpu').TgpuFn<(v: d.F32, contrast: d.F32, balance: d.F32) => d.F32>; /** * Glow pre-gamma, multiplicative contrast, inverted, percent-centred balance: * `pow(v, 5/glow)` → pivot contrast → `+ (balance/100 − 0.5)` → invert. * * The `5/glow` exponent is a SPREAD control, not a brightness one — a small `glow` raises the * exponent and pulls the bright region into a tight core, a large one flattens it out toward a wash. * Balance arrives as a 0–100 percentage here and is re-centred, so 50 is neutral. */ export declare const toneGlowInverted: import('typegpu').TgpuFn<(v: d.F32, glow: d.F32, contrast: d.F32, balance: d.F32) => d.F32>; export interface ToneRemapOptions { /** Input range: `unit` for a [0,1] field, `signed` for a raw [−1,1] one. */ domain: 'unit' | 'signed'; /** `additive` makes contrast 0 the identity; `multiplicative` makes 1 the identity. */ contrastMode: 'additive' | 'multiplicative'; /** * Whether to invert the result. Inverted is the convention for gradient parameters: it makes * colourA the LOW end of the field, matching how a stop list reads top-to-bottom. */ invert: boolean; /** Adds the `pow(v, 5/glow)` pre-step and a fourth `glow` argument. */ glowGamma?: boolean; /** Balance convention: `plain` adds it directly, `percentCentred` treats it as 0–100 about 50. */ balance?: 'plain' | 'percentCentred'; } /** A three-argument tone variant: `(value, contrast, balance) → f32`. */ export type ToneRemapFn = (v: number, contrast: number, balance: number) => number; /** The `glowGamma` variant: `(value, glow, contrast, balance) → f32`. */ export type ToneRemapGlowFn = (v: number, glow: number, contrast: number, balance: number) => number; /** * Resolve an option record to the matching tone variant — a CPU/builder-level dispatcher, exactly * like `colorMixing.mixColors`. Do NOT call this inside a `'use gpu'` body; call the returned fn. * * Only the four combinations that exist in the library resolve. An unsupported combination THROWS * rather than falling back, because a silent fallback here would be a wrong-looking texture with no * error: adding a fifth tone shape means writing its body above, not composing more flags. */ export declare function toneRemap(options: ToneRemapOptions & { glowGamma: true; }): ToneRemapGlowFn; export declare function toneRemap(options: ToneRemapOptions): ToneRemapFn; /** * Always-on ±0.002 hash dither on a FINAL rgb (the LightLeak idiom) — kills banding on long soft * ramps. Never apply to a ramp coordinate: wrapped palette bands would jitter. Alpha untouched. */ export declare const rgbDither: import('typegpu').TgpuFn<(base: d.Vec4f, uv: d.Vec2f, viewport: d.Vec2f, animTime: d.F32) => d.Vec4f>; //# sourceMappingURL=tone.d.ts.map