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
- feColorMatrix
- feComponentTransfer
- feComposite Only the arithmetic operator is supported since other one are pretty common and should be implemented by the 2D library itself.
- feConvolveMatrix
- feDiffuseLighting
- feDisplacementMap
- feGaussianBlur Box blur and IIR blur variants are available.
- feMorphology
- feSpecularLighting
- feTurbulence
§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§
- Convolve
Matrix - A convolve matrix used by
convolve_matrix
. - Image
Ref - An image reference.
- Image
RefMut - A mutable
ImageRef
variant.
Enums§
- Color
Channel - A color channel.
- Color
Matrix - A color matrix used by
color_matrix
. - Edge
Mode - An edges processing mode used by
convolve_matrix
. - Light
Source - A light source.
- Morphology
Operator - A morphology operation.
- Transfer
Function - A transfer function used
component_transfer
.
Functions§
- arithmetic_
composite - Performs an arithmetic composition.
- box_
blur - Applies a box blur.
- color_
matrix - Applies a color matrix filter.
- component_
transfer - Applies component transfer functions for each
src
image channel. - convolve_
matrix - Applies a convolve matrix.
- demultiply_
alpha - Demultiplies provided pixels alpha.
- diffuse_
lighting - Renders a diffuse lighting.
- displacement_
map - Applies a displacement map.
- from_
linear_ rgb - Converts input pixel from LinearRGB into sRGB.
- iir_
blur - Applies an IIR blur.
- into_
linear_ rgb - Converts input pixel from sRGB into LinearRGB.
- morphology
- Applies a morphology filter.
- multiply_
alpha - Multiplies provided pixels alpha.
- specular_
lighting - Renders a specular lighting.
- turbulence
- Applies a turbulence filter.