► |  | Images

1 | Icons
2 | Logos
3 | Embedding Bitmaps in Compiled Files
4 | Floating-Point Bitmaps

▼ | 4 | Floating-Point Bitmaps

4.1 | Overview
4.2 | Struct Type and Accessors
4.3 | Conversion and Construction
4.4 | Component Operations
4.5 | Pointwise Operations
4.6 | Gradients and Normals
4.7 | Blur
4.8 | Resizing
4.9 | Compositing
4.10 | Spatial Transformations
4.11 | Effects

On this page:

flomap-gaussian-blur
flomap-gaussian-blur-x
flomap-gaussian-blur-y
flomap-box-blur
flomap-box-blur-x
flomap-box-blur-y
flomap-blur
flomap-blur-x
flomap-blur-y

top← prev up next →

#### 4.7`` Blur

> > procedure

> > (flomap-gaussian-blur fm xσ [yσ]) → flomap

> fm : flomap
> xσ : Real
> yσ : Real = xσ

Returns fm convolved, per-component, with an axis-aligned Gaussian kernel with standard deviations xσ and yσ.

If perfect Gaussian blur is not important, use flomap-blur instead, which approximates Gaussian blur closely and is faster.

Examples:

> > (flomap->bitmap (flomap-gaussian-blur (flomap-inset fm 12) 4))
> > (flomap->bitmap (flomap-gaussian-blur (flomap-inset fm 12 3) 4 1))

> > procedure

> > (flomap-gaussian-blur-x fm σ) → flomap

> fm : flomap
> σ : Real

Returns fm convolved, per-component and per-row, with a Gaussian kernel with standard deviation σ.

If perfect Gaussian blur is not important, use flomap-blur-x instead, which approximates Gaussian blur closely and is usually much faster.

Example:

> > (flomap->bitmap (flomap-gaussian-blur-x (flomap-inset fm 12 0) 4))

> > procedure

> > (flomap-gaussian-blur-y fm σ) → flomap

> fm : flomap
> σ : Real

Like flomap-gaussian-blur-x, but per-column instead of per-row.

> > procedure

> > (flomap-box-blur fm x-radius [y-radius]) → flomap

> fm : flomap
> x-radius : Real
> y-radius : Real = x-radius

Returns fm convolved, per-component, with a box kernel with radii x-radius and y-radius. The radii are of the largest axis-aligned ellipse that would fit in the box.

Examples:

> > (flomap->bitmap (flomap-box-blur (flomap-inset fm 4) 4))
> > (flomap->bitmap (flomap-box-blur (flomap-inset fm 4 1) 4 1))

> > procedure

> > (flomap-box-blur-x fm radius) → flomap

> fm : flomap
> radius : Real

Returns fm convolved, per-component and per-row, with a box kernel with radius radius.

Example:

> > (flomap->bitmap (flomap-box-blur-x (flomap-inset fm 4 0) 4))

> > procedure

> > (flomap-box-blur-y fm radius) → flomap

> fm : flomap
> radius : Real

Like flomap-box-blur-x, but per-column instead of per-row.

> > procedure

> > (flomap-blur fm xσ [yσ]) → flomap

> fm : flomap
> xσ : Real
> yσ : Real = xσ

Returns approximately the result of (flomap-gaussian-blur fm xσ yσ).

Gaussian blur, as it is implemented by flomap-gaussian-blur, is O(xσ + yσ) for any fixed flomap size. On the other hand, flomap-blur is O(1) for the same size.

Examples:

> > (define gauss-blur-fm (time (flomap-gaussian-blur fm 12)))
> cpu time: 287 real time: 288 gc time: 0

> > (define blur-fm (time (flomap-blur fm 12)))
> cpu time: 101 real time: 101 gc time: 0

> > (flomap-extreme-values
> (fmsqr (fm- gauss-blur-fm blur-fm)))

> 0.0
> 0.0031581298032790717

> > procedure

> > (flomap-blur-x fm xσ) → flomap

> fm : flomap
> xσ : Real

Like flomap-blur, but blurs per-row only.

> > procedure

> > (flomap-blur-y fm yσ) → flomap

> fm : flomap
> yσ : Real

Like flomap-blur, but blurs per-column only.
top← prev up next →