use std::hash::Hash;
use std::collections::HashMap;
use image::{Rgb, RgbImage};
use imageproc::drawing::{
draw_filled_rect_mut,
draw_line_segment_mut
};
use imageproc::rect::Rect;
pub fn draw_uniform_colored_background(image : &mut RgbImage, img_width : &f32, img_height : &f32, color : Rgb<u8>) {
draw_filled_rect_mut(image, Rect::at(0,0).of_size(*img_width as u32,*img_height as u32), color);
}
pub fn draw_lifelines_vertical_spans<LI : Eq + Hash + Copy + Clone>(
image : &mut RgbImage,
absolute_top_y_pos : f32,
lifelines_horizontal_positions : &HashMap<LI,f32>,
absolute_bottom_y_pos : f32,
lifelines_colors : &HashMap<LI,Rgb<u8>>,
) {
for (lf_id,lf_x_middle) in lifelines_horizontal_positions {
let color = lifelines_colors.get(lf_id).unwrap();
draw_line_segment_mut(image,
(*lf_x_middle, absolute_top_y_pos),
(*lf_x_middle, absolute_bottom_y_pos),
*color
);
}
}