@nodetool-ai/gpu 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/blend/blendModes.d.ts +67 -0
- package/dist/blend/blendModes.d.ts.map +1 -0
- package/dist/blend/blendModes.js +80 -0
- package/dist/blend/blendModes.js.map +1 -0
- package/dist/blend/index.d.ts +10 -0
- package/dist/blend/index.d.ts.map +1 -0
- package/dist/blend/index.js +10 -0
- package/dist/blend/index.js.map +1 -0
- package/dist/blend/wgsl.d.ts +16 -0
- package/dist/blend/wgsl.d.ts.map +1 -0
- package/dist/blend/wgsl.js +85 -0
- package/dist/blend/wgsl.js.map +1 -0
- package/dist/compositor/compositor.d.ts +112 -0
- package/dist/compositor/compositor.d.ts.map +1 -0
- package/dist/compositor/compositor.js +353 -0
- package/dist/compositor/compositor.js.map +1 -0
- package/dist/compositor/headless.d.ts +47 -0
- package/dist/compositor/headless.d.ts.map +1 -0
- package/dist/compositor/headless.js +158 -0
- package/dist/compositor/headless.js.map +1 -0
- package/dist/compositor/index.d.ts +8 -0
- package/dist/compositor/index.d.ts.map +1 -0
- package/dist/compositor/index.js +8 -0
- package/dist/compositor/index.js.map +1 -0
- package/dist/compositor/shaders.d.ts +24 -0
- package/dist/compositor/shaders.d.ts.map +1 -0
- package/dist/compositor/shaders.js +241 -0
- package/dist/compositor/shaders.js.map +1 -0
- package/dist/compositor/transform.d.ts +49 -0
- package/dist/compositor/transform.d.ts.map +1 -0
- package/dist/compositor/transform.js +74 -0
- package/dist/compositor/transform.js.map +1 -0
- package/dist/context.d.ts +108 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +205 -0
- package/dist/context.js.map +1 -0
- package/dist/debug/premulValidator.d.ts +85 -0
- package/dist/debug/premulValidator.d.ts.map +1 -0
- package/dist/debug/premulValidator.js +239 -0
- package/dist/debug/premulValidator.js.map +1 -0
- package/dist/executor.d.ts +74 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +413 -0
- package/dist/executor.js.map +1 -0
- package/dist/fullscreenQuad.d.ts +11 -0
- package/dist/fullscreenQuad.d.ts.map +1 -0
- package/dist/fullscreenQuad.js +31 -0
- package/dist/fullscreenQuad.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +162 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +100 -0
- package/dist/module.js.map +1 -0
- package/dist/node.d.ts +38 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +140 -0
- package/dist/node.js.map +1 -0
- package/dist/pool.d.ts +30 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/pool.js +33 -0
- package/dist/pool.js.map +1 -0
- package/dist/recipe.d.ts +148 -0
- package/dist/recipe.d.ts.map +1 -0
- package/dist/recipe.js +181 -0
- package/dist/recipe.js.map +1 -0
- package/dist/registry.d.ts +49 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +100 -0
- package/dist/registry.js.map +1 -0
- package/dist/shaders/_canary/passthrough/v1/module.d.ts +13 -0
- package/dist/shaders/_canary/passthrough/v1/module.d.ts.map +1 -0
- package/dist/shaders/_canary/passthrough/v1/module.js +71 -0
- package/dist/shaders/_canary/passthrough/v1/module.js.map +1 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.d.ts +16 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.d.ts.map +1 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.js +62 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.js.map +1 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.d.ts +19 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.d.ts.map +1 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.js +61 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.js.map +1 -0
- package/dist/shaders/color/brightnessContrast/v1/module.d.ts +17 -0
- package/dist/shaders/color/brightnessContrast/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/brightnessContrast/v1/module.js +84 -0
- package/dist/shaders/color/brightnessContrast/v1/module.js.map +1 -0
- package/dist/shaders/color/cdl/v1/module.d.ts +35 -0
- package/dist/shaders/color/cdl/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/cdl/v1/module.js +106 -0
- package/dist/shaders/color/cdl/v1/module.js.map +1 -0
- package/dist/shaders/color/channelMerge/v1/module.d.ts +22 -0
- package/dist/shaders/color/channelMerge/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelMerge/v1/module.js +101 -0
- package/dist/shaders/color/channelMerge/v1/module.js.map +1 -0
- package/dist/shaders/color/channelShuffle/v1/module.d.ts +29 -0
- package/dist/shaders/color/channelShuffle/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelShuffle/v1/module.js +94 -0
- package/dist/shaders/color/channelShuffle/v1/module.js.map +1 -0
- package/dist/shaders/color/channelSplit/v1/module.d.ts +18 -0
- package/dist/shaders/color/channelSplit/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelSplit/v1/module.js +90 -0
- package/dist/shaders/color/channelSplit/v1/module.js.map +1 -0
- package/dist/shaders/color/colorBalance/v1/module.d.ts +18 -0
- package/dist/shaders/color/colorBalance/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/colorBalance/v1/module.js +86 -0
- package/dist/shaders/color/colorBalance/v1/module.js.map +1 -0
- package/dist/shaders/color/cubeLut/v1/module.d.ts +14 -0
- package/dist/shaders/color/cubeLut/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/cubeLut/v1/module.js +78 -0
- package/dist/shaders/color/cubeLut/v1/module.js.map +1 -0
- package/dist/shaders/color/curves/v1/module.d.ts +31 -0
- package/dist/shaders/color/curves/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/curves/v1/module.js +102 -0
- package/dist/shaders/color/curves/v1/module.js.map +1 -0
- package/dist/shaders/color/exposure/v1/module.d.ts +15 -0
- package/dist/shaders/color/exposure/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/exposure/v1/module.js +78 -0
- package/dist/shaders/color/exposure/v1/module.js.map +1 -0
- package/dist/shaders/color/exposureTone/v1/module.d.ts +28 -0
- package/dist/shaders/color/exposureTone/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/exposureTone/v1/module.js +107 -0
- package/dist/shaders/color/exposureTone/v1/module.js.map +1 -0
- package/dist/shaders/color/filmLook/v1/module.d.ts +28 -0
- package/dist/shaders/color/filmLook/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/filmLook/v1/module.js +103 -0
- package/dist/shaders/color/filmLook/v1/module.js.map +1 -0
- package/dist/shaders/color/grade/v1/module.d.ts +35 -0
- package/dist/shaders/color/grade/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/grade/v1/module.js +182 -0
- package/dist/shaders/color/grade/v1/module.js.map +1 -0
- package/dist/shaders/color/grayscale/v1/module.d.ts +14 -0
- package/dist/shaders/color/grayscale/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/grayscale/v1/module.js +79 -0
- package/dist/shaders/color/grayscale/v1/module.js.map +1 -0
- package/dist/shaders/color/hsb/v1/module.d.ts +20 -0
- package/dist/shaders/color/hsb/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/hsb/v1/module.js +131 -0
- package/dist/shaders/color/hsb/v1/module.js.map +1 -0
- package/dist/shaders/color/hslAdjust/v1/module.d.ts +30 -0
- package/dist/shaders/color/hslAdjust/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/hslAdjust/v1/module.js +170 -0
- package/dist/shaders/color/hslAdjust/v1/module.js.map +1 -0
- package/dist/shaders/color/invert/v1/module.d.ts +15 -0
- package/dist/shaders/color/invert/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/invert/v1/module.js +85 -0
- package/dist/shaders/color/invert/v1/module.js.map +1 -0
- package/dist/shaders/color/levels/v1/module.d.ts +33 -0
- package/dist/shaders/color/levels/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/levels/v1/module.js +116 -0
- package/dist/shaders/color/levels/v1/module.js.map +1 -0
- package/dist/shaders/color/liftGammaGain/v1/module.d.ts +40 -0
- package/dist/shaders/color/liftGammaGain/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/liftGammaGain/v1/module.js +114 -0
- package/dist/shaders/color/liftGammaGain/v1/module.js.map +1 -0
- package/dist/shaders/color/posterize/v1/module.d.ts +16 -0
- package/dist/shaders/color/posterize/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/posterize/v1/module.js +80 -0
- package/dist/shaders/color/posterize/v1/module.js.map +1 -0
- package/dist/shaders/color/solarize/v1/module.d.ts +15 -0
- package/dist/shaders/color/solarize/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/solarize/v1/module.js +83 -0
- package/dist/shaders/color/solarize/v1/module.js.map +1 -0
- package/dist/shaders/color/splitToning/v1/module.d.ts +26 -0
- package/dist/shaders/color/splitToning/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/splitToning/v1/module.js +95 -0
- package/dist/shaders/color/splitToning/v1/module.js.map +1 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.d.ts +23 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.js +110 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.js.map +1 -0
- package/dist/shaders/filters/blur/separable/v1/module.d.ts +18 -0
- package/dist/shaders/filters/blur/separable/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/blur/separable/v1/module.js +64 -0
- package/dist/shaders/filters/blur/separable/v1/module.js.map +1 -0
- package/dist/shaders/filters/convolve3x3/v1/module.d.ts +23 -0
- package/dist/shaders/filters/convolve3x3/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/convolve3x3/v1/module.js +128 -0
- package/dist/shaders/filters/convolve3x3/v1/module.js.map +1 -0
- package/dist/shaders/filters/glow/v1/module.d.ts +26 -0
- package/dist/shaders/filters/glow/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/glow/v1/module.js +102 -0
- package/dist/shaders/filters/glow/v1/module.js.map +1 -0
- package/dist/shaders/filters/grain/v1/module.d.ts +38 -0
- package/dist/shaders/filters/grain/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/grain/v1/module.js +110 -0
- package/dist/shaders/filters/grain/v1/module.js.map +1 -0
- package/dist/shaders/filters/pixelate/v1/module.d.ts +14 -0
- package/dist/shaders/filters/pixelate/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/pixelate/v1/module.js +76 -0
- package/dist/shaders/filters/pixelate/v1/module.js.map +1 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts +17 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js +93 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js.map +1 -0
- package/dist/shaders/filters/threshold/v1/module.d.ts +17 -0
- package/dist/shaders/filters/threshold/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/threshold/v1/module.js +71 -0
- package/dist/shaders/filters/threshold/v1/module.js.map +1 -0
- package/dist/shaders/filters/vignette/v1/module.d.ts +18 -0
- package/dist/shaders/filters/vignette/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/vignette/v1/module.js +78 -0
- package/dist/shaders/filters/vignette/v1/module.js.map +1 -0
- package/dist/shaders/filters/visualFx/v1/module.d.ts +24 -0
- package/dist/shaders/filters/visualFx/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/visualFx/v1/module.js +210 -0
- package/dist/shaders/filters/visualFx/v1/module.js.map +1 -0
- package/dist/shaders/index.d.ts +86 -0
- package/dist/shaders/index.d.ts.map +1 -0
- package/dist/shaders/index.js +161 -0
- package/dist/shaders/index.js.map +1 -0
- package/dist/shaders/keyer/chromaKey/v1/module.d.ts +25 -0
- package/dist/shaders/keyer/chromaKey/v1/module.d.ts.map +1 -0
- package/dist/shaders/keyer/chromaKey/v1/module.js +111 -0
- package/dist/shaders/keyer/chromaKey/v1/module.js.map +1 -0
- package/dist/shaders/keyer/lumaKey/v1/module.d.ts +22 -0
- package/dist/shaders/keyer/lumaKey/v1/module.d.ts.map +1 -0
- package/dist/shaders/keyer/lumaKey/v1/module.js +89 -0
- package/dist/shaders/keyer/lumaKey/v1/module.js.map +1 -0
- package/dist/shaders/mask/apply/v1/module.d.ts +16 -0
- package/dist/shaders/mask/apply/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/apply/v1/module.js +79 -0
- package/dist/shaders/mask/apply/v1/module.js.map +1 -0
- package/dist/shaders/mask/fromImage/v1/module.d.ts +18 -0
- package/dist/shaders/mask/fromImage/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/fromImage/v1/module.js +99 -0
- package/dist/shaders/mask/fromImage/v1/module.js.map +1 -0
- package/dist/shaders/mask/invert/v1/module.d.ts +12 -0
- package/dist/shaders/mask/invert/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/invert/v1/module.js +57 -0
- package/dist/shaders/mask/invert/v1/module.js.map +1 -0
- package/dist/shaders/mixer/add/v1/module.d.ts +17 -0
- package/dist/shaders/mixer/add/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/add/v1/module.js +73 -0
- package/dist/shaders/mixer/add/v1/module.js.map +1 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.d.ts +26 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.js +81 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.js.map +1 -0
- package/dist/shaders/mixer/dropShadow/v1/module.d.ts +28 -0
- package/dist/shaders/mixer/dropShadow/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/dropShadow/v1/module.js +104 -0
- package/dist/shaders/mixer/dropShadow/v1/module.js.map +1 -0
- package/dist/shaders/mixer/outline/v1/module.d.ts +27 -0
- package/dist/shaders/mixer/outline/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/outline/v1/module.js +105 -0
- package/dist/shaders/mixer/outline/v1/module.js.map +1 -0
- package/dist/shaders/mixer/over/v1/module.d.ts +16 -0
- package/dist/shaders/mixer/over/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/over/v1/module.js +71 -0
- package/dist/shaders/mixer/over/v1/module.js.map +1 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.d.ts +26 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.js +95 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.js.map +1 -0
- package/dist/shaders/sources/angularGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/angularGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/angularGradient/v1/module.js +67 -0
- package/dist/shaders/sources/angularGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/checkerboard/v1/module.d.ts +19 -0
- package/dist/shaders/sources/checkerboard/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/checkerboard/v1/module.js +70 -0
- package/dist/shaders/sources/checkerboard/v1/module.js.map +1 -0
- package/dist/shaders/sources/diamondGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/diamondGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/diamondGradient/v1/module.js +61 -0
- package/dist/shaders/sources/diamondGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.d.ts +21 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.js +72 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.js.map +1 -0
- package/dist/shaders/sources/linearGradient/v1/module.d.ts +21 -0
- package/dist/shaders/sources/linearGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/linearGradient/v1/module.js +72 -0
- package/dist/shaders/sources/linearGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/radialGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/radialGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/radialGradient/v1/module.js +60 -0
- package/dist/shaders/sources/radialGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/solid/v1/module.d.ts +17 -0
- package/dist/shaders/sources/solid/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/solid/v1/module.js +49 -0
- package/dist/shaders/sources/solid/v1/module.js.map +1 -0
- package/dist/shaders/transform/affine/v1/module.d.ts +36 -0
- package/dist/shaders/transform/affine/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/affine/v1/module.js +94 -0
- package/dist/shaders/transform/affine/v1/module.js.map +1 -0
- package/dist/shaders/transform/cornerPin/v1/module.d.ts +40 -0
- package/dist/shaders/transform/cornerPin/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/cornerPin/v1/module.js +109 -0
- package/dist/shaders/transform/cornerPin/v1/module.js.map +1 -0
- package/dist/shaders/transform/crop/v1/module.d.ts +26 -0
- package/dist/shaders/transform/crop/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/crop/v1/module.js +82 -0
- package/dist/shaders/transform/crop/v1/module.js.map +1 -0
- package/dist/shaders/transform/displace/v1/module.d.ts +23 -0
- package/dist/shaders/transform/displace/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/displace/v1/module.js +95 -0
- package/dist/shaders/transform/displace/v1/module.js.map +1 -0
- package/dist/shaders/transform/mirror/v1/module.d.ts +14 -0
- package/dist/shaders/transform/mirror/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/mirror/v1/module.js +73 -0
- package/dist/shaders/transform/mirror/v1/module.js.map +1 -0
- package/dist/shaders/transform/offset/v1/module.d.ts +21 -0
- package/dist/shaders/transform/offset/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/offset/v1/module.js +88 -0
- package/dist/shaders/transform/offset/v1/module.js.map +1 -0
- package/dist/shaders/transform/pad/v1/module.d.ts +26 -0
- package/dist/shaders/transform/pad/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/pad/v1/module.js +95 -0
- package/dist/shaders/transform/pad/v1/module.js.map +1 -0
- package/dist/shaders/transform/polarRemap/v1/module.d.ts +20 -0
- package/dist/shaders/transform/polarRemap/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/polarRemap/v1/module.js +95 -0
- package/dist/shaders/transform/polarRemap/v1/module.js.map +1 -0
- package/dist/shaders/transform/resize/v1/module.d.ts +20 -0
- package/dist/shaders/transform/resize/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/resize/v1/module.js +116 -0
- package/dist/shaders/transform/resize/v1/module.js.map +1 -0
- package/dist/shaders/transform/rotate90/v1/module.d.ts +25 -0
- package/dist/shaders/transform/rotate90/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/rotate90/v1/module.js +90 -0
- package/dist/shaders/transform/rotate90/v1/module.js.map +1 -0
- package/dist/shaders/transform/spherize/v1/module.d.ts +21 -0
- package/dist/shaders/transform/spherize/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/spherize/v1/module.js +94 -0
- package/dist/shaders/transform/spherize/v1/module.js.map +1 -0
- package/dist/shaders/transform/tile/v1/module.d.ts +22 -0
- package/dist/shaders/transform/tile/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/tile/v1/module.js +89 -0
- package/dist/shaders/transform/tile/v1/module.js.map +1 -0
- package/dist/shared/lumaWgsl.d.ts +14 -0
- package/dist/shared/lumaWgsl.d.ts.map +1 -0
- package/dist/shared/lumaWgsl.js +18 -0
- package/dist/shared/lumaWgsl.js.map +1 -0
- package/dist/shared/premulWgsl.d.ts +46 -0
- package/dist/shared/premulWgsl.d.ts.map +1 -0
- package/dist/shared/premulWgsl.js +90 -0
- package/dist/shared/premulWgsl.js.map +1 -0
- package/dist/texture.d.ts +54 -0
- package/dist/texture.d.ts.map +1 -0
- package/dist/texture.js +70 -0
- package/dist/texture.js.map +1 -0
- package/dist/types.d.ts +103 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/validate/wgslLinearity.d.ts +86 -0
- package/dist/validate/wgslLinearity.d.ts.map +1 -0
- package/dist/validate/wgslLinearity.js +298 -0
- package/dist/validate/wgslLinearity.js.map +1 -0
- package/dist/webgpu/index.d.ts +11 -0
- package/dist/webgpu/index.d.ts.map +1 -0
- package/dist/webgpu/index.js +11 -0
- package/dist/webgpu/index.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `alpha.premulToStraight@1` — convert premultiplied-alpha RGB to straight.
|
|
3
|
+
*
|
|
4
|
+
* Per-pixel `vec4(rgb, a) → vec4(rgb / a, a)` (transparent pixels collapse to
|
|
5
|
+
* `vec4(0)`). The inverse of
|
|
6
|
+
* {@link ./../straightToPremul/v1/module alphaStraightToPremulV1}; the two
|
|
7
|
+
* exist so hosts can bridge straight↔premultiplied boundaries explicitly
|
|
8
|
+
* instead of letting metadata drift.
|
|
9
|
+
*
|
|
10
|
+
* Output color space matches input — this module touches association only.
|
|
11
|
+
*/
|
|
12
|
+
import tgpu from "typegpu";
|
|
13
|
+
import * as d from "typegpu/data";
|
|
14
|
+
import { defineModule } from "../../../../module.js";
|
|
15
|
+
const ConvertParams = d.struct({ _unused: d.f32 });
|
|
16
|
+
const layout = tgpu.bindGroupLayout({
|
|
17
|
+
source: { texture: "float" },
|
|
18
|
+
outputTexture: { storageTexture: "rgba8unorm" }
|
|
19
|
+
});
|
|
20
|
+
export const alphaPremulToStraightV1 = defineModule({
|
|
21
|
+
id: "alpha.premulToStraight",
|
|
22
|
+
version: 1,
|
|
23
|
+
surface: "internal",
|
|
24
|
+
category: "alpha",
|
|
25
|
+
linearity: "nonlinear-in-rgb",
|
|
26
|
+
kind: "compute",
|
|
27
|
+
params: ConvertParams,
|
|
28
|
+
paramDefaults: { _unused: 0 },
|
|
29
|
+
layout,
|
|
30
|
+
workgroupSize: [16, 16, 1],
|
|
31
|
+
wgsl: /* wgsl */ `
|
|
32
|
+
@compute @workgroup_size(16, 16, 1)
|
|
33
|
+
fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
|
|
34
|
+
let dims = textureDimensions(layout.$.source);
|
|
35
|
+
if (gid.x >= dims.x || gid.y >= dims.y) { return; }
|
|
36
|
+
let coords = vec2<i32>(i32(gid.x), i32(gid.y));
|
|
37
|
+
let c = textureLoad(layout.$.source, coords, 0);
|
|
38
|
+
if (c.a <= 0.0) {
|
|
39
|
+
textureStore(layout.$.outputTexture, coords, vec4<f32>(0.0));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
textureStore(layout.$.outputTexture, coords, vec4<f32>(c.rgb / c.a, c.a));
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
45
|
+
io: {
|
|
46
|
+
inputs: {
|
|
47
|
+
source: {
|
|
48
|
+
colorSpace: "srgb",
|
|
49
|
+
alpha: "premultiplied",
|
|
50
|
+
bindingKinds: ["texture_2d"]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
output: {
|
|
54
|
+
colorSpace: "srgb",
|
|
55
|
+
alpha: "straight",
|
|
56
|
+
format: "rgba8unorm",
|
|
57
|
+
dimensions: "same-as:source"
|
|
58
|
+
},
|
|
59
|
+
rod: "same-as:source"
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/alpha/premulToStraight/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAEnD,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,aAAa,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE;CAChD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;IAClD,EAAE,EAAE,wBAAwB;IAC5B,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,aAAa;IACrB,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;IAC7B,MAAM;IACN,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;;;;;;;;;;;;;CAalB;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `alpha.straightToPremul@1` — convert straight-alpha RGB to premultiplied.
|
|
3
|
+
*
|
|
4
|
+
* Per-pixel `vec4(rgb, a) → vec4(rgb * a, a)`. Pairs with
|
|
5
|
+
* {@link ./../premulToStraight/v1/module premulToStraightV1} as the two
|
|
6
|
+
* canonical alpha boundary modules. The Executor's strict input validation
|
|
7
|
+
* (Phase 3) catches alpha-association mismatches between modules; hosts insert
|
|
8
|
+
* one of these passes explicitly to bridge a straight ingress (e.g. video
|
|
9
|
+
* `copyExternalImageToTexture` with `premultipliedAlpha: false`) into a chain
|
|
10
|
+
* of premultiplied modules.
|
|
11
|
+
*
|
|
12
|
+
* Output color space matches input — this module touches association only, not
|
|
13
|
+
* the encoding curve.
|
|
14
|
+
*/
|
|
15
|
+
import * as d from "typegpu/data";
|
|
16
|
+
export declare const alphaStraightToPremulV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
17
|
+
_unused: d.F32;
|
|
18
|
+
}>>;
|
|
19
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/alpha/straightToPremul/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAUlC,eAAO,MAAM,uBAAuB;;GAqClC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `alpha.straightToPremul@1` — convert straight-alpha RGB to premultiplied.
|
|
3
|
+
*
|
|
4
|
+
* Per-pixel `vec4(rgb, a) → vec4(rgb * a, a)`. Pairs with
|
|
5
|
+
* {@link ./../premulToStraight/v1/module premulToStraightV1} as the two
|
|
6
|
+
* canonical alpha boundary modules. The Executor's strict input validation
|
|
7
|
+
* (Phase 3) catches alpha-association mismatches between modules; hosts insert
|
|
8
|
+
* one of these passes explicitly to bridge a straight ingress (e.g. video
|
|
9
|
+
* `copyExternalImageToTexture` with `premultipliedAlpha: false`) into a chain
|
|
10
|
+
* of premultiplied modules.
|
|
11
|
+
*
|
|
12
|
+
* Output color space matches input — this module touches association only, not
|
|
13
|
+
* the encoding curve.
|
|
14
|
+
*/
|
|
15
|
+
import tgpu from "typegpu";
|
|
16
|
+
import * as d from "typegpu/data";
|
|
17
|
+
import { defineModule } from "../../../../module.js";
|
|
18
|
+
const ConvertParams = d.struct({ _unused: d.f32 });
|
|
19
|
+
const layout = tgpu.bindGroupLayout({
|
|
20
|
+
source: { texture: "float" },
|
|
21
|
+
outputTexture: { storageTexture: "rgba8unorm" }
|
|
22
|
+
});
|
|
23
|
+
export const alphaStraightToPremulV1 = defineModule({
|
|
24
|
+
id: "alpha.straightToPremul",
|
|
25
|
+
version: 1,
|
|
26
|
+
surface: "internal",
|
|
27
|
+
category: "alpha",
|
|
28
|
+
linearity: "linear-in-rgb",
|
|
29
|
+
kind: "compute",
|
|
30
|
+
params: ConvertParams,
|
|
31
|
+
paramDefaults: { _unused: 0 },
|
|
32
|
+
layout,
|
|
33
|
+
workgroupSize: [16, 16, 1],
|
|
34
|
+
wgsl: /* wgsl */ `
|
|
35
|
+
@compute @workgroup_size(16, 16, 1)
|
|
36
|
+
fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
|
|
37
|
+
let dims = textureDimensions(layout.$.source);
|
|
38
|
+
if (gid.x >= dims.x || gid.y >= dims.y) { return; }
|
|
39
|
+
let coords = vec2<i32>(i32(gid.x), i32(gid.y));
|
|
40
|
+
let c = textureLoad(layout.$.source, coords, 0);
|
|
41
|
+
textureStore(layout.$.outputTexture, coords, vec4<f32>(c.rgb * c.a, c.a));
|
|
42
|
+
}
|
|
43
|
+
`,
|
|
44
|
+
io: {
|
|
45
|
+
inputs: {
|
|
46
|
+
source: {
|
|
47
|
+
colorSpace: "srgb",
|
|
48
|
+
alpha: "straight",
|
|
49
|
+
bindingKinds: ["texture_2d"]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
output: {
|
|
53
|
+
colorSpace: "srgb",
|
|
54
|
+
alpha: "premultiplied",
|
|
55
|
+
format: "rgba8unorm",
|
|
56
|
+
dimensions: "same-as:source"
|
|
57
|
+
},
|
|
58
|
+
rod: "same-as:source"
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/alpha/straightToPremul/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAEnD,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,aAAa,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE;CAChD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;IAClD,EAAE,EAAE,wBAAwB;IAC5B,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,aAAa;IACrB,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;IAC7B,MAAM;IACN,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;;;;;;;;;CASlB;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,UAAU;gBACjB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.brightnessContrast@1` — additive brightness, multiplicative contrast.
|
|
3
|
+
*
|
|
4
|
+
* Math matches the timeline preview's color-correction stage (also used by
|
|
5
|
+
* `color.grade@1`): `rgb = (rgb - 0.5) * contrast + 0.5 + brightness`, clamped
|
|
6
|
+
* to `[0, 1]`. Fragment, with the canonical mask slot.
|
|
7
|
+
*/
|
|
8
|
+
import * as d from "typegpu/data";
|
|
9
|
+
export declare const BrightnessContrastParams: d.WgslStruct<{
|
|
10
|
+
brightness: d.F32;
|
|
11
|
+
contrast: d.F32;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const colorBrightnessContrastV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
14
|
+
brightness: d.F32;
|
|
15
|
+
contrast: d.F32;
|
|
16
|
+
}>>;
|
|
17
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/brightnessContrast/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,wBAAwB;;;EAGnC,CAAC;AAgBH,eAAO,MAAM,yBAAyB;;;GAwDpC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.brightnessContrast@1` — additive brightness, multiplicative contrast.
|
|
3
|
+
*
|
|
4
|
+
* Math matches the timeline preview's color-correction stage (also used by
|
|
5
|
+
* `color.grade@1`): `rgb = (rgb - 0.5) * contrast + 0.5 + brightness`, clamped
|
|
6
|
+
* to `[0, 1]`. Fragment, with the canonical mask slot.
|
|
7
|
+
*/
|
|
8
|
+
import tgpu from "typegpu";
|
|
9
|
+
import * as d from "typegpu/data";
|
|
10
|
+
import { defineModule } from "../../../../module.js";
|
|
11
|
+
export const BrightnessContrastParams = d.struct({
|
|
12
|
+
brightness: d.f32,
|
|
13
|
+
contrast: d.f32
|
|
14
|
+
});
|
|
15
|
+
const layout = tgpu.bindGroupLayout({
|
|
16
|
+
params: { uniform: BrightnessContrastParams },
|
|
17
|
+
source: { texture: "float" },
|
|
18
|
+
mask: { texture: "float" },
|
|
19
|
+
samp: { sampler: "filtering" }
|
|
20
|
+
});
|
|
21
|
+
const samplerDescriptor = {
|
|
22
|
+
magFilter: "linear",
|
|
23
|
+
minFilter: "linear",
|
|
24
|
+
addressModeU: "clamp-to-edge",
|
|
25
|
+
addressModeV: "clamp-to-edge"
|
|
26
|
+
};
|
|
27
|
+
export const colorBrightnessContrastV1 = defineModule({
|
|
28
|
+
id: "color.brightnessContrast",
|
|
29
|
+
version: 1,
|
|
30
|
+
// Same math as `color.grade`'s sub-stage, exposed as its own op for workflow
|
|
31
|
+
// nodes that only need brightness/contrast.
|
|
32
|
+
surface: "published",
|
|
33
|
+
category: "color",
|
|
34
|
+
linearity: "nonlinear-in-rgb",
|
|
35
|
+
kind: "fragment",
|
|
36
|
+
params: BrightnessContrastParams,
|
|
37
|
+
paramDefaults: { brightness: 0, contrast: 1 },
|
|
38
|
+
paramUi: {
|
|
39
|
+
brightness: { min: -1, max: 1, step: 0.01, label: "Brightness" },
|
|
40
|
+
contrast: { min: 0, max: 4, step: 0.01, label: "Contrast" }
|
|
41
|
+
},
|
|
42
|
+
layout,
|
|
43
|
+
samplers: { samp: samplerDescriptor },
|
|
44
|
+
wgsl: /* wgsl */ `
|
|
45
|
+
@fragment
|
|
46
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
47
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
48
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
49
|
+
let p = layout.$.params;
|
|
50
|
+
// Brightness/contrast is a straight-color formula; un-premultiply first so
|
|
51
|
+
// the operation acts on the underlying color, then re-premultiply on store.
|
|
52
|
+
// Applying the formula to premultiplied RGB silently scales each adjustment
|
|
53
|
+
// by a and breaks the rgb <= a invariant for transparent regions.
|
|
54
|
+
let safeA = max(src.a, 1.0 / 255.0);
|
|
55
|
+
let straight = src.rgb / safeA;
|
|
56
|
+
let adjusted = clamp((straight - vec3f(0.5)) * p.contrast + vec3f(0.5) + vec3f(p.brightness), vec3f(0.0), vec3f(1.0));
|
|
57
|
+
let mixedStraight = mix(straight, adjusted, coverage);
|
|
58
|
+
return vec4f(mixedStraight * src.a, src.a);
|
|
59
|
+
}
|
|
60
|
+
`,
|
|
61
|
+
io: {
|
|
62
|
+
inputs: {
|
|
63
|
+
source: {
|
|
64
|
+
colorSpace: "linear",
|
|
65
|
+
alpha: "premultiplied",
|
|
66
|
+
bindingKinds: ["texture_2d"]
|
|
67
|
+
},
|
|
68
|
+
mask: {
|
|
69
|
+
colorSpace: "linear",
|
|
70
|
+
alpha: "premultiplied",
|
|
71
|
+
bindingKinds: ["texture_2d"],
|
|
72
|
+
optional: true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
output: {
|
|
76
|
+
colorSpace: "linear",
|
|
77
|
+
alpha: "premultiplied",
|
|
78
|
+
format: "rgba8unorm",
|
|
79
|
+
dimensions: "same-as:source"
|
|
80
|
+
},
|
|
81
|
+
rod: "same-as:source"
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/brightnessContrast/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,UAAU,EAAE,CAAC,CAAC,GAAG;IACjB,QAAQ,EAAE,CAAC,CAAC,GAAG;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;IAC7C,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC1B,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAyB;IAC9C,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,YAAY,EAAE,eAAe;IAC7B,YAAY,EAAE,eAAe;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CAAC;IACpD,EAAE,EAAE,0BAA0B;IAC9B,OAAO,EAAE,CAAC;IACV,6EAA6E;IAC7E,4CAA4C;IAC5C,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,wBAAwB;IAChC,aAAa,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE;IAC7C,OAAO,EAAE;QACP,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;QAChE,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE;KAC5D;IACD,MAAM;IACN,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACrC,IAAI,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;CAgBlB;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,QAAQ;gBACpB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,QAAQ;gBACpB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;gBAC5B,QAAQ,EAAE,IAAI;aACf;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.cdl@1` — ASC CDL (Color Decision List) primary correction.
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from the CPU `lib.image.color_grading.CDL` loop:
|
|
5
|
+
* `out = clamp(in * slope + offset, 0, 1) ^ power`, followed by a luminance-
|
|
6
|
+
* preserving saturation adjustment. The industry-standard exchange formula for
|
|
7
|
+
* trading colour grades between tools. Fragment, with the canonical optional
|
|
8
|
+
* mask slot.
|
|
9
|
+
*/
|
|
10
|
+
import * as d from "typegpu/data";
|
|
11
|
+
export declare const CdlParams: d.WgslStruct<{
|
|
12
|
+
slopeR: d.F32;
|
|
13
|
+
slopeG: d.F32;
|
|
14
|
+
slopeB: d.F32;
|
|
15
|
+
offsetR: d.F32;
|
|
16
|
+
offsetG: d.F32;
|
|
17
|
+
offsetB: d.F32;
|
|
18
|
+
powerR: d.F32;
|
|
19
|
+
powerG: d.F32;
|
|
20
|
+
powerB: d.F32;
|
|
21
|
+
saturation: d.F32;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const colorCdlV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
24
|
+
slopeR: d.F32;
|
|
25
|
+
slopeG: d.F32;
|
|
26
|
+
slopeB: d.F32;
|
|
27
|
+
offsetR: d.F32;
|
|
28
|
+
offsetG: d.F32;
|
|
29
|
+
offsetB: d.F32;
|
|
30
|
+
powerR: d.F32;
|
|
31
|
+
powerG: d.F32;
|
|
32
|
+
powerB: d.F32;
|
|
33
|
+
saturation: d.F32;
|
|
34
|
+
}>>;
|
|
35
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/cdl/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAIlC,eAAO,MAAM,SAAS;;;;;;;;;;;EAWpB,CAAC;AAgBH,eAAO,MAAM,UAAU;;;;;;;;;;;GAmErB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.cdl@1` — ASC CDL (Color Decision List) primary correction.
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from the CPU `lib.image.color_grading.CDL` loop:
|
|
5
|
+
* `out = clamp(in * slope + offset, 0, 1) ^ power`, followed by a luminance-
|
|
6
|
+
* preserving saturation adjustment. The industry-standard exchange formula for
|
|
7
|
+
* trading colour grades between tools. Fragment, with the canonical optional
|
|
8
|
+
* mask slot.
|
|
9
|
+
*/
|
|
10
|
+
import tgpu from "typegpu";
|
|
11
|
+
import * as d from "typegpu/data";
|
|
12
|
+
import { defineModule } from "../../../../module.js";
|
|
13
|
+
import { WGSL_LUMA709 } from "../../../../shared/lumaWgsl.js";
|
|
14
|
+
export const CdlParams = d.struct({
|
|
15
|
+
slopeR: d.f32,
|
|
16
|
+
slopeG: d.f32,
|
|
17
|
+
slopeB: d.f32,
|
|
18
|
+
offsetR: d.f32,
|
|
19
|
+
offsetG: d.f32,
|
|
20
|
+
offsetB: d.f32,
|
|
21
|
+
powerR: d.f32,
|
|
22
|
+
powerG: d.f32,
|
|
23
|
+
powerB: d.f32,
|
|
24
|
+
saturation: d.f32
|
|
25
|
+
});
|
|
26
|
+
const layout = tgpu.bindGroupLayout({
|
|
27
|
+
params: { uniform: CdlParams },
|
|
28
|
+
source: { texture: "float" },
|
|
29
|
+
mask: { texture: "float" },
|
|
30
|
+
samp: { sampler: "filtering" }
|
|
31
|
+
});
|
|
32
|
+
const samplerDescriptor = {
|
|
33
|
+
magFilter: "linear",
|
|
34
|
+
minFilter: "linear",
|
|
35
|
+
addressModeU: "clamp-to-edge",
|
|
36
|
+
addressModeV: "clamp-to-edge"
|
|
37
|
+
};
|
|
38
|
+
export const colorCdlV1 = defineModule({
|
|
39
|
+
id: "color.cdl",
|
|
40
|
+
version: 1,
|
|
41
|
+
surface: "internal",
|
|
42
|
+
category: "color",
|
|
43
|
+
linearity: "nonlinear-in-rgb",
|
|
44
|
+
kind: "fragment",
|
|
45
|
+
params: CdlParams,
|
|
46
|
+
paramDefaults: {
|
|
47
|
+
slopeR: 1,
|
|
48
|
+
slopeG: 1,
|
|
49
|
+
slopeB: 1,
|
|
50
|
+
offsetR: 0,
|
|
51
|
+
offsetG: 0,
|
|
52
|
+
offsetB: 0,
|
|
53
|
+
powerR: 1,
|
|
54
|
+
powerG: 1,
|
|
55
|
+
powerB: 1,
|
|
56
|
+
saturation: 1
|
|
57
|
+
},
|
|
58
|
+
layout,
|
|
59
|
+
samplers: { samp: samplerDescriptor },
|
|
60
|
+
wgsl: /* wgsl */ `
|
|
61
|
+
${WGSL_LUMA709}
|
|
62
|
+
|
|
63
|
+
@fragment
|
|
64
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
65
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
66
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
67
|
+
let p = layout.$.params;
|
|
68
|
+
let safeA = max(src.a, 1.0 / 255.0);
|
|
69
|
+
let straight = src.rgb / safeA;
|
|
70
|
+
let slope = vec3f(p.slopeR, p.slopeG, p.slopeB);
|
|
71
|
+
let offset = vec3f(p.offsetR, p.offsetG, p.offsetB);
|
|
72
|
+
let power = vec3f(p.powerR, p.powerG, p.powerB);
|
|
73
|
+
// Clamp after slope/offset (matches the CPU loop) so pow() sees [0,1] and
|
|
74
|
+
// never takes a negative base.
|
|
75
|
+
var rgb = clamp(straight * slope + offset, vec3f(0.0), vec3f(1.0));
|
|
76
|
+
rgb = pow(rgb, power);
|
|
77
|
+
let lum = luma709(rgb);
|
|
78
|
+
rgb = vec3f(lum) + (rgb - vec3f(lum)) * p.saturation;
|
|
79
|
+
let mixed = mix(straight, rgb, coverage);
|
|
80
|
+
return vec4f(clamp(mixed, vec3f(0.0), vec3f(1.0)) * src.a, src.a);
|
|
81
|
+
}
|
|
82
|
+
`,
|
|
83
|
+
io: {
|
|
84
|
+
inputs: {
|
|
85
|
+
source: {
|
|
86
|
+
colorSpace: "srgb",
|
|
87
|
+
alpha: "premultiplied",
|
|
88
|
+
bindingKinds: ["texture_2d"]
|
|
89
|
+
},
|
|
90
|
+
mask: {
|
|
91
|
+
colorSpace: "srgb",
|
|
92
|
+
alpha: "premultiplied",
|
|
93
|
+
bindingKinds: ["texture_2d"],
|
|
94
|
+
optional: true
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
output: {
|
|
98
|
+
colorSpace: "srgb",
|
|
99
|
+
alpha: "premultiplied",
|
|
100
|
+
format: "rgba8unorm",
|
|
101
|
+
dimensions: "same-as:source"
|
|
102
|
+
},
|
|
103
|
+
rod: "same-as:source"
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/cdl/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,OAAO,EAAE,CAAC,CAAC,GAAG;IACd,OAAO,EAAE,CAAC,CAAC,GAAG;IACd,OAAO,EAAE,CAAC,CAAC,GAAG;IACd,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,UAAU,EAAE,CAAC,CAAC,GAAG;CAClB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;IAC9B,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC1B,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAyB;IAC9C,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,YAAY,EAAE,eAAe;IAC7B,YAAY,EAAE,eAAe;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;IACrC,EAAE,EAAE,WAAW;IACf,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE;QACb,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,CAAC;KACd;IACD,MAAM;IACN,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACrC,IAAI,EAAE,UAAU,CAAC;EACjB,YAAY;;;;;;;;;;;;;;;;;;;;;CAqBb;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;gBAC5B,QAAQ,EAAE,IAAI;aACf;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.channelMerge@1` — merge RGB from `source` with a single-channel alpha
|
|
3
|
+
* lifted from a second texture.
|
|
4
|
+
*
|
|
5
|
+
* `alphaChannel` selects which channel of the `alpha` input drives output
|
|
6
|
+
* alpha (`0` R, `1` G, `2` B, `3` A, `4` luma). The RGB of `source` is
|
|
7
|
+
* carried straight through; the result is then re-premultiplied with the new
|
|
8
|
+
* alpha so downstream consumers see the pool's canonical premultiplied form.
|
|
9
|
+
*
|
|
10
|
+
* Pairs with `color.channelSplit` (extract a channel as grayscale) and
|
|
11
|
+
* `mask.fromImage` (extract a coverage mask) — together they form the
|
|
12
|
+
* minimum-viable "swap an image's alpha for another image's channel"
|
|
13
|
+
* pipeline.
|
|
14
|
+
*/
|
|
15
|
+
import * as d from "typegpu/data";
|
|
16
|
+
export declare const ChannelMergeParams: d.WgslStruct<{
|
|
17
|
+
alphaChannel: d.F32;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const colorChannelMergeV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
20
|
+
alphaChannel: d.F32;
|
|
21
|
+
}>>;
|
|
22
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/channelMerge/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,kBAAkB;;EAE7B,CAAC;AAgBH,eAAO,MAAM,mBAAmB;;GAmE9B,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.channelMerge@1` — merge RGB from `source` with a single-channel alpha
|
|
3
|
+
* lifted from a second texture.
|
|
4
|
+
*
|
|
5
|
+
* `alphaChannel` selects which channel of the `alpha` input drives output
|
|
6
|
+
* alpha (`0` R, `1` G, `2` B, `3` A, `4` luma). The RGB of `source` is
|
|
7
|
+
* carried straight through; the result is then re-premultiplied with the new
|
|
8
|
+
* alpha so downstream consumers see the pool's canonical premultiplied form.
|
|
9
|
+
*
|
|
10
|
+
* Pairs with `color.channelSplit` (extract a channel as grayscale) and
|
|
11
|
+
* `mask.fromImage` (extract a coverage mask) — together they form the
|
|
12
|
+
* minimum-viable "swap an image's alpha for another image's channel"
|
|
13
|
+
* pipeline.
|
|
14
|
+
*/
|
|
15
|
+
import tgpu from "typegpu";
|
|
16
|
+
import * as d from "typegpu/data";
|
|
17
|
+
import { defineModule } from "../../../../module.js";
|
|
18
|
+
export const ChannelMergeParams = d.struct({
|
|
19
|
+
alphaChannel: d.f32
|
|
20
|
+
});
|
|
21
|
+
const layout = tgpu.bindGroupLayout({
|
|
22
|
+
params: { uniform: ChannelMergeParams },
|
|
23
|
+
source: { texture: "float" },
|
|
24
|
+
alpha: { texture: "float" },
|
|
25
|
+
samp: { sampler: "filtering" }
|
|
26
|
+
});
|
|
27
|
+
const samplerDescriptor = {
|
|
28
|
+
magFilter: "linear",
|
|
29
|
+
minFilter: "linear",
|
|
30
|
+
addressModeU: "clamp-to-edge",
|
|
31
|
+
addressModeV: "clamp-to-edge"
|
|
32
|
+
};
|
|
33
|
+
export const colorChannelMergeV1 = defineModule({
|
|
34
|
+
id: "color.channelMerge",
|
|
35
|
+
version: 1,
|
|
36
|
+
surface: "internal",
|
|
37
|
+
category: "color",
|
|
38
|
+
linearity: "nonlinear-in-rgb",
|
|
39
|
+
kind: "fragment",
|
|
40
|
+
params: ChannelMergeParams,
|
|
41
|
+
paramDefaults: { alphaChannel: 3 },
|
|
42
|
+
paramUi: {
|
|
43
|
+
alphaChannel: {
|
|
44
|
+
min: 0,
|
|
45
|
+
max: 4,
|
|
46
|
+
step: 1,
|
|
47
|
+
label: "Alpha source",
|
|
48
|
+
notes: "0 R / 1 G / 2 B / 3 A / 4 luma"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
layout,
|
|
52
|
+
samplers: { samp: samplerDescriptor },
|
|
53
|
+
wgsl: /* wgsl */ `
|
|
54
|
+
@fragment
|
|
55
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
56
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
57
|
+
let alphaSrc = textureSample(layout.$.alpha, layout.$.samp, uv);
|
|
58
|
+
let mode = i32(round(layout.$.params.alphaChannel));
|
|
59
|
+
var newA: f32 = 0.0;
|
|
60
|
+
if (mode == 0) {
|
|
61
|
+
newA = alphaSrc.r;
|
|
62
|
+
} else if (mode == 1) {
|
|
63
|
+
newA = alphaSrc.g;
|
|
64
|
+
} else if (mode == 2) {
|
|
65
|
+
newA = alphaSrc.b;
|
|
66
|
+
} else if (mode == 3) {
|
|
67
|
+
newA = alphaSrc.a;
|
|
68
|
+
} else {
|
|
69
|
+
newA = dot(alphaSrc.rgb, vec3f(0.299, 0.587, 0.114));
|
|
70
|
+
}
|
|
71
|
+
newA = clamp(newA, 0.0, 1.0);
|
|
72
|
+
// Un-premultiply source RGB by its own alpha, then re-premultiply with the
|
|
73
|
+
// new alpha so downstream consumers see canonical premultiplied output.
|
|
74
|
+
let safeA = max(src.a, 0.0001);
|
|
75
|
+
let straightRgb = src.rgb / safeA;
|
|
76
|
+
return vec4f(straightRgb * newA, newA);
|
|
77
|
+
}
|
|
78
|
+
`,
|
|
79
|
+
io: {
|
|
80
|
+
inputs: {
|
|
81
|
+
source: {
|
|
82
|
+
colorSpace: "linear",
|
|
83
|
+
alpha: "premultiplied",
|
|
84
|
+
bindingKinds: ["texture_2d"]
|
|
85
|
+
},
|
|
86
|
+
alpha: {
|
|
87
|
+
colorSpace: "linear",
|
|
88
|
+
alpha: "premultiplied",
|
|
89
|
+
bindingKinds: ["texture_2d"]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
output: {
|
|
93
|
+
colorSpace: "linear",
|
|
94
|
+
alpha: "premultiplied",
|
|
95
|
+
format: "rgba8unorm",
|
|
96
|
+
dimensions: "same-as:source"
|
|
97
|
+
},
|
|
98
|
+
rod: "same-as:source"
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/channelMerge/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,YAAY,EAAE,CAAC,CAAC,GAAG;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE;IACvC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC3B,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAyB;IAC9C,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,YAAY,EAAE,eAAe;IAC7B,YAAY,EAAE,eAAe;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;IAC9C,EAAE,EAAE,oBAAoB;IACxB,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,kBAAkB;IAC1B,aAAa,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE;IAClC,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE,gCAAgC;SACxC;KACF;IACD,MAAM;IACN,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACrC,IAAI,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAyBlB;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,QAAQ;gBACpB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;YACD,KAAK,EAAE;gBACL,UAAU,EAAE,QAAQ;gBACpB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.channelShuffle@1` — permute / rebroadcast source channels onto the
|
|
3
|
+
* output.
|
|
4
|
+
*
|
|
5
|
+
* Four integer indices (`rFrom`, `gFrom`, `bFrom`, `aFrom`) pick which input
|
|
6
|
+
* channel feeds each output channel: `0` R, `1` G, `2` B, `3` A. The
|
|
7
|
+
* identity permutation `(0, 1, 2, 3)` is passthrough; common swaps include
|
|
8
|
+
* RGB↔BGR (`2, 1, 0, 3`) and "alpha to grayscale" (`3, 3, 3, 3`).
|
|
9
|
+
*
|
|
10
|
+
* Premultiplication: the pool's contract is that alpha is premultiplied
|
|
11
|
+
* between modules, so the shader un-premultiplies the source's RGB by its
|
|
12
|
+
* original alpha before picking, then re-premultiplies the result by the
|
|
13
|
+
* shuffled output alpha. That keeps the canonical premultiplied invariant
|
|
14
|
+
* intact regardless of which input channel `aFrom` points at.
|
|
15
|
+
*/
|
|
16
|
+
import * as d from "typegpu/data";
|
|
17
|
+
export declare const ChannelShuffleParams: d.WgslStruct<{
|
|
18
|
+
rFrom: d.F32;
|
|
19
|
+
gFrom: d.F32;
|
|
20
|
+
bFrom: d.F32;
|
|
21
|
+
aFrom: d.F32;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const colorChannelShuffleV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
24
|
+
rFrom: d.F32;
|
|
25
|
+
gFrom: d.F32;
|
|
26
|
+
bFrom: d.F32;
|
|
27
|
+
aFrom: d.F32;
|
|
28
|
+
}>>;
|
|
29
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/channelShuffle/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,oBAAoB;;;;;EAK/B,CAAC;AAeH,eAAO,MAAM,qBAAqB;;;;;GAyDhC,CAAC"}
|