#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
offline_bg — 离线背景预处理（实时换脸换背景项目的第一个服务模块）。

一次会话的用法：
    from offline_bg import profile_camera, BackgroundPreprocessor, BackgroundLibrary

    frames  = frames_from_video("cam.mp4", 9)        # 产线里换成摄像头连续 9 帧
    profile = profile_camera(frames)                 # ① 估主光方向 + 画质画像
    prep    = BackgroundPreprocessor()
    rec     = prep.process(bg_bgr, profile, user_id="u1")   # ②③④⑤

    # 会话开始时按当前光照挑背景
    entry = BackgroundLibrary().pick("u1", profile)

所有已验证实现来自 reference/validated_impl.py（唯一真源），本包不复制不改写。
"""
from .config import DEFAULT, OfflineBGConfig
from .library import BackgroundLibrary
from .lighting import CameraProfile, classify_dir, frames_from_video, get_face_app, profile_camera
from .pipeline import BackgroundPreprocessor
from .quality import match_quality, quality_report
from .validate import EXPECT, axis_diff, score_direction, tb_brightness_diff

__all__ = [
    "OfflineBGConfig", "DEFAULT",
    "CameraProfile", "profile_camera", "frames_from_video", "get_face_app", "classify_dir",
    "BackgroundPreprocessor", "BackgroundLibrary",
    "score_direction", "axis_diff", "tb_brightness_diff", "EXPECT",
    "match_quality", "quality_report",
]
__version__ = "0.1.0"
