"""Multi-view stereo reconstruction of underwater surfaces with refractive modeling."""

from importlib.util import find_spec

if find_spec("torch") is None:
    raise ImportError(
        "PyTorch is required but not installed. "
        "Install it from https://pytorch.org/get-started/locally/ "
        "choosing the appropriate CUDA version for your system. "
        "Example: pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121"
    )

from .calibration import (
    CalibrationData,
    CameraData,
    UndistortionData,
    compute_undistortion_maps,
    load_calibration_data,
    undistort_image,
)
from .coloring import best_view_colors, normalize_colors
from .config import (
    BenchmarkConfig,
    ColorNormConfig,
    DenseMatchingConfig,
    DenseStereoConfig,
    DeviceConfig,
    EvaluationConfig,
    FeatureExtractionConfig,
    FrameSamplingConfig,
    FusionConfig,
    MatchingConfig,
    PairSelectionConfig,
    PipelineConfig,
    PreprocessingConfig,
    ReconstructionConfig,
    RuntimeConfig,
    SparseMatchingConfig,
    SurfaceConfig,
)
from .evaluation import (
    cloud_to_cloud_distance,
    height_map_difference,
    icp_align,
    reprojection_error,
)
from .fusion import (
    backproject_depth_map,
    filter_all_depth_maps,
    filter_depth_map,
    fuse_depth_maps,
    load_point_cloud,
    save_point_cloud,
)
from .masks import (
    apply_mask_to_depth,
    apply_mask_to_features,
    load_all_masks,
    load_mask,
)
from .pipeline import (
    Pipeline,
    PipelineContext,
    process_frame,
    run_pipeline,
    setup_pipeline,
)
from .surface import (
    export_mesh,
    load_mesh,
    reconstruct_bpa,
    reconstruct_heightfield,
    reconstruct_poisson,
    reconstruct_surface,
    save_mesh,
    simplify_mesh,
)
from .triangulation import (
    compute_depth_ranges,
    filter_sparse_cloud,
    load_sparse_cloud,
    save_sparse_cloud,
    triangulate_all_pairs,
    triangulate_pair,
    triangulate_rays,
)

__version__ = "0.1.0"

__all__ = [
    "PipelineConfig",
    "PreprocessingConfig",
    "SparseMatchingConfig",
    "DenseMatchingConfig",
    "ReconstructionConfig",
    "RuntimeConfig",
    "FrameSamplingConfig",
    "FeatureExtractionConfig",
    "PairSelectionConfig",
    "MatchingConfig",
    "DenseStereoConfig",
    "FusionConfig",
    "SurfaceConfig",
    "EvaluationConfig",
    "DeviceConfig",
    "BenchmarkConfig",
    "ColorNormConfig",
    "CalibrationData",
    "CameraData",
    "UndistortionData",
    "load_calibration_data",
    "compute_undistortion_maps",
    "undistort_image",
    "best_view_colors",
    "normalize_colors",
    "triangulate_rays",
    "triangulate_pair",
    "triangulate_all_pairs",
    "filter_sparse_cloud",
    "compute_depth_ranges",
    "save_sparse_cloud",
    "load_sparse_cloud",
    "filter_depth_map",
    "filter_all_depth_maps",
    "backproject_depth_map",
    "fuse_depth_maps",
    "save_point_cloud",
    "load_point_cloud",
    "load_mask",
    "load_all_masks",
    "apply_mask_to_features",
    "apply_mask_to_depth",
    "reconstruct_poisson",
    "reconstruct_heightfield",
    "reconstruct_bpa",
    "reconstruct_surface",
    "save_mesh",
    "load_mesh",
    "export_mesh",
    "simplify_mesh",
    "icp_align",
    "cloud_to_cloud_distance",
    "height_map_difference",
    "reprojection_error",
    "Pipeline",
    "PipelineContext",
    "setup_pipeline",
    "process_frame",
    "run_pipeline",
]
