#ifndef WRAPPER_H
#define WRAPPER_H

/* ============================================================
   P 项目 — wrapper.h
   封装层头文件 — 5 个 C 接口，供 Python ctypes 调用
   编译目标: wrapper.dll (Windows x64, Visual Studio)
   ============================================================ */

#ifdef __cplusplus
extern "C" {
#endif

    /* ───── 1. 加密狗操作 ───── */

    /**
     * @brief 打开加密狗（ICDevice.dll）
     * @return 0=成功, 非0=错误码
     */
    __declspec(dllexport) int IC_Open(void);

    /**
     * @brief 关闭加密狗
     */
    __declspec(dllexport) void IC_Close(void);

    /* ───── 2. 相机操作 ───── */

    /**
     * @brief 初始化双目相机
     * @return 0=成功, 非0=错误码
     */
    __declspec(dllexport) int Camera_Init(void);

    /**
     * @brief 采集一帧图像
     * @param left_buf   [out] 左相机灰度图缓冲区
     * @param right_buf  [out] 右相机灰度图缓冲区
     * @param width      [out] 返回当前分辨率宽度
     * @param height     [out] 返回当前分辨率高度
     * @return 0=成功, 非0=错误码
     */
    __declspec(dllexport) int Camera_Capture(
        unsigned char* left_buf,
        unsigned char* right_buf,
        int*           width,
        int*           height
    );

    /**
     * @brief 关闭相机
     */
    __declspec(dllexport) void Camera_Close(void);

#ifdef __cplusplus
}
#endif

#endif /* WRAPPER_H */
