import { UvMapSource } from '../gpu/scaffolds/uvRemapShader'; import { ArgSpec } from './invoke'; import { GatherEffect } from './types'; import { PropRef } from './values'; /** * Mirror the child across a line through `center` at `angle`. * * `center` is in uv, `angle` in degrees. One side of the line stays as it is and the other side * shows its reflection. * * @example * ```ts * map: warps.mirrorLine({center: p('center'), angle: p('angle')}) * ``` * @tip Pair it with an `edges` prop that defaults to `'mirror'` so the reflected half never runs out of picture. * @see flip, kaleidoscope */ export declare function mirrorLine(slots: { center: ArgSpec; angle: ArgSpec; }): UvMapSource; /** * Flip the child horizontally, vertically, or both. * * `flipX` and `flipY` are boolean props declared with `transform: transformBoolean`. The flip * never looks outside the child, so set `edges: 'none'` on the definition. * * @example * ```ts * map: warps.flip({flipX: p('flipX'), flipY: p('flipY')}), * edges: 'none', * ``` * @see mirrorLine */ export declare function flip(slots: { flipX: ArgSpec; flipY: ArgSpec; }): UvMapSource; /** * Curve the child like a bent sheet seen in perspective, so its ends swell or shrink. * * `strength` runs −1 to 1 and its sign picks the bend direction. `angle` is the bend axis in * degrees. `falloff` (0–1) keeps more of the middle flat and pushes the bend toward the ends. * Where the sheet leaves the frame there is nothing to show, so pair it with an `edges` prop * that defaults to `'transparent'`. * * @example * ```ts * map: warps.bend({strength: p('strength'), falloff: p('falloff'), angle: p('angle')}) * ``` * @see perspective, cornerPin */ export declare function bend(slots: { strength: ArgSpec; falloff: ArgSpec; angle: ArgSpec; }): UvMapSource; /** * Magnify or pinch the child inside a disc around `center`. * * `strength` runs −1 to 1: positive bulges out, negative pinches in. `radius` sets the size of * the disc (1 reaches about half the canvas height). `falloff` runs 0 (hard edge) to 1 (soft). * * @example * ```ts * map: warps.bulge({center: p('center'), strength: p('strength'), radius: p('radius'), falloff: p('falloff')}) * ``` * @see twirl, stretch */ export declare function bulge(slots: { center: ArgSpec; strength: ArgSpec; radius: ArgSpec; falloff: ArgSpec; }): UvMapSource; /** * Twist the child around `center`, turning more the farther a pixel is from it. * * `intensity` is the twist in radians per unit of distance, so the canvas edge turns by about * `intensity` radians. Negative values twist the other way. The library uses −5 to 5. * * @example * ```ts * map: warps.twirl({center: p('center'), intensity: p('intensity')}) * ``` * @see bulge, concentricRings */ export declare function twirl(slots: { center: ArgSpec; intensity: ArgSpec; }): UvMapSource; /** * Fold the child into mirrored pie slices around `center`. * * `segments` is the number of slices (2 or more). `angle` rotates the whole pattern, in * degrees. Pair it with an `edges` prop that defaults to `'mirror'`. * * @example * ```ts * map: warps.kaleidoscope({center: p('center'), segments: p('segments'), angle: p('angle')}) * ``` * @see mirrorLine, toPolar */ export declare function kaleidoscope(slots: { center: ArgSpec; segments: ArgSpec; angle: ArgSpec; }): UvMapSource; /** * Stretch the child along one direction, starting at `center`. * * `angle` is the direction in degrees. Content on the side `angle` points to is pulled out; * the other side is left alone. `strength` (0–1) sets how far. `falloff` (0–1) softens the * start of the stretch, from a hard line at 0 to a long ramp at 1. * * @example * ```ts * map: warps.stretch({center: p('center'), strength: p('strength'), angle: p('angle'), falloff: p('falloff')}) * ``` * @see bulge, bend */ export declare function stretch(slots: { center: ArgSpec; strength: ArgSpec; angle: ArgSpec; falloff: ArgSpec; }): UvMapSource; /** * Ripple the child with a travelling wave. * * `angle` is the travel direction in degrees, `frequency` the number of waves across the * canvas, `strength` (0–1) how far pixels move. `waveType` is a prop marked * `compileTime: true` holding `'sine'`, `'triangle'`, `'square'`, `'sawtooth'` or `'bounce'`. * The wave moves with the layer's clock, so declare `animatedTime: {speed: 'speed'}`. * * @example * ```ts * map: warps.wave({strength: p('strength'), frequency: p('frequency'), angle: p('angle'), waveType: p('waveType')}) * ``` * @tip Changing `waveType` recompiles the shader; the other inputs update live. * @see flowNoise, barOffset */ export declare function wave(slots: { strength: ArgSpec; frequency: ArgSpec; angle: ArgSpec; waveType: PropRef; }): UvMapSource; /** * Unroll the child around `center`, so angle becomes x and distance becomes y. * * `wrap` scales how many times the child repeats around (1 is once). `radius` scales the * distance axis. `intensity` runs 0 (no change) to 1 (the full polar unwrap), and the values * between are a real partial warp, not a cross-fade. * * @example * ```ts * map: warps.toPolar({center: p('center'), wrap: p('wrap'), radius: p('radius'), intensity: p('intensity')}) * ``` * @see fromPolar, kaleidoscope */ export declare function toPolar(slots: { center: ArgSpec; wrap: ArgSpec; radius: ArgSpec; intensity: ArgSpec; }): UvMapSource; /** * Wrap the child into a circle around `center`, reading its x as angle and its y as distance. * * The reverse of `toPolar`. `scale` sets how large the circle is. `intensity` runs 0 (no * change) to 1 (the full wrap). * * @example * ```ts * map: warps.fromPolar({center: p('center'), scale: p('scale'), intensity: p('intensity')}) * ``` * @see toPolar */ export declare function fromPolar(slots: { center: ArgSpec; scale: ArgSpec; intensity: ArgSpec; }): UvMapSource; /** * Pin the four corners of the child to new positions, with true perspective between them. * * The corners are positions in uv. `amount` (0–1) blends each corner from its normal place * (0) to the pinned position (1). Pixels outside the pinned quad are clipped to transparent * whatever the edge mode. * * @example * ```ts * map: warps.cornerPin({topLeft: p('topLeft'), topRight: p('topRight'), bottomRight: p('bottomRight'), bottomLeft: p('bottomLeft'), amount: p('amount')}) * ``` * @see perspective, bend */ export declare function cornerPin(slots: { topLeft: ArgSpec; topRight: ArgSpec; bottomRight: ArgSpec; bottomLeft: ArgSpec; amount: ArgSpec; }): UvMapSource; /** * Tilt the child in 3D, as if it were a card turned away from the camera. * * `pan` and `tilt` are the turns in degrees (−90 to 90). `fov` is the camera's field of view * in degrees: wider means stronger perspective. `zoom` scales the picture (1 is unchanged). * `center` is the pivot and `offset` shifts the result, both in uv. * * @example * ```ts * map: warps.perspective({center: p('center'), pan: p('pan'), tilt: p('tilt'), fov: p('fov'), zoom: p('zoom'), offset: p('offset')}) * ``` * @see cornerPin, bend */ export declare function perspective(slots: { center: ArgSpec; pan: ArgSpec; tilt: ArgSpec; fov: ArgSpec; zoom: ArgSpec; offset: ArgSpec; }): UvMapSource; /** * Cut the child into rings around `center` and spin each ring by its own amount. * * `rings` is how many rings fit in one unit of distance. `intensity` is the largest still * rotation a ring can have, in degrees. `smoothness` (0–1) blends neighbouring rings instead * of cutting between them. `seed` reshuffles the per-ring amounts and `speedRandomness` * (0–1) lets rings spin at different rates. Declare `animatedTime: {speed: 'speed'}`. * * @example * ```ts * map: warps.concentricRings({center: p('center'), intensity: p('intensity'), rings: p('rings'), smoothness: p('smoothness'), seed: p('seed'), speedRandomness: p('speedRandomness')}) * ``` * @see twirl, barOffset */ export declare function concentricRings(slots: { center: ArgSpec; intensity: ArgSpec; rings: ArgSpec; smoothness: ArgSpec; seed: ArgSpec; speedRandomness: ArgSpec; }): UvMapSource; /** * Push the child around with a slowly flowing liquid motion. * * `strength` is how far pixels move, in uv (the library uses 0–0.5). `detail` scales the flow * pattern (higher is finer). `seed` is a prop that picks a different pattern, even when still. * Two clocks drive it: declare `animatedTime: {speed: 'speed'}` for the drift and * `extraAnimatedTimes: {evolution: 'evolutionSpeed'}` for the pattern slowly reshaping. * * @example * ```ts * map: warps.flowNoise({strength: p('strength'), detail: p('detail'), seed: p('seed')}) * ``` * @tip Speed 0 on both clocks gives a fixed distortion you can still change with `seed`. * @see wave, liquidDisplace */ export declare function flowNoise(slots: { strength: ArgSpec; detail: ArgSpec; seed: PropRef; }): UvMapSource; /** * Slice the child into strips that slide out of frame in alternating directions. * * A wipe transition. `progress` runs 0 (whole) to 1 (gone). `angle` is the cut direction in * degrees and `count` the number of strips. Set `edges: 1` (transparent) on the definition so * the vacated space clears instead of smearing. * * @example * ```ts * map: warps.slicedSlide({angle: p('angle'), count: p('sliceCount'), progress: p('progress')}), * edges: 1, * ``` * @see barOffset */ export declare function slicedSlide(slots: { angle: ArgSpec; count: ArgSpec; progress: ArgSpec; }): UvMapSource; /** * Cut the child into parallel bars and shift each one sideways by a random amount. * * A glitch or fractured look. `count` is the number of bars across the canvas, `angle` their * direction in degrees, `intensity` (0–1) how far they shift. `seed` reshuffles the offsets. * Bars drift with the layer's clock, so declare `animatedTime: {speed: 'speed'}`. * * @example * ```ts * map: warps.barOffset({count: p('count'), angle: p('angle'), intensity: p('intensity'), seed: p('seed')}) * ``` * @see slicedSlide, concentricRings */ export declare function barOffset(slots: { count: ArgSpec; angle: ArgSpec; intensity: ArgSpec; seed: ArgSpec; }): UvMapSource; /** * Move the child by a displacement field your own simulation produces, one grid cell at a time. * * `output` names the simulation output (the same name you gave the field), `gridSize` the * number of cells across the shorter side of the canvas. Every pixel in a cell moves together, * by at most a tenth of the canvas. Add `uvRemapIdentityWhen: ({computeOutputs}) => * !computeOutputs?.` to the definition so the warp does nothing until the field exists. * * @example * ```ts * map: warps.gridCellDisplace({gridSize: p('gridSize'), output: 'displacement'}), * uvRemapIdentityWhen: ({computeOutputs}) => !computeOutputs?.displacement, * ``` * @see liquidDisplace */ export declare function gridCellDisplace(slots: { gridSize: ArgSpec; output: string; }): UvMapSource; /** * Move the child smoothly by a displacement field your own simulation produces. * * The liquid or cloth look. `output` names the simulation output. `intensity` scales the * movement (the library uses 0–20), capped at about 15% of the canvas. Add * `uvRemapIdentityWhen: ({computeOutputs}) => !computeOutputs?.` to the definition so * the warp does nothing until the field exists. * * @example * ```ts * map: warps.liquidDisplace({intensity: p('intensity'), output: 'displacement'}), * uvRemapIdentityWhen: ({computeOutputs}) => !computeOutputs?.displacement, * ``` * @see gridCellDisplace, flowNoise */ export declare function liquidDisplace(slots: { intensity: ArgSpec; output: string; }): UvMapSource; /** * Distort the child using another layer's pixels as a displacement map. * * This one goes in `effect:`, not `map:`, because it reads a second layer. `source` is a prop * marked `compileTime: true` that holds the other layer's id. `amount` (0–1) sets how far * pixels move. `channels` is a prop holding `'twoAxis'` (red moves x, green moves y) or * `'directional'` (brightness pushes along `angle`, in degrees). Mid-grey means no movement. * `edges` is a prop marked `compileTime: true` holding `'stretch'`, `'transparent'`, * `'mirror'` or `'wrap'`. With no source selected the child passes through unchanged. * * @example * ```ts * effect: warps.displaceByLayer({source: p('source'), amount: p('amount'), channels: p('channelMode'), angle: p('angle'), edges: p('edges')}) * ``` * @tip An animated source layer displaces live. * @see liquidDisplace */ export declare function displaceByLayer(slots: { source: PropRef; amount: ArgSpec; channels: PropRef; angle: ArgSpec; edges: PropRef; }): GatherEffect; //# sourceMappingURL=warps.d.ts.map