import { transformBoolean, transformAngle, transformEdges, transformColorSpace, transformStrokePosition, PositionAxisInput } from '../utilities/transformations'; import { colorStopsTransform } from '../utilities/colorStops'; import { listPropTransform } from '../utilities/listProps'; import * as d from 'typegpu/data'; export { transformBoolean, transformAngle, transformEdges, transformColorSpace, transformStrokePosition }; export { colorStopsTransform, listPropTransform }; export type { PositionAxisInput }; export declare function setColorSpaceModeGpu(mode: 'p3-linear' | 'srgb'): void; export declare function getColorSpaceModeGpu(): 'p3-linear' | 'srgb'; /** * GPU-side `transformColor`: CSS string → `d.vec4f` CPU instance. Uses the colorjs.io pipeline * + active color-space mode, with the NaN→0 guard. */ export declare function transformColorGpu(value: string): d.v4f; /** Convenience for the color-stops packer: CSS string → flat `[r, g, b, a]` tuple. */ export declare function colorToRGBA(value: string): [number, number, number, number]; /** * GPU-side `transformPosition`: `{x, y}` (or a CSS-style string) → `d.vec2f(x, 1 - y)` CPU * instance. Y-flip applied (y=0 top, y=1 bottom). DimensionalValue axis inputs are resolved to * UV numbers. */ export declare function transformPositionGpu(value: { x: PositionAxisInput; y: PositionAxisInput; } | string): d.v2f; /** * A GPU-side transform: takes a raw prop value and returns the FINAL value written to the * packed struct (a number, or a `d.vec*f` instance). The uniform store applies it (see * `FieldHandle.setFromRaw`), so it must be a pure value → value function. */ export type GpuTransform = (value: unknown) => unknown; /** * Identity transform (value → value). Not returned by `gpuTransformFor` — kept as a small * exported utility some callers/tests reference. */ export declare const identityTransform: GpuTransform; /** * Map a `PropConfig.transform` reference to the GPU-side transform the uniform store should * apply. Shaders keep their transform-referencing props; the bridge calls this to swap in the * GPU equivalent (for the value-producing transforms) or to hand back the transform itself * (for the pure scalar ones). * * transformColor → transformColorGpu (d.vec4f, not an {r,g,b,a} object) * transformPosition → transformPositionGpu (d.vec2f, Y-flip applied) * colorStopsTransform → colorStopsTransform (marker — the bridge expands the prop into * array fields; never applied as a field xform) * undefined → undefined (no transform) * anything else → itself (called directly to produce the field value) * * The "anything else" branch is the key: EVERY other prop transform in the library is a pure * value→value function producing a packable scalar — the shared scalar transforms * (transformBoolean/Angle/Edges/ColorSpace/StrokePosition), the inline numeric transforms * (`v => v * 0.5`, `v => 0.1 + v * 1.4`, deg→rad), the boolean→float transforms (`v => v ? 1 : 0`), * and the per-shader enum string→number maps. Their GPU-side equivalent IS the function itself, so * we return it and let the uniform store apply it (seed + `setFromRaw`). This is the single point at * which a prop's declared transform takes effect, so `uniforms.`, `propValues.` and * `getCpuValue('')` all observe the SAME transformed value. */ export declare function gpuTransformFor(propTransform: ((value: never) => unknown) | undefined): GpuTransform | undefined; //# sourceMappingURL=transforms.d.ts.map