/* @brief: This example shows users how to find available cameras. */
#include<stdio.h>
#include<stdlib.h>
#include"IKapC.h"
/* @brief: Determine whether the function is called successfully.
*@param[in]errc:Functionreturnvalue.*/
#define CHECK(errc) if (ITKSTATUS_OK != errc) printErrorAndExit(errc)
/* @brief: Users enter Enter to exit the program. */
voidpressEnterToExit(void);
/* @brief: Print error message and exit the program.
*@param[in]errc:Functionreturnvalue.*/
voidprintErrorAndExit(ITKSTATUSerrc);
intmain(void)
{
// Return value of IKapC functions.
ITKSTATUSres=ITKSTATUS_OK;
// The number of available devices.
uint32_tnumDevices=0;
// Initialize IKapC runtime environment.
res=ItkManInitialize();
CHECK(res);
// Enumerate the number of available devices. Before opening the device, ItkManGetDeviceCount() function must be called.
res=ItkManGetDeviceCount(&numDevices);
CHECK(res);
// When there is no connected devices.
if(numDevices==0)
{
fprintf(stderr,"No device.\n");
ItkManTerminate();
pressEnterToExit();
exit(EXIT_FAILURE);
}
// Print information of connected cameras.
uint32_ti=0;
for(;i<numDevices;++i)
{
// Camera information structure.
ITKDEV_INFOdi;
// Get device information.
ItkManGetDeviceInfo(i,&di);
// Print information.
printf("Device Full Name:%s\n Friendly Name:%s\n Vendor Name:%s\n Model Name:%s\n Serial Name:%s\n Device Class:%s\n Device Version:%s\n User Defined Name:%s\n",