forked from katzen-cafe/iowo
svg-filters: add nice abstractions for component transfer
This commit is contained in:
parent
9727ef82ca
commit
9ae8c2fbd3
4 changed files with 135 additions and 14 deletions
|
@ -1,6 +1,5 @@
|
|||
use std::convert::Into;
|
||||
|
||||
use quick_xml::{events::attributes::Attribute, ElementWriter, Writer};
|
||||
use std::convert::Into;
|
||||
|
||||
use super::CommonAttrs;
|
||||
|
||||
|
@ -86,18 +85,18 @@ impl WriteElement for FePrimitive {
|
|||
FePrimitive::ColorMatrix(el) => el.attrs(),
|
||||
FePrimitive::ComponentTransfer(el) => el.attrs(),
|
||||
FePrimitive::Composite(el) => el.attrs(),
|
||||
FePrimitive::GaussianBlur(el) => el.attrs(),
|
||||
FePrimitive::Offset(el) => el.attrs(),
|
||||
FePrimitive::Turbulence(el) => el.attrs(),
|
||||
FePrimitive::ConvolveMatrix(_) => todo!(),
|
||||
FePrimitive::DiffuseLighting(_) => todo!(),
|
||||
FePrimitive::DisplacementMap(_) => todo!(),
|
||||
FePrimitive::Flood(_) => todo!(),
|
||||
FePrimitive::GaussianBlur(el) => el.attrs(),
|
||||
FePrimitive::Image(_) => todo!(),
|
||||
FePrimitive::Merge(_) => todo!(),
|
||||
FePrimitive::Morphology(_) => todo!(),
|
||||
FePrimitive::Offset(el) => el.attrs(),
|
||||
FePrimitive::SpecularLighting(_) => todo!(),
|
||||
FePrimitive::Tile(_) => todo!(),
|
||||
FePrimitive::Turbulence(el) => el.attrs(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,18 +106,18 @@ impl WriteElement for FePrimitive {
|
|||
FePrimitive::ColorMatrix(el) => el.tag_name(),
|
||||
FePrimitive::ComponentTransfer(el) => el.tag_name(),
|
||||
FePrimitive::Composite(el) => el.tag_name(),
|
||||
FePrimitive::GaussianBlur(el) => el.tag_name(),
|
||||
FePrimitive::Offset(el) => el.tag_name(),
|
||||
FePrimitive::Turbulence(el) => el.tag_name(),
|
||||
FePrimitive::ConvolveMatrix(_) => todo!(),
|
||||
FePrimitive::DiffuseLighting(_) => todo!(),
|
||||
FePrimitive::DisplacementMap(_) => todo!(),
|
||||
FePrimitive::Flood(_) => todo!(),
|
||||
FePrimitive::GaussianBlur(el) => el.tag_name(),
|
||||
FePrimitive::Image(_) => todo!(),
|
||||
FePrimitive::Merge(_) => todo!(),
|
||||
FePrimitive::Morphology(_) => todo!(),
|
||||
FePrimitive::Offset(el) => el.tag_name(),
|
||||
FePrimitive::SpecularLighting(_) => todo!(),
|
||||
FePrimitive::Tile(_) => todo!(),
|
||||
FePrimitive::Turbulence(el) => el.tag_name(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,18 +133,18 @@ impl WriteElement for FePrimitive {
|
|||
FePrimitive::ColorMatrix(el) => el.element_writer(writer, common, inputs, output),
|
||||
FePrimitive::ComponentTransfer(el) => el.element_writer(writer, common, inputs, output),
|
||||
FePrimitive::Composite(el) => el.element_writer(writer, common, inputs, output),
|
||||
FePrimitive::Turbulence(el) => el.element_writer(writer, common, inputs, output),
|
||||
FePrimitive::GaussianBlur(el) => el.element_writer(writer, common, inputs, output),
|
||||
FePrimitive::Offset(el) => el.element_writer(writer, common, inputs, output),
|
||||
FePrimitive::ConvolveMatrix(_) => todo!(),
|
||||
FePrimitive::DiffuseLighting(_) => todo!(),
|
||||
FePrimitive::DisplacementMap(_) => todo!(),
|
||||
FePrimitive::Flood(_) => todo!(),
|
||||
FePrimitive::GaussianBlur(el) => el.element_writer(writer, common, inputs, output),
|
||||
FePrimitive::Image(_) => todo!(),
|
||||
FePrimitive::Merge(_) => todo!(),
|
||||
FePrimitive::Morphology(_) => todo!(),
|
||||
FePrimitive::Offset(el) => el.element_writer(writer, common, inputs, output),
|
||||
FePrimitive::SpecularLighting(_) => todo!(),
|
||||
FePrimitive::Tile(_) => todo!(),
|
||||
FePrimitive::Turbulence(el) => el.element_writer(writer, common, inputs, output),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ impl WriteElement for ComponentTransfer {
|
|||
}
|
||||
|
||||
/// [transfer functions](https://www.w3.org/TR/SVG11/filters.html#transferFuncElements)
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum TransferFn {
|
||||
Identity,
|
||||
Table {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue