use crate::annotators::Color;
#[derive(Debug, Clone)]
pub struct VertexAnnotator {
pub color: Color,
pub radius: u32,
}
impl VertexAnnotator {
pub fn new(color: Color, radius: u32) -> Self {
Self { color, radius }
}
}
impl Default for VertexAnnotator {
fn default() -> Self {
Self::new(Color::new(0xFF, 0x64, 0x37), 4)
}
}
#[derive(Debug, Clone)]
pub struct EdgeAnnotator {
pub color: Color,
pub thickness: u32,
pub edges: Vec<(usize, usize)>,
}
impl EdgeAnnotator {
pub fn new(color: Color, thickness: u32, edges: Vec<(usize, usize)>) -> Self {
Self {
color,
thickness,
edges,
}
}
pub fn coco_17(color: Color, thickness: u32) -> Self {
Self::new(color, thickness, crate::core::COCO_17_EDGES.to_vec())
}
}
#[derive(Debug, Clone)]
pub struct VertexLabelAnnotator {
pub color: Color,
pub text_scale: u32,
}
impl VertexLabelAnnotator {
pub fn new(color: Color, text_scale: u32) -> Self {
Self { color, text_scale }
}
}
impl Default for VertexLabelAnnotator {
fn default() -> Self {
Self::new(Color::new(255, 255, 255), 1)
}
}