|
@@ -5,6 +5,7 @@ use clap::Parser;
|
|
use thyme::{
|
|
use thyme::{
|
|
data::{Config, Mapping},
|
|
data::{Config, Mapping},
|
|
draw::Pattern,
|
|
draw::Pattern,
|
|
|
|
+ file::ThymeFile,
|
|
image::Image,
|
|
image::Image,
|
|
};
|
|
};
|
|
|
|
|
|
@@ -17,6 +18,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
// load the color map file
|
|
// load the color map file
|
|
let mapping = Mapping::load(opts.mapping, &image)?;
|
|
let mapping = Mapping::load(opts.mapping, &image)?;
|
|
|
|
|
|
|
|
+ let thyme = ThymeFile::from_image_and_config(&image, &mapping);
|
|
|
|
+
|
|
let config = Config {
|
|
let config = Config {
|
|
grid_every: opts.grid,
|
|
grid_every: opts.grid,
|
|
line_weight: opts.line_weight,
|
|
line_weight: opts.line_weight,
|
|
@@ -32,9 +35,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
)?;
|
|
)?;
|
|
|
|
|
|
Pattern {
|
|
Pattern {
|
|
- image,
|
|
|
|
|
|
+ thyme,
|
|
config,
|
|
config,
|
|
- mapping,
|
|
|
|
}
|
|
}
|
|
.draw(cairo::Context::new(&surf)?)?;
|
|
.draw(cairo::Context::new(&surf)?)?;
|
|
|
|
|