lang: basic parser
This commit is contained in:
parent
ae86ae29ab
commit
ca84af4e1b
11 changed files with 362 additions and 33 deletions
|
@ -8,7 +8,7 @@ edition = "2021"
|
|||
[dependencies]
|
||||
csscolorparser = "0.6.2"
|
||||
indexmap = "2.2.5"
|
||||
petgraph = "0.6.4"
|
||||
petgraph = { workspace = true }
|
||||
quick-xml = { version = "0.31.0", features = ["serialize"] }
|
||||
|
||||
[lints]
|
||||
|
|
|
@ -1,35 +1,8 @@
|
|||
use std::hint::black_box;
|
||||
|
||||
use svg_filters::{
|
||||
codegen::SvgDocument,
|
||||
types::{
|
||||
graph::edge::Edge,
|
||||
nodes::{
|
||||
primitives::{
|
||||
blend::BlendMode,
|
||||
color_matrix::ColorMatrixType,
|
||||
turbulence::{NoiseType, StitchTiles, Turbulence},
|
||||
FePrimitive,
|
||||
},
|
||||
standard_input::StandardInput,
|
||||
},
|
||||
},
|
||||
Node,
|
||||
};
|
||||
use svg_filters::codegen::SvgDocument;
|
||||
|
||||
fn main() {
|
||||
let mut doc = SvgDocument::new();
|
||||
|
||||
let noise = doc.create_filter("noise");
|
||||
|
||||
noise.add_node(Node::simple(FePrimitive::Turbulence(Turbulence {
|
||||
base_frequency: (0.2, 0.2),
|
||||
num_octaves: 1,
|
||||
seed: 2,
|
||||
stitch_tiles: StitchTiles::NoStitch,
|
||||
noise_type: NoiseType::FractalNoise,
|
||||
})));
|
||||
|
||||
eprintln!("{}", doc.generate_svg_pretty());
|
||||
println!("{}", doc.generate_svg());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue