@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,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.grayscale@1` — collapse RGB to luminance.
|
|
3
|
+
*
|
|
4
|
+
* `output.rgb = vec3(luma709(rgb))`. Alpha preserved. Honours the canonical
|
|
5
|
+
* mask slot so workflows can grayscale a region while the rest stays colored.
|
|
6
|
+
*/
|
|
7
|
+
import tgpu from "typegpu";
|
|
8
|
+
import * as d from "typegpu/data";
|
|
9
|
+
import { defineModule } from "../../../../module.js";
|
|
10
|
+
import { WGSL_LUMA709 } from "../../../../shared/lumaWgsl.js";
|
|
11
|
+
export const GrayscaleParams = d.struct({
|
|
12
|
+
amount: d.f32
|
|
13
|
+
});
|
|
14
|
+
const layout = tgpu.bindGroupLayout({
|
|
15
|
+
params: { uniform: GrayscaleParams },
|
|
16
|
+
source: { texture: "float" },
|
|
17
|
+
mask: { texture: "float" },
|
|
18
|
+
samp: { sampler: "filtering" }
|
|
19
|
+
});
|
|
20
|
+
const samplerDescriptor = {
|
|
21
|
+
magFilter: "linear",
|
|
22
|
+
minFilter: "linear",
|
|
23
|
+
addressModeU: "clamp-to-edge",
|
|
24
|
+
addressModeV: "clamp-to-edge"
|
|
25
|
+
};
|
|
26
|
+
export const colorGrayscaleV1 = defineModule({
|
|
27
|
+
id: "color.grayscale",
|
|
28
|
+
version: 1,
|
|
29
|
+
// Internal for now — promoted to `published` once a workflow node ships
|
|
30
|
+
// against it and the surface-promotion review is recorded. See
|
|
31
|
+
// `tests/surfacePromotion.test.ts` for the published-set contract.
|
|
32
|
+
surface: "internal",
|
|
33
|
+
category: "color",
|
|
34
|
+
linearity: "linear-in-rgb",
|
|
35
|
+
kind: "fragment",
|
|
36
|
+
params: GrayscaleParams,
|
|
37
|
+
paramDefaults: { amount: 1 },
|
|
38
|
+
paramUi: {
|
|
39
|
+
amount: { min: 0, max: 1, step: 0.01, label: "Amount" }
|
|
40
|
+
},
|
|
41
|
+
layout,
|
|
42
|
+
samplers: { samp: samplerDescriptor },
|
|
43
|
+
wgsl: /* wgsl */ `
|
|
44
|
+
${WGSL_LUMA709}
|
|
45
|
+
|
|
46
|
+
@fragment
|
|
47
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
48
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
49
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
50
|
+
let luma = luma709(src.rgb);
|
|
51
|
+
let gray = vec3f(luma);
|
|
52
|
+
let mixed = mix(src.rgb, gray, coverage * layout.$.params.amount);
|
|
53
|
+
return vec4f(mixed, src.a);
|
|
54
|
+
}
|
|
55
|
+
`,
|
|
56
|
+
io: {
|
|
57
|
+
inputs: {
|
|
58
|
+
source: {
|
|
59
|
+
colorSpace: "linear",
|
|
60
|
+
alpha: "premultiplied",
|
|
61
|
+
bindingKinds: ["texture_2d"]
|
|
62
|
+
},
|
|
63
|
+
mask: {
|
|
64
|
+
colorSpace: "linear",
|
|
65
|
+
alpha: "premultiplied",
|
|
66
|
+
bindingKinds: ["texture_2d"],
|
|
67
|
+
optional: true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
output: {
|
|
71
|
+
colorSpace: "linear",
|
|
72
|
+
alpha: "premultiplied",
|
|
73
|
+
format: "rgba8unorm",
|
|
74
|
+
dimensions: "same-as:source"
|
|
75
|
+
},
|
|
76
|
+
rod: "same-as:source"
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/grayscale/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,GAAG;CACd,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;IACpC,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,gBAAgB,GAAG,YAAY,CAAC;IAC3C,EAAE,EAAE,iBAAiB;IACrB,OAAO,EAAE,CAAC;IACV,wEAAwE;IACxE,+DAA+D;IAC/D,mEAAmE;IACnE,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,eAAe;IACvB,aAAa,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;IAC5B,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;KACxD;IACD,MAAM;IACN,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACrC,IAAI,EAAE,UAAU,CAAC;EACjB,YAAY;;;;;;;;;;;CAWb;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,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.hsb@1` — hue / saturation / brightness shift.
|
|
3
|
+
*
|
|
4
|
+
* Hue is in degrees (-180..180); saturation is multiplicative (0=grayscale,
|
|
5
|
+
* 1=passthrough, >1=oversaturate); brightness is multiplicative on the value
|
|
6
|
+
* channel. Math is the standard `rgb ↔ hsv` round-trip used by `color.grade`.
|
|
7
|
+
* Fragment, with the canonical mask slot.
|
|
8
|
+
*/
|
|
9
|
+
import * as d from "typegpu/data";
|
|
10
|
+
export declare const HsbParams: d.WgslStruct<{
|
|
11
|
+
hue: d.F32;
|
|
12
|
+
saturation: d.F32;
|
|
13
|
+
brightness: d.F32;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const colorHsbV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
16
|
+
hue: d.F32;
|
|
17
|
+
saturation: d.F32;
|
|
18
|
+
brightness: d.F32;
|
|
19
|
+
}>>;
|
|
20
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/hsb/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,SAAS;;;;EAIpB,CAAC;AAgBH,eAAO,MAAM,UAAU;;;;GAqGrB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.hsb@1` — hue / saturation / brightness shift.
|
|
3
|
+
*
|
|
4
|
+
* Hue is in degrees (-180..180); saturation is multiplicative (0=grayscale,
|
|
5
|
+
* 1=passthrough, >1=oversaturate); brightness is multiplicative on the value
|
|
6
|
+
* channel. Math is the standard `rgb ↔ hsv` round-trip used by `color.grade`.
|
|
7
|
+
* Fragment, with the canonical mask slot.
|
|
8
|
+
*/
|
|
9
|
+
import tgpu from "typegpu";
|
|
10
|
+
import * as d from "typegpu/data";
|
|
11
|
+
import { defineModule } from "../../../../module.js";
|
|
12
|
+
export const HsbParams = d.struct({
|
|
13
|
+
hue: d.f32,
|
|
14
|
+
saturation: d.f32,
|
|
15
|
+
brightness: d.f32
|
|
16
|
+
});
|
|
17
|
+
const layout = tgpu.bindGroupLayout({
|
|
18
|
+
params: { uniform: HsbParams },
|
|
19
|
+
source: { texture: "float" },
|
|
20
|
+
mask: { texture: "float" },
|
|
21
|
+
samp: { sampler: "filtering" }
|
|
22
|
+
});
|
|
23
|
+
const samplerDescriptor = {
|
|
24
|
+
magFilter: "linear",
|
|
25
|
+
minFilter: "linear",
|
|
26
|
+
addressModeU: "clamp-to-edge",
|
|
27
|
+
addressModeV: "clamp-to-edge"
|
|
28
|
+
};
|
|
29
|
+
export const colorHsbV1 = defineModule({
|
|
30
|
+
id: "color.hsb",
|
|
31
|
+
version: 1,
|
|
32
|
+
// HSB shift is the workflow user's mental model for color adjustment; the
|
|
33
|
+
// schema matches that vocabulary exactly.
|
|
34
|
+
surface: "published",
|
|
35
|
+
category: "color",
|
|
36
|
+
linearity: "nonlinear-in-rgb",
|
|
37
|
+
kind: "fragment",
|
|
38
|
+
params: HsbParams,
|
|
39
|
+
paramDefaults: { hue: 0, saturation: 1, brightness: 1 },
|
|
40
|
+
paramUi: {
|
|
41
|
+
hue: { min: -180, max: 180, step: 1, label: "Hue", notes: "degrees" },
|
|
42
|
+
saturation: { min: 0, max: 4, step: 0.01, label: "Saturation" },
|
|
43
|
+
brightness: { min: 0, max: 4, step: 0.01, label: "Brightness" }
|
|
44
|
+
},
|
|
45
|
+
layout,
|
|
46
|
+
samplers: { samp: samplerDescriptor },
|
|
47
|
+
wgsl: /* wgsl */ `
|
|
48
|
+
fn rgb2hsv(rgb: vec3f) -> vec3f {
|
|
49
|
+
let maxC = max(max(rgb.r, rgb.g), rgb.b);
|
|
50
|
+
let minC = min(min(rgb.r, rgb.g), rgb.b);
|
|
51
|
+
let delta = maxC - minC;
|
|
52
|
+
var h: f32 = 0.0;
|
|
53
|
+
var s: f32 = 0.0;
|
|
54
|
+
let v: f32 = maxC;
|
|
55
|
+
if (delta > 0.00001) {
|
|
56
|
+
s = delta / maxC;
|
|
57
|
+
if (maxC == rgb.r) {
|
|
58
|
+
h = (rgb.g - rgb.b) / delta;
|
|
59
|
+
if (rgb.g < rgb.b) { h = h + 6.0; }
|
|
60
|
+
} else if (maxC == rgb.g) {
|
|
61
|
+
h = 2.0 + (rgb.b - rgb.r) / delta;
|
|
62
|
+
} else {
|
|
63
|
+
h = 4.0 + (rgb.r - rgb.g) / delta;
|
|
64
|
+
}
|
|
65
|
+
h = h / 6.0;
|
|
66
|
+
}
|
|
67
|
+
return vec3f(h, s, v);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
fn hsv2rgb(hsv: vec3f) -> vec3f {
|
|
71
|
+
let h = hsv.x * 6.0;
|
|
72
|
+
let s = hsv.y;
|
|
73
|
+
let v = hsv.z;
|
|
74
|
+
let i = floor(h);
|
|
75
|
+
let f = h - i;
|
|
76
|
+
let p = v * (1.0 - s);
|
|
77
|
+
let q = v * (1.0 - s * f);
|
|
78
|
+
let t = v * (1.0 - s * (1.0 - f));
|
|
79
|
+
let idx = i32(i) % 6;
|
|
80
|
+
if (idx == 0) { return vec3f(v, t, p); }
|
|
81
|
+
if (idx == 1) { return vec3f(q, v, p); }
|
|
82
|
+
if (idx == 2) { return vec3f(p, v, t); }
|
|
83
|
+
if (idx == 3) { return vec3f(p, q, v); }
|
|
84
|
+
if (idx == 4) { return vec3f(t, p, v); }
|
|
85
|
+
return vec3f(v, p, q);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@fragment
|
|
89
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
90
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
91
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
92
|
+
let p = layout.$.params;
|
|
93
|
+
// Operate on the straight color: rgb2hsv's V channel is max(r,g,b), so a
|
|
94
|
+
// premultiplied input reports a*V_true and the saturation/brightness
|
|
95
|
+
// multipliers act against the wrong magnitude. Re-premultiply on store so
|
|
96
|
+
// the output stays valid premul.
|
|
97
|
+
let safeA = max(src.a, 1.0 / 255.0);
|
|
98
|
+
let straight = src.rgb / safeA;
|
|
99
|
+
var hsv = rgb2hsv(clamp(straight, vec3f(0.0), vec3f(1.0)));
|
|
100
|
+
hsv.x = fract(hsv.x + p.hue / 360.0);
|
|
101
|
+
hsv.y = clamp(hsv.y * p.saturation, 0.0, 1.0);
|
|
102
|
+
hsv.z = clamp(hsv.z * p.brightness, 0.0, 1.0);
|
|
103
|
+
let processed = clamp(hsv2rgb(hsv), vec3f(0.0), vec3f(1.0));
|
|
104
|
+
let mixedStraight = mix(straight, processed, coverage);
|
|
105
|
+
return vec4f(mixedStraight * src.a, src.a);
|
|
106
|
+
}
|
|
107
|
+
`,
|
|
108
|
+
io: {
|
|
109
|
+
inputs: {
|
|
110
|
+
source: {
|
|
111
|
+
colorSpace: "linear",
|
|
112
|
+
alpha: "premultiplied",
|
|
113
|
+
bindingKinds: ["texture_2d"]
|
|
114
|
+
},
|
|
115
|
+
mask: {
|
|
116
|
+
colorSpace: "linear",
|
|
117
|
+
alpha: "premultiplied",
|
|
118
|
+
bindingKinds: ["texture_2d"],
|
|
119
|
+
optional: true
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
output: {
|
|
123
|
+
colorSpace: "linear",
|
|
124
|
+
alpha: "premultiplied",
|
|
125
|
+
format: "rgba8unorm",
|
|
126
|
+
dimensions: "same-as:source"
|
|
127
|
+
},
|
|
128
|
+
rod: "same-as:source"
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/hsb/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,GAAG,EAAE,CAAC,CAAC,GAAG;IACV,UAAU,EAAE,CAAC,CAAC,GAAG;IACjB,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,0EAA0E;IAC1E,0CAA0C;IAC1C,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;IACvD,OAAO,EAAE;QACP,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE;QACrE,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;QAC/D,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;KAChE;IACD,MAAM;IACN,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACrC,IAAI,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DlB;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,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.hslAdjust@1` — selective hue / saturation / luminance adjustment over
|
|
3
|
+
* an optional hue range.
|
|
4
|
+
*
|
|
5
|
+
* Ported verbatim from the CPU `lib.image.color_grading.HSLAdjust` loop. When
|
|
6
|
+
* `useRange = 0` the adjustment applies to every pixel (the "ALL" path: hue
|
|
7
|
+
* shift, saturation and luminance multipliers). When `useRange = 1` the host
|
|
8
|
+
* passes a normalized `[rangeLo, rangeHi]` hue window (wrapping when
|
|
9
|
+
* `rangeLo > rangeHi`, as for reds) and the per-pixel `blend` weight gates the
|
|
10
|
+
* adjustment by hue proximity to that window's centre, skipping near-grey
|
|
11
|
+
* pixels (`s < 0.1`). Fragment, with the canonical optional mask slot.
|
|
12
|
+
*/
|
|
13
|
+
import * as d from "typegpu/data";
|
|
14
|
+
export declare const HslAdjustParams: d.WgslStruct<{
|
|
15
|
+
hueShift: d.F32;
|
|
16
|
+
satAdj: d.F32;
|
|
17
|
+
lumAdj: d.F32;
|
|
18
|
+
rangeLo: d.F32;
|
|
19
|
+
rangeHi: d.F32;
|
|
20
|
+
useRange: d.F32;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const colorHslAdjustV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
23
|
+
hueShift: d.F32;
|
|
24
|
+
satAdj: d.F32;
|
|
25
|
+
lumAdj: d.F32;
|
|
26
|
+
rangeLo: d.F32;
|
|
27
|
+
rangeHi: d.F32;
|
|
28
|
+
useRange: d.F32;
|
|
29
|
+
}>>;
|
|
30
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/hslAdjust/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,eAAe;;;;;;;EAO1B,CAAC;AAgBH,eAAO,MAAM,gBAAgB;;;;;;;GAqI3B,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.hslAdjust@1` — selective hue / saturation / luminance adjustment over
|
|
3
|
+
* an optional hue range.
|
|
4
|
+
*
|
|
5
|
+
* Ported verbatim from the CPU `lib.image.color_grading.HSLAdjust` loop. When
|
|
6
|
+
* `useRange = 0` the adjustment applies to every pixel (the "ALL" path: hue
|
|
7
|
+
* shift, saturation and luminance multipliers). When `useRange = 1` the host
|
|
8
|
+
* passes a normalized `[rangeLo, rangeHi]` hue window (wrapping when
|
|
9
|
+
* `rangeLo > rangeHi`, as for reds) and the per-pixel `blend` weight gates the
|
|
10
|
+
* adjustment by hue proximity to that window's centre, skipping near-grey
|
|
11
|
+
* pixels (`s < 0.1`). Fragment, with the canonical optional mask slot.
|
|
12
|
+
*/
|
|
13
|
+
import tgpu from "typegpu";
|
|
14
|
+
import * as d from "typegpu/data";
|
|
15
|
+
import { defineModule } from "../../../../module.js";
|
|
16
|
+
export const HslAdjustParams = d.struct({
|
|
17
|
+
hueShift: d.f32,
|
|
18
|
+
satAdj: d.f32,
|
|
19
|
+
lumAdj: d.f32,
|
|
20
|
+
rangeLo: d.f32,
|
|
21
|
+
rangeHi: d.f32,
|
|
22
|
+
useRange: d.f32
|
|
23
|
+
});
|
|
24
|
+
const layout = tgpu.bindGroupLayout({
|
|
25
|
+
params: { uniform: HslAdjustParams },
|
|
26
|
+
source: { texture: "float" },
|
|
27
|
+
mask: { texture: "float" },
|
|
28
|
+
samp: { sampler: "filtering" }
|
|
29
|
+
});
|
|
30
|
+
const samplerDescriptor = {
|
|
31
|
+
magFilter: "linear",
|
|
32
|
+
minFilter: "linear",
|
|
33
|
+
addressModeU: "clamp-to-edge",
|
|
34
|
+
addressModeV: "clamp-to-edge"
|
|
35
|
+
};
|
|
36
|
+
export const colorHslAdjustV1 = defineModule({
|
|
37
|
+
id: "color.hslAdjust",
|
|
38
|
+
version: 1,
|
|
39
|
+
surface: "internal",
|
|
40
|
+
category: "color",
|
|
41
|
+
linearity: "nonlinear-in-rgb",
|
|
42
|
+
kind: "fragment",
|
|
43
|
+
params: HslAdjustParams,
|
|
44
|
+
paramDefaults: {
|
|
45
|
+
hueShift: 0,
|
|
46
|
+
satAdj: 0,
|
|
47
|
+
lumAdj: 0,
|
|
48
|
+
rangeLo: 0,
|
|
49
|
+
rangeHi: 1,
|
|
50
|
+
useRange: 0
|
|
51
|
+
},
|
|
52
|
+
paramUi: {
|
|
53
|
+
hueShift: { min: -1, max: 1, step: 0.01, label: "Hue shift" },
|
|
54
|
+
satAdj: { min: -1, max: 1, step: 0.01, label: "Saturation" },
|
|
55
|
+
lumAdj: { min: -1, max: 1, step: 0.01, label: "Luminance" },
|
|
56
|
+
rangeLo: { min: 0, max: 1, step: 0.01, label: "Range low" },
|
|
57
|
+
rangeHi: { min: 0, max: 1, step: 0.01, label: "Range high" },
|
|
58
|
+
useRange: { min: 0, max: 1, step: 1, label: "Use range" }
|
|
59
|
+
},
|
|
60
|
+
layout,
|
|
61
|
+
samplers: { samp: samplerDescriptor },
|
|
62
|
+
wgsl: /* wgsl */ `
|
|
63
|
+
fn rgb2hsv(rgb: vec3f) -> vec3f {
|
|
64
|
+
let maxC = max(max(rgb.r, rgb.g), rgb.b);
|
|
65
|
+
let minC = min(min(rgb.r, rgb.g), rgb.b);
|
|
66
|
+
let delta = maxC - minC;
|
|
67
|
+
var h: f32 = 0.0;
|
|
68
|
+
var s: f32 = 0.0;
|
|
69
|
+
let v: f32 = maxC;
|
|
70
|
+
if (delta > 0.00001) {
|
|
71
|
+
s = delta / maxC;
|
|
72
|
+
if (maxC == rgb.r) {
|
|
73
|
+
h = (rgb.g - rgb.b) / delta;
|
|
74
|
+
if (rgb.g < rgb.b) { h = h + 6.0; }
|
|
75
|
+
} else if (maxC == rgb.g) {
|
|
76
|
+
h = 2.0 + (rgb.b - rgb.r) / delta;
|
|
77
|
+
} else {
|
|
78
|
+
h = 4.0 + (rgb.r - rgb.g) / delta;
|
|
79
|
+
}
|
|
80
|
+
h = h / 6.0;
|
|
81
|
+
}
|
|
82
|
+
return vec3f(h, s, v);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
fn hsv2rgb(hsv: vec3f) -> vec3f {
|
|
86
|
+
let h = hsv.x * 6.0;
|
|
87
|
+
let s = hsv.y;
|
|
88
|
+
let v = hsv.z;
|
|
89
|
+
let i = floor(h);
|
|
90
|
+
let f = h - i;
|
|
91
|
+
let p = v * (1.0 - s);
|
|
92
|
+
let q = v * (1.0 - s * f);
|
|
93
|
+
let t = v * (1.0 - s * (1.0 - f));
|
|
94
|
+
let idx = i32(i) % 6;
|
|
95
|
+
if (idx == 0) { return vec3f(v, t, p); }
|
|
96
|
+
if (idx == 1) { return vec3f(q, v, p); }
|
|
97
|
+
if (idx == 2) { return vec3f(p, v, t); }
|
|
98
|
+
if (idx == 3) { return vec3f(p, q, v); }
|
|
99
|
+
if (idx == 4) { return vec3f(t, p, v); }
|
|
100
|
+
return vec3f(v, p, q);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@fragment
|
|
104
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
105
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
106
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
107
|
+
let p = layout.$.params;
|
|
108
|
+
let safeA = max(src.a, 1.0 / 255.0);
|
|
109
|
+
let straight = clamp(src.rgb / safeA, vec3f(0.0), vec3f(1.0));
|
|
110
|
+
var hsv = rgb2hsv(straight);
|
|
111
|
+
var blend: f32 = 1.0;
|
|
112
|
+
if (p.useRange > 0.5) {
|
|
113
|
+
if (hsv.y < 0.1) {
|
|
114
|
+
blend = 0.0;
|
|
115
|
+
} else {
|
|
116
|
+
let lo = p.rangeLo;
|
|
117
|
+
let hi = p.rangeHi;
|
|
118
|
+
if (lo > hi) {
|
|
119
|
+
// Wrapping window (e.g. reds): in-range when above lo OR below hi.
|
|
120
|
+
if (hsv.x >= lo || hsv.x <= hi) {
|
|
121
|
+
let halfWidth = (1.0 - lo + hi) * 0.5;
|
|
122
|
+
let center = fract(lo + halfWidth);
|
|
123
|
+
var dist = abs(hsv.x - center);
|
|
124
|
+
if (dist > 0.5) { dist = 1.0 - dist; }
|
|
125
|
+
blend = clamp(1.0 - dist / halfWidth, 0.0, 1.0);
|
|
126
|
+
} else {
|
|
127
|
+
blend = 0.0;
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
let center = (lo + hi) * 0.5;
|
|
131
|
+
let halfWidth = (hi - lo) * 0.5;
|
|
132
|
+
let dist = abs(hsv.x - center);
|
|
133
|
+
blend = clamp(1.0 - dist / halfWidth, 0.0, 1.0);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (blend > 0.0) {
|
|
138
|
+
hsv.x = fract(hsv.x + p.hueShift * 0.5 * blend);
|
|
139
|
+
hsv.y = clamp(hsv.y * (1.0 + p.satAdj * blend), 0.0, 1.0);
|
|
140
|
+
hsv.z = clamp(hsv.z * (1.0 + p.lumAdj * blend), 0.0, 1.0);
|
|
141
|
+
}
|
|
142
|
+
let processed = hsv2rgb(hsv);
|
|
143
|
+
let mixed = mix(straight, processed, coverage);
|
|
144
|
+
return vec4f(clamp(mixed, vec3f(0.0), vec3f(1.0)) * src.a, src.a);
|
|
145
|
+
}
|
|
146
|
+
`,
|
|
147
|
+
io: {
|
|
148
|
+
inputs: {
|
|
149
|
+
source: {
|
|
150
|
+
colorSpace: "srgb",
|
|
151
|
+
alpha: "premultiplied",
|
|
152
|
+
bindingKinds: ["texture_2d"]
|
|
153
|
+
},
|
|
154
|
+
mask: {
|
|
155
|
+
colorSpace: "srgb",
|
|
156
|
+
alpha: "premultiplied",
|
|
157
|
+
bindingKinds: ["texture_2d"],
|
|
158
|
+
optional: true
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
output: {
|
|
162
|
+
colorSpace: "srgb",
|
|
163
|
+
alpha: "premultiplied",
|
|
164
|
+
format: "rgba8unorm",
|
|
165
|
+
dimensions: "same-as:source"
|
|
166
|
+
},
|
|
167
|
+
rod: "same-as:source"
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/hslAdjust/v1/module.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.invert@1` — invert RGB (1 - rgb), preserve alpha.
|
|
3
|
+
*
|
|
4
|
+
* Fragment, mask slot honored (`output = mix(source, processed, coverage * amount)`).
|
|
5
|
+
* The `amount` param lets the inversion fade smoothly between 0 (passthrough) and
|
|
6
|
+
* 1 (full invert) — useful for animated transitions.
|
|
7
|
+
*/
|
|
8
|
+
import * as d from "typegpu/data";
|
|
9
|
+
export declare const InvertParams: d.WgslStruct<{
|
|
10
|
+
amount: d.F32;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const colorInvertV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
13
|
+
amount: d.F32;
|
|
14
|
+
}>>;
|
|
15
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/invert/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAIlC,eAAO,MAAM,YAAY;;EAEvB,CAAC;AAgBH,eAAO,MAAM,aAAa;;GAyDxB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.invert@1` — invert RGB (1 - rgb), preserve alpha.
|
|
3
|
+
*
|
|
4
|
+
* Fragment, mask slot honored (`output = mix(source, processed, coverage * amount)`).
|
|
5
|
+
* The `amount` param lets the inversion fade smoothly between 0 (passthrough) and
|
|
6
|
+
* 1 (full invert) — useful for animated transitions.
|
|
7
|
+
*/
|
|
8
|
+
import tgpu from "typegpu";
|
|
9
|
+
import * as d from "typegpu/data";
|
|
10
|
+
import { defineModule } from "../../../../module.js";
|
|
11
|
+
import { WGSL_PREMUL_HELPERS } from "../../../../shared/premulWgsl.js";
|
|
12
|
+
export const InvertParams = d.struct({
|
|
13
|
+
amount: d.f32
|
|
14
|
+
});
|
|
15
|
+
const layout = tgpu.bindGroupLayout({
|
|
16
|
+
params: { uniform: InvertParams },
|
|
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 colorInvertV1 = defineModule({
|
|
28
|
+
id: "color.invert",
|
|
29
|
+
version: 1,
|
|
30
|
+
// Trivial schema (single `amount` param) and canonical mask slot; no
|
|
31
|
+
// near-term split or rename in sight, so the API is safe to publish.
|
|
32
|
+
surface: "published",
|
|
33
|
+
category: "color",
|
|
34
|
+
linearity: "nonlinear-in-rgb",
|
|
35
|
+
kind: "fragment",
|
|
36
|
+
params: InvertParams,
|
|
37
|
+
paramDefaults: { amount: 1 },
|
|
38
|
+
paramUi: {
|
|
39
|
+
amount: { min: 0, max: 1, step: 0.01, label: "Amount" }
|
|
40
|
+
},
|
|
41
|
+
layout,
|
|
42
|
+
samplers: { samp: samplerDescriptor },
|
|
43
|
+
wgsl: /* wgsl */ `
|
|
44
|
+
${WGSL_PREMUL_HELPERS}
|
|
45
|
+
|
|
46
|
+
@fragment
|
|
47
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
48
|
+
// Input is premultiplied. The typed helpers force us through unpremul()
|
|
49
|
+
// before touching channels — the prior hand-rolled "safeA = max(a, 1/255);
|
|
50
|
+
// straight = rgb/safeA; invert; re-premultiply" dance is now expressed as
|
|
51
|
+
// unpremul/premul calls that can't be skipped accidentally.
|
|
52
|
+
let p = samplePremul(layout.$.source, layout.$.samp, uv);
|
|
53
|
+
let s = unpremul(p);
|
|
54
|
+
let inverted = Straight(vec4f(vec3f(1.0) - s.v.rgb, s.v.a));
|
|
55
|
+
let invPremul = premul(inverted);
|
|
56
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
57
|
+
// Linear mix between two premul values is itself a premul-safe linear op,
|
|
58
|
+
// so it's correct to lerp src.v ↔ invPremul.v directly.
|
|
59
|
+
return mix(p.v, invPremul.v, coverage * layout.$.params.amount);
|
|
60
|
+
}
|
|
61
|
+
`,
|
|
62
|
+
io: {
|
|
63
|
+
inputs: {
|
|
64
|
+
source: {
|
|
65
|
+
colorSpace: "linear",
|
|
66
|
+
alpha: "premultiplied",
|
|
67
|
+
bindingKinds: ["texture_2d"]
|
|
68
|
+
},
|
|
69
|
+
mask: {
|
|
70
|
+
colorSpace: "linear",
|
|
71
|
+
alpha: "premultiplied",
|
|
72
|
+
bindingKinds: ["texture_2d"],
|
|
73
|
+
optional: true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
output: {
|
|
77
|
+
colorSpace: "linear",
|
|
78
|
+
alpha: "premultiplied",
|
|
79
|
+
format: "rgba8unorm",
|
|
80
|
+
dimensions: "same-as:source"
|
|
81
|
+
},
|
|
82
|
+
rod: "same-as:source"
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/invert/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;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,GAAG;CACd,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;IACjC,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,aAAa,GAAG,YAAY,CAAC;IACxC,EAAE,EAAE,cAAc;IAClB,OAAO,EAAE,CAAC;IACV,qEAAqE;IACrE,qEAAqE;IACrE,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,YAAY;IACpB,aAAa,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;IAC5B,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;KACxD;IACD,MAAM;IACN,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACrC,IAAI,EAAE,UAAU,CAAC;EACjB,mBAAmB;;;;;;;;;;;;;;;;;CAiBpB;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,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.levels@1` — per-channel input black point, gamma, and white point.
|
|
3
|
+
*
|
|
4
|
+
* For each of R/G/B independently: remap `[black, white]` onto `[0, 1]` then
|
|
5
|
+
* apply gamma — `out = pow(clamp((in - black) / (white - black), 0, 1), 1/gamma)`.
|
|
6
|
+
* `black`/`white` are normalized to `[0, 1]` (the host divides 0–255 inputs by
|
|
7
|
+
* 255); `gamma` is the channel gamma. The identity is `black=0, gamma=1,
|
|
8
|
+
* white=1`. Alpha is untouched. Fragment, with the canonical mask slot.
|
|
9
|
+
*/
|
|
10
|
+
import * as d from "typegpu/data";
|
|
11
|
+
export declare const LevelsParams: d.WgslStruct<{
|
|
12
|
+
rBlack: d.F32;
|
|
13
|
+
rGamma: d.F32;
|
|
14
|
+
rWhite: d.F32;
|
|
15
|
+
gBlack: d.F32;
|
|
16
|
+
gGamma: d.F32;
|
|
17
|
+
gWhite: d.F32;
|
|
18
|
+
bBlack: d.F32;
|
|
19
|
+
bGamma: d.F32;
|
|
20
|
+
bWhite: d.F32;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const colorLevelsV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
23
|
+
rBlack: d.F32;
|
|
24
|
+
rGamma: d.F32;
|
|
25
|
+
rWhite: d.F32;
|
|
26
|
+
gBlack: d.F32;
|
|
27
|
+
gGamma: d.F32;
|
|
28
|
+
gWhite: d.F32;
|
|
29
|
+
bBlack: d.F32;
|
|
30
|
+
bGamma: d.F32;
|
|
31
|
+
bWhite: d.F32;
|
|
32
|
+
}>>;
|
|
33
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/levels/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,YAAY;;;;;;;;;;EAUvB,CAAC;AAgBH,eAAO,MAAM,aAAa;;;;;;;;;;GA+ExB,CAAC"}
|