"""Protocol surface for the coordinate_transforms component (ARCH-05).

Per ARCH-04 the implementation stays in ``core/coordinates.py`` —
this directory holds ONLY the Protocol so the ARCH-01 directory
inventory is complete. Method signatures mirror the concrete
``CoordinateTransformer`` public surface.
"""
from __future__ import annotations

from typing import Protocol, runtime_checkable

import numpy as np

from gps_denied.schemas import CameraParameters, GPSPoint


@runtime_checkable
class CoordinateTransformsProtocol(Protocol):
    """ENU origin management + WGS84⇄ENU⇄pixel transforms."""

    def set_enu_origin(self, flight_id: str, origin_gps: GPSPoint) -> None: ...

    def get_enu_origin(self, flight_id: str) -> GPSPoint: ...

    def gps_to_enu(
        self, flight_id: str, gps: GPSPoint
    ) -> tuple[float, float, float]: ...

    def enu_to_gps(
        self, flight_id: str, enu: tuple[float, float, float]
    ) -> GPSPoint: ...

    def pixel_to_gps(
        self,
        flight_id: str,
        pixel: tuple[float, float],
        frame_pose: dict,
        camera_params: CameraParameters,
        altitude: float,
        quaternion: np.ndarray | None = None,
    ) -> GPSPoint: ...

    def gps_to_pixel(
        self,
        flight_id: str,
        gps: GPSPoint,
        frame_pose: dict,
        camera_params: CameraParameters,
        altitude: float,
        quaternion: np.ndarray | None = None,
    ) -> tuple[float, float]: ...

    def image_object_to_gps(
        self,
        flight_id: str,
        frame_id: int,
        object_pixel: tuple[float, float],
        frame_pose: dict | None = None,
        camera_params: CameraParameters | None = None,
        altitude: float = 100.0,
        quaternion: np.ndarray | None = None,
    ) -> GPSPoint: ...

    def transform_points(
        self,
        points: list[tuple[float, float]],
        transformation: list[list[float]],
    ) -> list[tuple[float, float]]: ...
