Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
GaussianBlur.h File Reference
#include <array>
#include <cstdint>
#include "donner/gpu/shader/CompiledShader.h"
Include dependency graph for GaussianBlur.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::gpu::shader::programs::GaussianBlurParams
 Host layout for the params uniform resource of the Gaussian blur program. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

const CompiledShaderView & donner::gpu::shader::programs::GaussianBlurShader ()
 Returns the WGSL projection and reflected interface used by the Geode backend.
const CompiledShaderView & donner::gpu::shader::programs::GaussianBlurNativeShader ()
 Returns the native projection and reflected interface used by Metal or Vulkan.

Variables

constexpr uint32_t donner::gpu::shader::programs::kGaussianBlurKernelGaussian = 0
 GaussianBlurParams::kernelType for a sampled Gaussian, the shader's default path.
constexpr uint32_t donner::gpu::shader::programs::kGaussianBlurKernelBox = 1
 GaussianBlurParams::kernelType for one box pass; mirrored as kKernelBox.
constexpr uint32_t donner::gpu::shader::programs::kGaussianBlurKernelBoxCascade = 2
 GaussianBlurParams::kernelType for all three box passes of the window in GaussianBlurParams::boxLeft at once, with transparent edges; mirrored as kKernelBoxCascade.
constexpr uint32_t donner::gpu::shader::programs::kGaussianBlurEdgeTransparent = 0
 GaussianBlurParams::edgeMode reading transparent black outside the input; mirrored as kEdgeTransparent.
constexpr uint32_t donner::gpu::shader::programs::kGaussianBlurEdgeDuplicate = 1
 GaussianBlurParams::edgeMode clamping to the nearest edge pixel; mirrored as kEdgeDuplicate.
constexpr uint32_t donner::gpu::shader::programs::kGaussianBlurEdgeWrap = 2
 GaussianBlurParams::edgeMode wrapping around the input, the shader's default path.

Function Documentation

◆ GaussianBlurNativeShader()

const CompiledShaderView & donner::gpu::shader::programs::GaussianBlurNativeShader ( )

Returns the native projection and reflected interface used by Metal or Vulkan.

Returns
Stable view into a process-lifetime compiled artifact.

◆ GaussianBlurShader()

const CompiledShaderView & donner::gpu::shader::programs::GaussianBlurShader ( )

Returns the WGSL projection and reflected interface used by the Geode backend.

The filter admission path bounds finite sigma to [0,256], box extents to [0,240], cascade windows to [2,481], and supplies equally sized nonempty source and destination textures. The cascade kernel weighs each input tap by how many ways the three box passes reach it, so it equals the three passes without discarding what they spread past the texture edge. The shader caps Gaussian support at 127 pixels and applies its optional output clip before the [0,1] output clamp.

Returns
Stable view into a process-lifetime compiled artifact.