basler_fg.h Source File

basler_fg.h
Go to the documentation of this file.
1
13#ifndef __BASLER_FG_H
14#define __BASLER_FG_H
15
16#pragma warning(push)
17#pragma warning(disable: 4005)
18#if defined(_MSC_VER) && (_MSC_VER < 1600)
19#include <msinttypes/stdint.h>
20#else
21#include <stdint.h>
22#endif
23#pragma warning(pop)
24
25#include <sys/types.h>
26
27#include "fg_struct.h"
28#include "fg_define.h"
29#include "fg_error_codes.h"
30#include "os_type.h"
31#include "os_funcs.h"
32
33#include "SisoDisplay.h"
34
35// For GCC, we control visibility of symbols via attributes
36// For MSVC this is done via a .def file.
37// TODO: Move this to a common place for all libraries?
38#if defined(__GNUC__) && (__GNUC__ >= 4)
39 #define PUBLIC_API __attribute__ ((visibility ("default")))
40#else
41 #define PUBLIC_API
42#endif
43
44#ifdef __cplusplus
45#include <string>
46#include <sstream>
47#include <new>
48#include <cstring>
49
50#if defined(__GNUC__) || defined(_MSC_VER) || defined(__clang__)
51#define INLINE inline
52#else /* __GNUC__ || _MSC_VER || __clang__ */
53#define INLINE
54#endif /* __GNUC__ || _MSC_VER || __clang__ */
55
56extern "C"
57{
58class dma_mem;
59class ShadingMaster;
60#else
61struct dma_mem_s;
62typedef struct dma_mem_s dma_mem;
63struct ShadingMaster_s;
64typedef struct ShadingMaster_s ShadingMaster;
65#endif
66
67struct fg_event_info;
68
76
97PUBLIC_API int Fg_InitLibraries(const char * sisoDir);
98
141PUBLIC_API int Fg_InitLibrariesEx(const char * sisoDir, unsigned int flags, const char * id, unsigned int timeout);
142
157
170
192
216PUBLIC_API int Fg_findApplet(const unsigned int BoardIndex, char * Path, size_t Size);
217
235PUBLIC_API Fg_Struct * Fg_Init(const char *FileName, unsigned int BoardIndex);
236
260PUBLIC_API Fg_Struct * Fg_InitConfig(const char *Config_Name, unsigned int BoardIndex);
261
262
303PUBLIC_API Fg_Struct * Fg_InitEx(const char *FileName, unsigned int BoardIndex, int flags);
304
346PUBLIC_API Fg_Struct * Fg_InitConfigEx(const char *Config_Name, unsigned int BoardIndex, int flags);
347
400PUBLIC_API void * Fg_AllocMem(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt, const unsigned int DmaIndex);
401
426PUBLIC_API dma_mem * Fg_AllocMemEx(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt);
427
441PUBLIC_API int Fg_FreeMem(Fg_Struct *Fg, const unsigned int DmaIndex);
442
459
506PUBLIC_API dma_mem * Fg_AllocMemHead(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt);
507
530
552PUBLIC_API int Fg_AddMem(Fg_Struct *Fg, void *pBuffer, const size_t Size, const frameindex_t bufferIndex, dma_mem *memHandle);
553
570PUBLIC_API int Fg_DelMem(Fg_Struct *Fg, dma_mem *memHandle, const frameindex_t bufferIndex);
571
590
605
617
633
649
660PUBLIC_API const char * Fg_getParameterName(Fg_Struct *fg, int index);
661
697
709PUBLIC_API const char * Fg_getParameterNameById(Fg_Struct *fg, const unsigned int id, const unsigned int dma);
710
722
734PUBLIC_API enum FgParamTypes Fg_getParameterTypeById(Fg_Struct *fg, const unsigned int id, const unsigned int dma);
735
773PUBLIC_API int Fg_setParameter(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex);
774
784PUBLIC_API int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
785
786#ifdef __cplusplus
787}
788
792static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const uint64_t Value, const unsigned int DmaIndex)
793{
794 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_UINT64_T);
795}
796
800static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const int64_t Value, const unsigned int DmaIndex)
801{
802 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_INT64_T);
803}
804
808static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const uint32_t Value, const unsigned int DmaIndex)
809{
810 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_UINT32_T);
811}
812
816static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const int32_t Value, const unsigned int DmaIndex)
817{
818 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_INT32_T);
819}
820
824static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const float Value, const unsigned int DmaIndex)
825{
826 double val = Value;
827 return Fg_setParameterWithType(Fg, Parameter, &val, DmaIndex, FG_PARAM_TYPE_DOUBLE);
828}
829
833static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const double Value, const unsigned int DmaIndex)
834{
835 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_DOUBLE);
836}
837
838
842static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const char *Value, const unsigned int DmaIndex)
843{
844 return Fg_setParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_CHAR_PTR);
845}
846
850static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const std::string & Value, const unsigned int DmaIndex)
851{
852 return Fg_setParameterWithType(Fg, Parameter, Value.c_str(), DmaIndex, FG_PARAM_TYPE_CHAR_PTR);
853}
854
855extern "C" {
856#endif /* __cplusplus */
857
890PUBLIC_API int Fg_getParameter(Fg_Struct *Fg, int Parameter, void *Value, const unsigned int DmaIndex);
891
910PUBLIC_API int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
911
928PUBLIC_API int Fg_freeParameterStringWithType(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
929
930#ifdef __cplusplus
931}
932
936static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, uint64_t *Value, const unsigned int DmaIndex)
937{
938 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_UINT64_T);
939}
940
944static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, int64_t *Value, const unsigned int DmaIndex)
945{
946 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_INT64_T);
947}
948
952static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, uint32_t *Value, const unsigned int DmaIndex)
953{
954 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_UINT32_T);
955}
956
960static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, int32_t *Value, const unsigned int DmaIndex)
961{
962 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_INT32_T);
963}
964
968static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, float *Value, const unsigned int DmaIndex)
969{
970 double val = 0;
971 int result = Fg_getParameterWithType(Fg, Parameter, &val, DmaIndex, FG_PARAM_TYPE_DOUBLE);
972 if (result == FG_OK)
973 *Value = static_cast<float>(val);
974 return result;
975}
976
980static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, double *Value, const unsigned int DmaIndex)
981{
982 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_DOUBLE);
983}
984
988static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, std::string & Value, const unsigned int DmaIndex)
989{
990 char * cstr = NULL;
991 int result = Fg_getParameterWithType(Fg, Parameter, &cstr, DmaIndex, FG_PARAM_TYPE_CHAR_PTR_PTR);
992 if (result != 0) {
993 return result;
994 }
995
996 Value = cstr;
997 Fg_freeParameterStringWithType(Fg, Parameter, cstr, DmaIndex, FG_PARAM_TYPE_CHAR_PTR_PTR);
998 return 0;
999}
1000
1001extern "C" {
1002#endif /* __cplusplus */
1003
1037PUBLIC_API int Fg_getParameterEx(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, dma_mem *pMem, const frameindex_t ImgNr);
1038
1064PUBLIC_API int Fg_getParameterInfoXML(Fg_Struct *Fg, int port, char * infoBuffer, size_t *infoBufferSize);
1065
1075
1095PUBLIC_API int Fg_saveConfig(Fg_Struct *Fg, const char *Filename);
1096
1121PUBLIC_API int Fg_saveFieldParameterToFile(Fg_Struct * Fg, const int Parameter, const unsigned int DmaIndex, const char * FileName);
1122
1144PUBLIC_API int Fg_loadConfig(Fg_Struct *Fg, const char *Filename);
1145
1169PUBLIC_API int Fg_loadFieldParameterFromFile(Fg_Struct * Fg, const int Parameter, const unsigned int DmaIndex, const char * FileName);
1170
1209PUBLIC_API int Fg_Acquire(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount);
1210
1232PUBLIC_API int Fg_stopAcquire(Fg_Struct *Fg, const unsigned int DmaIndex);
1233
1261PUBLIC_API frameindex_t Fg_getLastPicNumberBlocking(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, const int Timeout);
1262
1281PUBLIC_API frameindex_t Fg_getLastPicNumber(Fg_Struct *Fg, const unsigned int DmaIndex);
1282
1311PUBLIC_API frameindex_t Fg_getLastPicNumberBlockingEx(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, const int Timeout, dma_mem *pMem);
1312
1332PUBLIC_API frameindex_t Fg_getLastPicNumberEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *pMem);
1333
1357PUBLIC_API void * Fg_getImagePtr(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex);
1358
1383PUBLIC_API void * Fg_getImagePtrEx(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, dma_mem *pMem);
1384
1435PUBLIC_API int Fg_AcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount, const int nFlag, dma_mem *memHandle);
1436
1452PUBLIC_API int Fg_sendImage(Fg_Struct *Fg, const frameindex_t startImage, const frameindex_t PicCount, const int nFlag, const unsigned int DmaIndex);
1468PUBLIC_API int Fg_sendImageEx(Fg_Struct *Fg, const frameindex_t startImage, const frameindex_t PicCount, const int nFlag, const unsigned int DmaIndex, dma_mem *memHandle);
1469
1494PUBLIC_API int Fg_stopAcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *memHandle, int nFlag);
1495
1527PUBLIC_API frameindex_t Fg_getImage(Fg_Struct *Fg, const int Param, const frameindex_t PicNr, const unsigned int DmaIndex, const unsigned int Timeout);
1528
1561PUBLIC_API frameindex_t Fg_getImageEx(Fg_Struct *Fg, const int Param, const frameindex_t PicNr, const unsigned int DmaIndex, const unsigned int Timeout, dma_mem *pMem);
1562
1586PUBLIC_API int Fg_queueBuffer(Fg_Struct *fg, frameindex_t bufferIndex, uint64_t transferLength, uint32_t dmaIndex, dma_mem *memoryHandle);
1587
1588#ifdef __cplusplus
1589
1590extern "C++" {
1591
1599 inline int Fg_queueBuffer(Fg_Struct *fg, frameindex_t bufferIndex, uint64_t transferLength, uint32_t dmaIndex) {
1600 return Fg_queueBuffer(fg, bufferIndex, transferLength, dmaIndex, nullptr);
1601 }
1602
1609 inline int Fg_queueBuffer(Fg_Struct *fg, frameindex_t bufferIndex, uint64_t transferLength, dma_mem *memoryHandle)
1610 {
1611 return Fg_queueBuffer(fg, bufferIndex, transferLength, UINT32_MAX, memoryHandle);
1612 }
1613
1614}
1615#endif // __cplusplus
1616
1617
1633PUBLIC_API int Fg_waitForBuffers(Fg_Struct *fg, uint32_t dmaIndex, uint64_t timeoutSeconds, void *reserved1, size_t reserved2);
1634
1635#ifdef __cplusplus
1636
1641extern "C++" inline int Fg_waitForBuffers(Fg_Struct *fg, const uint32_t dmaIndex, const uint64_t timeoutSeconds)
1642{
1643 return Fg_waitForBuffers(fg, dmaIndex, timeoutSeconds, nullptr, 0);
1644}
1645
1646#endif // __cplusplus
1647
1676PUBLIC_API int Fg_startBufferQueue(Fg_Struct *fg, uint32_t dmaIndex, dma_mem *memoryHandle);
1677
1702PUBLIC_API int Fg_stopBufferQueue(Fg_Struct *fg, uint32_t dmaIndex, int32_t flags);
1703
1819PUBLIC_API int Fg_registerApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex, const struct FgApcControl *control, enum FgApcControlFlags flags);
1820
1821#ifdef __cplusplus
1822}
1823
1827static INLINE int Fg_registerApcHandlerEx(Fg_Struct *Fg, const unsigned int DmaIndex, Fg_ApcFunc_t func, void *data, const unsigned int timeout, const unsigned int flags)
1828{
1829 FgApcControl control;
1830 control.version = 0;
1831 control.func = func;
1832 control.data = data;
1833 control.timeout = timeout;
1834 control.flags = flags;
1835 return Fg_registerApcHandler(Fg, DmaIndex, &control, FG_APC_CONTROL_BASIC);
1836}
1837
1838static INLINE int Fg_unregisterApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex)
1839{
1840 return Fg_registerApcHandler(Fg, DmaIndex, NULL, FG_APC_CONTROL_BASIC);
1841}
1842
1843extern "C" {
1844#endif
1859
1870PUBLIC_API const char * getErrorDescription(int ErrorNumber);
1871
1885
1898PUBLIC_API const char * Fg_getErrorDescription(Fg_Struct *Fg, int ErrorNumber);
1899
1928PUBLIC_API int Fg_getBoardType(int BoardIndex);
1929
1943PUBLIC_API const char * Fg_getBoardNameByType(const int BoardType, const int UseShortName);
1944
1956
1966
1978PUBLIC_API const char * Fg_getAppletVersion(Fg_Struct *Fg, int AppletId);
1979
1994PUBLIC_API int Fg_getAppletId(Fg_Struct *Fg, const char *ignored);
1995
1996
1997
1998
2025 const int parameterId,
2026 const enum FgProperty propertyId,
2027 void* buffer, int* bufLen);
2028
2029#ifdef __cplusplus
2030}
2031
2035static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, std::string & Value)
2036{
2037 char * buffer = 0;
2038 int len = 0;
2039
2040 int result = Fg_getParameterProperty(Fg, parameterId, propertyId, NULL, &len);
2041 if (result != FG_OK) return result;
2042
2043 buffer = new(std::nothrow) char[len];
2044 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2045
2046 result = Fg_getParameterProperty(Fg, parameterId, propertyId, buffer, &len);
2047 if (result == FG_OK && len > 0) {
2048 buffer[len - 1] = '\0';
2049 Value = buffer;
2050 }
2051
2052 delete[] buffer;
2053 return result;
2054}
2055
2059static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint64_t *Value)
2060{
2061 std::string temp;
2062 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, temp);
2063 if (result == FG_OK) {
2064 std::istringstream is(temp);
2065 is >> (*Value);
2066 if (is.fail()) result = FG_INVALID_TYPE;
2067 }
2068
2069 return result;
2070}
2071
2075static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int64_t *Value)
2076{
2077 return Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, reinterpret_cast<uint64_t *>(Value));
2078}
2079
2083static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint32_t *Value)
2084{
2085 uint64_t temp = 0;
2086 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
2087 if (result == FG_OK) *Value = static_cast<uint32_t>(temp);
2088
2089 return result;
2090}
2091
2095static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int32_t *Value)
2096{
2097 uint64_t temp = 0;
2098 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
2099 if (result == FG_OK) *Value = static_cast<int32_t>(temp);
2100
2101 return result;
2102}
2103
2107static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, double *Value)
2108{
2109 std::string temp;
2110 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, temp);
2111 if (result == FG_OK) {
2112 std::istringstream is(temp);
2113 is >> (*Value);
2114 if (is.fail()) result = FG_INVALID_TYPE;
2115 }
2116
2117 return result;
2118}
2119
2123static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, float *Value)
2124{
2125 double temp = 0;
2126 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
2127 if (result == FG_OK) *Value = static_cast<float>(temp);
2128
2129 return result;
2130}
2131
2132extern "C" {
2133#endif /* __cplusplus */
2134
2162 const int parameterId,
2163 const enum FgProperty propertyId,
2164 const int DmaIndex,
2165 void* buffer, int* bufLen);
2166
2167#ifdef __cplusplus
2168}
2169
2173static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, std::string & Value, const unsigned int DmaIndex)
2174{
2175 char * buffer = 0;
2176 int len = 0;
2177
2178 int result = Fg_getParameterPropertyEx(Fg, parameterId, propertyId, static_cast<int>(DmaIndex), NULL, &len);
2179 if (result != FG_OK) return result;
2180
2181 buffer = new(std::nothrow) char[len];
2182 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2183
2184 result = Fg_getParameterPropertyEx(Fg, parameterId, propertyId, static_cast<int>(DmaIndex), buffer, &len);
2185 if (result == FG_OK && len > 0) {
2186 buffer[len - 1] = '\0';
2187 Value = buffer;
2188 }
2189
2190 delete[] buffer;
2191 return result;
2192}
2193
2197static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint64_t *Value, const unsigned int DmaIndex)
2198{
2199 std::string temp;
2200 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, temp, DmaIndex);
2201 if (result == FG_OK) {
2202 std::istringstream is(temp);
2203 is >> (*Value);
2204 if (is.fail()) result = FG_INVALID_TYPE;
2205 }
2206
2207 return result;
2208}
2209
2213static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int64_t *Value, const unsigned int DmaIndex)
2214{
2215 return Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, reinterpret_cast<uint64_t *>(Value), DmaIndex);
2216}
2217
2221static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint32_t *Value, const unsigned int DmaIndex)
2222{
2223 uint64_t temp = 0;
2224 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2225 if (result == FG_OK) *Value = static_cast<uint32_t>(temp);
2226
2227 return result;
2228}
2229
2233static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int32_t *Value, const unsigned int DmaIndex)
2234{
2235 uint64_t temp = 0;
2236 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2237 if (result == FG_OK) *Value = static_cast<int32_t>(temp);
2238
2239 return result;
2240}
2241
2245static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, double *Value, const unsigned int DmaIndex)
2246{
2247 std::string temp;
2248 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, temp, DmaIndex);
2249 if (result == FG_OK) {
2250 std::istringstream is(temp);
2251 is >> (*Value);
2252 if (is.fail()) result = FG_INVALID_TYPE;
2253 }
2254
2255 return result;
2256}
2257
2261static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, float *Value, const unsigned int DmaIndex)
2262{
2263 double temp = 0;
2264 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2265 if (result == FG_OK) *Value = static_cast<float>(temp);
2266
2267 return result;
2268}
2269
2270extern "C" {
2271#endif /* __cplusplus */
2272
2297PUBLIC_API int Fg_getSystemInformation(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int param1, void* buffer, unsigned int* bufLen);
2298
2299#ifdef __cplusplus
2300}
2301
2305static INLINE int Fg_getIntSystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2306{
2307 char * buffer = 0;
2308 unsigned int len = 0;
2309
2310 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, NULL, &len);
2311 if (result != FG_OK) return result;
2312
2313 buffer = new(std::nothrow) char[len];
2314 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2315
2316 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2317 if (result == FG_OK) {
2318 std::istringstream is(buffer);
2319 is >> (*val);
2320 if (is.fail()) result = FG_INVALID_TYPE;
2321 }
2322
2323 delete[] buffer;
2324 return result;
2325}
2326
2330static INLINE int Fg_getIntSystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2331{
2332 char * buffer = 0;
2333 unsigned int len = 0;
2334
2335 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), NULL, &len);
2336 if (result != FG_OK) return result;
2337
2338 buffer = new(std::nothrow) char[len];
2339 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2340
2341 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2342 if (result == FG_OK) {
2343 std::istringstream is(buffer);
2344 is >> (*val);
2345 if (is.fail()) result = FG_INVALID_TYPE;
2346 }
2347
2348 delete[] buffer;
2349 return result;
2350}
2351
2355static INLINE int Fg_getIntSystemInformationGlobal(const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2356{
2357 return Fg_getIntSystemInformationForBoardIndex(static_cast<unsigned>(-1), selector, propertyId, val);
2358}
2359
2363static INLINE int Fg_getInt64SystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int64_t * val)
2364{
2365 char * buffer = 0;
2366 unsigned int len = 0;
2367
2368 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, NULL, &len);
2369 if (result != FG_OK) return result;
2370
2371 buffer = new(std::nothrow) char[len];
2372 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2373
2374 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2375 if (result == FG_OK) {
2376 std::istringstream is(buffer);
2377 is >> (*val);
2378 if (is.fail()) result = FG_INVALID_TYPE;
2379 }
2380
2381 delete[] buffer;
2382 return result;
2383}
2384
2388static INLINE int Fg_getInt64SystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int64_t * val)
2389{
2390 char * buffer = 0;
2391 unsigned int len = 0;
2392
2393 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), NULL, &len);
2394 if (result != FG_OK) return result;
2395
2396 buffer = new(std::nothrow) char[len];
2397 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2398
2399 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2400 if (result == FG_OK) {
2401 std::istringstream is(buffer);
2402 is >> (*val);
2403 if (is.fail()) result = FG_INVALID_TYPE;
2404 }
2405
2406 delete[] buffer;
2407 return result;
2408}
2409
2413static INLINE int Fg_getStringSystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2414{
2415 char * buffer = 0;
2416 unsigned int len = 0;
2417
2418 if (arg.length()) {
2419 len = static_cast<unsigned int>(arg.length()) + 1;
2420 buffer = new(std::nothrow) char[len];
2421 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2422
2423#ifdef _WIN32
2424 strncpy_s(buffer, len, arg.c_str(), len - 1);
2425#else
2426 strncpy(buffer, arg.c_str(), len - 1);
2427#endif
2428 }
2429
2430 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2431
2432 if (result != FG_OK) {
2433 delete[] buffer;
2434 return result;
2435 }
2436
2437 if (!arg.empty() && len <= static_cast<unsigned int>(arg.length()) + 1) {
2438 // The buffer size was sufficient and it contains the requested value.
2439 val = buffer;
2440 delete[] buffer;
2441 return FG_OK;
2442 } else {
2443 // The buffer was too small. Create a suitable buffer and try again.
2444 // len has been set the required size.
2445 delete[] buffer;
2446 buffer = new(std::nothrow) char[len];
2447 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2448
2449 if (!arg.empty()) {
2450#ifdef _WIN32
2451 strncpy_s(buffer, len, arg.c_str(), arg.length());
2452#else
2453 strncpy(buffer, arg.c_str(), arg.length());
2454#endif
2455 }
2456
2457 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2458 if (result == FG_OK) {
2459 val = buffer;
2460 }
2461
2462 delete[] buffer;
2463 return result;
2464 }
2465}
2466
2470static INLINE int Fg_getStringSystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2471{
2472 char * buffer = 0;
2473 unsigned int len = 0;
2474
2475 if (!arg.empty()) {
2476 len = static_cast<unsigned int>(arg.length()) + 1;
2477 buffer = new(std::nothrow) char[len];
2478 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2479
2480#ifdef _WIN32
2481 strncpy_s(buffer, len, arg.c_str(), arg.length());
2482#else
2483 strncpy(buffer, arg.c_str(), arg.length());
2484#endif
2485 }
2486
2487 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2488 if (result != FG_OK) {
2489 delete[] buffer;
2490 return result;
2491 }
2492
2493 if (!arg.empty() && len <= static_cast<unsigned int>(arg.length()) + 1) {
2494 val = buffer;
2495 delete[] buffer;
2496 return FG_OK;
2497 } else {
2498 delete[] buffer;
2499 buffer = new(std::nothrow) char[len];
2500 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2501
2502 if (!arg.empty()) {
2503#ifdef _WIN32
2504 strncpy_s(buffer, len, arg.c_str(), arg.length());
2505#else
2506 strncpy(buffer, arg.c_str(), arg.length());
2507#endif
2508 }
2509
2510 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2511 if (!result) {
2512 val = buffer;
2513 }
2514
2515 delete[] buffer;
2516 return result;
2517 }
2518}
2519
2523static INLINE int Fg_getStringSystemInformationGlobal(const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2524{
2525 return Fg_getStringSystemInformationForBoardIndex(static_cast<unsigned>(-1), selector, propertyId, val, arg);
2526}
2527
2528extern "C" {
2529#endif
2530
2555PUBLIC_API int Fg_readUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, void * buffer);
2556
2581PUBLIC_API int Fg_writeUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, const void * buffer);
2582
2616PUBLIC_API frameindex_t Fg_getStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex);
2617
2652PUBLIC_API frameindex_t Fg_getStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem);
2653
2679PUBLIC_API int Fg_setStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex);
2680
2707PUBLIC_API int Fg_setStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem);
2708
2740PUBLIC_API int Fg_getAppletIterator(int boardIndex, const enum FgAppletIteratorSource src, Fg_AppletIteratorType * iter, int flags);
2741
2751
2769
2786
2801
2820
2840
2841#ifdef __cplusplus
2842} /* extern "C" */
2843
2847static INLINE int Fg_findApplet(const unsigned int BoardIndex, std::string & Path) {
2848
2849 // ensure a defined state of the output argument
2850 Path.clear();
2851
2853 int ret = Fg_getAppletIterator(BoardIndex, FG_AIS_FILESYSTEM, &iter, FG_AF_IS_LOADABLE);
2854
2855 const int numItems = ret;
2856 ret = FG_FILE_NOT_FOUND;
2857
2858 // Iterate over found applets in case there are more than one.
2859 for (int i = 0; i < numItems && ret != FG_OK; ++i) {
2860 const Fg_AppletIteratorItem item = Fg_getAppletIteratorItem(iter, i);
2861 if (item != nullptr) {
2862 const int64_t info = Fg_getAppletIntProperty(item, FG_AP_INT_INFO);
2863 if (info & FG_AI_IS_VALID) {
2865 ret = FG_OK;
2866 }
2867 }
2868 }
2870 return ret;
2871}
2872
2873extern "C" {
2874#endif /* __cplusplus */
2875
2895PUBLIC_API uint64_t Fg_getEventMask(Fg_Struct *Fg, const char *name);
2896
2910
2923PUBLIC_API const char * Fg_getEventName(Fg_Struct *Fg, uint64_t mask);
2924
2938
2955PUBLIC_API int Fg_activateEvents(Fg_Struct *Fg, uint64_t mask, int enable);
2956
2973PUBLIC_API int Fg_clearEvents(Fg_Struct *Fg, uint64_t mask);
2974
3005PUBLIC_API uint64_t Fg_eventWait(Fg_Struct *Fg, uint64_t mask, unsigned int timeout, unsigned int flags, struct fg_event_info *info);
3006
3052PUBLIC_API int Fg_registerEventCallback(Fg_Struct *Fg, uint64_t mask, Fg_EventFunc_t handler, void *data, unsigned int flags, struct fg_event_info *info);
3053
3054#ifdef __cplusplus
3055}
3056
3060static INLINE int Fg_unregisterEventCallback(Fg_Struct *Fg, uint64_t mask)
3061{
3062 return Fg_registerEventCallback(Fg, mask, NULL, NULL, FG_EVENT_DEFAULT_FLAGS, NULL);
3063}
3064
3065extern "C" {
3066#endif
3100
3121
3137PUBLIC_API int Fg_resetAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph);
3138
3153PUBLIC_API int Fg_setAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph);
3154
3177PUBLIC_API int DEPRECATED(Fg_setExsync(Fg_Struct *Fg, int Flag, const unsigned int CamPort));
3178
3201PUBLIC_API int DEPRECATED(Fg_setFlash(Fg_Struct *Fg, int Flag, const unsigned int CamPort));
3202
3234PUBLIC_API int Fg_sendSoftwareTrigger(Fg_Struct *Fg, const unsigned int CamPort);
3235
3271PUBLIC_API int Fg_sendSoftwareTriggerEx(Fg_Struct *Fg, const unsigned int CamPort, const unsigned int Triggers);
3272
3299PUBLIC_API ShadingMaster * Fg_AllocShading(Fg_Struct *Fg, int set, const unsigned int CamPort);
3300
3317
3338
3358
3377
3402PUBLIC_API int Shad_SetSubValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float sub);
3403
3428PUBLIC_API int Shad_SetMultValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float mult);
3429
3454PUBLIC_API int Shad_SetFixedPatternNoiseLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, int on);
3455
3477#ifdef __cplusplus
3478
3479struct VAdevice;
3480struct RegisterInfo;
3481class fpga_design;
3482
3491PUBLIC_API Fg_Struct * Fg_InitHandle(const char *appletName, struct VAdevice *hwhandle, fpga_design *deshandle);
3492
3502PUBLIC_API Fg_Struct * Fg_InitHandleSlaveAware(const char *appletName, struct VAdevice *hwhandle, fpga_design *deshandle, int isSlave);
3503
3511PUBLIC_API RegisterInfo * Fg_getParameterInfo(Fg_Struct *Fg, const unsigned int CamPort);
3512
3513#endif /* __cplusplus */
3514
3515/* Deprecated functions, do not use as they will eventually go away */
3516
3523PUBLIC_API int DEPRECATED(getLastErrorNumber());
3524
3525#ifdef __cplusplus
3526} /* extern "C" */
3527
3528#endif
3529
3530#endif /* __BASLER_FG_H */
Header file for all display lib public functions.
PUBLIC_API int Fg_getEventCount(Fg_Struct *Fg)
get the number of available event types
PUBLIC_API int Fg_NumaPinThread(Fg_Struct *Fg)
NUMA aware pinning of thread affinity. .
PUBLIC_API int Fg_saveFieldParameterToFile(Fg_Struct *Fg, const int Parameter, const unsigned int DmaIndex, const char *FileName)
Saving applet field parameter.
PUBLIC_API int64_t Fg_getAppletIntProperty(Fg_AppletIteratorItem item, const enum FgAppletIntProperty property)
Gets an integer applet properties .
PUBLIC_API int Fg_resetAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph)
acknowledge an asynchronous notifications
PUBLIC_API const char * getErrorDescription(int ErrorNumber)
Description of error message. .
PUBLIC_API Fg_AppletIteratorItem Fg_findAppletIteratorItem(Fg_AppletIteratorType iter, const char *path)
Looks for an item from applet iterator matching the applet path, file, or name. .
PUBLIC_API Fg_AppletIteratorItem Fg_getAppletIteratorItem(Fg_AppletIteratorType iter, int index)
Gets an item from applet iterator by index. .
PUBLIC_API dma_mem * Fg_AllocMemHead(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt)
Use an allocated user memory as frame buffer. .
PUBLIC_API int Shad_SetMultValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float mult)
set multiplicative correction value for shading correction
PUBLIC_API frameindex_t Fg_getLastPicNumber(Fg_Struct *Fg, const unsigned int DmaIndex)
Requesting the current image number (non-blocking). .
PUBLIC_API int Fg_clearEvents(Fg_Struct *Fg, uint64_t mask)
drop all already queued events
PUBLIC_API int Fg_getAppletIterator(int boardIndex, const enum FgAppletIteratorSource src, Fg_AppletIteratorType *iter, int flags)
Gets an applet iterator. .
PUBLIC_API int Fg_readUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, void *buffer)
read user data area
PUBLIC_API int Fg_getParameterId(Fg_Struct *fg, int index)
The function Fg_getParameterId() returns the parameter ID of the parameter referenced by index....
PUBLIC_API frameindex_t Fg_getImage(Fg_Struct *Fg, const int Param, const frameindex_t PicNr, const unsigned int DmaIndex, const unsigned int Timeout)
Getting the image. .
PUBLIC_API int Fg_getAppletId(Fg_Struct *Fg, const char *ignored)
Get the ID of the currently running applet. .
struct dma_mem_s dma_mem
DMA buffer head control object.
Definition basler_fg.h:62
PUBLIC_API int Fg_getSystemInformation(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int param1, void *buffer, unsigned int *bufLen)
query information about the overall framegrabber setup
PUBLIC_API int Fg_FreeMemEx(Fg_Struct *Fg, dma_mem *mem)
Releasing frame buffers. .
PUBLIC_API int Fg_unregisterAsyncNotifyCallback(Fg_Struct *Fg, Fg_AsyncNotifyFunc_t handler, void *context)
unregister callback for asynchronous notifications
PUBLIC_API uint64_t Fg_getEventMask(Fg_Struct *Fg, const char *name)
get the event mask for the named event
PUBLIC_API ShadingMaster * Fg_AllocShading(Fg_Struct *Fg, int set, const unsigned int CamPort)
allocate shading control object
PUBLIC_API int Fg_startBufferQueue(Fg_Struct *fg, uint32_t dmaIndex, dma_mem *memoryHandle)
Starts transmission of queued buffers.
PUBLIC_API frameindex_t Fg_getLastPicNumberBlockingEx(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, const int Timeout, dma_mem *pMem)
Requesting the current image number (blocking) .
PUBLIC_API int Fg_sendImage(Fg_Struct *Fg, const frameindex_t startImage, const frameindex_t PicCount, const int nFlag, const unsigned int DmaIndex)
Sending images from Software to the applet .
PUBLIC_API int Fg_getParameterPropertyEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, const int DmaIndex, void *buffer, int *bufLen)
query the properties of a given parameter
PUBLIC_API int Fg_activateEvents(Fg_Struct *Fg, uint64_t mask, int enable)
activates/disable event generation
PUBLIC_API enum FgParamTypes Fg_getParameterTypeById(Fg_Struct *fg, const unsigned int id, const unsigned int dma)
The function Fg_getParameterTypeById() informs about the type of a parameter by its id....
PUBLIC_API int Fg_sendSoftwareTriggerEx(Fg_Struct *Fg, const unsigned int CamPort, const unsigned int Triggers)
send multiple trigger signals to the camera
PUBLIC_API void Fg_AbortInitLibraries()
The function Fg_AbortInitLibraries() aborts and fails the initialization of internal structures and t...
PUBLIC_API frameindex_t Fg_getStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem)
Reading the status of frame buffer. .
PUBLIC_API dma_mem * Fg_AllocMemEx(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt)
The function Fg_AllocMemEx() reserves an area of the main memory as frame buffer, blocks it and makes...
PUBLIC_API int Fg_InitLibraries(const char *sisoDir)
The function Fg_InitLibraries() initializes internal structures of the library. .
PUBLIC_API Fg_Struct * Fg_InitEx(const char *FileName, unsigned int BoardIndex, int flags)
Initialize a frame grabber in master or slave mode. .
PUBLIC_API int Fg_stopAcquire(Fg_Struct *Fg, const unsigned int DmaIndex)
Stopping image grabbing. .
PUBLIC_API int Shad_FreeAccess(Fg_Struct *Fg, ShadingMaster *sh)
deactivate shading object
PUBLIC_API Fg_AppletIteratorItem Fg_addAppletIteratorItem(Fg_AppletIteratorType iter, const char *path, int *numItems)
Add an applet to applet iterator.
PUBLIC_API int Fg_FreeMemHead(Fg_Struct *Fg, dma_mem *memHandle)
Releasing memory. .
PUBLIC_API int Shad_GetAccess(Fg_Struct *Fg, ShadingMaster *sh)
activate shading object
PUBLIC_API const char * Fg_getParameterName(Fg_Struct *fg, int index)
The function Fg_getParameterName() informs about the name of a special parameter by index....
PUBLIC_API void * Fg_AllocMem(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt, const unsigned int DmaIndex)
The function Fg_AllocMem() reserves a defined area of the user memory as frame grabber memory and blo...
PUBLIC_API Fg_Struct * Fg_InitConfigEx(const char *Config_Name, unsigned int BoardIndex, int flags)
The function Fg_InitConfigEx() initializes the frame grabber in master or slave mode and loads a para...
PUBLIC_API frameindex_t Fg_getImageEx(Fg_Struct *Fg, const int Param, const frameindex_t PicNr, const unsigned int DmaIndex, const unsigned int Timeout, dma_mem *pMem)
Getting the image. .
PUBLIC_API int Fg_freeParameterStringWithType(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, const enum FgParamTypes type)
Release previously allocated frame grabber string parameter. .
struct ShadingMaster_s ShadingMaster
Shading control object.
Definition basler_fg.h:64
PUBLIC_API int Fg_waitForBuffers(Fg_Struct *fg, uint32_t dmaIndex, uint64_t timeoutSeconds, void *reserved1, size_t reserved2)
Waits for new buffers to be become available again. If any buffers were processed when calling this f...
PUBLIC_API int Fg_freeAppletIterator(Fg_AppletIteratorType iter)
This function releases an applet iterator .
PUBLIC_API void * Fg_getImagePtr(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex)
Access on frame buffer. .
PUBLIC_API frameindex_t Fg_getStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex)
Reading the status of frame buffer. .
PUBLIC_API int Shad_GetMaxLine(Fg_Struct *Fg, ShadingMaster *sh)
query current line number for shading correction
PUBLIC_API int Fg_Acquire(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount)
Starting image grabbing. .
PUBLIC_API uint64_t Fg_eventWait(Fg_Struct *Fg, uint64_t mask, unsigned int timeout, unsigned int flags, struct fg_event_info *info)
wait for events
PUBLIC_API void * Fg_getImagePtrEx(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, dma_mem *pMem)
Access on frame buffer. .
PUBLIC_API int Fg_setAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph)
trigger an asynchronous notifications
PUBLIC_API int Fg_setStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex)
Setting the status of frame buffer. .
PUBLIC_API int Fg_setParameter(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex)
Setting frame grabber parameters. .
PUBLIC_API int Fg_findApplet(const unsigned int BoardIndex, char *Path, size_t Size)
The function Fg_findApplet() returns the file name of the currently active applet for ME5 board....
PUBLIC_API int Fg_getNrOfParameter(Fg_Struct *Fg)
The function Fg_getNrOfParameter() returns the number of parameters available within the loaded apple...
PUBLIC_API int Fg_getBoardType(int BoardIndex)
Board type. .
PUBLIC_API int Fg_registerEventCallback(Fg_Struct *Fg, uint64_t mask, Fg_EventFunc_t handler, void *data, unsigned int flags, struct fg_event_info *info)
register callback for events
PUBLIC_API unsigned int Fg_getSerialNumber(Fg_Struct *Fg)
Serial number. .
PUBLIC_API int Fg_getParameterInfoXML(Fg_Struct *Fg, int port, char *infoBuffer, size_t *infoBufferSize)
Get parameter description in a Genicam compatible XML format. .
PUBLIC_API int Fg_DelMem(Fg_Struct *Fg, dma_mem *memHandle, const frameindex_t bufferIndex)
Deleting user memory, .
PUBLIC_API int Fg_queueBuffer(Fg_Struct *fg, frameindex_t bufferIndex, uint64_t transferLength, uint32_t dmaIndex, dma_mem *memoryHandle)
Queues a buffer for DMA transmission.
PUBLIC_API int Fg_stopBufferQueue(Fg_Struct *fg, uint32_t dmaIndex, int32_t flags)
Stops the processing of the buffer queue.
PUBLIC_API int Fg_InitLibrariesEx(const char *sisoDir, unsigned int flags, const char *id, unsigned int timeout)
The function Fg_InitLibrariesEx() initializes internal structures of the library and synchronizes the...
PUBLIC_API const char * Fg_getEventName(Fg_Struct *Fg, uint64_t mask)
get the name for the event represented by the event mask
PUBLIC_API int Fg_registerApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex, const struct FgApcControl *control, enum FgApcControlFlags flags)
Register an APC handler for the given DMA channel. .
PUBLIC_API const char * Fg_getAppletVersion(Fg_Struct *Fg, int AppletId)
Get the version of the currently running applet. .
PUBLIC_API const char * Fg_getParameterNameById(Fg_Struct *fg, const unsigned int id, const unsigned int dma)
The function Fg_getParameterNameById() informs about the name of a parameter by its id....
PUBLIC_API int Shad_WriteActLine(Fg_Struct *Fg, ShadingMaster *sh, int Line)
write shading correction values for given line
PUBLIC_API int Fg_writeUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, const void *buffer)
write user data area
PUBLIC_API int Fg_NumaFreeDmaBuffer(Fg_Struct *Fg, void *Buffer)
NUMA aware freeing of memory. .
PUBLIC_API int Fg_getBitsPerPixel(int format)
Calculate the bits per pixel for a specific output format (FG_GRAY, FG_COL24, etc....
PUBLIC_API int Fg_loadConfig(Fg_Struct *Fg, const char *Filename)
Loading a frame grabber configuration. .
PUBLIC_API int Fg_getLastErrorNumber(Fg_Struct *Fg)
Getting the last error code. .
PUBLIC_API Fg_Struct * Fg_Init(const char *FileName, unsigned int BoardIndex)
The function Fg_Init() initializes the frame grabber. .
PUBLIC_API int Fg_getParameterEx(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, dma_mem *pMem, const frameindex_t ImgNr)
Getting special parameter settings. .
PUBLIC_API int Fg_setStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem)
Setting the status of frame buffer. .
#define PUBLIC_API
Definition basler_fg.h:41
PUBLIC_API frameindex_t Fg_getLastPicNumberEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *pMem)
Requesting the current image number (non-blocking). .
PUBLIC_API const char * Fg_getLastErrorDescription(Fg_Struct *Fg)
Description of last error message. .
PUBLIC_API int Fg_AddMem(Fg_Struct *Fg, void *pBuffer, const size_t Size, const frameindex_t bufferIndex, dma_mem *memHandle)
Adding user memory. .
PUBLIC_API const char * Fg_getSWVersion()
Software version number. .
PUBLIC_API int Fg_getEventPayload(Fg_Struct *Fg, uint64_t mask)
get the payload size for the event represented by the event mask
PUBLIC_API int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, const enum FgParamTypes type)
Getting frame grabber parameters with type information. .
PUBLIC_API int Fg_stopAcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *memHandle, int nFlag)
Stopping image grabbing .
PUBLIC_API enum FgParamTypes Fg_getParameterType(Fg_Struct *fg, int index)
The function Fg_getParameterType() informs about the type of a special parameter by index....
PUBLIC_API int Fg_sendImageEx(Fg_Struct *Fg, const frameindex_t startImage, const frameindex_t PicCount, const int nFlag, const unsigned int DmaIndex, dma_mem *memHandle)
Sending images from Software to the applet .
PUBLIC_API int Fg_getParameter(Fg_Struct *Fg, int Parameter, void *Value, const unsigned int DmaIndex)
Getting special parameter settings. .
PUBLIC_API int DEPRECATED(Fg_setExsync(Fg_Struct *Fg, int Flag, const unsigned int CamPort))
set Exsync camera signal
PUBLIC_API int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex, const enum FgParamTypes type)
Setting frame grabber parameters with type information. .
PUBLIC_API int Fg_FreeShading(Fg_Struct *Fg, ShadingMaster *sh)
release shading control object
PUBLIC_API const char * Fg_getErrorDescription(Fg_Struct *Fg, int ErrorNumber)
Description of error message to an error code. .
PUBLIC_API const char * Fg_getAppletStringProperty(Fg_AppletIteratorItem item, const enum FgAppletStringProperty property)
Gets string applet properties .
PUBLIC_API int Fg_AcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount, const int nFlag, dma_mem *memHandle)
Starting image grabbing. .
PUBLIC_API frameindex_t Fg_getLastPicNumberBlocking(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, const int Timeout)
Requesting the current image number (blocking) .
PUBLIC_API int Shad_SetFixedPatternNoiseLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, int on)
set defective pixel interpolation value for shading correction
PUBLIC_API int Fg_getParameterIdByName(Fg_Struct *fg, const char *name)
The function Fg_getParameterIdByName() searchs for the ID of the parameter referenced by the string n...
PUBLIC_API Fg_Struct * Fg_InitConfig(const char *Config_Name, unsigned int BoardIndex)
The function Fg_InitConfig() initializes the frame grabber and loads a parameter file (microEnable co...
PUBLIC_API int Fg_getParameterProperty(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, void *buffer, int *bufLen)
query the properties of a given parameter
PUBLIC_API int Fg_FreeGrabber(Fg_Struct *Fg)
Releasing frame grabber resources. .
PUBLIC_API int Shad_SetSubValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float sub)
set substractive correction value for shading correction
PUBLIC_API int Fg_registerAsyncNotifyCallback(Fg_Struct *Fg, Fg_AsyncNotifyFunc_t handler, void *context)
register callback for asynchronous notifications
PUBLIC_API int Fg_sendSoftwareTrigger(Fg_Struct *Fg, const unsigned int CamPort)
send trigger signal to the camera
PUBLIC_API void Fg_FreeLibraries()
The function Fg_FreeLibraries() releases internal structures of the library. .
PUBLIC_API int Fg_FreeMem(Fg_Struct *Fg, const unsigned int DmaIndex)
Releasing a frame buffer. .
PUBLIC_API int Fg_loadFieldParameterFromFile(Fg_Struct *Fg, const int Parameter, const unsigned int DmaIndex, const char *FileName)
Loading field parameter from file.
PUBLIC_API void * Fg_NumaAllocDmaBuffer(Fg_Struct *Fg, size_t Size)
NUMA aware allocation of memory. .
PUBLIC_API void Fg_InitLibrariesStartNextSlave()
The function Fg_InitLibrariesStartNextSlave() signals the next slave process to start....
PUBLIC_API const char * Fg_getBoardNameByType(const int BoardType, const int UseShortName)
Board name from type. .
PUBLIC_API int Fg_saveConfig(Fg_Struct *Fg, const char *Filename)
Saving a frame grabber configuration .
Constant and enum definitions.
void * Fg_AppletIteratorItem
Definition fg_define.h:2465
FgAppletIteratorSource
Applet Iterator Sources.
Definition fg_define.h:2470
@ FG_AIS_FILESYSTEM
Definition fg_define.h:2472
@ FG_AI_IS_VALID
Definition fg_define.h:2520
@ FG_EVENT_DEFAULT_FLAGS
Definition fg_define.h:1407
int(* Fg_EventFunc_t)(uint64_t events, void *data, const struct fg_event_info *info)
Definition fg_define.h:1401
FgParamTypes
Definition fg_define.h:217
@ FG_PARAM_TYPE_UINT32_T
Definition fg_define.h:220
@ FG_PARAM_TYPE_INT64_T
Definition fg_define.h:221
@ FG_PARAM_TYPE_DOUBLE
Definition fg_define.h:223
@ FG_PARAM_TYPE_CHAR_PTR_PTR
Definition fg_define.h:226
@ FG_PARAM_TYPE_INT32_T
Definition fg_define.h:219
@ FG_PARAM_TYPE_UINT64_T
Definition fg_define.h:222
@ FG_PARAM_TYPE_CHAR_PTR
Definition fg_define.h:224
int(* Fg_AsyncNotifyFunc_t)(int boardIndex, unsigned long notification, unsigned long pl, unsigned long ph, void *context)
Definition fg_define.h:1461
FgProperty
definitions for querying information about a certain field
Definition fg_define.h:1176
void * Fg_AppletIteratorType
Definition fg_define.h:2464
FgAppletStringProperty
Available String Applet Properties .
Definition fg_define.h:2551
@ FG_AP_STRING_APPLET_PATH
Definition fg_define.h:2558
FgAppletIntProperty
Available Integer Applet Properties .
Definition fg_define.h:2529
@ FG_AP_INT_INFO
Definition fg_define.h:2531
int(* Fg_ApcFunc_t)(frameindex_t imgNr, void *data)
Definition fg_define.h:1359
FgApcControlFlags
control flags for Fg_registerApcHandler()
Definition fg_define.h:1378
@ FG_APC_CONTROL_BASIC
Definition fg_define.h:1379
@ FG_AF_IS_LOADABLE
Definition fg_define.h:2485
Fg_Info_Selector
definitions of available system informations
Definition fg_define.h:1073
Constant and enum definitions.
#define FG_INVALID_TYPE
Definition fg_error_codes.h:120
#define FG_FILE_NOT_FOUND
Definition fg_error_codes.h:66
#define FG_NOT_ENOUGH_MEMORY
Definition fg_error_codes.h:96
#define FG_OK
Definition fg_error_codes.h:31
struct declarations.
struct Fg_Struct_s Fg_Struct
The structure for a framegrabber.
Definition fg_struct.h:153
Definitions for platform dependent types.
long frameindex_t
Definition os_type.h:78
Definition fg_struct.h:133
unsigned int flags
Definition fg_struct.h:139
unsigned int version
Definition fg_struct.h:134
Fg_ApcFunc_t func
Definition fg_struct.h:136
void * data
Definition fg_struct.h:137
unsigned int timeout
Definition fg_struct.h:138
Definition fg_struct.h:155
uint16_t data[254]
Definition fg_struct.h:161