blur

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package blur provides a fast separable blur used as a primitive by the effects package. It approximates a Gaussian with three successive box blurs, a well-known technique: three boxes converge to within a visually indistinct error of a true Gaussian, and each box blur is O(n) per pixel via a sliding window, independent of radius. Both passes parallelize across fixed bands so the result is deterministic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoxBlur

func BoxBlur(b *raster.Buffer, radius int)

BoxBlur applies a single box blur of the given pixel radius in place, exposed for callers that want the cheaper primitive directly

func Gaussian

func Gaussian(b *raster.Buffer, sigma float32)

Gaussian blurs the buffer in place, approximating a Gaussian of standard deviation sigma pixels. It operates on premultiplied channels, which is what shadow and glow effects need. A non-positive sigma is a no-op.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL