├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── img ├── advanced-stereographic.jpg ├── alpha-from-max-color.png ├── asciimii.jpg ├── bezier-aligner.jpg ├── bilateral-blur.jpg ├── blendmode-color.jpg ├── blendmode-color2.jpg ├── brightness-threshold.jpg ├── bulge.jpg ├── bumpmap.jpg ├── cassini.jpg ├── channel-threshold.jpg ├── checker-fill.jpg ├── chihuly.png ├── circle-pattern.png ├── circle-pixels.png ├── circular-disks.png ├── color-burn.jpg ├── color-dodge.jpg ├── color.jpg ├── complex-inverse.jpg ├── complex-rational.jpg ├── cross-stitch.png ├── crossfade.jpg ├── crystallize.png ├── cubes-03.jpg ├── cubic-space.jpg ├── deformer.jpg ├── difference-key.png ├── dilate-circle.jpg ├── dilate-cross.jpg ├── dilate-diamond.jpg ├── dilate-quad.jpg ├── disks.png ├── displace.jpg ├── droste.jpg ├── dynamic-palette.jpg ├── erode-circle.jpg ├── erode-cross.jpg ├── erode-diamond.jpg ├── erode-quad.jpg ├── escherizer.jpg ├── exclusion.jpg ├── focus-linear-blur.jpg ├── fontmap.png ├── fractal-explorer-orbit-traps.jpg ├── fractal-explorer.jpg ├── frei-chen.jpg ├── green-screen.png ├── helicopter.jpg ├── hex-cells.png ├── high-contrast.jpg ├── hue.jpg ├── hypno.jpg ├── invert-rgb.jpg ├── ipad.png ├── jitter.png ├── landscape.jpg ├── levels.jpg ├── luminosity.jpg ├── malgorzata-socha.jpg ├── malgorzata-socha2.jpg ├── mandelbrot.jpg ├── mandelbulb-quick.jpg ├── mandelbulb.jpg ├── mercator.jpg ├── metallic.png ├── newton-raphson.jpg ├── outline.jpg ├── outline2.jpg ├── painting.jpg ├── pb-toolkit.jpg ├── pencil.jpg ├── pixelate.jpg ├── planes.jpg ├── plasma.jpg ├── posterize.jpg ├── quaternion-julia.jpg ├── radial-caleidoscope.png ├── random-pixelation.jpg ├── rays.jpg ├── rays2.jpg ├── raytracer.jpg ├── ripple-blocks.jpg ├── rt-julia.png ├── rt-terrain.jpg ├── saturation.jpg ├── sepia.jpg ├── sharpen.jpg ├── simple-box-blur.jpg ├── simple-point-light.png ├── simple.jpg ├── skin-color-filter.jpg ├── slices.png ├── smart-normal-map.jpg ├── smart-ssao.jpg ├── smudger.png ├── soft-light.jpg ├── sphere.png ├── star.jpg ├── stripe.png ├── telephone-cord.png ├── tint.jpg ├── tunnel.jpg ├── tunnel2.jpg ├── tunnel3.jpg ├── tunnel4.jpg ├── twirl.png ├── vertical-scroll.png ├── vortex.jpg ├── warp.png ├── wave.png ├── wood.jpg ├── zig-logo.jpg └── zoom-blur-focus.jpg ├── multi-image.md ├── pb2zig ├── .nycrc ├── LICENSE ├── README.md ├── bin │ └── cli.js ├── dist │ └── index.js ├── package-lock.json ├── package.json ├── rollup.config.js ├── src │ ├── cli.js │ ├── index.js │ ├── pb-nodes.js │ ├── pb-parser.js │ ├── pb-visitor.js │ ├── translator.js │ ├── utils.js │ ├── zig-nodes.js │ └── zig-serializer.js ├── test │ ├── example │ │ ├── crystallize.png │ │ ├── crystallize.zig │ │ ├── index.js │ │ └── socha.jpg │ ├── img-input │ │ ├── bigmap-blur.jpg │ │ ├── bigmap-normal.png │ │ ├── diffuse-map-big.jpg │ │ ├── fontmap.png │ │ ├── helicopter.png │ │ ├── ipad.png │ │ ├── malgorzata-socha.png │ │ ├── malgorzata-socha2.png │ │ ├── mandelbrot.png │ │ ├── red-circle.png │ │ ├── red-dot.png │ │ ├── sky-sphere4.jpg │ │ ├── stripe.png │ │ ├── telephone-cord.png │ │ ├── wood.png │ │ └── zig-logo.png │ ├── img-output │ │ ├── advanced-stereographic.png │ │ ├── alpha-channel.png │ │ ├── alpha-from-max-color.png │ │ ├── asciimii.png │ │ ├── bezier-aligner.png │ │ ├── bilateral-blur.png │ │ ├── blendmode-color.png │ │ ├── blendmode-color2.png │ │ ├── brightness-threshold.png │ │ ├── bulge.png │ │ ├── bumpmap.png │ │ ├── cassini.png │ │ ├── channel-threshold.png │ │ ├── checker-fill.png │ │ ├── chihuly.png │ │ ├── circle-pattern.png │ │ ├── circle-pixels.png │ │ ├── circular-disks.png │ │ ├── color-burn.png │ │ ├── color-dodge.png │ │ ├── color.png │ │ ├── complex-inverse.png │ │ ├── complex-rational.png │ │ ├── cross-stitch.png │ │ ├── crossfade.png │ │ ├── crystallize-f32.png │ │ ├── crystallize-i16.png │ │ ├── crystallize-u16.png │ │ ├── crystallize.png │ │ ├── cubes-03.png │ │ ├── cubic-space.png │ │ ├── deformer.png │ │ ├── difference-key.png │ │ ├── dilate-circle.png │ │ ├── dilate-cross.png │ │ ├── dilate-diamond.png │ │ ├── dilate-quad.png │ │ ├── disks.png │ │ ├── displace.png │ │ ├── droste.png │ │ ├── dynamic-palette.png │ │ ├── erode-circle.png │ │ ├── erode-cross.png │ │ ├── erode-diamond.png │ │ ├── erode-quad.png │ │ ├── escherizer.png │ │ ├── exclusion.png │ │ ├── focus-linear-blur.png │ │ ├── fractal-explorer-orbit-traps.png │ │ ├── fractal-explorer.png │ │ ├── frei-chen.png │ │ ├── green-screen.png │ │ ├── hex-cells.png │ │ ├── high-contrast.png │ │ ├── hue.png │ │ ├── hypno.png │ │ ├── invert-rgb.png │ │ ├── jitter.png │ │ ├── landscape.png │ │ ├── levels.png │ │ ├── luminosity.png │ │ ├── mandelbulb-quick.png │ │ ├── mandelbulb.png │ │ ├── mercator.png │ │ ├── metallic.png │ │ ├── newton-raphson.png │ │ ├── outline.png │ │ ├── outline2.png │ │ ├── painting.png │ │ ├── pencil.png │ │ ├── pixelate.png │ │ ├── planes.png │ │ ├── plasma.png │ │ ├── posterize.png │ │ ├── quaternion-julia.png │ │ ├── radial-caleidoscope.png │ │ ├── random-pixelation.png │ │ ├── rays.png │ │ ├── rays2.png │ │ ├── raytracer.png │ │ ├── rgb-adjustment.png │ │ ├── ripple-blocks.png │ │ ├── rt-julia.png │ │ ├── rt-terrain.png │ │ ├── sample-linear.png │ │ ├── sample-nearest.png │ │ ├── saturation.png │ │ ├── sepia.png │ │ ├── sharpen.png │ │ ├── simple-box-blur.png │ │ ├── simple-point-light.png │ │ ├── simple.png │ │ ├── skin-color-filter.png │ │ ├── slices.png │ │ ├── smart-normal-map.png │ │ ├── smart-ssao.png │ │ ├── smudger.png │ │ ├── soft-light.png │ │ ├── sphere.png │ │ ├── star.png │ │ ├── tint.png │ │ ├── tunnel.png │ │ ├── tunnel2.png │ │ ├── tunnel3.png │ │ ├── tunnel4.png │ │ ├── twirl.png │ │ ├── vertical-scroll.png │ │ ├── vortex.png │ │ ├── warp.png │ │ ├── wave.png │ │ └── zoom-blur-focus.png │ ├── integration.test.js │ ├── node-zigar.config.json │ ├── parser.test.js │ ├── pbk-samples │ │ ├── advanced-stereographic.pbk │ │ ├── alpha-channel.pbk │ │ ├── alpha-from-max-color.pbk │ │ ├── asciimii.pbk │ │ ├── bezier-aligner.pbk │ │ ├── bilateral-blur.pbk │ │ ├── blendmode-color.pbk │ │ ├── blendmode-color2.pbk │ │ ├── brightness-threshold.pbk │ │ ├── bulge.pbk │ │ ├── bumpmap.pbk │ │ ├── cassini.pbk │ │ ├── channel-threshold.pbk │ │ ├── checker-fill.pbk │ │ ├── chihuly.pbk │ │ ├── circle-pattern.pbk │ │ ├── circle-pixels.pbk │ │ ├── circular-disks.pbk │ │ ├── color-burn.pbk │ │ ├── color-dodge.pbk │ │ ├── color.pbk │ │ ├── complex-inverse.pbk │ │ ├── complex-rational.pbk │ │ ├── cross-stitch.pbk │ │ ├── crossfade.pbk │ │ ├── crystallize.pbk │ │ ├── cubes-03.pbk │ │ ├── cubic-space.pbk │ │ ├── deformer.pbk │ │ ├── difference-key.pbk │ │ ├── dilate-circle.pbk │ │ ├── dilate-cross.pbk │ │ ├── dilate-diamond.pbk │ │ ├── dilate-quad.pbk │ │ ├── disks.pbk │ │ ├── displace.pbk │ │ ├── droste.pbk │ │ ├── dynamic-palette.pbk │ │ ├── erode-circle.pbk │ │ ├── erode-cross.pbk │ │ ├── erode-diamond.pbk │ │ ├── erode-quad.pbk │ │ ├── escherizer.pbk │ │ ├── exclusion.pbk │ │ ├── focus-linear-blur.pbk │ │ ├── fractal-explorer-orbit-traps.pbk │ │ ├── fractal-explorer.pbk │ │ ├── frei-chen.pbk │ │ ├── green-screen-effect.pbk │ │ ├── green-screen.pbk │ │ ├── hex-cells.pbk │ │ ├── high-contrast.pbk │ │ ├── hsl-color-difference.pbk │ │ ├── hsv-color-difference.pbk │ │ ├── hsv-to-rgb.pbk │ │ ├── hue.pbk │ │ ├── hypno.pbk │ │ ├── invert-rgb.pbk │ │ ├── jitter.pbk │ │ ├── landscape.pbk │ │ ├── levels.pbk │ │ ├── luminosity-mask-filter.pbk │ │ ├── luminosity.pbk │ │ ├── mandelbulb-quick.pbk │ │ ├── mandelbulb.pbk │ │ ├── mercator.pbk │ │ ├── metallic.pbk │ │ ├── newton-raphson.pbk │ │ ├── outline.pbk │ │ ├── outline2.pbk │ │ ├── painting.pbk │ │ ├── pencil.pbk │ │ ├── pixelate.pbk │ │ ├── planes.pbk │ │ ├── plasma.pbk │ │ ├── posterize.pbk │ │ ├── quaternion-julia.pbk │ │ ├── radial-caleidoscope.pbk │ │ ├── random-pixelation.pbk │ │ ├── rays.pbk │ │ ├── rays2.pbk │ │ ├── raytracer.pbk │ │ ├── rgb-adjustment.pbk │ │ ├── rgb-to-hsl.pbk │ │ ├── rgb-to-hsv.pbk │ │ ├── ripple-blocks.pbk │ │ ├── rt-julia.pbk │ │ ├── rt-terrain.pbk │ │ ├── sample-linear.pbk │ │ ├── sample-nearest.pbk │ │ ├── saturation.pbk │ │ ├── sepia.pbk │ │ ├── sharpen.pbk │ │ ├── simple-box-blur.pbk │ │ ├── simple-point-light.pbk │ │ ├── simple.pbk │ │ ├── skin-color-filter.pbk │ │ ├── slices.pbk │ │ ├── smart-normal-map.pbk │ │ ├── smart-ssao.pbk │ │ ├── smudger.pbk │ │ ├── soft-light.pbk │ │ ├── sphere.pbk │ │ ├── star.pbk │ │ ├── tint.pbk │ │ ├── tunnel.pbk │ │ ├── tunnel2.pbk │ │ ├── tunnel3.pbk │ │ ├── tunnel4.pbk │ │ ├── twirl.pbk │ │ ├── vertical-scroll.pbk │ │ ├── vortex.pbk │ │ ├── warp.pbk │ │ ├── wave.pbk │ │ └── zoom-blur-focus.pbk │ ├── translator.test.js │ ├── util.test.js │ └── zig-output │ │ ├── advanced-stereographic.zig │ │ ├── alpha-channel.zig │ │ ├── alpha-from-max-color.zig │ │ ├── asciimii.zig │ │ ├── bezier-aligner.zig │ │ ├── bilateral-blur.zig │ │ ├── blendmode-color.zig │ │ ├── blendmode-color2.zig │ │ ├── brightness-threshold.zig │ │ ├── bulge.zig │ │ ├── bumpmap.zig │ │ ├── cassini.zig │ │ ├── channel-threshold.zig │ │ ├── checker-fill.zig │ │ ├── chihuly.zig │ │ ├── circle-pattern.zig │ │ ├── circle-pixels.zig │ │ ├── circular-disks.zig │ │ ├── color-burn.zig │ │ ├── color-dodge.zig │ │ ├── color.zig │ │ ├── complex-inverse.zig │ │ ├── complex-rational.zig │ │ ├── cross-stitch.zig │ │ ├── crossfade.zig │ │ ├── crystallize-f32.zig │ │ ├── crystallize-i16.zig │ │ ├── crystallize-u16.zig │ │ ├── crystallize-u32.zig │ │ ├── crystallize.zig │ │ ├── cubes-03.zig │ │ ├── cubic-space.zig │ │ ├── deformer.zig │ │ ├── difference-key.zig │ │ ├── dilate-circle.zig │ │ ├── dilate-cross.zig │ │ ├── dilate-diamond.zig │ │ ├── dilate-quad.zig │ │ ├── disks.zig │ │ ├── displace.zig │ │ ├── droste.zig │ │ ├── dynamic-palette.zig │ │ ├── erode-circle.zig │ │ ├── erode-cross.zig │ │ ├── erode-diamond.zig │ │ ├── erode-quad.zig │ │ ├── escherizer.zig │ │ ├── exclusion.zig │ │ ├── focus-linear-blur.zig │ │ ├── fractal-explorer-orbit-traps.zig │ │ ├── fractal-explorer.zig │ │ ├── frei-chen.zig │ │ ├── green-screen.zig │ │ ├── hex-cells.zig │ │ ├── high-contrast.zig │ │ ├── hue.zig │ │ ├── hypno.zig │ │ ├── invert-rgb.zig │ │ ├── jitter.zig │ │ ├── landscape.zig │ │ ├── levels.zig │ │ ├── luminosity.zig │ │ ├── mandelbulb-quick.zig │ │ ├── mandelbulb.zig │ │ ├── mercator.zig │ │ ├── metallic.zig │ │ ├── newton-raphson.zig │ │ ├── outline.zig │ │ ├── outline2.zig │ │ ├── painting.zig │ │ ├── pencil.zig │ │ ├── pixelate.zig │ │ ├── planes.zig │ │ ├── plasma.zig │ │ ├── posterize.zig │ │ ├── quaternion-julia.zig │ │ ├── radial-caleidoscope.zig │ │ ├── random-pixelation.zig │ │ ├── rays.zig │ │ ├── rays2.zig │ │ ├── raytracer.zig │ │ ├── rgb-adjustment.zig │ │ ├── ripple-blocks.zig │ │ ├── rt-julia.zig │ │ ├── rt-terrain.zig │ │ ├── sample-linear.zig │ │ ├── sample-nearest.zig │ │ ├── saturation.zig │ │ ├── sepia.zig │ │ ├── sharpen.zig │ │ ├── simple-box-blur.zig │ │ ├── simple-point-light.zig │ │ ├── simple.zig │ │ ├── skin-color-filter.zig │ │ ├── slices.zig │ │ ├── smart-normal-map.zig │ │ ├── smart-ssao.zig │ │ ├── smudger.zig │ │ ├── soft-light.zig │ │ ├── sphere.zig │ │ ├── star.zig │ │ ├── tint.zig │ │ ├── tunnel.zig │ │ ├── tunnel2.zig │ │ ├── tunnel3.zig │ │ ├── tunnel4.zig │ │ ├── twirl.zig │ │ ├── vertical-scroll.zig │ │ ├── vortex.zig │ │ ├── warp.zig │ │ ├── wave.zig │ │ └── zoom-blur-focus.zig └── zig │ ├── functions.zig │ ├── process-async.zig │ └── process.zig ├── rendering.md ├── rollup-plugin-pb2zig ├── README.md ├── demos │ ├── demo-1 │ │ ├── README.md │ │ ├── img │ │ │ ├── helicopter.png │ │ │ ├── ipad.png │ │ │ └── malgorzata-socha.png │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pbk │ │ │ ├── advanced-stereographic.pbk │ │ │ ├── alpha-from-max-color.pbk │ │ │ ├── bilateral-blur.pbk │ │ │ ├── brightness-threshold.pbk │ │ │ ├── bulge.pbk │ │ │ ├── cassini.pbk │ │ │ ├── channel-threshold.pbk │ │ │ ├── checker-fill.pbk │ │ │ ├── chihuly.pbk │ │ │ ├── circle-pattern.pbk │ │ │ ├── circle-pixels.pbk │ │ │ ├── circular-disks.pbk │ │ │ ├── complex-inverse.pbk │ │ │ ├── complex-rational.pbk │ │ │ ├── cross-stitch.pbk │ │ │ ├── crystallize.pbk │ │ │ ├── cubes-03.pbk │ │ │ ├── cubic-space.pbk │ │ │ ├── deformer.pbk │ │ │ ├── difference-key.pbk │ │ │ ├── dilate-circle.pbk │ │ │ ├── dilate-cross.pbk │ │ │ ├── dilate-diamond.pbk │ │ │ ├── dilate-quad.pbk │ │ │ ├── disks.pbk │ │ │ ├── droste.pbk │ │ │ ├── dynamic-palette.pbk │ │ │ ├── erode-circle.pbk │ │ │ ├── erode-cross.pbk │ │ │ ├── erode-diamond.pbk │ │ │ ├── erode-quad.pbk │ │ │ ├── escherizer.pbk │ │ │ ├── focus-linear-blur.pbk │ │ │ ├── fractal-explorer-orbit-traps.pbk │ │ │ ├── frei-chen.pbk │ │ │ ├── green-screen.pbk │ │ │ ├── hex-cells.pbk │ │ │ ├── high-contrast.pbk │ │ │ ├── hypno.pbk │ │ │ ├── invert-rgb.pbk │ │ │ ├── jitter.pbk │ │ │ ├── levels.pbk │ │ │ ├── mercator.pbk │ │ │ ├── outline.pbk │ │ │ ├── outline2.pbk │ │ │ ├── painting.pbk │ │ │ ├── pencil.pbk │ │ │ ├── pixelate.pbk │ │ │ ├── planes.pbk │ │ │ ├── posterize.pbk │ │ │ ├── radial-caleidoscope.pbk │ │ │ ├── random-pixelation.pbk │ │ │ ├── rays.pbk │ │ │ ├── rays2.pbk │ │ │ ├── ripple-blocks.pbk │ │ │ ├── rt-julia.pbk │ │ │ ├── sepia.pbk │ │ │ ├── sharpen.pbk │ │ │ ├── simple-box-blur.pbk │ │ │ ├── simple-point-light.pbk │ │ │ ├── simple.pbk │ │ │ ├── skin-color-filter.pbk │ │ │ ├── slices.pbk │ │ │ ├── smart-normal-map.pbk │ │ │ ├── smart-ssao.pbk │ │ │ ├── smudger.pbk │ │ │ ├── sphere.pbk │ │ │ ├── star.pbk │ │ │ ├── tint.pbk │ │ │ ├── tunnel.pbk │ │ │ ├── tunnel2.pbk │ │ │ ├── tunnel3.pbk │ │ │ ├── tunnel4.pbk │ │ │ ├── twirl.pbk │ │ │ ├── vertical-scroll.pbk │ │ │ ├── vortex.pbk │ │ │ ├── warp.pbk │ │ │ ├── wave.pbk │ │ │ └── zoom-blur-focus.pbk │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.jsx │ │ │ ├── crystallize.pbk │ │ │ ├── index.css │ │ │ └── main.jsx │ │ └── vite.config.js │ ├── demo-2 │ │ ├── README.md │ │ ├── img │ │ │ ├── fontmap.png │ │ │ ├── malgorzata-socha.png │ │ │ ├── malgorzata-socha2.png │ │ │ ├── mandelbrot.png │ │ │ ├── stripe.png │ │ │ ├── telephone-cord.png │ │ │ ├── wood.png │ │ │ └── zig-logo.png │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pbk │ │ │ ├── asciimii.pbk │ │ │ ├── bezier-aligner.pbk │ │ │ ├── blendmode-color.pbk │ │ │ ├── blendmode-color2.pbk │ │ │ ├── bumpmap.pbk │ │ │ ├── color-burn.pbk │ │ │ ├── color-dodge.pbk │ │ │ ├── color.pbk │ │ │ ├── crossfade.pbk │ │ │ ├── displace.pbk │ │ │ ├── exclusion.pbk │ │ │ ├── hue.pbk │ │ │ ├── luminosity.pbk │ │ │ ├── metallic.pbk │ │ │ ├── saturation.pbk │ │ │ └── soft-light.pbk │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.jsx │ │ │ ├── crystallize.pbk │ │ │ ├── index.css │ │ │ └── main.jsx │ │ └── vite.config.js │ ├── demo-3 │ │ ├── README.md │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pbk │ │ │ ├── fractal-explorer.pbk │ │ │ ├── landscape.pbk │ │ │ ├── mandelbulb-quick.pbk │ │ │ ├── mandelbulb.pbk │ │ │ ├── newton-raphson.pbk │ │ │ ├── plasma.pbk │ │ │ ├── quaternion-julia.pbk │ │ │ ├── raytracer.pbk │ │ │ └── rt-julia.pbk │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.jsx │ │ │ ├── crystallize.pbk │ │ │ ├── index.css │ │ │ └── main.jsx │ │ └── vite.config.js │ ├── demo-4 │ │ ├── README.md │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pbk │ │ │ ├── crystallize.pbk │ │ │ └── pencil.pbk │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.jsx │ │ │ ├── crystallize.pbk │ │ │ ├── index.css │ │ │ └── main.jsx │ │ └── vite.config.js │ └── demo-5 │ │ ├── README.md │ │ ├── img │ │ └── fontmap.png │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pbk │ │ └── asciimii.pbk │ │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── crystallize.pbk │ │ ├── index.css │ │ └── main.jsx │ │ └── vite.config.js ├── dist │ ├── image-async.js │ ├── image.js │ └── index.js ├── package-lock.json ├── package.json └── test │ ├── rollup-project-async │ ├── assets │ │ ├── simple-7d98870e.wasm │ │ ├── simple-B0FzZmn9.wasm │ │ ├── simple-DVeM9ljI.wasm │ │ └── simple-iE_8-aNG.wasm │ ├── rollup.config.js │ ├── simple.js │ └── simple.pbk │ ├── rollup-project │ ├── assets │ │ ├── simple-7d98870e.wasm │ │ ├── simple-DVeM9ljI.wasm │ │ └── simple-iE_8-aNG.wasm │ ├── rollup.config.js │ ├── simple.js │ └── simple.pbk │ ├── vite-project-async │ ├── README.md │ ├── dist │ │ └── assets │ │ │ ├── crystallize-d39825fe.wasm │ │ │ ├── crystallize-worker-42c517a4.js │ │ │ ├── index-71519df0.js │ │ │ └── index-82ad5941.css │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── crystallize.pbk │ │ ├── index.css │ │ └── main.jsx │ └── vite.config.js │ └── vite-project │ ├── README.md │ ├── dist │ ├── assets │ │ ├── crystallize-d39825fe.wasm │ │ ├── crystallize-worker-42c517a4.js │ │ ├── index-71519df0.js │ │ ├── index-82ad5941.css │ │ └── malgorzata-socha-f82491f2.png │ └── index.html │ ├── img │ └── malgorzata-socha.png │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── App.css │ ├── App.jsx │ ├── crystallize.pbk │ ├── index.css │ └── main.jsx │ └── vite.config.js └── single-image.md /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.14.0 2 | 3 | * Upgraded Zigar to version 0.14.0 4 | 5 | ## 0.13.2 6 | 7 | * Upgraded Zigar to version 0.13.2 8 | 9 | ## 0.13.1 10 | 11 | * Upgraded Zigar to version 0.13.1 12 | 13 | ## 0.13.0 14 | 15 | * Upgraded Zigar to version 0.13.0 16 | 17 | ## 0.12.0 18 | 19 | * Upgraded Zigar to version 0.12.0 20 | 21 | ## 0.11.2 22 | 23 | * Upgraded Zigar to version 0.11.2 24 | 25 | ## 0.11.1 26 | 27 | * Upgraded Zigar to version 0.11.1 28 | * Made translated code compatible with upcoming Zig 0.12.0 29 | * Translating local variable declarations as const when variables are not mutated 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Chung Leong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /img/advanced-stereographic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/advanced-stereographic.jpg -------------------------------------------------------------------------------- /img/alpha-from-max-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/alpha-from-max-color.png -------------------------------------------------------------------------------- /img/asciimii.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/asciimii.jpg -------------------------------------------------------------------------------- /img/bezier-aligner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/bezier-aligner.jpg -------------------------------------------------------------------------------- /img/bilateral-blur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/bilateral-blur.jpg -------------------------------------------------------------------------------- /img/blendmode-color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/blendmode-color.jpg -------------------------------------------------------------------------------- /img/blendmode-color2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/blendmode-color2.jpg -------------------------------------------------------------------------------- /img/brightness-threshold.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/brightness-threshold.jpg -------------------------------------------------------------------------------- /img/bulge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/bulge.jpg -------------------------------------------------------------------------------- /img/bumpmap.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/bumpmap.jpg -------------------------------------------------------------------------------- /img/cassini.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/cassini.jpg -------------------------------------------------------------------------------- /img/channel-threshold.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/channel-threshold.jpg -------------------------------------------------------------------------------- /img/checker-fill.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/checker-fill.jpg -------------------------------------------------------------------------------- /img/chihuly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/chihuly.png -------------------------------------------------------------------------------- /img/circle-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/circle-pattern.png -------------------------------------------------------------------------------- /img/circle-pixels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/circle-pixels.png -------------------------------------------------------------------------------- /img/circular-disks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/circular-disks.png -------------------------------------------------------------------------------- /img/color-burn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/color-burn.jpg -------------------------------------------------------------------------------- /img/color-dodge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/color-dodge.jpg -------------------------------------------------------------------------------- /img/color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/color.jpg -------------------------------------------------------------------------------- /img/complex-inverse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/complex-inverse.jpg -------------------------------------------------------------------------------- /img/complex-rational.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/complex-rational.jpg -------------------------------------------------------------------------------- /img/cross-stitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/cross-stitch.png -------------------------------------------------------------------------------- /img/crossfade.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/crossfade.jpg -------------------------------------------------------------------------------- /img/crystallize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/crystallize.png -------------------------------------------------------------------------------- /img/cubes-03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/cubes-03.jpg -------------------------------------------------------------------------------- /img/cubic-space.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/cubic-space.jpg -------------------------------------------------------------------------------- /img/deformer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/deformer.jpg -------------------------------------------------------------------------------- /img/difference-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/difference-key.png -------------------------------------------------------------------------------- /img/dilate-circle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/dilate-circle.jpg -------------------------------------------------------------------------------- /img/dilate-cross.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/dilate-cross.jpg -------------------------------------------------------------------------------- /img/dilate-diamond.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/dilate-diamond.jpg -------------------------------------------------------------------------------- /img/dilate-quad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/dilate-quad.jpg -------------------------------------------------------------------------------- /img/disks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/disks.png -------------------------------------------------------------------------------- /img/displace.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/displace.jpg -------------------------------------------------------------------------------- /img/droste.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/droste.jpg -------------------------------------------------------------------------------- /img/dynamic-palette.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/dynamic-palette.jpg -------------------------------------------------------------------------------- /img/erode-circle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/erode-circle.jpg -------------------------------------------------------------------------------- /img/erode-cross.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/erode-cross.jpg -------------------------------------------------------------------------------- /img/erode-diamond.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/erode-diamond.jpg -------------------------------------------------------------------------------- /img/erode-quad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/erode-quad.jpg -------------------------------------------------------------------------------- /img/escherizer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/escherizer.jpg -------------------------------------------------------------------------------- /img/exclusion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/exclusion.jpg -------------------------------------------------------------------------------- /img/focus-linear-blur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/focus-linear-blur.jpg -------------------------------------------------------------------------------- /img/fontmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/fontmap.png -------------------------------------------------------------------------------- /img/fractal-explorer-orbit-traps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/fractal-explorer-orbit-traps.jpg -------------------------------------------------------------------------------- /img/fractal-explorer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/fractal-explorer.jpg -------------------------------------------------------------------------------- /img/frei-chen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/frei-chen.jpg -------------------------------------------------------------------------------- /img/green-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/green-screen.png -------------------------------------------------------------------------------- /img/helicopter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/helicopter.jpg -------------------------------------------------------------------------------- /img/hex-cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/hex-cells.png -------------------------------------------------------------------------------- /img/high-contrast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/high-contrast.jpg -------------------------------------------------------------------------------- /img/hue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/hue.jpg -------------------------------------------------------------------------------- /img/hypno.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/hypno.jpg -------------------------------------------------------------------------------- /img/invert-rgb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/invert-rgb.jpg -------------------------------------------------------------------------------- /img/ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/ipad.png -------------------------------------------------------------------------------- /img/jitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/jitter.png -------------------------------------------------------------------------------- /img/landscape.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/landscape.jpg -------------------------------------------------------------------------------- /img/levels.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/levels.jpg -------------------------------------------------------------------------------- /img/luminosity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/luminosity.jpg -------------------------------------------------------------------------------- /img/malgorzata-socha.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/malgorzata-socha.jpg -------------------------------------------------------------------------------- /img/malgorzata-socha2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/malgorzata-socha2.jpg -------------------------------------------------------------------------------- /img/mandelbrot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/mandelbrot.jpg -------------------------------------------------------------------------------- /img/mandelbulb-quick.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/mandelbulb-quick.jpg -------------------------------------------------------------------------------- /img/mandelbulb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/mandelbulb.jpg -------------------------------------------------------------------------------- /img/mercator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/mercator.jpg -------------------------------------------------------------------------------- /img/metallic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/metallic.png -------------------------------------------------------------------------------- /img/newton-raphson.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/newton-raphson.jpg -------------------------------------------------------------------------------- /img/outline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/outline.jpg -------------------------------------------------------------------------------- /img/outline2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/outline2.jpg -------------------------------------------------------------------------------- /img/painting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/painting.jpg -------------------------------------------------------------------------------- /img/pb-toolkit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/pb-toolkit.jpg -------------------------------------------------------------------------------- /img/pencil.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/pencil.jpg -------------------------------------------------------------------------------- /img/pixelate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/pixelate.jpg -------------------------------------------------------------------------------- /img/planes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/planes.jpg -------------------------------------------------------------------------------- /img/plasma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/plasma.jpg -------------------------------------------------------------------------------- /img/posterize.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/posterize.jpg -------------------------------------------------------------------------------- /img/quaternion-julia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/quaternion-julia.jpg -------------------------------------------------------------------------------- /img/radial-caleidoscope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/radial-caleidoscope.png -------------------------------------------------------------------------------- /img/random-pixelation.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/random-pixelation.jpg -------------------------------------------------------------------------------- /img/rays.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/rays.jpg -------------------------------------------------------------------------------- /img/rays2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/rays2.jpg -------------------------------------------------------------------------------- /img/raytracer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/raytracer.jpg -------------------------------------------------------------------------------- /img/ripple-blocks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/ripple-blocks.jpg -------------------------------------------------------------------------------- /img/rt-julia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/rt-julia.png -------------------------------------------------------------------------------- /img/rt-terrain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/rt-terrain.jpg -------------------------------------------------------------------------------- /img/saturation.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/saturation.jpg -------------------------------------------------------------------------------- /img/sepia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/sepia.jpg -------------------------------------------------------------------------------- /img/sharpen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/sharpen.jpg -------------------------------------------------------------------------------- /img/simple-box-blur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/simple-box-blur.jpg -------------------------------------------------------------------------------- /img/simple-point-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/simple-point-light.png -------------------------------------------------------------------------------- /img/simple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/simple.jpg -------------------------------------------------------------------------------- /img/skin-color-filter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/skin-color-filter.jpg -------------------------------------------------------------------------------- /img/slices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/slices.png -------------------------------------------------------------------------------- /img/smart-normal-map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/smart-normal-map.jpg -------------------------------------------------------------------------------- /img/smart-ssao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/smart-ssao.jpg -------------------------------------------------------------------------------- /img/smudger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/smudger.png -------------------------------------------------------------------------------- /img/soft-light.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/soft-light.jpg -------------------------------------------------------------------------------- /img/sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/sphere.png -------------------------------------------------------------------------------- /img/star.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/star.jpg -------------------------------------------------------------------------------- /img/stripe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/stripe.png -------------------------------------------------------------------------------- /img/telephone-cord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/telephone-cord.png -------------------------------------------------------------------------------- /img/tint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/tint.jpg -------------------------------------------------------------------------------- /img/tunnel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/tunnel.jpg -------------------------------------------------------------------------------- /img/tunnel2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/tunnel2.jpg -------------------------------------------------------------------------------- /img/tunnel3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/tunnel3.jpg -------------------------------------------------------------------------------- /img/tunnel4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/tunnel4.jpg -------------------------------------------------------------------------------- /img/twirl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/twirl.png -------------------------------------------------------------------------------- /img/vertical-scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/vertical-scroll.png -------------------------------------------------------------------------------- /img/vortex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/vortex.jpg -------------------------------------------------------------------------------- /img/warp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/warp.png -------------------------------------------------------------------------------- /img/wave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/wave.png -------------------------------------------------------------------------------- /img/wood.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/wood.jpg -------------------------------------------------------------------------------- /img/zig-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/zig-logo.jpg -------------------------------------------------------------------------------- /img/zoom-blur-focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/img/zoom-blur-focus.jpg -------------------------------------------------------------------------------- /pb2zig/.nycrc: -------------------------------------------------------------------------------- 1 | { 2 | "checkCoverage": true, 3 | "reporter": [ 4 | "text", 5 | "html" 6 | ], 7 | "lines": 99, 8 | "branches": 96, 9 | "statements": 99, 10 | "functions": 100 11 | } 12 | -------------------------------------------------------------------------------- /pb2zig/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Chung Leong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pb2zig/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pb2zig", 3 | "version": "0.14.0", 4 | "description": "Pixel Bender to Zig code translator", 5 | "main": "./dist/index.js", 6 | "bin": "./bin/cli.js", 7 | "type": "module", 8 | "scripts": { 9 | "test": "node --experimental-loader node-zigar --no-warnings ./node_modules/mocha/bin/mocha.js -- test/*.test.js", 10 | "debug": "node --experimental-loader node-zigar --no-warnings --inspect-brk ./node_modules/mocha/bin/mocha.js -- test/*.test.js", 11 | "coverage": "node ./node_modules/c8/bin/c8.js ./node_modules/mocha/bin/mocha.js -- test/*.test.js", 12 | "rollup": "rollup -c rollup.config.js" 13 | }, 14 | "files": [ 15 | "bin/*", 16 | "dist/*", 17 | "zig/*.zig" 18 | ], 19 | "author": "", 20 | "license": "MIT", 21 | "dependencies": { 22 | "chevrotain": "^11.0.3" 23 | }, 24 | "devDependencies": { 25 | "c8": "^10.1.3", 26 | "chai": "^5.2.0", 27 | "mocha": "^11.1.0", 28 | "mocha-skip-if": "^1.0.4", 29 | "node-zigar": "^0.14.0", 30 | "rollup": "^4.36.0", 31 | "sharp": "^0.33.5" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /pb2zig/rollup.config.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | input: './src/cli.js', 4 | output: { 5 | file: './bin/cli.js', 6 | format: 'esm', 7 | banner: '#!/usr/bin/env node', 8 | }, 9 | }, 10 | { 11 | input: './src/index.js', 12 | output: { 13 | file: './dist/index.js', 14 | format: 'esm', 15 | }, 16 | }, 17 | ]; 18 | -------------------------------------------------------------------------------- /pb2zig/src/index.js: -------------------------------------------------------------------------------- 1 | import { parse } from './pb-parser.js'; 2 | import { process } from './pb-visitor.js'; 3 | import { translate } from './translator.js'; 4 | import { serialize } from './zig-serializer.js'; 5 | 6 | export function convertPixelBender(code, options) { 7 | const { cst, macroCSTs, lexErrors, parseErrors } = parse(code); 8 | const errCount = lexErrors.length + parseErrors.length; 9 | if (errCount > 0) { 10 | const msgs = []; 11 | for (const err of lexErrors) { 12 | const { message, line, column } = err; 13 | msgs.push(` [LEXER]: ${message} at line ${line}, column ${column}`); 14 | } 15 | for (const err of parseErrors) { 16 | const { message, token: { startLine, startColumn } } = err;; 17 | msgs.push(` [PARSER]: ${message} at line ${startLine}, column ${startColumn}`); 18 | } 19 | const s = (errCount > 1) ? 's' : ''; 20 | throw new Error(`${errCount} error${s} encountered parsing Pixel Bender code:\n\n${msgs.join('\n')}`); 21 | } 22 | const { ast, macroASTs } = process(cst, macroCSTs); 23 | const zigAST = translate(ast, macroASTs, options); 24 | return serialize(zigAST); 25 | } 26 | -------------------------------------------------------------------------------- /pb2zig/src/utils.js: -------------------------------------------------------------------------------- 1 | export function walk(tree, cb) { 2 | const f = (node, key, parent) => { 3 | if (Array.isArray(node)) { 4 | for (const [ key, child ] of node.entries()) { 5 | const res = f(child, key, node); 6 | // end iteration if callback returns false 7 | if (res === false) { 8 | return false; 9 | } 10 | } 11 | } else { 12 | const res = cb(node, key, parent); 13 | if (res !== undefined) { 14 | return res; 15 | } 16 | if (parent && node !== parent[key]) { 17 | // object has been swapped out--scan the new object instead 18 | return f(parent[key], key, parent); 19 | } 20 | if (node instanceof Object) { 21 | // scan sub-nodes if callback doesn't return anything 22 | for (const [ key, child ] of Object.entries(node)) { 23 | const res = f(child, key, node); 24 | if (res === false) { 25 | return false; 26 | } 27 | } 28 | } 29 | } 30 | }; 31 | f(tree); 32 | } 33 | 34 | export function find(tree, classes, recursive = false) { 35 | if (!Array.isArray(classes)) { 36 | classes = [ classes ]; 37 | } 38 | const list = []; 39 | walk(tree, (node) => { 40 | if (classes.some(c => node instanceof c)) { 41 | list.push(node); 42 | if (!recursive) { 43 | return true; 44 | } 45 | } 46 | }); 47 | return list; 48 | } 49 | 50 | export function map(object, cb) { 51 | const result = {}; 52 | for (const [ name, value ] of Object.entries(object)) { 53 | const newValue = cb(value, name); 54 | if (newValue !== undefined) { 55 | result[name] = newValue; 56 | } 57 | } 58 | return result; 59 | } 60 | -------------------------------------------------------------------------------- /pb2zig/test/example/crystallize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/example/crystallize.png -------------------------------------------------------------------------------- /pb2zig/test/example/index.js: -------------------------------------------------------------------------------- 1 | import { createOutput } from 'crystallize.zig'; 2 | import sharp from 'sharp'; 3 | 4 | // create image object, ensure that it has an alpha channel 5 | const img = sharp(`./socha.jpg`).ensureAlpha().raw(); 6 | // extract raw data 7 | const { data, info } = await img.toBuffer({ resolveWithObject: true }); 8 | const { width, height, channels } = info; 9 | // call createOutput() with input image and params 10 | const input = { src: { data, width, height } }; 11 | const params = { size: 25 }; 12 | const output = createOutput(width, height, input, params); 13 | // obtain Uint8Array from image "dst"; its data property is of the type `[]@Vector(4, u8)` 14 | // since an array of x4 u8 vector has the same memory layout as an array of u8, Zigar 15 | // attaches a "typedArray" property to the object for our convenience 16 | const { typedArray } = output.dst.data; 17 | // save the raw data as a PNG file 18 | sharp(typedArray, { raw: { width, height, channels } }).png().toFile(`./crystallize.png`); 19 | -------------------------------------------------------------------------------- /pb2zig/test/example/socha.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/example/socha.jpg -------------------------------------------------------------------------------- /pb2zig/test/img-input/bigmap-blur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/bigmap-blur.jpg -------------------------------------------------------------------------------- /pb2zig/test/img-input/bigmap-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/bigmap-normal.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/diffuse-map-big.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/diffuse-map-big.jpg -------------------------------------------------------------------------------- /pb2zig/test/img-input/fontmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/fontmap.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/helicopter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/helicopter.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/ipad.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/malgorzata-socha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/malgorzata-socha.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/malgorzata-socha2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/malgorzata-socha2.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/mandelbrot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/mandelbrot.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/red-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/red-circle.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/red-dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/red-dot.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/sky-sphere4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/sky-sphere4.jpg -------------------------------------------------------------------------------- /pb2zig/test/img-input/stripe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/stripe.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/telephone-cord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/telephone-cord.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/wood.png -------------------------------------------------------------------------------- /pb2zig/test/img-input/zig-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-input/zig-logo.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/advanced-stereographic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/advanced-stereographic.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/alpha-channel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/alpha-channel.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/alpha-from-max-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/alpha-from-max-color.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/asciimii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/asciimii.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/bezier-aligner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/bezier-aligner.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/bilateral-blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/bilateral-blur.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/blendmode-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/blendmode-color.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/blendmode-color2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/blendmode-color2.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/brightness-threshold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/brightness-threshold.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/bulge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/bulge.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/bumpmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/bumpmap.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/cassini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/cassini.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/channel-threshold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/channel-threshold.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/checker-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/checker-fill.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/chihuly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/chihuly.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/circle-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/circle-pattern.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/circle-pixels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/circle-pixels.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/circular-disks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/circular-disks.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/color-burn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/color-burn.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/color-dodge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/color-dodge.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/color.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/complex-inverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/complex-inverse.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/complex-rational.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/complex-rational.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/cross-stitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/cross-stitch.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/crossfade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/crossfade.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/crystallize-f32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/crystallize-f32.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/crystallize-i16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/crystallize-i16.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/crystallize-u16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/crystallize-u16.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/crystallize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/crystallize.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/cubes-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/cubes-03.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/cubic-space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/cubic-space.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/deformer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/deformer.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/difference-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/difference-key.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/dilate-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/dilate-circle.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/dilate-cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/dilate-cross.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/dilate-diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/dilate-diamond.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/dilate-quad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/dilate-quad.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/disks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/disks.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/displace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/displace.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/droste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/droste.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/dynamic-palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/dynamic-palette.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/erode-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/erode-circle.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/erode-cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/erode-cross.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/erode-diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/erode-diamond.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/erode-quad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/erode-quad.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/escherizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/escherizer.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/exclusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/exclusion.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/focus-linear-blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/focus-linear-blur.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/fractal-explorer-orbit-traps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/fractal-explorer-orbit-traps.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/fractal-explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/fractal-explorer.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/frei-chen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/frei-chen.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/green-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/green-screen.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/hex-cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/hex-cells.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/high-contrast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/high-contrast.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/hue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/hue.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/hypno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/hypno.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/invert-rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/invert-rgb.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/jitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/jitter.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/landscape.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/levels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/levels.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/luminosity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/luminosity.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/mandelbulb-quick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/mandelbulb-quick.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/mandelbulb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/mandelbulb.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/mercator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/mercator.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/metallic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/metallic.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/newton-raphson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/newton-raphson.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/outline.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/outline2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/outline2.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/painting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/painting.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/pencil.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/pixelate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/pixelate.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/planes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/planes.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/plasma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/plasma.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/posterize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/posterize.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/quaternion-julia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/quaternion-julia.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/radial-caleidoscope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/radial-caleidoscope.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/random-pixelation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/random-pixelation.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/rays.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/rays.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/rays2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/rays2.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/raytracer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/raytracer.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/rgb-adjustment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/rgb-adjustment.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/ripple-blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/ripple-blocks.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/rt-julia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/rt-julia.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/rt-terrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/rt-terrain.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/sample-linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/sample-linear.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/sample-nearest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/sample-nearest.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/saturation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/saturation.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/sepia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/sepia.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/sharpen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/sharpen.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/simple-box-blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/simple-box-blur.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/simple-point-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/simple-point-light.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/simple.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/skin-color-filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/skin-color-filter.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/slices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/slices.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/smart-normal-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/smart-normal-map.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/smart-ssao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/smart-ssao.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/smudger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/smudger.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/soft-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/soft-light.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/sphere.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/star.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/tint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/tint.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/tunnel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/tunnel.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/tunnel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/tunnel2.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/tunnel3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/tunnel3.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/tunnel4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/tunnel4.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/twirl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/twirl.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/vertical-scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/vertical-scroll.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/vortex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/vortex.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/warp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/warp.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/wave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/wave.png -------------------------------------------------------------------------------- /pb2zig/test/img-output/zoom-blur-focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/img-output/zoom-blur-focus.png -------------------------------------------------------------------------------- /pb2zig/test/node-zigar.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "optimize": "ReleaseSmall" 3 | } 4 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/alpha-channel.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel premultiplication 4 | < namespace : "Your Namespace"; 5 | vendor : "Your Vendor"; 6 | version : 1; 7 | > 8 | { 9 | input image4 src; 10 | output pixel4 dst; 11 | 12 | void 13 | evaluatePixel() 14 | { 15 | dst = float4(0.5, 0.0, 0.0, 0.5); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/alpha-from-max-color.pbk: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * ADOBE SYSTEMS INCORPORATED 4 | * Copyright (C) 2010 Adobe Systems Incorporated 5 | * All Rights Reserved. 6 | * 7 | * NOTICE: Adobe permits you to use, modify, and distribute this file in 8 | * accordance with the terms of the Adobe license agreement accompanying it. 9 | * If you have received this file from a source other than Adobe, then your 10 | * use, modification, or distribution of it requires the prior written 11 | * permission of Adobe. 12 | * 13 | *****************************************************************************/ 14 | 15 | 16 | kernel AlphaFromMaxColor 17 | < 18 | namespace: "AfterEffects"; 19 | vendor : "Adobe Systems Incorporated"; 20 | version : 2; 21 | description : "Estimate alpha based on color channels."; 22 | displayname: "Alpha From Max Color"; 23 | category: "Utility"; 24 | > 25 | { 26 | 27 | input image4 src; 28 | output pixel4 dst; 29 | 30 | void 31 | evaluatePixel() 32 | { 33 | dst = sampleNearest(src, outCoord()); 34 | dst.rgb *= dst.a; // premultiply first. does nothing on opaque 35 | 36 | dst.a = max(max(dst.r, dst.g), dst.b); // take max of color components 37 | dst.a *= 254.0/255.0; // and scale slightly. 38 | 39 | // assume incoming colors are premultiplied against black 40 | // alpha. unmultiply if dst.a != 0 [otherwise div/0] 41 | if (dst.a != 0.0) { 42 | dst.rgb /= dst.a; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/blendmode-color.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel ColorBlend 4 | < namespace : "com.quasimondo"; 5 | vendor : "Quasimondo"; 6 | version : 1; 7 | description : "Color Blendmode"; 8 | > 9 | { 10 | input image4 src1; 11 | input image4 src2; 12 | 13 | output pixel4 dst; 14 | 15 | void 16 | evaluatePixel() 17 | { 18 | float4 rgb1 = sampleNearest(src1,outCoord()); 19 | float4 rgb2 = sampleNearest(src2,outCoord()); 20 | 21 | float y = rgb1.r * 0.29900 + rgb1.g * 0.58700 + rgb1.b * 0.14400; 22 | float u = - rgb2.r * 0.14714 - rgb2.g * 0.28886 + rgb2.b * 0.43600; 23 | float v = rgb2.r * 0.61500 - rgb2.g * 0.51499 - rgb2.b * 0.10001; 24 | 25 | 26 | dst.r = 0.970874 * y - 0.0591995 * u + 1.13983 * v; 27 | dst.g = 0.970874 * y - 0.453834 * u - 0.580599 * v; 28 | dst.b = 0.970874 * y + 1.97292 * u + 0.00000781528 * v; 29 | dst.a = rgb1.a; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/blendmode-color2.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel ColorBlend2 4 | < namespace : "com.quasimondo"; 5 | vendor : "Quasimondo"; 6 | version : 1; 7 | description : "Alternative Color Blendmode"; 8 | > 9 | { 10 | input image4 src1; 11 | input image4 src2; 12 | 13 | output pixel4 dst; 14 | 15 | void 16 | evaluatePixel() 17 | { 18 | float4 rgb1 = sampleNearest(src1,outCoord()); 19 | float4 rgb2 = sampleNearest(src2,outCoord()); 20 | 21 | 22 | float y = rgb1.r * 0.29029126213592233 + rgb1.g * 0.56990291262135921 + rgb1.b * 0.13980582524271845; 23 | float u = rgb2.r * 140.58486056821164 - rgb2.g * 125.474697792149809 - rgb2.b * 15.11016277606183; 24 | float v = -rgb2.r * 327.14030548802001 - rgb2.g * 1.3881417465045215 + rgb2.b * 325.75216374151549; 25 | 26 | dst.r = y + 0.004539556278762163 * u - 0.00021860911105424223 * v; 27 | dst.g = y - 0.0034342699108313463 * u - 0.0005884786778098704 * v; 28 | dst.b = y + 0.004573535488250788 * u + 0.0028527854727750856 * v; 29 | dst.a = rgb1.a; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/brightness-threshold.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel brightnessThreshold 3 | < 4 | namespace: "net.onthewings.filters"; 5 | vendor: "Andy Li"; 6 | version: 1; 7 | description: "Thresholding bases on brightness."; 8 | > 9 | { 10 | parameter float2 threshold < 11 | defaultValue: float2(0.0,1.0); 12 | description:"Min and max limits."; 13 | >; 14 | parameter float4 outputColor1 < 15 | defaultValue: float4(0.0,0.0,0.0,1.0); 16 | description:"Color for thresholded area.colorForAllPassedArea"; 17 | >; 18 | parameter float4 outputColor2 < 19 | defaultValue: float4(1.0,1.0,1.0,1.0); 20 | description:"Color for all passed area"; 21 | >; 22 | 23 | input image4 source; 24 | output pixel4 target; 25 | 26 | void evaluatePixel() 27 | { 28 | pixel4 ori = sampleNearest(source, outCoord()); 29 | float brightness = 0.2126*ori.r + 0.7152*ori.g + 0.0722*ori.b; 30 | if (brightness < threshold[0] || brightness > threshold[1]) 31 | target = outputColor1; 32 | else 33 | target = outputColor2; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/bulge.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "bulge"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 center 14 | < 15 | minValue: float2( 0.0, 0.0 ); 16 | maxValue: float2( 4096.0, 4096.0 ); 17 | defaultValue: float2( 0.0, 0.0 ); 18 | >; 19 | 20 | parameter float amplitude 21 | < 22 | minValue: 0.0; 23 | maxValue: 100.0; 24 | defaultValue: 3.0; 25 | >; 26 | 27 | void 28 | evaluatePixel() 29 | { 30 | 31 | float2 coord = outCoord(); 32 | 33 | float dx = coord.x - center.x; 34 | float dy = coord.y - center.y; 35 | 36 | float a = atan( dy , dx ); 37 | float r = sqrt( dx*dx + dy*dy ); 38 | 39 | r *= r / sqrt( center.x * center.y ) / amplitude; 40 | 41 | float2 dest = float2( center.x + cos( a ) * r,center.y + sin( a ) * r ); 42 | dst = sampleNearest( src, dest ); 43 | 44 | } 45 | } 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/channel-threshold.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel channelThreshold 3 | < 4 | namespace: "net.onthewings.filters"; 5 | vendor: "Andy Li"; 6 | version: 1; 7 | description: "Thresholding bases on the channels. Only the pixels passed ALL thresholds will be white (or color you configed)."; 8 | > 9 | { 10 | parameter float2 threshold0 < 11 | defaultValue: float2(0.0,1.0); 12 | description:"For red channel."; 13 | >; 14 | parameter float2 threshold1 < 15 | defaultValue: float2(0.0,1.0); 16 | description:"For green channel."; 17 | >; 18 | parameter float2 threshold2 < 19 | defaultValue: float2(0.0,1.0); 20 | description:"For blue channel."; 21 | >; 22 | parameter float2 threshold3 < 23 | defaultValue: float2(0.0,1.0); 24 | description:"For alpha channel."; 25 | >; 26 | parameter float4 outputColor1 < 27 | defaultValue: float4(0.0,0.0,0.0,1.0); 28 | description:"Color for thresholded area.colorForAllPassedArea"; 29 | >; 30 | parameter float4 outputColor2 < 31 | defaultValue: float4(1.0,1.0,1.0,1.0); 32 | description:"Color for all passed area"; 33 | >; 34 | 35 | input image4 source; 36 | output pixel4 target; 37 | 38 | void evaluatePixel() 39 | { 40 | pixel4 ori = sampleNearest(source, outCoord()); 41 | 42 | if (ori[0]threshold0[1] || 43 | ori[1]threshold1[1] || 44 | ori[2]threshold2[1] || 45 | ori[3]threshold3[1]) 46 | target = outputColor1; 47 | else 48 | target = outputColor2; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/checker-fill.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel CheckerFill 4 | < namespace : "com.adobe.example"; 5 | vendor : "Adobe Systems Inc."; 6 | version : 1; 7 | description : "A checkered field generator"; 8 | > 9 | { 10 | output pixel4 dst; 11 | 12 | parameter float checkerSize 13 | < 14 | defaultValue : 10.0; 15 | minValue : 1.0; 16 | maxValue : 75.0; 17 | >; 18 | 19 | parameter pixel4 colorA 20 | < 21 | defaultValue : pixel4(0.0, 1.0, 1.0, 1.0); 22 | >; 23 | 24 | parameter pixel4 colorB 25 | < 26 | defaultValue : pixel4( 0.0, 0.0, 0.0, 1.0 ); 27 | >; 28 | 29 | void evaluatePixel() 30 | { 31 | float2 position = outCoord(); 32 | float vertical = mod(position.x, checkerSize * 2.0); 33 | float horizontal = mod(position.y, checkerSize * 2.0); 34 | dst = (( vertical < checkerSize ) ^^ ( horizontal < checkerSize )) ? colorA : colorB; 35 | } 36 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/crossfade.pbk: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * ADOBE SYSTEMS INCORPORATED 4 | * Copyright (C) 2010 Adobe Systems Incorporated 5 | * All Rights Reserved. 6 | * 7 | * NOTICE: Adobe permits you to use, modify, and distribute this file in 8 | * accordance with the terms of the Adobe license agreement accompanying it. 9 | * If you have received this file from a source other than Adobe, then your 10 | * use, modification, or distribution of it requires the prior written 11 | * permission of Adobe. 12 | * 13 | *****************************************************************************/ 14 | 15 | 16 | kernel Crossfade 17 | < namespace : "AIF"; 18 | vendor : "Adobe Systems"; 19 | version : 2; 20 | description : "Crossfade between two images"; > 21 | { 22 | parameter float intensity 23 | < minValue: 0.0; 24 | maxValue: 1.0; 25 | defaultValue: 0.0; 26 | >; 27 | 28 | input image4 frontImage; 29 | input image4 backImage; 30 | output pixel4 dst; 31 | 32 | void evaluatePixel() 33 | { 34 | // Acquire the pixel values from both images at the current location 35 | float4 frontPixel = sampleNearest(frontImage, outCoord()); 36 | float4 backPixel = sampleNearest(backImage, outCoord()); 37 | 38 | // We set the output to the mix of the two pixels. The mix function 39 | // applies the following equation to the pixel values: 40 | // (1.0 - intensity) * frontPixel + intensity * backPixel 41 | dst = mix(frontPixel, backPixel, intensity); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/deformer.pbk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/pb2zig/test/pbk-samples/deformer.pbk -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/difference-key.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel DifferenceKey 4 | < namespace : "com.quasimondo"; 5 | vendor : "Quasimondo"; 6 | version : 1; 7 | description : "A simple difference key for chroma keying"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float3 keyColor; 14 | 15 | parameter float tolerance 16 | < 17 | minValue: 0.0; 18 | maxValue: 3.0; 19 | defaultValue: 0.02; 20 | >; 21 | 22 | parameter float ramp 23 | < 24 | minValue: 0.0; 25 | maxValue: 1.0; 26 | defaultValue: 0.005; 27 | >; 28 | 29 | parameter float gamma 30 | < 31 | minValue: 0.0; 32 | maxValue: 10.0; 33 | defaultValue: 1.00; 34 | >; 35 | 36 | void 37 | evaluatePixel() 38 | { 39 | dst = sampleNearest(src,outCoord()); 40 | float diff = length( dst.rgb - keyColor ); 41 | if ( diff < tolerance ) 42 | { 43 | dst.a = 0.0; 44 | } else if ( diff < tolerance + ramp ) 45 | { 46 | dst.a = pow( (diff - tolerance) / ramp, gamma ); 47 | } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/dilate-cross.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Dilate_cross 4 | < namespace : "com.gasubasu"; 5 | vendor : "gasubasu"; 6 | version : 1; 7 | description : "flash compatible dilate filter 'cross'"; 8 | > 9 | { 10 | input image4 i; 11 | output pixel4 o; 12 | 13 | void 14 | evaluatePixel() 15 | { 16 | float2 c = outCoord(); 17 | float2 p; 18 | pixel4 n; 19 | 20 | o=pixel4(0.0,0.0,0.0,1.0); 21 | 22 | p=float2( 0, 0);n=sampleNearest(i,c+p);if(o.r 2 | 3 | kernel Dilate_quad 4 | < namespace : "com.gasubasu"; 5 | vendor : "gasubasu"; 6 | version : 1; 7 | description : "flash compatible dilate filter 'quad'"; 8 | > 9 | { 10 | input image4 i; 11 | output pixel4 o; 12 | 13 | void 14 | evaluatePixel() 15 | { 16 | float2 c = outCoord(); 17 | float2 p; 18 | pixel4 n; 19 | 20 | o=pixel4(0.0,0.0,0.0,1.0); 21 | 22 | p=float2(-1,-1);n=sampleNearest(i,c+p);if(o.r 2 | kernel DynamicColorPalette 3 | < namespace : "thelab.org"; 4 | vendor : "Eduardo.Costa"; 5 | version : 1; 6 | description : "Manipulates the Color Palette of the bitmap"; 7 | > 8 | { 9 | input image4 src1; 10 | 11 | output pixel4 dst; 12 | 13 | parameter int palette 14 | < 15 | minValue:int(1); 16 | maxValue:int(128); 17 | defaultValue:int(64); 18 | >; 19 | 20 | 21 | void 22 | evaluatePixel() 23 | { 24 | float2 uv = outCoord(); 25 | dst = sampleLinear(src1, uv); 26 | 27 | dst = floor(dst*floor(float(palette)))/floor(float(palette)); 28 | 29 | } 30 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/erode-cross.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Erode_cross 4 | < namespace : "com.gasubasu"; 5 | vendor : "gasubasu"; 6 | version : 1; 7 | description : "flash compatible erode filter 'cross'"; 8 | > 9 | { 10 | input image4 i; 11 | output pixel4 o; 12 | 13 | void 14 | evaluatePixel() 15 | { 16 | float2 c = outCoord(); 17 | float2 p; 18 | pixel4 n; 19 | 20 | o=pixel4(1.0,1.0,1.0,1.0); 21 | p=float2( 0, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 22 | p=float2(-1, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 23 | p=float2( 0,-1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 24 | p=float2( 0, 1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 25 | p=float2( 1, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 26 | p=float2(-2, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 27 | p=float2( 2, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 28 | p=float2( 0,-2);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 29 | p=float2( 0, 2);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 30 | 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/erode-quad.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Erode_quad 4 | < namespace : "com.gasubasu"; 5 | vendor : "gasubasu"; 6 | version : 1; 7 | description : "flash compatible erode filter 'quad'"; 8 | > 9 | { 10 | input image4 i; 11 | output pixel4 o; 12 | 13 | void 14 | evaluatePixel() 15 | { 16 | float2 c = outCoord(); 17 | float2 p; 18 | pixel4 n; 19 | 20 | o=pixel4(1.0,1.0,1.0,1.0); 21 | p=float2(-1,-1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 22 | p=float2(-1, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 23 | p=float2(-1, 1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 24 | p=float2( 0,-1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 25 | p=float2( 0, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 26 | p=float2( 0, 1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 27 | p=float2( 1,-1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 28 | p=float2( 1, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 29 | p=float2( 1, 1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 30 | 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/high-contrast.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel HighContrastFilter 4 | < namespace : "com.mimswright"; 5 | vendor : "MimsWright.com"; 6 | version : 1; 7 | description : "extreme contrast filter that converts to either 1 or 0 based on brightness of source."; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float threshhold 14 | ; 17 | 18 | parameter int invert 19 | ; 20 | 21 | void 22 | evaluatePixel() 23 | { 24 | pixel4 px = sampleNearest(src, outCoord()); 25 | float brightest = max( px.r, max( px.g, px.b)); 26 | float v; 27 | if ( invert > 0 ) { 28 | v = step(threshhold, (brightest * 255.0)); 29 | } else { 30 | v = step((brightest * 255.0), threshhold); 31 | } 32 | dst = pixel4(v,v,v,v); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/hsv-to-rgb.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel rgbToHSV 3 | < 4 | namespace: "net.onthewings.filters"; 5 | vendor: "Andy Li"; 6 | version: 1; 7 | description: "Convert HSV input to RGB."; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 target; 12 | 13 | void evaluatePixel() 14 | { 15 | pixel4 ori = sampleNearest(src,outCoord()); 16 | float h = ori[0]*360.0; 17 | float s = ori[1]; 18 | float v = ori[2]; 19 | 20 | //Modified from mojocolor http://code.google.com/p/mojocolors/ 21 | float i, f, p, q, t; 22 | float red = 0.0; 23 | float green = 0.0; 24 | float blue = 0.0; 25 | 26 | if( s == 0.0 ) { 27 | // achromatic (grey) 28 | red = green = blue = v; 29 | } else { 30 | if(h > 360.0) { 31 | h = h - 360.0; 32 | } 33 | if(h < 0.0) { 34 | h = 360.0 + h; 35 | } 36 | h = h / 60.0; 37 | // sector 0 to 5 38 | i = floor(h); 39 | f = h - i; 40 | // factorial part of h 41 | p = v * ( 1.0 - s ); 42 | q = v * ( 1.0 - s * f ); 43 | t = v * ( 1.0 - s * ( 1.0 - f ) ); 44 | 45 | if (i == 0.0){ 46 | red = v; 47 | green = t; 48 | blue = p; 49 | } else if (i == 1.0){ 50 | red = q; 51 | green = v; 52 | blue = p; 53 | } else if (i == 2.0){ 54 | red = p; 55 | green = v; 56 | blue = t; 57 | } else if (i == 3.0){ 58 | red = p; 59 | green = q; 60 | blue = v; 61 | } else if (i == 4.0){ 62 | red = t; 63 | green = p; 64 | blue = v; 65 | } else { 66 | // case 5: 67 | red = v; 68 | green = p; 69 | blue = q; 70 | } 71 | } 72 | target = float4(red,green,blue,ori.a); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/jitter.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "jitter"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 center 14 | < 15 | minValue: float2( 0.0, 0.0 ); 16 | maxValue: float2( 4096.0, 4096.0 ); 17 | defaultValue: float2( 0.0, 0.0 ); 18 | >; 19 | parameter float amplitude 20 | < 21 | minValue: 0.01; 22 | maxValue: 2.0; 23 | defaultValue: 0.1; 24 | >; 25 | 26 | void 27 | evaluatePixel() 28 | { 29 | 30 | float2 coord = outCoord(); 31 | 32 | float dx = coord.x - center.x; 33 | float dy = coord.y - center.y; 34 | 35 | float a = atan( dy , dx ); 36 | float r = sqrt( dx*dx + dy*dy ); 37 | 38 | a = a + mod( a , amplitude ) - amplitude / 2.0; 39 | 40 | float2 dest = float2( center.x + cos( a ) * r,center.y + sin( a ) * r ); 41 | dst = sampleNearest( src, dest ); 42 | 43 | } 44 | } 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/levels.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Levels 4 | < namespace : "com.anttikupila"; 5 | vendor : "Antti Kupila"; 6 | version : 1; 7 | description : "Levels filter"; 8 | > 9 | { 10 | 11 | parameter float2 red 12 | < 13 | minValue: float2(0,0); 14 | maxValue: float2(1,1); 15 | defaultValue: float2(0,1); 16 | >; 17 | 18 | parameter float2 green 19 | < 20 | minValue: float2(0,0); 21 | maxValue: float2(1,1); 22 | defaultValue: float2(0,1); 23 | >; 24 | 25 | parameter float2 blue 26 | < 27 | minValue: float2(0,0); 28 | maxValue: float2(1,1); 29 | defaultValue: float2(0,1); 30 | >; 31 | 32 | parameter float2 luminance 33 | < 34 | minValue: float2(0,0); 35 | maxValue: float2(1,1); 36 | defaultValue: float2(0,1); 37 | >; 38 | 39 | input image4 src; 40 | output pixel4 dst; 41 | 42 | void 43 | evaluatePixel() 44 | { 45 | 46 | pixel4 p = sampleNearest(src,outCoord()); 47 | 48 | float lumDiff = luminance[1] - luminance[0]; 49 | 50 | p.r = ((p.r - red[0])/(red[1] - red[0]) - luminance[0])/lumDiff; 51 | p.g = ((p.g - green[0])/(green[1] - green[0]) - luminance[0])/lumDiff; 52 | p.b = ((p.b - blue[0])/(blue[1] - blue[0]) - luminance[0])/lumDiff; 53 | 54 | dst = p; 55 | } 56 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/mercator.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "mercator"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | 14 | parameter float center 15 | < 16 | minValue: 0.0; 17 | maxValue: 4096.0; 18 | defaultValue: 0.0; 19 | >; 20 | parameter float width 21 | < 22 | 23 | minValue: 0.0; 24 | maxValue: 4096.0; 25 | defaultValue: 0.0; 26 | 27 | >; 28 | void 29 | evaluatePixel() 30 | { 31 | 32 | float pi = 3.14159265358979; 33 | 34 | float2 pos = outCoord(); 35 | 36 | float2 dest = float2( center - ( center - pos.x ) * sin( ( pi / width ) * pos.y ), pos.y ); 37 | 38 | dst = sampleNearest( src, dest ); 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/planes.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel NewFilter 4 | < namespace : "Planes"; 5 | vendor : "Mr.doob"; 6 | version : 1; 7 | description : "Planes effect"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 imgSize 14 | < 15 | defaultValue : float2(512.0, 512.0); 16 | minValue : float2(0.0,0.0); 17 | maxValue : float2(512.0,512.0); 18 | >; 19 | 20 | parameter float2 center 21 | < 22 | defaultValue : float2(256.0, 256.0); 23 | minValue : float2(0.0,0.0); 24 | maxValue : float2(512.0,512.0); 25 | >; 26 | 27 | parameter float2 offset; 28 | 29 | void evaluatePixel() 30 | { 31 | float2 pos = (outCoord() - center) / imgSize; 32 | 33 | float pi = 3.141592653589793; 34 | float a = atan(pos.y,pos.x); 35 | float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0)); 36 | 37 | float u = 0.0; 38 | float v = 0.0; 39 | float w = 0.0; 40 | 41 | u += offset.x; 42 | v += offset.y; 43 | 44 | u += .2/abs(pos.y); 45 | v += .2*pos.x/abs(pos.y); 46 | w += abs(pos.y * 2.0); 47 | 48 | u *= imgSize.x; 49 | v *= imgSize.y; 50 | 51 | if (u < 0.0) u += imgSize.x * ceil(-u / imgSize.x); 52 | if (v < 0.0) v += imgSize.y * ceil(-v / imgSize.y); 53 | if (u > imgSize.x) u -= imgSize.x * floor(u / imgSize.x); 54 | if (v > imgSize.y) v -= imgSize.y * floor(v / imgSize.y); 55 | 56 | dst = sampleNearest(src,float2(u, v)); 57 | dst.rgb *= w; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/random-pixelation.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel randomPixelation 4 | < 5 | namespace : "random size pixelation"; 6 | vendor : "pixelero"; 7 | version : 1; 8 | description : "random size pixelation"; 9 | > 10 | { 11 | parameter float n0 12 | < 13 | minValue:float(1); 14 | maxValue:float(100.0); 15 | defaultValue:float(13); 16 | >; 17 | parameter float n1 18 | < 19 | minValue:float(1); 20 | maxValue:float(100.0); 21 | defaultValue:float(17); 22 | >; 23 | parameter float n2 24 | < 25 | minValue:float(1); 26 | maxValue:float(100.0); 27 | defaultValue:float(19); 28 | >; 29 | 30 | parameter float n3 31 | < 32 | minValue:float(1); 33 | maxValue:float(100.0); 34 | defaultValue:float(21); 35 | >; 36 | 37 | parameter float n4 38 | < 39 | minValue:float(1); 40 | maxValue:float(100.0); 41 | defaultValue:float(23); 42 | >; 43 | 44 | parameter float2 randomPoint 45 | < 46 | minValue:float2(-100,-100); 47 | maxValue:float2(1000,1000); 48 | defaultValue:float2(217.5,781.6); 49 | >; 50 | 51 | input image4 src; 52 | output pixel4 dst; 53 | 54 | void 55 | evaluatePixel() 56 | { 57 | float2 p = outCoord() +randomPoint; 58 | p += mod(p,n4) - mod(p,n3); // Subtracting modulos 59 | 60 | float2 ds= mod(p,n0) +mod(p,n1) +mod(p,n2) -0.5*(n0+n1+n2); // Adding modulos 61 | 62 | dst = sample(src,outCoord() -0.333333*ds); 63 | } 64 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/rgb-adjustment.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel adjust 4 | < 5 | namespace : "example"; 6 | vendor : "example"; 7 | version : 1; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float3 multipliers 14 | < 15 | minValue: float3(0.0, 0.0, 0.0); 16 | maxValue: float3(5.0, 5.0, 5.0); 17 | defaultValue: float3(1.5, 1.0, 1.0); 18 | description: "multiplier for RGB channels"; 19 | >; 20 | 21 | void 22 | evaluatePixel() 23 | { 24 | dst = sampleNearest(src, outCoord()); 25 | dst.rgb *= multipliers; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/rgb-to-hsv.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel rgbToHSV 3 | < 4 | namespace: "net.onthewings.filters"; 5 | vendor: "Andy Li"; 6 | version: 1; 7 | description: "Convert RGB input to HSV."; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 target; 12 | 13 | void evaluatePixel() 14 | { 15 | pixel4 ori = sampleNearest(src,outCoord()); 16 | 17 | 18 | //Modified from wikipedia http://en.wikipedia.org/wiki/HSL_and_HSV and mojocolor http://code.google.com/p/mojocolors/ 19 | float min; 20 | float max; 21 | float delta; 22 | 23 | min = min(min(ori.r,ori.g),ori.b); 24 | max = max(max(ori.r,ori.g),ori.b); 25 | 26 | float h; 27 | float s; 28 | float v = max; 29 | delta = max - min; 30 | 31 | if( max != 0.0 ) { 32 | s = delta / max; // s 33 | 34 | if( ori.r == max ) { 35 | h = ( ori.g - ori.b ) / delta; // between yellow & magenta 36 | } else if ( ori.g == max ) { 37 | h = 2.0 + ( ori.b - ori.r ) / delta; // between cyan & yellow 38 | } else { 39 | h = 4.0 + ( ori.r - ori.g ) / delta; // between magenta & cyan 40 | } 41 | h *= 60.0; 42 | // degrees 43 | if( h < 0.0 ) { 44 | h += 360.0; 45 | } 46 | } else { 47 | s = 0.0; 48 | h = -1.0; 49 | } 50 | //hsv is calculated at this point 51 | //h: 0 - 360 52 | //s: 0 - 1 53 | //v: 0 - 1 54 | 55 | target = float4(h/360.0,s,v,ori.a); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/ripple-blocks.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel RippleBlocks 4 | < namespace : "Allen Chou"; 5 | vendor : ""; 6 | version : 1; 7 | description : "box-shaped ripple effect"; 8 | > 9 | { 10 | parameter float2 amplitude 11 | < 12 | minValue: float2( 0, 0); 13 | maxValue: float2(100, 100); 14 | defaultValue: float2( 20, 20); 15 | >; 16 | 17 | parameter float2 wavelength 18 | < 19 | minValue: float2( 1.0, 1.0); 20 | maxValue: float2( 100.0, 100.0); 21 | defaultValue: float2( 10.0, 10.0); 22 | >; 23 | 24 | parameter float2 phase 25 | < 26 | minValue: float2( 0.0, 0.0); 27 | maxValue: float2(6.283, 6.283); 28 | defaultValue: float2( 0.0, 0.0); 29 | >; 30 | 31 | input image4 src; 32 | output pixel4 dst; 33 | 34 | void 35 | evaluatePixel() 36 | { 37 | float2 coord = outCoord(); 38 | coord.x += amplitude.x * sin((coord.x / wavelength.x) + phase.x); 39 | coord.y += amplitude.y * cos((coord.y / wavelength.y) + phase.y); 40 | 41 | dst = sample(src, float2(coord.x, coord.y)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/sample-linear.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel untitled 4 | < namespace : "Your Namespace"; 5 | vendor : "Your Vendor"; 6 | version : 1; 7 | > 8 | { 9 | input image4 src; 10 | output pixel4 dst; 11 | 12 | void 13 | evaluatePixel() 14 | { 15 | float2 c1 = outCoord(); 16 | float2 c2; 17 | if (c1.y == 0.5) { 18 | c2 = float2(10.5, 10.5); 19 | } else if (c1.y < 50.0) { 20 | c2 = float2(9.5, 9.5); 21 | } else if (c1.y < 100.0) { 22 | c2 = float2(9.5, 10.0); 23 | } else if (c1.y < 150.0) { 24 | c2 = float2(10.0, 10.0); 25 | } else if (c1.y < 200.0) { 26 | c2 = float2(10.5, 10.0); 27 | } else if (c1.y < 250.0) { 28 | c2 = float2(10.5, 10.5); 29 | } else if (c1.y < 300.0) { 30 | c2 = float2(10.25, 10.25); 31 | } else if (c1.y < 350.0) { 32 | c2 = float2(10.75, 10.75); 33 | } else { 34 | c2 = float2(9.75, 9.75); 35 | } 36 | dst = sample(src, c2); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/sample-nearest.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel untitled 4 | < namespace : "Your Namespace"; 5 | vendor : "Your Vendor"; 6 | version : 1; 7 | > 8 | { 9 | input image4 src; 10 | output pixel4 dst; 11 | 12 | void 13 | evaluatePixel() 14 | { 15 | float2 c1 = outCoord(); 16 | float2 c2; 17 | if (c1.y < 200.0) { 18 | c2 = float2(9.95, 10.0); 19 | } else { 20 | c2 = float2(10.05, 10.05); 21 | } 22 | dst = sampleNearest(src, c2); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/sharpen.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kernel sharpen 5 | < namespace : "com.rphelan"; 6 | vendor : "Ryan Phelan"; 7 | version : 1; 8 | description : "Applies a sharpen effect to an image."; > 9 | { 10 | parameter float amount 11 | < 12 | minValue:0.0; 13 | maxValue:20.0; 14 | defaultValue:1.0; 15 | >; 16 | 17 | parameter float radius 18 | < 19 | minValue:0.0; 20 | maxValue:1.0; 21 | defaultValue:0.1; 22 | >; 23 | 24 | input image4 src; 25 | output float4 dst; 26 | 27 | void 28 | evaluatePixel() 29 | { 30 | // Obtain the input pixel coordinate 31 | float2 coord = outCoord(); 32 | 33 | // Obtain the input pixel color 34 | float4 inputColor = sampleLinear(src, coord); 35 | 36 | // Start with the original color 37 | dst.rgb = inputColor.rgb; 38 | 39 | // Offset the color by the surrounding pixels 40 | float2 hOffset = float2(radius, 0.0); 41 | float2 vOffset = float2(0.0, radius); 42 | float4 left = sampleLinear(src, coord - hOffset) * amount; 43 | float4 right = sampleLinear(src, coord + hOffset) * amount; 44 | float4 top = sampleLinear(src, coord - vOffset) * amount; 45 | float4 bottom = sampleLinear(src, coord + vOffset) * amount; 46 | 47 | dst.rgb += (top.rgb); 48 | dst.rgb -= (bottom.rgb); 49 | dst.rgb += left.rgb; 50 | dst.rgb -= right.rgb; 51 | 52 | // set the alpha value equal to the alpha of the input 53 | dst.a = inputColor.a; 54 | } 55 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/simple-point-light.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel SimplePointLight 4 | < namespace : "navhali"; 5 | vendor : "John Engler"; 6 | version : 0; 7 | description : "Simple point light--playing with PixelBender"; 8 | > 9 | { 10 | parameter float2 center 11 | < 12 | minValue: float2(0.0,0.0); 13 | maxValue: float2(4096.0,4096.0); 14 | defaultValue: float2(0.0,0.0); 15 | >; 16 | 17 | parameter float attenuationDelta 18 | < 19 | minValue: float(0.0); 20 | maxValue: float(2000.0); 21 | defaultValue: float(175.0); 22 | >; 23 | 24 | parameter float attenuationSpeed 25 | < 26 | minValue: float(0.0); 27 | maxValue: float(2.0); 28 | defaultValue: float(1.0); 29 | >; 30 | 31 | parameter float attenuationDecay 32 | < 33 | minValue: float(0.0); 34 | maxValue: float(2.0); 35 | defaultValue: float(1.0); 36 | >; 37 | 38 | input image4 src; 39 | output pixel4 dst; 40 | 41 | void 42 | evaluatePixel() 43 | { 44 | float2 out_pixel_coord = outCoord(); 45 | float attenuation = pow(attenuationDelta/pow(distance(out_pixel_coord, center), attenuationDecay), attenuationSpeed); 46 | dst = attenuation * sampleNearest(src, out_pixel_coord); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/simple.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel simple 4 | < namespace : "Your Namespace"; 5 | vendor : "Your Vendor"; 6 | version : 1; 7 | > 8 | { 9 | parameter float3x3 transform 10 | < 11 | minValue:float3x3( 12 | -1.0, -1.0, -1.0, 13 | -1.0, -1.0, -1.0, 14 | -1.0, -1.0, -1.0 15 | ); 16 | 17 | maxValue:float3x3( 18 | 1.0, 1.0, 1.0, 19 | 1.0, 1.0, 1.0, 20 | 1.0, 1.0, 1.0 21 | ); 22 | defaultValue:float3x3( 23 | 0.5, 0.0, 0.0, 24 | 0.3, 1.0, 0.7, 25 | 0.1, 0.3, 0.8 26 | ); 27 | >; 28 | 29 | input image3 src; 30 | output pixel3 dst; 31 | 32 | void 33 | evaluatePixel() 34 | { 35 | dst = sampleNearest(src,outCoord()); 36 | dst = transform * dst; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/skin-color-filter.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel NewFilter 4 | < namespace : "me.cosmodro.filters"; 5 | vendor : "Steve Shipman"; 6 | version : 1; 7 | description : "Skin Color filter"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float CbMin 14 | < 15 | minValue:0.0; 16 | maxValue:1.0; 17 | defaultValue:105.0/255.0; 18 | >; 19 | 20 | parameter float CbMax 21 | < 22 | minValue:0.0; 23 | maxValue:1.0; 24 | defaultValue:135.0/255.0; 25 | >; 26 | 27 | parameter float CrMin 28 | < 29 | minValue:0.0; 30 | maxValue:1.0; 31 | defaultValue:140.0/255.0; 32 | >; 33 | 34 | parameter float CrMax 35 | < 36 | minValue:0.0; 37 | maxValue:1.0; 38 | defaultValue:165.0/255.0; 39 | >; 40 | 41 | 42 | void 43 | evaluatePixel() 44 | { 45 | dst = sampleNearest(src,outCoord()); 46 | pixel3 ycbcr = dst.rgb * float3x3(0.0, 0.0, 0.0, -0.168736, -0.331264, 0.5, 0.5, -0.418688, -0.081312) + float3(0.0, 0.5, 0.5); 47 | 48 | if ((ycbcr.g >= CbMin) && (ycbcr.g <= CbMax) && (ycbcr.b >= CrMin) && (ycbcr.b <= CrMax)){ 49 | dst.rgb = float3(1); 50 | }else{ 51 | dst.rgb = float3(0); 52 | } 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/slices.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "slices"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | /** 14 | * horizontal block size (should remain lower than image width) 15 | */ 16 | parameter float horizontal 17 | < 18 | minValue: 0.0; 19 | maxValue: 2880.0; 20 | defaultValue: 10.0; 21 | >; 22 | /** 23 | * vertical block size (should remain lower than image height) 24 | */ 25 | parameter float vertical 26 | < 27 | minValue: 0.0; 28 | maxValue: 2880.0; 29 | defaultValue: 10.0; 30 | >; 31 | 32 | void 33 | evaluatePixel() 34 | { 35 | 36 | float2 coord = outCoord(); 37 | 38 | coord.x += vertical * ( ( cos( coord[ 1 ] / vertical) > 0.0 ) ? 1.0 : -1.0 ); 39 | coord.y += horizontal * ( ( cos( coord[ 0 ] / horizontal ) > 0.0 ) ? 1.0 : -1.0 ); 40 | 41 | dst = sampleNearest( src, coord ); 42 | 43 | } 44 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/smudger.pbk: -------------------------------------------------------------------------------- 1 | 2 | ///////////////////////////////////////////////////// 3 | // smudger 4 | // 5 | // author : frank reitberger 6 | // blog : http://www.prinzipiell.com 7 | // copyright 2008 8 | // 9 | ///////////////////////////////////////////////////// 10 | 11 | 12 | 13 | kernel smudge 14 | 15 | < 16 | namespace: "smudger"; 17 | vendor: "Frank Reitberger"; 18 | version: 1; 19 | description: "generates a smudged pattern"; 20 | > 21 | 22 | { 23 | parameter float amount 24 | < 25 | minValue: float(0.0); 26 | maxValue: float(5.0); 27 | defaultValue: float(0.5); 28 | description: "amount"; 29 | >; 30 | 31 | 32 | input image4 src; 33 | output pixel4 dst; 34 | 35 | void 36 | evaluatePixel() 37 | { 38 | float2 pos = outCoord(); 39 | 40 | ////////////////////////// 41 | // patterize transition 42 | ////////////////////////// 43 | float nx = 5.0 * (cos(pos.y / 5.0)); 44 | float ny = 5.0 * (cos(pos.x / 6.0)); 45 | float2 pnt = float2( nx*ny , nx* ny ); 46 | dst = sampleNearest( src, outCoord() + pnt * amount); 47 | 48 | 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/tint.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Tint 4 | < 5 | namespace: "Allen Chou"; 6 | vendor: ""; 7 | version: 1; 8 | description: "tint effect"; 9 | > 10 | { 11 | parameter float amount 12 | < 13 | minValue: -1.0; 14 | maxValue: 1.0; 15 | defaultValue: 0.0; 16 | >; 17 | 18 | parameter float3 color 19 | < 20 | minValue: float3(0, 0, 0); 21 | maxValue: float3(1, 1, 1); 22 | defaultValue: float3(0, 0, 0); 23 | >; 24 | 25 | input image4 src; 26 | output pixel4 dst; 27 | 28 | void evaluatePixel() 29 | { 30 | float4 rgba; 31 | float r, g, b, a; 32 | 33 | // sample pixel value 34 | rgba = sampleNearest(src, outCoord()); 35 | 36 | //calculate luminance 37 | float luminance = rgba.r * 0.3086 + 38 | rgba.g * 0.6094 + 39 | rgba.b * 0.0820; 40 | 41 | //interpolation 42 | r = (color.r + luminance) * amount + rgba.r * (1.0 - amount); 43 | g = (color.g + luminance) * amount + rgba.g * (1.0 - amount); 44 | b = (color.b + luminance) * amount + rgba.b * (1.0 - amount); 45 | 46 | //range assurance 47 | clamp(r, 0.0, 1.0); 48 | clamp(g, 0.0, 1.0); 49 | clamp(b, 0.0, 1.0); 50 | 51 | // set output pixel 52 | dst = float4(r, g, b, rgba.a); 53 | } 54 | } -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/tunnel.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel NewFilter 4 | < namespace : "Tunnel"; 5 | vendor : "Mr.doob"; 6 | version : 1; 7 | description : "Tunnel effect"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 imgSize 14 | < 15 | defaultValue : float2(512.0, 512.0); 16 | minValue : float2(0.0,0.0); 17 | maxValue : float2(512.0,512.0); 18 | >; 19 | 20 | parameter float2 center 21 | < 22 | defaultValue : float2(256.0, 256.0); 23 | minValue : float2(0.0,0.0); 24 | maxValue : float2(512.0,512.0); 25 | >; 26 | 27 | parameter float2 offset; 28 | 29 | void evaluatePixel() 30 | { 31 | float2 pos = (outCoord() - center) / imgSize; 32 | 33 | float pi = 3.141592653589793; 34 | float a = atan(pos.y,pos.x); 35 | float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0)); 36 | 37 | float u = 0.0; 38 | float v = 0.0; 39 | float w = 0.0; 40 | 41 | u += offset.x; 42 | v += offset.y; 43 | 44 | u += 1.0/r; 45 | v += 3.0*a/pi; 46 | w += r*2.0; 47 | 48 | u *= imgSize.x; 49 | v *= imgSize.y; 50 | 51 | if (u < 0.0) u += imgSize.x * ceil(-u / imgSize.x); 52 | if (v < 0.0) v += imgSize.y * ceil(-v / imgSize.y); 53 | if (u > imgSize.x) u -= imgSize.x * floor(u / imgSize.x); 54 | if (v > imgSize.y) v -= imgSize.y * floor(v / imgSize.y); 55 | 56 | dst = sampleNearest(src,float2(u, v)); 57 | dst.rgb *= w; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/tunnel4.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel NewFilter 4 | < namespace : "Tunnel 4"; 5 | vendor : "Mr.doob"; 6 | version : 1; 7 | description : "Tunnel effect 4"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 imgSize 14 | < 15 | defaultValue : float2(512.0, 512.0); 16 | minValue : float2(0.0,0.0); 17 | maxValue : float2(512.0,512.0); 18 | >; 19 | 20 | parameter float2 center 21 | < 22 | defaultValue : float2(256.0, 256.0); 23 | minValue : float2(0.0,0.0); 24 | maxValue : float2(512.0,512.0); 25 | >; 26 | 27 | parameter float2 offset; 28 | 29 | void evaluatePixel() 30 | { 31 | float2 pos = (outCoord() - center) / imgSize; 32 | 33 | float pi = 3.141592653589793; 34 | float a = atan(pos.y,pos.x); 35 | float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0)); 36 | 37 | float u = 0.0; 38 | float v = 0.0; 39 | float w = 0.0; 40 | 41 | u += offset.x; 42 | v += offset.y; 43 | 44 | u += 3.0*a/pi; 45 | v += abs(cos(1.5*a)/r); 46 | w += .2+.5*abs(cos(1.5*a)/r); 47 | 48 | u *= imgSize.x; 49 | v *= imgSize.y; 50 | 51 | if (u < 0.0) u += imgSize.x * ceil(-u / imgSize.x); 52 | if (v < 0.0) v += imgSize.y * ceil(-v / imgSize.y); 53 | if (u > imgSize.x) u -= imgSize.x * floor(u / imgSize.x); 54 | if (v > imgSize.y) v -= imgSize.y * floor(v / imgSize.y); 55 | 56 | dst = sampleNearest(src,float2(u, v)); 57 | dst.rgb *= w; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /pb2zig/test/pbk-samples/wave.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "wave"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 center 14 | < 15 | minValue: float2( 0.0, 0.0 ); 16 | maxValue: float2( 4096.0, 4096.0 ); 17 | defaultValue: float2( 0.0, 0.0 ); 18 | >; 19 | parameter float amplitude 20 | < 21 | minValue: 0.0; 22 | maxValue: 100.0; 23 | defaultValue: 10.0; 24 | >; 25 | parameter float frequency 26 | < 27 | minValue: 0.0; 28 | maxValue: 100.0; 29 | defaultValue: 5.0; 30 | >; 31 | 32 | 33 | void 34 | evaluatePixel() 35 | { 36 | 37 | float2 coord = outCoord(); 38 | 39 | float dx = coord.x - center.x; 40 | float dy = coord.y - center.y; 41 | 42 | float a = atan( dy , dx ); 43 | float r = sqrt( dx*dx + dy*dy ); 44 | 45 | r += cos( r / frequency ) * amplitude; 46 | 47 | float2 dest = float2( 0.0,0.0 ); 48 | dest.x = center.x + cos( a ) * r; 49 | dest.y = center.y + sin( a ) * r; 50 | 51 | dst = sampleNearest( src, dest ); 52 | 53 | } 54 | } 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /pb2zig/test/util.test.js: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | 3 | import { walk } from '../src/utils.js'; 4 | 5 | describe('Utilities', function() { 6 | describe('walk', function() { 7 | it('should scan through all items when callback returns nothing', function() { 8 | let last = 0; 9 | walk([ 1, 2, 3 ], (v) => { 10 | last = v; 11 | }); 12 | expect(last).to.equal(3); 13 | walk([ { a: 1 }, { a: 2 } ], (v) => { 14 | last = v; 15 | }); 16 | expect(last).to.equal(2); 17 | }) 18 | it('should stop when callback returns false', function() { 19 | let last = 0; 20 | walk([ 1, 2, 3 ], (v) => { 21 | last = v; 22 | return false; 23 | }); 24 | expect(last).to.equal(1); 25 | walk([ { a: 1 }, { a: 2 } ], (v) => { 26 | last = v; 27 | if (typeof(v) === 'number') { 28 | return false; 29 | } 30 | }); 31 | expect(last).to.equal(1); 32 | }) 33 | }) 34 | }) 35 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/img/helicopter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-1/img/helicopter.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/img/ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-1/img/ipad.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/img/malgorzata-socha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-1/img/malgorzata-socha.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | pb2zig demo 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pb2zig-web-demo-1", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^19.0.10", 18 | "@types/react-dom": "^19.0.4", 19 | "@vitejs/plugin-react-swc": "^3.8.0", 20 | "eslint": "^9.21.0", 21 | "eslint-plugin-react": "^7.37.4", 22 | "eslint-plugin-react-hooks": "^5.1.0", 23 | "eslint-plugin-react-refresh": "^0.4.19", 24 | "rollup-plugin-pb2zig": "^0.14.0", 25 | "vite": "^6.2.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/alpha-from-max-color.pbk: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * ADOBE SYSTEMS INCORPORATED 4 | * Copyright (C) 2010 Adobe Systems Incorporated 5 | * All Rights Reserved. 6 | * 7 | * NOTICE: Adobe permits you to use, modify, and distribute this file in 8 | * accordance with the terms of the Adobe license agreement accompanying it. 9 | * If you have received this file from a source other than Adobe, then your 10 | * use, modification, or distribution of it requires the prior written 11 | * permission of Adobe. 12 | * 13 | *****************************************************************************/ 14 | 15 | 16 | kernel AlphaFromMaxColor 17 | < 18 | namespace: "AfterEffects"; 19 | vendor : "Adobe Systems Incorporated"; 20 | version : 2; 21 | description : "Estimate alpha based on color channels."; 22 | displayname: "Alpha From Max Color"; 23 | category: "Utility"; 24 | > 25 | { 26 | 27 | input image4 src; 28 | output pixel4 dst; 29 | 30 | void 31 | evaluatePixel() 32 | { 33 | dst = sampleNearest(src, outCoord()); 34 | dst.rgb *= dst.a; // premultiply first. does nothing on opaque 35 | 36 | dst.a = max(max(dst.r, dst.g), dst.b); // take max of color components 37 | dst.a *= 254.0/255.0; // and scale slightly. 38 | 39 | // assume incoming colors are premultiplied against black 40 | // alpha. unmultiply if dst.a != 0 [otherwise div/0] 41 | if (dst.a != 0.0) { 42 | dst.rgb /= dst.a; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/brightness-threshold.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel brightnessThreshold 3 | < 4 | namespace: "net.onthewings.filters"; 5 | vendor: "Andy Li"; 6 | version: 1; 7 | description: "Thresholding bases on brightness."; 8 | > 9 | { 10 | parameter float2 threshold < 11 | defaultValue: float2(0.0,1.0); 12 | description:"Min and max limits."; 13 | >; 14 | parameter float4 outputColor1 < 15 | defaultValue: float4(0.0,0.0,0.0,1.0); 16 | description:"Color for thresholded area.colorForAllPassedArea"; 17 | >; 18 | parameter float4 outputColor2 < 19 | defaultValue: float4(1.0,1.0,1.0,1.0); 20 | description:"Color for all passed area"; 21 | >; 22 | 23 | input image4 source; 24 | output pixel4 target; 25 | 26 | void evaluatePixel() 27 | { 28 | pixel4 ori = sampleNearest(source, outCoord()); 29 | float brightness = 0.2126*ori.r + 0.7152*ori.g + 0.0722*ori.b; 30 | if (brightness < threshold[0] || brightness > threshold[1]) 31 | target = outputColor1; 32 | else 33 | target = outputColor2; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/bulge.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "bulge"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 center 14 | < 15 | minValue: float2( 0.0, 0.0 ); 16 | maxValue: float2( 4096.0, 4096.0 ); 17 | defaultValue: float2( 0.0, 0.0 ); 18 | >; 19 | 20 | parameter float amplitude 21 | < 22 | minValue: 0.0; 23 | maxValue: 100.0; 24 | defaultValue: 3.0; 25 | >; 26 | 27 | void 28 | evaluatePixel() 29 | { 30 | 31 | float2 coord = outCoord(); 32 | 33 | float dx = coord.x - center.x; 34 | float dy = coord.y - center.y; 35 | 36 | float a = atan( dy , dx ); 37 | float r = sqrt( dx*dx + dy*dy ); 38 | 39 | r *= r / sqrt( center.x * center.y ) / amplitude; 40 | 41 | float2 dest = float2( center.x + cos( a ) * r,center.y + sin( a ) * r ); 42 | dst = sampleNearest( src, dest ); 43 | 44 | } 45 | } 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/channel-threshold.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel channelThreshold 3 | < 4 | namespace: "net.onthewings.filters"; 5 | vendor: "Andy Li"; 6 | version: 1; 7 | description: "Thresholding bases on the channels. Only the pixels passed ALL thresholds will be white (or color you configed)."; 8 | > 9 | { 10 | parameter float2 threshold0 < 11 | defaultValue: float2(0.0,1.0); 12 | description:"For red channel."; 13 | >; 14 | parameter float2 threshold1 < 15 | defaultValue: float2(0.0,1.0); 16 | description:"For green channel."; 17 | >; 18 | parameter float2 threshold2 < 19 | defaultValue: float2(0.0,1.0); 20 | description:"For blue channel."; 21 | >; 22 | parameter float2 threshold3 < 23 | defaultValue: float2(0.0,1.0); 24 | description:"For alpha channel."; 25 | >; 26 | parameter float4 outputColor1 < 27 | defaultValue: float4(0.0,0.0,0.0,1.0); 28 | description:"Color for thresholded area.colorForAllPassedArea"; 29 | >; 30 | parameter float4 outputColor2 < 31 | defaultValue: float4(1.0,1.0,1.0,1.0); 32 | description:"Color for all passed area"; 33 | >; 34 | 35 | input image4 source; 36 | output pixel4 target; 37 | 38 | void evaluatePixel() 39 | { 40 | pixel4 ori = sampleNearest(source, outCoord()); 41 | 42 | if (ori[0]threshold0[1] || 43 | ori[1]threshold1[1] || 44 | ori[2]threshold2[1] || 45 | ori[3]threshold3[1]) 46 | target = outputColor1; 47 | else 48 | target = outputColor2; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/checker-fill.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel CheckerFill 4 | < namespace : "com.adobe.example"; 5 | vendor : "Adobe Systems Inc."; 6 | version : 1; 7 | description : "A checkered field generator"; 8 | > 9 | { 10 | output pixel4 dst; 11 | 12 | parameter float checkerSize 13 | < 14 | defaultValue : 10.0; 15 | minValue : 1.0; 16 | maxValue : 75.0; 17 | >; 18 | 19 | parameter pixel4 colorA 20 | < 21 | defaultValue : pixel4(0.0, 1.0, 1.0, 1.0); 22 | >; 23 | 24 | parameter pixel4 colorB 25 | < 26 | defaultValue : pixel4( 0.0, 0.0, 0.0, 1.0 ); 27 | >; 28 | 29 | void evaluatePixel() 30 | { 31 | float2 position = outCoord(); 32 | float vertical = mod(position.x, checkerSize * 2.0); 33 | float horizontal = mod(position.y, checkerSize * 2.0); 34 | dst = (( vertical < checkerSize ) ^^ ( horizontal < checkerSize )) ? colorA : colorB; 35 | } 36 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/deformer.pbk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-1/pbk/deformer.pbk -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/difference-key.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel DifferenceKey 4 | < namespace : "com.quasimondo"; 5 | vendor : "Quasimondo"; 6 | version : 1; 7 | description : "A simple difference key for chroma keying"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float3 keyColor; 14 | 15 | parameter float tolerance 16 | < 17 | minValue: 0.0; 18 | maxValue: 3.0; 19 | defaultValue: 0.02; 20 | >; 21 | 22 | parameter float ramp 23 | < 24 | minValue: 0.0; 25 | maxValue: 1.0; 26 | defaultValue: 0.005; 27 | >; 28 | 29 | parameter float gamma 30 | < 31 | minValue: 0.0; 32 | maxValue: 10.0; 33 | defaultValue: 1.00; 34 | >; 35 | 36 | void 37 | evaluatePixel() 38 | { 39 | dst = sampleNearest(src,outCoord()); 40 | float diff = length( dst.rgb - keyColor ); 41 | if ( diff < tolerance ) 42 | { 43 | dst.a = 0.0; 44 | } else if ( diff < tolerance + ramp ) 45 | { 46 | dst.a = pow( (diff - tolerance) / ramp, gamma ); 47 | } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/dilate-cross.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Dilate_cross 4 | < namespace : "com.gasubasu"; 5 | vendor : "gasubasu"; 6 | version : 1; 7 | description : "flash compatible dilate filter 'cross'"; 8 | > 9 | { 10 | input image4 i; 11 | output pixel4 o; 12 | 13 | void 14 | evaluatePixel() 15 | { 16 | float2 c = outCoord(); 17 | float2 p; 18 | pixel4 n; 19 | 20 | o=pixel4(0.0,0.0,0.0,1.0); 21 | 22 | p=float2( 0, 0);n=sampleNearest(i,c+p);if(o.r 2 | 3 | kernel Dilate_quad 4 | < namespace : "com.gasubasu"; 5 | vendor : "gasubasu"; 6 | version : 1; 7 | description : "flash compatible dilate filter 'quad'"; 8 | > 9 | { 10 | input image4 i; 11 | output pixel4 o; 12 | 13 | void 14 | evaluatePixel() 15 | { 16 | float2 c = outCoord(); 17 | float2 p; 18 | pixel4 n; 19 | 20 | o=pixel4(0.0,0.0,0.0,1.0); 21 | 22 | p=float2(-1,-1);n=sampleNearest(i,c+p);if(o.r 2 | kernel DynamicColorPalette 3 | < namespace : "thelab.org"; 4 | vendor : "Eduardo.Costa"; 5 | version : 1; 6 | description : "Manipulates the Color Palette of the bitmap"; 7 | > 8 | { 9 | input image4 src1; 10 | 11 | output pixel4 dst; 12 | 13 | parameter int palette 14 | < 15 | minValue:int(1); 16 | maxValue:int(128); 17 | defaultValue:int(64); 18 | >; 19 | 20 | 21 | void 22 | evaluatePixel() 23 | { 24 | float2 uv = outCoord(); 25 | dst = sampleLinear(src1, uv); 26 | 27 | dst = floor(dst*floor(float(palette)))/floor(float(palette)); 28 | 29 | } 30 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/erode-cross.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Erode_cross 4 | < namespace : "com.gasubasu"; 5 | vendor : "gasubasu"; 6 | version : 1; 7 | description : "flash compatible erode filter 'cross'"; 8 | > 9 | { 10 | input image4 i; 11 | output pixel4 o; 12 | 13 | void 14 | evaluatePixel() 15 | { 16 | float2 c = outCoord(); 17 | float2 p; 18 | pixel4 n; 19 | 20 | o=pixel4(1.0,1.0,1.0,1.0); 21 | p=float2( 0, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 22 | p=float2(-1, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 23 | p=float2( 0,-1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 24 | p=float2( 0, 1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 25 | p=float2( 1, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 26 | p=float2(-2, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 27 | p=float2( 2, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 28 | p=float2( 0,-2);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 29 | p=float2( 0, 2);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 30 | 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/erode-quad.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Erode_quad 4 | < namespace : "com.gasubasu"; 5 | vendor : "gasubasu"; 6 | version : 1; 7 | description : "flash compatible erode filter 'quad'"; 8 | > 9 | { 10 | input image4 i; 11 | output pixel4 o; 12 | 13 | void 14 | evaluatePixel() 15 | { 16 | float2 c = outCoord(); 17 | float2 p; 18 | pixel4 n; 19 | 20 | o=pixel4(1.0,1.0,1.0,1.0); 21 | p=float2(-1,-1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 22 | p=float2(-1, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 23 | p=float2(-1, 1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 24 | p=float2( 0,-1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 25 | p=float2( 0, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 26 | p=float2( 0, 1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 27 | p=float2( 1,-1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 28 | p=float2( 1, 0);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 29 | p=float2( 1, 1);n=sampleNearest(i,c+p);if(o.r>n.r)o.r=n.r;if(o.g>n.g)o.g=n.g;if(o.b>n.b)o.b=n.b; 30 | 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/high-contrast.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel HighContrastFilter 4 | < namespace : "com.mimswright"; 5 | vendor : "MimsWright.com"; 6 | version : 1; 7 | description : "extreme contrast filter that converts to either 1 or 0 based on brightness of source."; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float threshhold 14 | ; 17 | 18 | parameter int invert 19 | ; 20 | 21 | void 22 | evaluatePixel() 23 | { 24 | pixel4 px = sampleNearest(src, outCoord()); 25 | float brightest = max( px.r, max( px.g, px.b)); 26 | float v; 27 | if ( invert > 0 ) { 28 | v = step(threshhold, (brightest * 255.0)); 29 | } else { 30 | v = step((brightest * 255.0), threshhold); 31 | } 32 | dst = pixel4(v,v,v,v); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/jitter.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "jitter"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 center 14 | < 15 | minValue: float2( 0.0, 0.0 ); 16 | maxValue: float2( 4096.0, 4096.0 ); 17 | defaultValue: float2( 0.0, 0.0 ); 18 | >; 19 | parameter float amplitude 20 | < 21 | minValue: 0.01; 22 | maxValue: 2.0; 23 | defaultValue: 0.1; 24 | >; 25 | 26 | void 27 | evaluatePixel() 28 | { 29 | 30 | float2 coord = outCoord(); 31 | 32 | float dx = coord.x - center.x; 33 | float dy = coord.y - center.y; 34 | 35 | float a = atan( dy , dx ); 36 | float r = sqrt( dx*dx + dy*dy ); 37 | 38 | a = a + mod( a , amplitude ) - amplitude / 2.0; 39 | 40 | float2 dest = float2( center.x + cos( a ) * r,center.y + sin( a ) * r ); 41 | dst = sampleNearest( src, dest ); 42 | 43 | } 44 | } 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/levels.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Levels 4 | < namespace : "com.anttikupila"; 5 | vendor : "Antti Kupila"; 6 | version : 1; 7 | description : "Levels filter"; 8 | > 9 | { 10 | 11 | parameter float2 red 12 | < 13 | minValue: float2(0,0); 14 | maxValue: float2(1,1); 15 | defaultValue: float2(0,1); 16 | >; 17 | 18 | parameter float2 green 19 | < 20 | minValue: float2(0,0); 21 | maxValue: float2(1,1); 22 | defaultValue: float2(0,1); 23 | >; 24 | 25 | parameter float2 blue 26 | < 27 | minValue: float2(0,0); 28 | maxValue: float2(1,1); 29 | defaultValue: float2(0,1); 30 | >; 31 | 32 | parameter float2 luminance 33 | < 34 | minValue: float2(0,0); 35 | maxValue: float2(1,1); 36 | defaultValue: float2(0,1); 37 | >; 38 | 39 | input image4 src; 40 | output pixel4 dst; 41 | 42 | void 43 | evaluatePixel() 44 | { 45 | 46 | pixel4 p = sampleNearest(src,outCoord()); 47 | 48 | float lumDiff = luminance[1] - luminance[0]; 49 | 50 | p.r = ((p.r - red[0])/(red[1] - red[0]) - luminance[0])/lumDiff; 51 | p.g = ((p.g - green[0])/(green[1] - green[0]) - luminance[0])/lumDiff; 52 | p.b = ((p.b - blue[0])/(blue[1] - blue[0]) - luminance[0])/lumDiff; 53 | 54 | dst = p; 55 | } 56 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/mercator.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "mercator"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | 14 | parameter float center 15 | < 16 | minValue: 0.0; 17 | maxValue: 4096.0; 18 | defaultValue: 0.0; 19 | >; 20 | parameter float width 21 | < 22 | 23 | minValue: 0.0; 24 | maxValue: 4096.0; 25 | defaultValue: 0.0; 26 | 27 | >; 28 | void 29 | evaluatePixel() 30 | { 31 | 32 | float pi = 3.14159265358979; 33 | 34 | float2 pos = outCoord(); 35 | 36 | float2 dest = float2( center - ( center - pos.x ) * sin( ( pi / width ) * pos.y ), pos.y ); 37 | 38 | dst = sampleNearest( src, dest ); 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/planes.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel NewFilter 4 | < namespace : "Planes"; 5 | vendor : "Mr.doob"; 6 | version : 1; 7 | description : "Planes effect"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 imgSize 14 | < 15 | defaultValue : float2(512.0, 512.0); 16 | minValue : float2(0.0,0.0); 17 | maxValue : float2(512.0,512.0); 18 | >; 19 | 20 | parameter float2 center 21 | < 22 | defaultValue : float2(256.0, 256.0); 23 | minValue : float2(0.0,0.0); 24 | maxValue : float2(512.0,512.0); 25 | >; 26 | 27 | parameter float2 offset; 28 | 29 | void evaluatePixel() 30 | { 31 | float2 pos = (outCoord() - center) / imgSize; 32 | 33 | float pi = 3.141592653589793; 34 | float a = atan(pos.y,pos.x); 35 | float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0)); 36 | 37 | float u = 0.0; 38 | float v = 0.0; 39 | float w = 0.0; 40 | 41 | u += offset.x; 42 | v += offset.y; 43 | 44 | u += .2/abs(pos.y); 45 | v += .2*pos.x/abs(pos.y); 46 | w += abs(pos.y * 2.0); 47 | 48 | u *= imgSize.x; 49 | v *= imgSize.y; 50 | 51 | if (u < 0.0) u += imgSize.x * ceil(-u / imgSize.x); 52 | if (v < 0.0) v += imgSize.y * ceil(-v / imgSize.y); 53 | if (u > imgSize.x) u -= imgSize.x * floor(u / imgSize.x); 54 | if (v > imgSize.y) v -= imgSize.y * floor(v / imgSize.y); 55 | 56 | dst = sampleNearest(src,float2(u, v)); 57 | dst.rgb *= w; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/random-pixelation.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel randomPixelation 4 | < 5 | namespace : "random size pixelation"; 6 | vendor : "pixelero"; 7 | version : 1; 8 | description : "random size pixelation"; 9 | > 10 | { 11 | parameter float n0 12 | < 13 | minValue:float(1); 14 | maxValue:float(100.0); 15 | defaultValue:float(13); 16 | >; 17 | parameter float n1 18 | < 19 | minValue:float(1); 20 | maxValue:float(100.0); 21 | defaultValue:float(17); 22 | >; 23 | parameter float n2 24 | < 25 | minValue:float(1); 26 | maxValue:float(100.0); 27 | defaultValue:float(19); 28 | >; 29 | 30 | parameter float n3 31 | < 32 | minValue:float(1); 33 | maxValue:float(100.0); 34 | defaultValue:float(21); 35 | >; 36 | 37 | parameter float n4 38 | < 39 | minValue:float(1); 40 | maxValue:float(100.0); 41 | defaultValue:float(23); 42 | >; 43 | 44 | parameter float2 randomPoint 45 | < 46 | minValue:float2(-100,-100); 47 | maxValue:float2(1000,1000); 48 | defaultValue:float2(217.5,781.6); 49 | >; 50 | 51 | input image4 src; 52 | output pixel4 dst; 53 | 54 | void 55 | evaluatePixel() 56 | { 57 | float2 p = outCoord() +randomPoint; 58 | p += mod(p,n4) - mod(p,n3); // Subtracting modulos 59 | 60 | float2 ds= mod(p,n0) +mod(p,n1) +mod(p,n2) -0.5*(n0+n1+n2); // Adding modulos 61 | 62 | dst = sample(src,outCoord() -0.333333*ds); 63 | } 64 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/ripple-blocks.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel RippleBlocks 4 | < namespace : "Allen Chou"; 5 | vendor : ""; 6 | version : 1; 7 | description : "box-shaped ripple effect"; 8 | > 9 | { 10 | parameter float2 amplitude 11 | < 12 | minValue: float2( 0, 0); 13 | maxValue: float2(100, 100); 14 | defaultValue: float2( 20, 20); 15 | >; 16 | 17 | parameter float2 wavelength 18 | < 19 | minValue: float2( 1.0, 1.0); 20 | maxValue: float2( 100.0, 100.0); 21 | defaultValue: float2( 10.0, 10.0); 22 | >; 23 | 24 | parameter float2 phase 25 | < 26 | minValue: float2( 0.0, 0.0); 27 | maxValue: float2(6.283, 6.283); 28 | defaultValue: float2( 0.0, 0.0); 29 | >; 30 | 31 | input image4 src; 32 | output pixel4 dst; 33 | 34 | void 35 | evaluatePixel() 36 | { 37 | float2 coord = outCoord(); 38 | coord.x += amplitude.x * sin((coord.x / wavelength.x) + phase.x); 39 | coord.y += amplitude.y * cos((coord.y / wavelength.y) + phase.y); 40 | 41 | dst = sample(src, float2(coord.x, coord.y)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/sharpen.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | kernel sharpen 5 | < namespace : "com.rphelan"; 6 | vendor : "Ryan Phelan"; 7 | version : 1; 8 | description : "Applies a sharpen effect to an image."; > 9 | { 10 | parameter float amount 11 | < 12 | minValue:0.0; 13 | maxValue:20.0; 14 | defaultValue:1.0; 15 | >; 16 | 17 | parameter float radius 18 | < 19 | minValue:0.0; 20 | maxValue:1.0; 21 | defaultValue:0.1; 22 | >; 23 | 24 | input image4 src; 25 | output float4 dst; 26 | 27 | void 28 | evaluatePixel() 29 | { 30 | // Obtain the input pixel coordinate 31 | float2 coord = outCoord(); 32 | 33 | // Obtain the input pixel color 34 | float4 inputColor = sampleLinear(src, coord); 35 | 36 | // Start with the original color 37 | dst.rgb = inputColor.rgb; 38 | 39 | // Offset the color by the surrounding pixels 40 | float2 hOffset = float2(radius, 0.0); 41 | float2 vOffset = float2(0.0, radius); 42 | float4 left = sampleLinear(src, coord - hOffset) * amount; 43 | float4 right = sampleLinear(src, coord + hOffset) * amount; 44 | float4 top = sampleLinear(src, coord - vOffset) * amount; 45 | float4 bottom = sampleLinear(src, coord + vOffset) * amount; 46 | 47 | dst.rgb += (top.rgb); 48 | dst.rgb -= (bottom.rgb); 49 | dst.rgb += left.rgb; 50 | dst.rgb -= right.rgb; 51 | 52 | // set the alpha value equal to the alpha of the input 53 | dst.a = inputColor.a; 54 | } 55 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/simple-point-light.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel SimplePointLight 4 | < namespace : "navhali"; 5 | vendor : "John Engler"; 6 | version : 0; 7 | description : "Simple point light--playing with PixelBender"; 8 | > 9 | { 10 | parameter float2 center 11 | < 12 | minValue: float2(0.0,0.0); 13 | maxValue: float2(4096.0,4096.0); 14 | defaultValue: float2(0.0,0.0); 15 | >; 16 | 17 | parameter float attenuationDelta 18 | < 19 | minValue: float(0.0); 20 | maxValue: float(2000.0); 21 | defaultValue: float(175.0); 22 | >; 23 | 24 | parameter float attenuationSpeed 25 | < 26 | minValue: float(0.0); 27 | maxValue: float(2.0); 28 | defaultValue: float(1.0); 29 | >; 30 | 31 | parameter float attenuationDecay 32 | < 33 | minValue: float(0.0); 34 | maxValue: float(2.0); 35 | defaultValue: float(1.0); 36 | >; 37 | 38 | input image4 src; 39 | output pixel4 dst; 40 | 41 | void 42 | evaluatePixel() 43 | { 44 | float2 out_pixel_coord = outCoord(); 45 | float attenuation = pow(attenuationDelta/pow(distance(out_pixel_coord, center), attenuationDecay), attenuationSpeed); 46 | dst = attenuation * sampleNearest(src, out_pixel_coord); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/simple.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel simple 4 | < namespace : "Your Namespace"; 5 | vendor : "Your Vendor"; 6 | version : 1; 7 | > 8 | { 9 | parameter float3x3 transform 10 | < 11 | minValue:float3x3( 12 | -1.0, -1.0, -1.0, 13 | -1.0, -1.0, -1.0, 14 | -1.0, -1.0, -1.0 15 | ); 16 | 17 | maxValue:float3x3( 18 | 1.0, 1.0, 1.0, 19 | 1.0, 1.0, 1.0, 20 | 1.0, 1.0, 1.0 21 | ); 22 | defaultValue:float3x3( 23 | 0.5, 0.0, 0.0, 24 | 0.3, 1.0, 0.7, 25 | 0.1, 0.3, 0.8 26 | ); 27 | >; 28 | 29 | input image3 src; 30 | output pixel3 dst; 31 | 32 | void 33 | evaluatePixel() 34 | { 35 | dst = sampleNearest(src,outCoord()); 36 | dst = transform * dst; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/skin-color-filter.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel NewFilter 4 | < namespace : "me.cosmodro.filters"; 5 | vendor : "Steve Shipman"; 6 | version : 1; 7 | description : "Skin Color filter"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float CbMin 14 | < 15 | minValue:0.0; 16 | maxValue:1.0; 17 | defaultValue:105.0/255.0; 18 | >; 19 | 20 | parameter float CbMax 21 | < 22 | minValue:0.0; 23 | maxValue:1.0; 24 | defaultValue:135.0/255.0; 25 | >; 26 | 27 | parameter float CrMin 28 | < 29 | minValue:0.0; 30 | maxValue:1.0; 31 | defaultValue:140.0/255.0; 32 | >; 33 | 34 | parameter float CrMax 35 | < 36 | minValue:0.0; 37 | maxValue:1.0; 38 | defaultValue:165.0/255.0; 39 | >; 40 | 41 | 42 | void 43 | evaluatePixel() 44 | { 45 | dst = sampleNearest(src,outCoord()); 46 | pixel3 ycbcr = dst.rgb * float3x3(0.0, 0.0, 0.0, -0.168736, -0.331264, 0.5, 0.5, -0.418688, -0.081312) + float3(0.0, 0.5, 0.5); 47 | 48 | if ((ycbcr.g >= CbMin) && (ycbcr.g <= CbMax) && (ycbcr.b >= CrMin) && (ycbcr.b <= CrMax)){ 49 | dst.rgb = float3(1); 50 | }else{ 51 | dst.rgb = float3(0); 52 | } 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/slices.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "slices"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | /** 14 | * horizontal block size (should remain lower than image width) 15 | */ 16 | parameter float horizontal 17 | < 18 | minValue: 0.0; 19 | maxValue: 2880.0; 20 | defaultValue: 10.0; 21 | >; 22 | /** 23 | * vertical block size (should remain lower than image height) 24 | */ 25 | parameter float vertical 26 | < 27 | minValue: 0.0; 28 | maxValue: 2880.0; 29 | defaultValue: 10.0; 30 | >; 31 | 32 | void 33 | evaluatePixel() 34 | { 35 | 36 | float2 coord = outCoord(); 37 | 38 | coord.x += vertical * ( ( cos( coord[ 1 ] / vertical) > 0.0 ) ? 1.0 : -1.0 ); 39 | coord.y += horizontal * ( ( cos( coord[ 0 ] / horizontal ) > 0.0 ) ? 1.0 : -1.0 ); 40 | 41 | dst = sampleNearest( src, coord ); 42 | 43 | } 44 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/smudger.pbk: -------------------------------------------------------------------------------- 1 | 2 | ///////////////////////////////////////////////////// 3 | // smudger 4 | // 5 | // author : frank reitberger 6 | // blog : http://www.prinzipiell.com 7 | // copyright 2008 8 | // 9 | ///////////////////////////////////////////////////// 10 | 11 | 12 | 13 | kernel smudge 14 | 15 | < 16 | namespace: "smudger"; 17 | vendor: "Frank Reitberger"; 18 | version: 1; 19 | description: "generates a smudged pattern"; 20 | > 21 | 22 | { 23 | parameter float amount 24 | < 25 | minValue: float(0.0); 26 | maxValue: float(5.0); 27 | defaultValue: float(0.5); 28 | description: "amount"; 29 | >; 30 | 31 | 32 | input image4 src; 33 | output pixel4 dst; 34 | 35 | void 36 | evaluatePixel() 37 | { 38 | float2 pos = outCoord(); 39 | 40 | ////////////////////////// 41 | // patterize transition 42 | ////////////////////////// 43 | float nx = 5.0 * (cos(pos.y / 5.0)); 44 | float ny = 5.0 * (cos(pos.x / 6.0)); 45 | float2 pnt = float2( nx*ny , nx* ny ); 46 | dst = sampleNearest( src, outCoord() + pnt * amount); 47 | 48 | 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/tint.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel Tint 4 | < 5 | namespace: "Allen Chou"; 6 | vendor: ""; 7 | version: 1; 8 | description: "tint effect"; 9 | > 10 | { 11 | parameter float amount 12 | < 13 | minValue: -1.0; 14 | maxValue: 1.0; 15 | defaultValue: 0.0; 16 | >; 17 | 18 | parameter float3 color 19 | < 20 | minValue: float3(0, 0, 0); 21 | maxValue: float3(1, 1, 1); 22 | defaultValue: float3(0, 0, 0); 23 | >; 24 | 25 | input image4 src; 26 | output pixel4 dst; 27 | 28 | void evaluatePixel() 29 | { 30 | float4 rgba; 31 | float r, g, b, a; 32 | 33 | // sample pixel value 34 | rgba = sampleNearest(src, outCoord()); 35 | 36 | //calculate luminance 37 | float luminance = rgba.r * 0.3086 + 38 | rgba.g * 0.6094 + 39 | rgba.b * 0.0820; 40 | 41 | //interpolation 42 | r = (color.r + luminance) * amount + rgba.r * (1.0 - amount); 43 | g = (color.g + luminance) * amount + rgba.g * (1.0 - amount); 44 | b = (color.b + luminance) * amount + rgba.b * (1.0 - amount); 45 | 46 | //range assurance 47 | clamp(r, 0.0, 1.0); 48 | clamp(g, 0.0, 1.0); 49 | clamp(b, 0.0, 1.0); 50 | 51 | // set output pixel 52 | dst = float4(r, g, b, rgba.a); 53 | } 54 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/tunnel.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel NewFilter 4 | < namespace : "Tunnel"; 5 | vendor : "Mr.doob"; 6 | version : 1; 7 | description : "Tunnel effect"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 imgSize 14 | < 15 | defaultValue : float2(512.0, 512.0); 16 | minValue : float2(0.0,0.0); 17 | maxValue : float2(512.0,512.0); 18 | >; 19 | 20 | parameter float2 center 21 | < 22 | defaultValue : float2(256.0, 256.0); 23 | minValue : float2(0.0,0.0); 24 | maxValue : float2(512.0,512.0); 25 | >; 26 | 27 | parameter float2 offset; 28 | 29 | void evaluatePixel() 30 | { 31 | float2 pos = (outCoord() - center) / imgSize; 32 | 33 | float pi = 3.141592653589793; 34 | float a = atan(pos.y,pos.x); 35 | float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0)); 36 | 37 | float u = 0.0; 38 | float v = 0.0; 39 | float w = 0.0; 40 | 41 | u += offset.x; 42 | v += offset.y; 43 | 44 | u += 1.0/r; 45 | v += 3.0*a/pi; 46 | w += r*2.0; 47 | 48 | u *= imgSize.x; 49 | v *= imgSize.y; 50 | 51 | if (u < 0.0) u += imgSize.x * ceil(-u / imgSize.x); 52 | if (v < 0.0) v += imgSize.y * ceil(-v / imgSize.y); 53 | if (u > imgSize.x) u -= imgSize.x * floor(u / imgSize.x); 54 | if (v > imgSize.y) v -= imgSize.y * floor(v / imgSize.y); 55 | 56 | dst = sampleNearest(src,float2(u, v)); 57 | dst.rgb *= w; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/tunnel4.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel NewFilter 4 | < namespace : "Tunnel 4"; 5 | vendor : "Mr.doob"; 6 | version : 1; 7 | description : "Tunnel effect 4"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 imgSize 14 | < 15 | defaultValue : float2(512.0, 512.0); 16 | minValue : float2(0.0,0.0); 17 | maxValue : float2(512.0,512.0); 18 | >; 19 | 20 | parameter float2 center 21 | < 22 | defaultValue : float2(256.0, 256.0); 23 | minValue : float2(0.0,0.0); 24 | maxValue : float2(512.0,512.0); 25 | >; 26 | 27 | parameter float2 offset; 28 | 29 | void evaluatePixel() 30 | { 31 | float2 pos = (outCoord() - center) / imgSize; 32 | 33 | float pi = 3.141592653589793; 34 | float a = atan(pos.y,pos.x); 35 | float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0)); 36 | 37 | float u = 0.0; 38 | float v = 0.0; 39 | float w = 0.0; 40 | 41 | u += offset.x; 42 | v += offset.y; 43 | 44 | u += 3.0*a/pi; 45 | v += abs(cos(1.5*a)/r); 46 | w += .2+.5*abs(cos(1.5*a)/r); 47 | 48 | u *= imgSize.x; 49 | v *= imgSize.y; 50 | 51 | if (u < 0.0) u += imgSize.x * ceil(-u / imgSize.x); 52 | if (v < 0.0) v += imgSize.y * ceil(-v / imgSize.y); 53 | if (u > imgSize.x) u -= imgSize.x * floor(u / imgSize.x); 54 | if (v > imgSize.y) v -= imgSize.y * floor(v / imgSize.y); 55 | 56 | dst = sampleNearest(src,float2(u, v)); 57 | dst.rgb *= w; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/pbk/wave.pbk: -------------------------------------------------------------------------------- 1 | 2 | kernel Distort 3 | < 4 | namespace : "net.nicoptere.filters"; 5 | vendor : "nicoptere"; 6 | version : 1; 7 | description : "wave"; 8 | > 9 | { 10 | input image4 src; 11 | output pixel4 dst; 12 | 13 | parameter float2 center 14 | < 15 | minValue: float2( 0.0, 0.0 ); 16 | maxValue: float2( 4096.0, 4096.0 ); 17 | defaultValue: float2( 0.0, 0.0 ); 18 | >; 19 | parameter float amplitude 20 | < 21 | minValue: 0.0; 22 | maxValue: 100.0; 23 | defaultValue: 10.0; 24 | >; 25 | parameter float frequency 26 | < 27 | minValue: 0.0; 28 | maxValue: 100.0; 29 | defaultValue: 5.0; 30 | >; 31 | 32 | 33 | void 34 | evaluatePixel() 35 | { 36 | 37 | float2 coord = outCoord(); 38 | 39 | float dx = coord.x - center.x; 40 | float dy = coord.y - center.y; 41 | 42 | float a = atan( dy , dx ); 43 | float r = sqrt( dx*dx + dy*dy ); 44 | 45 | r += cos( r / frequency ) * amplitude; 46 | 47 | float2 dest = float2( 0.0,0.0 ); 48 | dest.x = center.x + cos( a ) * r; 49 | dest.y = center.y + sin( a ) * r; 50 | 51 | dst = sampleNearest( src, dest ); 52 | 53 | } 54 | } 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | display: flex; 3 | flex-direction: column; 4 | padding: 5px; 5 | } 6 | 7 | .display { 8 | display: flex; 9 | flex-direction: row; 10 | } 11 | 12 | .frame { 13 | margin: 5px 5px 5px 5px; 14 | flex: 0 1 auto; 15 | } 16 | 17 | .frame CANVAS { 18 | max-width: 100%; 19 | } 20 | 21 | .controls { 22 | border-top: 1px solid #999999; 23 | padding-top: 2px; 24 | } 25 | 26 | .control { 27 | display: inline-block; 28 | margin: 5px 5px 5px 5px; 29 | } 30 | 31 | .control input[type="range"] { 32 | margin: 5px 5px 0 0; 33 | vertical-align: middle; 34 | } 35 | 36 | .control input[type="number"] { 37 | width: 5em; 38 | } 39 | 40 | .element { 41 | margin-right: 4px; 42 | } 43 | 44 | .matrix { 45 | display: flex; 46 | flex-direction: row; 47 | } 48 | 49 | .change-btn { 50 | cursor: pointer; 51 | color: rgba(50, 160, 255, 0.4); 52 | margin-left: 10px; 53 | } 54 | 55 | .change-btn:hover { 56 | color: rgba(50, 160, 255, 1); 57 | } 58 | 59 | .change-btn input[type="file"] { 60 | width: 0px; 61 | } 62 | 63 | .control.button { 64 | float: right; 65 | } 66 | 67 | button { 68 | background-color: #aaaaaa; 69 | font-size: 1.5em; 70 | text-transform: uppercase; 71 | } 72 | 73 | @media screen and (max-width: 600px) { 74 | .display { 75 | display: flex; 76 | flex-direction: column; 77 | } 78 | 79 | .control { 80 | display: block; 81 | margin-top: 10px; 82 | } 83 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | font-family: Arial, Helvetica, sans-serif; 8 | background-color: #333333; 9 | color: #ffffff; 10 | } 11 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | ) 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-1/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import React from '@vitejs/plugin-react-swc' 3 | import Pb2Zig from '../../dist/index.js'; 4 | 5 | export default defineConfig({ 6 | plugins: [ 7 | React(), 8 | Pb2Zig({ topLevelAwait: false, embedWASM: true, multithreaded: true }), 9 | ], 10 | server: { 11 | headers: { 12 | 'Cross-Origin-Opener-Policy': 'same-origin', 13 | 'Cross-Origin-Embedder-Policy': 'require-corp', 14 | } 15 | }, 16 | base: '/pb2zig/demo-1', 17 | build: { 18 | emptyOutDir: true, 19 | outDir: '../../../../zigar.website/pb2zig/demo-1', 20 | }, 21 | }) 22 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/img/fontmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-2/img/fontmap.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/img/malgorzata-socha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-2/img/malgorzata-socha.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/img/malgorzata-socha2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-2/img/malgorzata-socha2.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/img/mandelbrot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-2/img/mandelbrot.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/img/stripe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-2/img/stripe.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/img/telephone-cord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-2/img/telephone-cord.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/img/wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-2/img/wood.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/img/zig-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-2/img/zig-logo.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | pb2zig demo 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pb2zig-web-demo-2", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^19.0.10", 18 | "@types/react-dom": "^19.0.4", 19 | "@vitejs/plugin-react-swc": "^3.8.0", 20 | "eslint": "^9.21.0", 21 | "eslint-plugin-react": "^7.37.4", 22 | "eslint-plugin-react-hooks": "^5.1.0", 23 | "eslint-plugin-react-refresh": "^0.4.19", 24 | "rollup-plugin-pb2zig": "^0.14.0", 25 | "vite": "^6.2.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/pbk/blendmode-color.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel ColorBlend 4 | < namespace : "com.quasimondo"; 5 | vendor : "Quasimondo"; 6 | version : 1; 7 | description : "Color Blendmode"; 8 | > 9 | { 10 | input image4 src1; 11 | input image4 src2; 12 | 13 | output pixel4 dst; 14 | 15 | void 16 | evaluatePixel() 17 | { 18 | float4 rgb1 = sampleNearest(src1,outCoord()); 19 | float4 rgb2 = sampleNearest(src2,outCoord()); 20 | 21 | float y = rgb1.r * 0.29900 + rgb1.g * 0.58700 + rgb1.b * 0.14400; 22 | float u = - rgb2.r * 0.14714 - rgb2.g * 0.28886 + rgb2.b * 0.43600; 23 | float v = rgb2.r * 0.61500 - rgb2.g * 0.51499 - rgb2.b * 0.10001; 24 | 25 | 26 | dst.r = 0.970874 * y - 0.0591995 * u + 1.13983 * v; 27 | dst.g = 0.970874 * y - 0.453834 * u - 0.580599 * v; 28 | dst.b = 0.970874 * y + 1.97292 * u + 0.00000781528 * v; 29 | dst.a = rgb1.a; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/pbk/blendmode-color2.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel ColorBlend2 4 | < namespace : "com.quasimondo"; 5 | vendor : "Quasimondo"; 6 | version : 1; 7 | description : "Alternative Color Blendmode"; 8 | > 9 | { 10 | input image4 src1; 11 | input image4 src2; 12 | 13 | output pixel4 dst; 14 | 15 | void 16 | evaluatePixel() 17 | { 18 | float4 rgb1 = sampleNearest(src1,outCoord()); 19 | float4 rgb2 = sampleNearest(src2,outCoord()); 20 | 21 | 22 | float y = rgb1.r * 0.29029126213592233 + rgb1.g * 0.56990291262135921 + rgb1.b * 0.13980582524271845; 23 | float u = rgb2.r * 140.58486056821164 - rgb2.g * 125.474697792149809 - rgb2.b * 15.11016277606183; 24 | float v = -rgb2.r * 327.14030548802001 - rgb2.g * 1.3881417465045215 + rgb2.b * 325.75216374151549; 25 | 26 | dst.r = y + 0.004539556278762163 * u - 0.00021860911105424223 * v; 27 | dst.g = y - 0.0034342699108313463 * u - 0.0005884786778098704 * v; 28 | dst.b = y + 0.004573535488250788 * u + 0.0028527854727750856 * v; 29 | dst.a = rgb1.a; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/pbk/crossfade.pbk: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * ADOBE SYSTEMS INCORPORATED 4 | * Copyright (C) 2010 Adobe Systems Incorporated 5 | * All Rights Reserved. 6 | * 7 | * NOTICE: Adobe permits you to use, modify, and distribute this file in 8 | * accordance with the terms of the Adobe license agreement accompanying it. 9 | * If you have received this file from a source other than Adobe, then your 10 | * use, modification, or distribution of it requires the prior written 11 | * permission of Adobe. 12 | * 13 | *****************************************************************************/ 14 | 15 | 16 | kernel Crossfade 17 | < namespace : "AIF"; 18 | vendor : "Adobe Systems"; 19 | version : 2; 20 | description : "Crossfade between two images"; > 21 | { 22 | parameter float intensity 23 | < minValue: 0.0; 24 | maxValue: 1.0; 25 | defaultValue: 0.0; 26 | >; 27 | 28 | input image4 frontImage; 29 | input image4 backImage; 30 | output pixel4 dst; 31 | 32 | void evaluatePixel() 33 | { 34 | // Acquire the pixel values from both images at the current location 35 | float4 frontPixel = sampleNearest(frontImage, outCoord()); 36 | float4 backPixel = sampleNearest(backImage, outCoord()); 37 | 38 | // We set the output to the mix of the two pixels. The mix function 39 | // applies the following equation to the pixel values: 40 | // (1.0 - intensity) * frontPixel + intensity * backPixel 41 | dst = mix(frontPixel, backPixel, intensity); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | display: flex; 3 | flex-direction: column; 4 | padding: 5px; 5 | } 6 | 7 | .display { 8 | display: flex; 9 | flex-direction: row; 10 | } 11 | 12 | .frame { 13 | margin: 5px 5px 5px 5px; 14 | flex: 0 1 auto; 15 | } 16 | 17 | .frame CANVAS { 18 | max-width: 100%; 19 | } 20 | 21 | .controls { 22 | border-top: 1px solid #999999; 23 | padding-top: 2px; 24 | } 25 | 26 | .control { 27 | display: inline-block; 28 | margin: 5px 5px 5px 5px; 29 | } 30 | 31 | .control input[type="range"] { 32 | margin: 5px 5px 0 0; 33 | vertical-align: middle; 34 | } 35 | 36 | .control input[type="number"] { 37 | width: 5em; 38 | } 39 | 40 | .element { 41 | margin-right: 4px; 42 | } 43 | 44 | .matrix { 45 | display: flex; 46 | flex-direction: row; 47 | } 48 | 49 | .change-btn { 50 | cursor: pointer; 51 | color: rgba(50, 160, 255, 0.4); 52 | margin-left: 10px; 53 | } 54 | 55 | .change-btn:hover { 56 | color: rgba(50, 160, 255, 1); 57 | } 58 | 59 | .change-btn input[type="file"] { 60 | width: 0px; 61 | } 62 | 63 | .control.button { 64 | float: right; 65 | } 66 | 67 | button { 68 | background-color: #aaaaaa; 69 | font-size: 1.5em; 70 | text-transform: uppercase; 71 | } 72 | 73 | @media screen and (max-width: 600px) { 74 | .display { 75 | display: flex; 76 | flex-direction: column; 77 | } 78 | 79 | .control { 80 | display: block; 81 | margin-top: 10px; 82 | } 83 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | font-family: Arial, Helvetica, sans-serif; 8 | background-color: #333333; 9 | color: #ffffff; 10 | } 11 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | ) 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-2/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import React from '@vitejs/plugin-react-swc' 3 | import Pb2Zig from '../../dist/index.js'; 4 | 5 | export default defineConfig({ 6 | plugins: [ 7 | React(), 8 | Pb2Zig({ topLevelAwait: false, embedWASM: true, multithreaded: true }), 9 | ], 10 | server: { 11 | headers: { 12 | 'Cross-Origin-Opener-Policy': 'same-origin', 13 | 'Cross-Origin-Embedder-Policy': 'require-corp', 14 | } 15 | }, 16 | base: '/pb2zig/demo-2', 17 | build: { 18 | emptyOutDir: true, 19 | outDir: '../../../../zigar.website/pb2zig/demo-2', 20 | }, 21 | }) 22 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-3/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | pb2zig demo 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pb2zig-web-demo-3", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^19.0.10", 18 | "@types/react-dom": "^19.0.4", 19 | "@vitejs/plugin-react-swc": "^3.8.0", 20 | "eslint": "^9.21.0", 21 | "eslint-plugin-react": "^7.37.4", 22 | "eslint-plugin-react-hooks": "^5.1.0", 23 | "eslint-plugin-react-refresh": "^0.4.19", 24 | "rollup-plugin-pb2zig": "^0.14.0", 25 | "vite": "^6.2.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-3/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | display: flex; 3 | flex-direction: column; 4 | padding: 5px; 5 | } 6 | 7 | .display { 8 | display: flex; 9 | flex-direction: row; 10 | } 11 | 12 | .frame { 13 | margin: 5px 5px 5px 5px; 14 | flex: 0 1 auto; 15 | } 16 | 17 | .frame CANVAS { 18 | max-width: 100%; 19 | } 20 | 21 | .controls { 22 | border-top: 1px solid #999999; 23 | padding-top: 2px; 24 | } 25 | 26 | .control { 27 | display: inline-block; 28 | margin: 5px 5px 5px 5px; 29 | } 30 | 31 | .control input[type="range"] { 32 | margin: 5px 5px 0 0; 33 | vertical-align: middle; 34 | } 35 | 36 | .control input[type="number"] { 37 | width: 5em; 38 | } 39 | 40 | .element { 41 | margin-right: 4px; 42 | } 43 | 44 | .matrix { 45 | display: flex; 46 | flex-direction: row; 47 | } 48 | 49 | .change-btn { 50 | cursor: pointer; 51 | color: rgba(50, 160, 255, 0.4); 52 | margin-left: 10px; 53 | } 54 | 55 | .change-btn:hover { 56 | color: rgba(50, 160, 255, 1); 57 | } 58 | 59 | .change-btn input[type="file"] { 60 | width: 0px; 61 | } 62 | 63 | .control.button { 64 | float: right; 65 | } 66 | 67 | button { 68 | background-color: #aaaaaa; 69 | font-size: 1.5em; 70 | text-transform: uppercase; 71 | } 72 | 73 | @media screen and (max-width: 600px) { 74 | .display { 75 | display: flex; 76 | flex-direction: column; 77 | } 78 | 79 | .control { 80 | display: block; 81 | margin-top: 10px; 82 | } 83 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-3/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | font-family: Arial, Helvetica, sans-serif; 8 | background-color: #333333; 9 | color: #ffffff; 10 | } 11 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-3/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | ) 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-3/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import React from '@vitejs/plugin-react-swc' 3 | import Pb2Zig from '../../dist/index.js'; 4 | 5 | export default defineConfig({ 6 | plugins: [ 7 | React(), 8 | Pb2Zig({ topLevelAwait: false, embedWASM: true, multithreaded: true }), 9 | ], 10 | server: { 11 | headers: { 12 | 'Cross-Origin-Opener-Policy': 'same-origin', 13 | 'Cross-Origin-Embedder-Policy': 'require-corp', 14 | } 15 | }, 16 | base: '/pb2zig/demo-3', 17 | build: { 18 | emptyOutDir: true, 19 | outDir: '../../../../zigar.website/pb2zig/demo-3', 20 | }, 21 | }) 22 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-4/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | pb2zig demo 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-4/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pb2zig-web-demo-4", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^19.0.8", 18 | "@types/react-dom": "^19.0.3", 19 | "@vitejs/plugin-react-swc": "^3.7.2", 20 | "eslint": "^9.19.0", 21 | "eslint-plugin-react": "^7.37.4", 22 | "eslint-plugin-react-hooks": "^5.1.0", 23 | "eslint-plugin-react-refresh": "^0.4.18", 24 | "react-media-capture": "^0.0.13", 25 | "rollup-plugin-pb2zig": "^0.14.0", 26 | "vite": "^6.0.11" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-4/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | display: flex; 3 | flex-direction: column; 4 | padding: 5px; 5 | } 6 | 7 | .display { 8 | display: flex; 9 | flex-direction: row; 10 | } 11 | 12 | .frame { 13 | margin: 5px 5px 5px 5px; 14 | flex: 0 1 auto; 15 | } 16 | 17 | .frame CANVAS { 18 | max-width: 100%; 19 | } 20 | 21 | .controls { 22 | border-top: 1px solid #999999; 23 | padding-top: 2px; 24 | } 25 | 26 | .control { 27 | display: inline-block; 28 | margin: 5px 5px 5px 5px; 29 | } 30 | 31 | .control input[type="range"] { 32 | margin: 5px 5px 0 0; 33 | vertical-align: middle; 34 | } 35 | 36 | .control input[type="number"] { 37 | width: 5em; 38 | } 39 | 40 | .element { 41 | margin-right: 4px; 42 | } 43 | 44 | .matrix { 45 | display: flex; 46 | flex-direction: row; 47 | } 48 | 49 | .change-btn { 50 | cursor: pointer; 51 | color: rgba(50, 160, 255, 0.4); 52 | margin-left: 10px; 53 | } 54 | 55 | .change-btn:hover { 56 | color: rgba(50, 160, 255, 1); 57 | } 58 | 59 | .change-btn input[type="file"] { 60 | width: 0px; 61 | } 62 | 63 | .control.button { 64 | float: right; 65 | } 66 | 67 | button { 68 | background-color: #aaaaaa; 69 | font-size: 1.5em; 70 | text-transform: uppercase; 71 | } 72 | 73 | @media screen and (max-width: 600px) { 74 | .display { 75 | display: flex; 76 | flex-direction: column; 77 | } 78 | 79 | .control { 80 | display: block; 81 | margin-top: 10px; 82 | } 83 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-4/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | font-family: Arial, Helvetica, sans-serif; 8 | background-color: #333333; 9 | color: #ffffff; 10 | } 11 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-4/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | ) 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-4/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import React from '@vitejs/plugin-react-swc' 3 | import Pb2Zig from '../../dist/index.js'; 4 | 5 | export default defineConfig({ 6 | plugins: [ 7 | React(), 8 | Pb2Zig({ topLevelAwait: false, embedWASM: true, multithreaded: true }), 9 | ], 10 | server: { 11 | headers: { 12 | 'Cross-Origin-Opener-Policy': 'same-origin', 13 | 'Cross-Origin-Embedder-Policy': 'require-corp', 14 | } 15 | }, 16 | base: '/pb2zig/demo-4', 17 | build: { 18 | emptyOutDir: true, 19 | outDir: '../../../../zigar.website/pb2zig/demo-4', 20 | }, 21 | }) 22 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-5/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-5/img/fontmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/demos/demo-5/img/fontmap.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | pb2zig demo 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-5/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pb2zig-web-demo-5", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^19.0.8", 18 | "@types/react-dom": "^19.0.3", 19 | "@vitejs/plugin-react-swc": "^3.7.2", 20 | "eslint": "^9.19.0", 21 | "eslint-plugin-react": "^7.37.4", 22 | "eslint-plugin-react-hooks": "^5.1.0", 23 | "eslint-plugin-react-refresh": "^0.4.18", 24 | "react-media-capture": "^0.0.13", 25 | "rollup-plugin-pb2zig": "^0.14.0", 26 | "vite": "^6.0.11" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-5/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | display: flex; 3 | flex-direction: column; 4 | padding: 5px; 5 | } 6 | 7 | .display { 8 | display: flex; 9 | flex-direction: row; 10 | } 11 | 12 | .frame { 13 | margin: 5px 5px 5px 5px; 14 | flex: 0 1 auto; 15 | } 16 | 17 | .frame CANVAS { 18 | max-width: 100%; 19 | } 20 | 21 | .controls { 22 | border-top: 1px solid #999999; 23 | padding-top: 2px; 24 | } 25 | 26 | .control { 27 | display: inline-block; 28 | margin: 5px 5px 5px 5px; 29 | } 30 | 31 | .control input[type="range"] { 32 | margin: 5px 5px 0 0; 33 | vertical-align: middle; 34 | } 35 | 36 | .control input[type="number"] { 37 | width: 5em; 38 | } 39 | 40 | .element { 41 | margin-right: 4px; 42 | } 43 | 44 | .matrix { 45 | display: flex; 46 | flex-direction: row; 47 | } 48 | 49 | .change-btn { 50 | cursor: pointer; 51 | color: rgba(50, 160, 255, 0.4); 52 | margin-left: 10px; 53 | } 54 | 55 | .change-btn:hover { 56 | color: rgba(50, 160, 255, 1); 57 | } 58 | 59 | .change-btn input[type="file"] { 60 | width: 0px; 61 | } 62 | 63 | .control.button { 64 | float: right; 65 | } 66 | 67 | button { 68 | background-color: #aaaaaa; 69 | font-size: 1.5em; 70 | text-transform: uppercase; 71 | } 72 | 73 | @media screen and (max-width: 600px) { 74 | .display { 75 | display: flex; 76 | flex-direction: column; 77 | } 78 | 79 | .control { 80 | display: block; 81 | margin-top: 10px; 82 | } 83 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-5/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | font-family: Arial, Helvetica, sans-serif; 8 | background-color: #333333; 9 | color: #ffffff; 10 | } 11 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-5/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | ) 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/demos/demo-5/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import React from '@vitejs/plugin-react-swc' 3 | import Pb2Zig from '../../dist/index.js'; 4 | 5 | export default defineConfig({ 6 | plugins: [ 7 | React(), 8 | Pb2Zig({ topLevelAwait: false, embedWASM: true, multithreaded: true }), 9 | ], 10 | server: { 11 | headers: { 12 | 'Cross-Origin-Opener-Policy': 'same-origin', 13 | 'Cross-Origin-Embedder-Policy': 'require-corp', 14 | } 15 | }, 16 | base: '/pb2zig/demo-5', 17 | build: { 18 | emptyOutDir: true, 19 | outDir: '../../../../zigar.website/pb2zig/demo-5', 20 | }, 21 | }) 22 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/dist/image-async.js: -------------------------------------------------------------------------------- 1 | const { createOutputAsync, startThreadPool, stopThreadPool } = constructor; 2 | 3 | export async function createImageDataAsync(width, height, source = {}, params = {}, options = {}) { 4 | const input = createInput(source); 5 | const colorSpace = getColorSpace(input); 6 | const output = await createOutputAsync(width, height, input, params, options); 7 | return createResult(output, colorSpace); 8 | } 9 | 10 | export class AbortManager { 11 | currentOp = null; 12 | 13 | async call(cb) { 14 | const controller = new AbortController; 15 | const { signal } = controller; 16 | const prevOp = this.currentOp; 17 | const thisOp = this.currentOp = { controller, promise: null }; 18 | if (prevOp) { 19 | // abort previous call and wait for promise rejection 20 | prevOp.controller.abort(); 21 | await prevOp.promise?.catch(() => {}); 22 | } 23 | if (signal.aborted) { 24 | // throw error now if the operation was aborted, 25 | // before the function is even called 26 | throw new Error('Aborted'); 27 | } 28 | const result = await (this.currentOp.promise = cb?.(signal)); 29 | if (thisOp === this.currentOp) { 30 | this.currentOp = null; 31 | } 32 | return result; 33 | } 34 | 35 | async stop() { 36 | return this.call(null); 37 | } 38 | } 39 | 40 | export { startThreadPool, stopThreadPool }; 41 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rollup-plugin-pb2zig", 3 | "version": "0.14.0", 4 | "description": "Rollup plugin for creating images filters from Pixel Bender kernels", 5 | "main": "./dist/index.js", 6 | "type": "module", 7 | "directories": { 8 | "test": "test" 9 | }, 10 | "scripts": { 11 | "test": "node ./node_modules/mocha/bin/mocha.js --parallel -- test/*.test.js", 12 | "debug": "node --inspect-brk ./node_modules/mocha/bin/mocha.js -- test/*.test.js", 13 | "coverage": "node ./node_modules/c8/bin/c8.js ./node_modules/mocha/bin/mocha.js --parallel -- test/*.test.js" 14 | }, 15 | "files": [ 16 | "dist/*" 17 | ], 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/chung-leong/pb2zig.git" 21 | }, 22 | "keywords": [ 23 | "zig", 24 | "rollup-plugin", 25 | "image", 26 | "filter", 27 | "pixel-bender", 28 | "pbk" 29 | ], 30 | "author": "Chung Leong", 31 | "license": "MIT", 32 | "gypfile": true, 33 | "bugs": { 34 | "url": "https://github.com/chung-leong/pb2zig/issues" 35 | }, 36 | "homepage": "https://github.com/chung-leong/pb2zig#readme", 37 | "dependencies": { 38 | "pb2zig": "^0.14.0", 39 | "rollup-plugin-zigar": "^0.14.0" 40 | }, 41 | "devDependencies": { 42 | "@rollup/plugin-node-resolve": "^16.0.1", 43 | "@rollup/plugin-replace": "^6.0.2", 44 | "c8": "^10.1.3", 45 | "chai": "^5.2.0", 46 | "mocha": "^11.1.0", 47 | "mocha-skip-if": "^1.0.4", 48 | "rollup": "^4.36.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project-async/assets/simple-7d98870e.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/rollup-project-async/assets/simple-7d98870e.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project-async/assets/simple-B0FzZmn9.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/rollup-project-async/assets/simple-B0FzZmn9.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project-async/assets/simple-DVeM9ljI.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/rollup-project-async/assets/simple-DVeM9ljI.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project-async/assets/simple-iE_8-aNG.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/rollup-project-async/assets/simple-iE_8-aNG.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project-async/rollup.config.js: -------------------------------------------------------------------------------- 1 | import Pb2zig from '../../dist/index.js'; 2 | 3 | export default { 4 | input: './simple.pbk', 5 | plugins: [ 6 | Pb2zig({ topLevelAwait: false, nodeCompat: true, multithreaded: true }), 7 | ], 8 | output: { 9 | file: './simple.js', 10 | format: 'esm', 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project-async/simple.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel simple 4 | < namespace : "Your Namespace"; 5 | vendor : "Your Vendor"; 6 | version : 1; 7 | > 8 | { 9 | parameter float3x3 transform 10 | < 11 | minValue:float3x3( 12 | -1.0, -1.0, -1.0, 13 | -1.0, -1.0, -1.0, 14 | -1.0, -1.0, -1.0 15 | ); 16 | 17 | maxValue:float3x3( 18 | 1.0, 1.0, 1.0, 19 | 1.0, 1.0, 1.0, 20 | 1.0, 1.0, 1.0 21 | ); 22 | defaultValue:float3x3( 23 | 0.5, 0.0, 0.0, 24 | 0.3, 1.0, 0.7, 25 | 0.1, 0.3, 0.8 26 | ); 27 | >; 28 | 29 | input image3 src; 30 | output pixel3 dst; 31 | 32 | void 33 | evaluatePixel() 34 | { 35 | dst = sampleNearest(src,outCoord()); 36 | dst = transform * dst; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project/assets/simple-7d98870e.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/rollup-project/assets/simple-7d98870e.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project/assets/simple-DVeM9ljI.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/rollup-project/assets/simple-DVeM9ljI.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project/assets/simple-iE_8-aNG.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/rollup-project/assets/simple-iE_8-aNG.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project/rollup.config.js: -------------------------------------------------------------------------------- 1 | import Pb2zig from '../../dist/index.js'; 2 | 3 | export default { 4 | input: './simple.pbk', 5 | plugins: [ 6 | Pb2zig({ topLevelAwait: false, nodeCompat: true }), 7 | ], 8 | output: { 9 | file: './simple.js', 10 | format: 'esm', 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/rollup-project/simple.pbk: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel simple 4 | < namespace : "Your Namespace"; 5 | vendor : "Your Vendor"; 6 | version : 1; 7 | > 8 | { 9 | parameter float3x3 transform 10 | < 11 | minValue:float3x3( 12 | -1.0, -1.0, -1.0, 13 | -1.0, -1.0, -1.0, 14 | -1.0, -1.0, -1.0 15 | ); 16 | 17 | maxValue:float3x3( 18 | 1.0, 1.0, 1.0, 19 | 1.0, 1.0, 1.0, 20 | 1.0, 1.0, 1.0 21 | ); 22 | defaultValue:float3x3( 23 | 0.5, 0.0, 0.0, 24 | 0.3, 1.0, 0.7, 25 | 0.1, 0.3, 0.8 26 | ); 27 | >; 28 | 29 | input image3 src; 30 | output pixel3 dst; 31 | 32 | void 33 | evaluatePixel() 34 | { 35 | dst = sampleNearest(src,outCoord()); 36 | dst = transform * dst; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project-async/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project-async/dist/assets/crystallize-d39825fe.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/vite-project-async/dist/assets/crystallize-d39825fe.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project-async/dist/assets/index-82ad5941.css: -------------------------------------------------------------------------------- 1 | .App{display:flex;flex-direction:column;height:100vh;width:100vw;padding:5px}*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;background-color:#333;color:#fff} 2 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project-async/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-project-async", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^18.2.15", 18 | "@types/react-dom": "^18.2.7", 19 | "@vitejs/plugin-react-swc": "^3.3.2", 20 | "eslint": "^8.45.0", 21 | "eslint-plugin-react": "^7.32.2", 22 | "eslint-plugin-react-hooks": "^4.6.0", 23 | "eslint-plugin-react-refresh": "^0.4.3", 24 | "vite": "^4.4.5" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project-async/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | display: flex; 3 | flex-direction: column; 4 | height: 100vh; 5 | width: 100vw; 6 | padding: 5px; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project-async/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | font-family: Arial, Helvetica, sans-serif; 8 | background-color: #333333; 9 | color: #ffffff; 10 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project-async/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | ) 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project-async/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import React from '@vitejs/plugin-react-swc' 3 | import Pb2Zig from '../../dist/index.js'; 4 | 5 | export default defineConfig({ 6 | plugins: [ 7 | React(), 8 | Pb2Zig({ multithreaded: true }), 9 | ], 10 | server: { 11 | headers: { 12 | 'Cross-Origin-Opener-Policy': 'same-origin', 13 | 'Cross-Origin-Embedder-Policy': 'require-corp', 14 | } 15 | }, 16 | }) 17 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/dist/assets/crystallize-d39825fe.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/vite-project/dist/assets/crystallize-d39825fe.wasm -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/dist/assets/index-82ad5941.css: -------------------------------------------------------------------------------- 1 | .App{display:flex;flex-direction:column;height:100vh;width:100vw;padding:5px}*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;background-color:#333;color:#fff} 2 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/dist/assets/malgorzata-socha-f82491f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/vite-project/dist/assets/malgorzata-socha-f82491f2.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vite + React + Zigar 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/img/malgorzata-socha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chung-leong/pb2zig/b7bc8f06fcd2da4b8b36682e81ac014c32135d95/rollup-plugin-pb2zig/test/vite-project/img/malgorzata-socha.png -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vite + React + Zigar 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-project", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^18.2.15", 18 | "@types/react-dom": "^18.2.7", 19 | "@vitejs/plugin-react-swc": "^3.3.2", 20 | "eslint": "^8.45.0", 21 | "eslint-plugin-react": "^7.32.2", 22 | "eslint-plugin-react-hooks": "^4.6.0", 23 | "eslint-plugin-react-refresh": "^0.4.3", 24 | "vite": "^4.4.5" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | display: flex; 3 | flex-direction: column; 4 | height: 100vh; 5 | width: 100vw; 6 | padding: 5px; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | font-family: Arial, Helvetica, sans-serif; 8 | background-color: #333333; 9 | color: #ffffff; 10 | } -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | ) 9 | -------------------------------------------------------------------------------- /rollup-plugin-pb2zig/test/vite-project/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import React from '@vitejs/plugin-react-swc' 3 | import Pb2Zig from '../../dist/index.js'; 4 | 5 | export default defineConfig({ 6 | plugins: [ 7 | React(), 8 | Pb2Zig(), 9 | ], 10 | }) 11 | --------------------------------------------------------------------------------