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