2025-12-10 00:01:32 +08:00

67 lines
2.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <IKapBoard.h>
#include <IKapC.h>
#include <stdio.h>
#include <stdlib.h>
/// \~chinese 用户输入回车键后退出程序 \~english Users enter Enter to exit the program
inline void pressEnterToExit(void)
{
fprintf(stderr, "\nPress enter to exit.\n");
while (getchar() != '\n')
;
}
/* @brief判断函数是否成功调用。
* @param[in] errc函数返回值。
*
* @briefDetermine whether the function is called successfully.
* @param[in] errcFunction return value. */
#define CHECK(errc) \
if (ITKSTATUS_OK != errc) \
printErrorAndExit(errc)
/* @brief判断 IKapBoard 函数是否成功调用。
* @param[in] errc函数返回值。
*
* @briefDetermine whether the IKapBoard function is called successfully.
* @param[in] errcFunction return value. */
#define CHECK_IKAPBOARD(errc) \
if (errc != 1) \
printIKapBoardErrorAndExit()
/* @brief判断 IKapC 函数是否成功调用。
* @param[in] errc函数返回值。
*
* @briefDetermine whether the IKapC function is called successfully.
* @param[in] errcFunction return value. */
#define CHECK_IKAPC(errc) \
if (errc != ITKSTATUS_OK) \
printIKapCErrorAndExit(errc)
/* @brief打印错误信息后退出程序。
* @param[in] errc函数返回值。
*
* @briefPrint error message and exit the program.
* @param[in] errcFunction return value. */
void printErrorAndExit(ITKSTATUS errc);
/* @brief打印 IKapBoard 错误信息后退出程序。
*
* @briefPrint IKapBoard error message and exit the program. */
void printIKapBoardErrorAndExit();
/* @brief打印 IKapC 错误信息后退出程序。
* @param[in] errc函数返回值。
*
* @briefPrint IKapC error message and exit the program.
* @param[in] errcFunction return value. */
void printIKapCErrorAndExit(ITKSTATUS errc);
/* @brief打印相机信息。
* @param[in] numCameras枚举到的可用相机个数。
*
* @briefPrint cameras information.
* @param[in] numCamerasThe number of available cameras enumerated. */
void printCameraInfo(uint32_t numCameras);