Source code for radioviz.models.transform_model

#  Copyright 2026 European Union
#  Author: Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)
#  SPDX-License-Identifier: EUPL-1.2
"""
Transform model definitions for RadioViz application.

This module defines data structures for representing geometric transformations
including affine and homography transforms with their associated parameters.
"""

from __future__ import annotations

import sys
from dataclasses import dataclass

if sys.version_info >= (3, 11):
    from enum import StrEnum
else:
    from radioviz.models.legacy import StrEnum

from typing import Any


[docs] class TransformType(StrEnum): """ Enumeration of supported transform types. This enum defines the different types of geometric transformations that can be applied to images or coordinates in radio visualization applications. """ AFFINE = 'Affine' """Affine transformation type.""" HOMOGRAPHY = 'Homography' """Homography transformation type."""
[docs] @dataclass(frozen=True) class Transform: """ Data class representing a geometric transformation. This class encapsulates the type and parameters of a geometric transformation, allowing for immutable storage and easy comparison of transformation configurations. """ type: TransformType """ The type of transformation to apply. :type: TransformType """ params: dict[str, Any] """ Dictionary containing transformation parameters. :type: dict[str, Any] """