xiQ - Technical Manual Version 1.0
87
5.6.
Programming
5.6.1.
XIMEA APIs
•
- Legacy API , plain C/C++ (Not recommended for new developments)
•
- Streamlined API. The standard API for C/C++ based projects, see
•
- Managed .NET Common Language Runtime (CLR) API.
xiAPI.NET is designed as a wrapper around xiAPI and therefore shares most of its functionality.
5.6.2.
xiAPI Overview
xiAPI stands for XIMEA Application Programming Interface. It is a new common interface for all XIMEA cameras, and represents a
simplified version of generic
Architecture
API is a software interface between the camera system driver and application.
•
On Windows: xiAPI is compiled into m3api.dll
•
On Linux: xiAPI is compiled into /usr/lib/libm3api.so
Installation
xiAPI is part of all current XIMEA software packages for Windows, Linux and MacOS.
For information on the software packages, see
5.6.3.
xiAPI Functions Description
The core of xiAPI consists of the following functions, which allow controlling of the camera functionality.
// get the number of discovered devices.
XI_RETURN xiGetNumberDevices(OUT DWORD *pNumberDevices);
// open interface
XI_RETURN xiOpenDevice(IN DWORD DevId, OUT PHANDLE hDevice);
// get parameter
XI_RETURN xiGetParam(IN HANDLE hDevice,
const
char
* prm,
void
* val,
DWORD * size, XI_PRM_TYPE * type);
// set parameter
XI_RETURN xiSetParam(IN HANDLE hDevice,
const
char
* prm,
void
* val,
DWORD size, XI_PRM_TYPE type);
// start the data acquisition
XI_RETURN xiStartAcquisition(IN HANDLE hDevice);
// acquire image and return image information
XI_RETURN xiGetImage(IN HANDLE hDevice, IN DWORD TimeOut, INOUT XI_IMG
* img);
// stop the data acquisition
XI_RETURN xiStopAcquisition(IN HANDLE hDevice);
// close interface
XI_RETURN xiCloseDevice(IN HANDLE hDevice);