"""共通フィクスチャ．

全テストモジュールから利用可能な pytest フィクスチャを定義する．
"""

import numpy
import pytest


@pytest.fixture
def uniform_luminance_100x100() -> numpy.ndarray:
    """全画素が 100.0 の (100, 100) 輝度配列."""
    return numpy.full((100, 100), 100.0, dtype=numpy.float64)


@pytest.fixture
def radial_gradient_luminance_100x100() -> numpy.ndarray:
    """中心が明るく周辺が暗い放射グラジェント輝度配列 (100, 100).

    正規化楕円距離 d を用いて 200 - 100 * d で合成する．
    中心 (d=0) で 200，周辺 (d=1) で 100 程度となる．
    """
    from sm_tias_lightsim.evaluation.zones import compute_normalized_distance_map

    d = compute_normalized_distance_map(100, 100)
    return (200.0 - 100.0 * d).astype(numpy.float64)


@pytest.fixture
def red_pixel() -> numpy.ndarray:
    """純赤 (255, 0, 0) の 1x1 uint8 RGB 画像."""
    return numpy.array([[[255, 0, 0]]], dtype=numpy.uint8)


@pytest.fixture
def green_pixel() -> numpy.ndarray:
    """純緑 (0, 255, 0) の 1x1 uint8 RGB 画像."""
    return numpy.array([[[0, 255, 0]]], dtype=numpy.uint8)


@pytest.fixture
def blue_pixel() -> numpy.ndarray:
    """純青 (0, 0, 255) の 1x1 uint8 RGB 画像."""
    return numpy.array([[[0, 0, 255]]], dtype=numpy.uint8)
