#![allow(unused)]
use anyhow::Result;
use runarium::{
configs::{
image_config::RouteImageConfig,
video_config::{
Color, FileConfig, Font, LapDataConfig, PaceDistConfig, RouteColor,
RouteScale, RouteVideoConfig,
},
},
generators::{
route_image::{image_route_with_config, route_image},
route_video::{progressive_route, progressive_route_with_config},
},
utils::performance::measure,
};
fn main() -> Result<()> {
let route_scale = RouteScale::new(
0.2, 0.1, 0.1, );
let colors = RouteColor::new(
[0.0, 0.0, 255.0, 0.0], [0.0, 255.0, 0.0, 0.0], [255.0, 255.0, 255.0, 0.0], [0.0, 165.0, 255.0, 0.0], );
let pace_dist = PaceDistConfig::new(
0.6, 2, Font::Simplex, None, true, true, );
let lap_data = LapDataConfig::new(
(0.5, 0.09), 0.5, 1, Font::Simplex, Color::White, true, true, true, );
let video_file_config = FileConfig::new(
"source/example.fit".to_string(),
"source/example.jpg".to_string(),
"outputs/config.mp4".to_string(),
);
let video_config = RouteVideoConfig::new(
route_scale,
colors,
pace_dist,
lap_data.clone(),
video_file_config,
true, true, true, );
let image_file_config = FileConfig::new(
"source/example.fit".to_string(),
"source/example.jpg".to_string(),
"outputs/route.png".to_string(),
);
let image_config = RouteImageConfig::with_lap_data(
route_scale,
colors,
image_file_config,
2, lap_data,
);
measure("Total execution", || {
progressive_route_with_config(video_config)
})?;
Ok(())
}