import type { TSLNode, TSLNodeFactory, TSLVec4Node } from '../types/tsl.js'; export interface StructureTensorNodeFactory extends TSLNodeFactory<[ textureNode: TSLNode ], TSLVec4Node> { setParameterLength(length: number): this; } /** * Compute structure tensor for edge-aware image filtering. * * **Algorithm** * - Computes image gradients using Sobel operator (3×3 kernel) * - Calculates outer product of gradient: `J = [∇I ⊗ ∇I]` * - Outputs (Jxx, Jyy, Jxy) in RGB channels for downstream use * * **Use Cases** * - Input for Kuwahara filter (`kuwahara`) * - Edge detection and orientation analysis * - Anisotropic filtering and diffusion * * **Pipeline** * Structure tensor is typically used as a first pass before applying * edge-aware filters like Kuwahara. * * ```js * import { structureTensor } from 'three-blocks/experimental/core-tsl-effects'; * import { kuwahara } from 'three-blocks'; * import { pass } from 'three/tsl'; * * // First pass: compute structure tensor * const scenePass = pass(scene, camera); * const tensorPass = structureTensor(scenePass); * * // Second pass: use tensor for edge-aware filtering * const filtered = kuwahara(scenePass, tensorPass, { radius: 5 }); * * renderPipeline.outputNode = filtered; * ``` * * @function structureTensor * @category TSL * @tags WebGPU, WebGL * @tsl * @param {Node} textureNode Source texture for gradient analysis. * @returns {Node.} Structure tensor (Jxx, Jyy, Jxy, 1.0) in RGBA. * @see kuwahara */ export declare const structureTensor: StructureTensorNodeFactory;