from __future__ import annotations

from PIL import Image, ImageDraw

from planemapper.constants import COLOUR_HOME_MARKER
from planemapper.renderer.projection import MapBounds, project


def draw_home_marker(image: Image.Image, bounds: MapBounds) -> None:
    cx, cy = project(bounds.home_lat, bounds.home_lon, bounds)
    draw = ImageDraw.Draw(image)
    draw.line([(cx - 10, cy), (cx + 10, cy)], fill=COLOUR_HOME_MARKER, width=3)
    draw.line([(cx, cy - 10), (cx, cy + 10)], fill=COLOUR_HOME_MARKER, width=3)
