Crate svgfilters[][src]

Expand description

svgfilters provides low-level SVG filters implementation.

svgfilters doesn’t implement the whole filters workflow, just operations on raster images. Filter region calculation, image colors (un)premultiplication, input validation, filter primitives order, transformations, etc. should be implemented by the caller.

Implemented filters

Unimplemented filters

  • feFlood, because it’s just a simple fill.
  • feImage, because it can be implemented only by a caller.
  • feTile, because it’s basically a fill with pattern.
  • feMerge, because it’s just a layer compositing and a 2D library will be faster.
  • feOffset, because it’s just a layer compositing with offset.

Performance

The library isn’t well optimized yet, but it’s mostly allocation free. Some methods will allocate necessary, temporary buffers which will be reflected in the documentation. But majority of methods will work on provided buffers.

Structs

A convolve matrix used by convolve_matrix.

An image reference.

A mutable ImageRef variant.

Enums

A color channel.

A color matrix used by color_matrix.

An edges processing mode used by convolve_matrix.

A light source.

A morphology operation.

A transfer function used component_transfer.

Functions

Performs an arithmetic composition.

Applies a box blur.

Applies a color matrix filter.

Applies component transfer functions for each src image channel.

Applies a convolve matrix.

Demultiplies provided pixels alpha.

Renders a diffuse lighting.

Applies a displacement map.

Converts input pixel from LinearRGB into sRGB.

Applies an IIR blur.

Converts input pixel from sRGB into LinearRGB.

Applies a morphology filter.

Multiplies provided pixels alpha.

Renders a specular lighting.

Applies a turbulence filter.

Type Definitions

8-bit RGB

8-bit RGBA, alpha is last. 0 = transparent, 255 = opaque.