use super::{
config::{FileConfig, RouteColor, RouteScale},
video_config::LapDataConfig,
};
#[derive(Debug, Clone)]
pub struct RouteImageConfig {
pub route_scale: RouteScale,
pub colors: RouteColor,
pub file_config: FileConfig,
pub line_thickness: i32,
pub lap_data: Option<LapDataConfig>,
pub show_lap_data: bool,
}
impl RouteImageConfig {
pub fn new(
route_scale: RouteScale,
colors: RouteColor,
file_config: FileConfig,
line_thickness: i32,
) -> Self {
Self {
route_scale,
colors,
file_config,
line_thickness,
lap_data: None,
show_lap_data: false,
}
}
pub fn with_lap_data(
route_scale: RouteScale,
colors: RouteColor,
file_config: FileConfig,
line_thickness: i32,
lap_data: LapDataConfig,
) -> Self {
Self {
route_scale,
colors,
file_config,
line_thickness,
lap_data: Some(lap_data),
show_lap_data: true,
}
}
pub fn default(
fit_file: String,
background_image: String,
output_file: String,
) -> Self {
Self {
route_scale: RouteScale::default(),
colors: RouteColor::default(),
file_config: FileConfig::new(fit_file, background_image, output_file),
line_thickness: 2,
lap_data: None,
show_lap_data: false,
}
}
}