import { Expr } from '../gpu/contract'; import { PropRef, Scalar } from './values'; /** * A soft band around a line, sharp on one side and long on the other. * * `distance` is the signed distance from the line: negative below it, positive above. * Coverage rises from 0 to 1 as the distance crosses `below.from` to `below.to`, then falls * back to 0 as it crosses `above.from` (default 0) to `above.to`. The shape under curtains, * horizons and underlines. * * @example * ```ts * const curtain = mask.softBand({distance: sub(uv.member('y'), pathY), below: {from: -0.04, to: 0.015}, above: {to: height}}) * ``` * @see softDisc, crispStroke */ export declare function softBand(opts: { distance: Expr; below: { from: Expr | number; to: Expr | number; }; above: { from?: Expr | number; to: Expr | number; }; }): Expr; /** * A filled disc with a soft, shaped edge. * * `dist` is the distance from the disc's center and `radius` its size, both in the same * units. The edge fades over `softness.width` either side of the radius, and * `softness.curve` bends that fade: 1 is even, higher values pull it tighter toward the * rim. The look of blobs, orbs and glow dots. * * @example * ```ts * const orb = mask.softDisc({dist, radius: params.uniforms.size, softness: {width: 0.08, curve: 1.5}}) * ``` * @see crispFill, softBand */ export declare function softDisc(opts: { dist: Expr; radius: Expr | number; softness: { width: Expr | number; curve: Expr | number; }; }): Expr; /** * A clean fill of a shape: 1 inside, 0 outside. * * `distance` is a signed distance, negative inside the shape, such as one from the `shape` * words. `footprint` is how wide the edge blends. One pixel in the distance's units gives an * anti-aliased edge. A wider value gives a deliberate soft edge. * * @example * ```ts * const bar = mask.crispFill({distance: shape.roundedRect(x, y, w, h, rounding), footprint: px}) * ``` * @tip One pixel in uv is `div(1, viewport.member('y'))`, with `viewport` from `frames.surfaceOf`. * @see crispStroke, softDisc */ export declare function crispFill(opts: { distance: Expr; footprint: Expr | number; }): Expr; /** * A clean outline of a shape, or a drawn curve, of a given width. * * `distance` is a signed distance to the shape's edge or to the curve. The stroke is * centered on the edge and `width` wide, in the distance's units. `footprint` blends the * stroke's own edges, as in `crispFill`. * * @example * ```ts * const outline = mask.crispStroke({distance: shape.circle(x, y, radius), width: params.uniforms.lineWidth, footprint: px}) * ``` * @see crispFill */ export declare function crispStroke(opts: { distance: Expr; width: Expr | number; footprint: Expr | number; }): Expr; /** * An amount that is 0 near a center and grows to 1 with distance, for an effect's strength. * * Coverage stays 0 inside `radius` and reaches 1 at `radius + falloff`, measured in uv with * the aspect corrected so the ring is round. Every slot takes a prop: `center` is a position * prop, `radius` and `falloff` are numbers in uv. Chain `.times(p('intensity'))` to scale * it. * * @example * ```ts * effect: tintToward(p('color'), {amount: radialMask({center: p('center'), radius: p('radius'), falloff: p('falloff')}).times(p('intensity'))}) * ``` * @tip Also exported at the top level of `shaders/std`, so `radialMask` works without the `mask.` prefix. * @see softDisc */ export declare function radialMask(slots: { center: PropRef; radius: PropRef; falloff: PropRef; }): Scalar; //# sourceMappingURL=mask.d.ts.map