import { CodeGenFn, ModuleRegistry } from "wgsl-linker"; /** code generator or template to create wgsl that load a value from vec4 */ export type LoadComponent = LoadTemplate | LoadCodeGen; /** wgsl template for loading a value from a wgsl vec4 */ export interface LoadTemplate { kind: "template"; wgsl: string; } /** code gen function to generate wgsl for loading a value from a wgsl vec4 */ export interface LoadCodeGen { kind: "function"; fn: CodeGenFn; } export type ComponentName = "r" | "g" | "b" | "a"; /** * A function to generate wgsl to load a value from a texel. * @param component - the component to load from the texture e.g. "r" or "a" * @param outputParams - the number of elements in the output struct * The wgsl importer should pass two paramaters: * . "output" defining the output type e.g. f32 * . "texelType" defining the type of the input texture (e.g. "f32"). */ export declare function loadTexelCodeGen(component: ComponentName, outputParams?: number): LoadCodeGen; /** * @return a function or template to generate wgsl to load a value from a texel * * @param texelComponent - the component name to load from the texture e.g. "r" or "a", * (or an already defined generator function or wgsl template which is just passed through) */ export declare function texelLoader(texelComponent: ComponentName | LoadComponent): LoadComponent; export declare function registerTexelLoader(texelComponent: ComponentName | LoadComponent, registry: ModuleRegistry): void;