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#include <stdint.h>
17
18#include <sys/types.h>
19
20#include "fg_struct.h"
21#include "fg_define.h"
22#include "fg_error_codes.h"
23#include "os_type.h"
24#include "os_funcs.h"
25
26#include "SisoDisplay.h"
27
28// For GCC, we control visibility of symbols via attributes
29// For MSVC this is done via a .def file.
30// TODO: Move this to a common place for all libraries?
31#if defined(__GNUC__) && (__GNUC__ >= 4)
32 #define PUBLIC_API __attribute__ ((visibility ("default")))
33#else
34 #define PUBLIC_API
35#endif
36
37#ifdef __cplusplus
38#include <string>
39#include <sstream>
40#include <new>
41#include <cstring>
42
43#if defined(__GNUC__) || defined(_MSC_VER) || defined(__clang__)
44#define INLINE inline
45#else /* __GNUC__ || _MSC_VER || __clang__ */
46#define INLINE
47#endif /* __GNUC__ || _MSC_VER || __clang__ */
48
49extern "C"
50{
51class dma_mem;
52class ShadingMaster;
53#else
54struct dma_mem_s;
55typedef struct dma_mem_s dma_mem;
56struct ShadingMaster_s;
57typedef struct ShadingMaster_s ShadingMaster;
58#endif
59
60struct fg_event_info;
61
69
90PUBLIC_API int Fg_InitLibraries(const char * sisoDir);
91
134PUBLIC_API int Fg_InitLibrariesEx(const char * sisoDir, unsigned int flags, const char * id, unsigned int timeout);
135
150
163
185
209PUBLIC_API int Fg_findApplet(const unsigned int BoardIndex, char * Path, size_t Size);
210
228PUBLIC_API Fg_Struct * Fg_Init(const char *FileName, unsigned int BoardIndex);
229
253PUBLIC_API Fg_Struct * Fg_InitConfig(const char *Config_Name, unsigned int BoardIndex);
254
255
296PUBLIC_API Fg_Struct * Fg_InitEx(const char *FileName, unsigned int BoardIndex, int flags);
297
339PUBLIC_API Fg_Struct * Fg_InitConfigEx(const char *Config_Name, unsigned int BoardIndex, int flags);
340
393PUBLIC_API void * Fg_AllocMem(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt, const unsigned int DmaIndex);
394
419PUBLIC_API dma_mem * Fg_AllocMemEx(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt);
420
434PUBLIC_API int Fg_FreeMem(Fg_Struct *Fg, const unsigned int DmaIndex);
435
452
499PUBLIC_API dma_mem * Fg_AllocMemHead(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt);
500
523
545PUBLIC_API int Fg_AddMem(Fg_Struct *Fg, void *pBuffer, const size_t Size, const frameindex_t bufferIndex, dma_mem *memHandle);
546
563PUBLIC_API int Fg_DelMem(Fg_Struct *Fg, dma_mem *memHandle, const frameindex_t bufferIndex);
564
583
598
610
626
642
653PUBLIC_API const char * Fg_getParameterName(Fg_Struct *fg, int index);
654
690
702PUBLIC_API const char * Fg_getParameterNameById(Fg_Struct *fg, const unsigned int id, const unsigned int dma);
703
715
727PUBLIC_API enum FgParamTypes Fg_getParameterTypeById(Fg_Struct *fg, const unsigned int id, const unsigned int dma);
728
766PUBLIC_API int Fg_setParameter(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex);
767
777PUBLIC_API int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
778
779#ifdef __cplusplus
780}
781
785static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const uint64_t Value, const unsigned int DmaIndex)
786{
787 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_UINT64_T);
788}
789
793static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const int64_t Value, const unsigned int DmaIndex)
794{
795 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_INT64_T);
796}
797
801static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const uint32_t Value, const unsigned int DmaIndex)
802{
803 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_UINT32_T);
804}
805
809static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const int32_t Value, const unsigned int DmaIndex)
810{
811 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_INT32_T);
812}
813
817static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const float Value, const unsigned int DmaIndex)
818{
819 double val = Value;
820 return Fg_setParameterWithType(Fg, Parameter, &val, DmaIndex, FG_PARAM_TYPE_DOUBLE);
821}
822
826static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const double Value, const unsigned int DmaIndex)
827{
828 return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_DOUBLE);
829}
830
831
835static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const char *Value, const unsigned int DmaIndex)
836{
837 return Fg_setParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_CHAR_PTR);
838}
839
843static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const std::string & Value, const unsigned int DmaIndex)
844{
845 return Fg_setParameterWithType(Fg, Parameter, Value.c_str(), DmaIndex, FG_PARAM_TYPE_CHAR_PTR);
846}
847
848extern "C" {
849#endif /* __cplusplus */
850
883PUBLIC_API int Fg_getParameter(Fg_Struct *Fg, int Parameter, void *Value, const unsigned int DmaIndex);
884
903PUBLIC_API int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
904
921PUBLIC_API int Fg_freeParameterStringWithType(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
922
923#ifdef __cplusplus
924}
925
929static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, uint64_t *Value, const unsigned int DmaIndex)
930{
931 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_UINT64_T);
932}
933
937static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, int64_t *Value, const unsigned int DmaIndex)
938{
939 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_INT64_T);
940}
941
945static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, uint32_t *Value, const unsigned int DmaIndex)
946{
947 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_UINT32_T);
948}
949
953static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, int32_t *Value, const unsigned int DmaIndex)
954{
955 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_INT32_T);
956}
957
961static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, float *Value, const unsigned int DmaIndex)
962{
963 double val = 0;
964 int result = Fg_getParameterWithType(Fg, Parameter, &val, DmaIndex, FG_PARAM_TYPE_DOUBLE);
965 if (result == FG_OK)
966 *Value = static_cast<float>(val);
967 return result;
968}
969
973static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, double *Value, const unsigned int DmaIndex)
974{
975 return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_DOUBLE);
976}
977
981static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, std::string & Value, const unsigned int DmaIndex)
982{
983 char * cstr = NULL;
984 int result = Fg_getParameterWithType(Fg, Parameter, &cstr, DmaIndex, FG_PARAM_TYPE_CHAR_PTR_PTR);
985 if (result != 0) {
986 return result;
987 }
988
989 Value = cstr;
990 Fg_freeParameterStringWithType(Fg, Parameter, cstr, DmaIndex, FG_PARAM_TYPE_CHAR_PTR_PTR);
991 return 0;
992}
993
994extern "C" {
995#endif /* __cplusplus */
996
1030PUBLIC_API int Fg_getParameterEx(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, dma_mem *pMem, const frameindex_t ImgNr);
1031
1057PUBLIC_API int Fg_getParameterInfoXML(Fg_Struct *Fg, int port, char * infoBuffer, size_t *infoBufferSize);
1058
1068
1088PUBLIC_API int Fg_saveConfig(Fg_Struct *Fg, const char *Filename);
1089
1114PUBLIC_API int Fg_saveFieldParameterToFile(Fg_Struct * Fg, const int Parameter, const unsigned int DmaIndex, const char * FileName);
1115
1137PUBLIC_API int Fg_loadConfig(Fg_Struct *Fg, const char *Filename);
1138
1162PUBLIC_API int Fg_loadFieldParameterFromFile(Fg_Struct * Fg, const int Parameter, const unsigned int DmaIndex, const char * FileName);
1163
1202PUBLIC_API int Fg_Acquire(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount);
1203
1225PUBLIC_API int Fg_stopAcquire(Fg_Struct *Fg, const unsigned int DmaIndex);
1226
1254PUBLIC_API frameindex_t Fg_getLastPicNumberBlocking(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, const int Timeout);
1255
1274PUBLIC_API frameindex_t Fg_getLastPicNumber(Fg_Struct *Fg, const unsigned int DmaIndex);
1275
1304PUBLIC_API frameindex_t Fg_getLastPicNumberBlockingEx(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, const int Timeout, dma_mem *pMem);
1305
1325PUBLIC_API frameindex_t Fg_getLastPicNumberEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *pMem);
1326
1350PUBLIC_API void * Fg_getImagePtr(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex);
1351
1376PUBLIC_API void * Fg_getImagePtrEx(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, dma_mem *pMem);
1377
1428PUBLIC_API int Fg_AcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount, const int nFlag, dma_mem *memHandle);
1429
1445PUBLIC_API int Fg_sendImage(Fg_Struct *Fg, const frameindex_t startImage, const frameindex_t PicCount, const int nFlag, const unsigned int DmaIndex);
1461PUBLIC_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);
1462
1487PUBLIC_API int Fg_stopAcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *memHandle, int nFlag);
1488
1520PUBLIC_API frameindex_t Fg_getImage(Fg_Struct *Fg, const int Param, const frameindex_t PicNr, const unsigned int DmaIndex, const unsigned int Timeout);
1521
1554PUBLIC_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);
1555
1579PUBLIC_API int Fg_queueBuffer(Fg_Struct *fg, frameindex_t bufferIndex, uint64_t transferLength, uint32_t dmaIndex, dma_mem *memoryHandle);
1580
1581#ifdef __cplusplus
1582
1583extern "C++" {
1584
1592 inline int Fg_queueBuffer(Fg_Struct *fg, frameindex_t bufferIndex, uint64_t transferLength, uint32_t dmaIndex) {
1593 return Fg_queueBuffer(fg, bufferIndex, transferLength, dmaIndex, nullptr);
1594 }
1595
1602 inline int Fg_queueBuffer(Fg_Struct *fg, frameindex_t bufferIndex, uint64_t transferLength, dma_mem *memoryHandle)
1603 {
1604 return Fg_queueBuffer(fg, bufferIndex, transferLength, UINT32_MAX, memoryHandle);
1605 }
1606
1607}
1608#endif // __cplusplus
1609
1610
1626PUBLIC_API int Fg_waitForBuffers(Fg_Struct *fg, uint32_t dmaIndex, uint64_t timeoutSeconds, void *reserved1, size_t reserved2);
1627
1628#ifdef __cplusplus
1629
1634extern "C++" inline int Fg_waitForBuffers(Fg_Struct *fg, const uint32_t dmaIndex, const uint64_t timeoutSeconds)
1635{
1636 return Fg_waitForBuffers(fg, dmaIndex, timeoutSeconds, nullptr, 0);
1637}
1638
1639#endif // __cplusplus
1640
1669PUBLIC_API int Fg_startBufferQueue(Fg_Struct *fg, uint32_t dmaIndex, dma_mem *memoryHandle);
1670
1695PUBLIC_API int Fg_stopBufferQueue(Fg_Struct *fg, uint32_t dmaIndex, int32_t flags);
1696
1812PUBLIC_API int Fg_registerApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex, const struct FgApcControl *control, enum FgApcControlFlags flags);
1813
1814#ifdef __cplusplus
1815}
1816
1820static 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)
1821{
1822 FgApcControl control;
1823 control.version = 0;
1824 control.func = func;
1825 control.data = data;
1826 control.timeout = timeout;
1827 control.flags = flags;
1828 return Fg_registerApcHandler(Fg, DmaIndex, &control, FG_APC_CONTROL_BASIC);
1829}
1830
1831static INLINE int Fg_unregisterApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex)
1832{
1833 return Fg_registerApcHandler(Fg, DmaIndex, NULL, FG_APC_CONTROL_BASIC);
1834}
1835
1836extern "C" {
1837#endif
1852
1863PUBLIC_API const char * getErrorDescription(int ErrorNumber);
1864
1878
1891PUBLIC_API const char * Fg_getErrorDescription(Fg_Struct *Fg, int ErrorNumber);
1892
1921PUBLIC_API int Fg_getBoardType(int BoardIndex);
1922
1936PUBLIC_API const char * Fg_getBoardNameByType(const int BoardType, const int UseShortName);
1937
1949
1959
1971PUBLIC_API const char * Fg_getAppletVersion(Fg_Struct *Fg, int AppletId);
1972
1987PUBLIC_API int Fg_getAppletId(Fg_Struct *Fg, const char *ignored);
1988
1989
1990
1991
2018 const int parameterId,
2019 const enum FgProperty propertyId,
2020 void* buffer, int* bufLen);
2021
2022#ifdef __cplusplus
2023}
2024
2028static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, std::string & Value)
2029{
2030 char * buffer = 0;
2031 int len = 0;
2032
2033 int result = Fg_getParameterProperty(Fg, parameterId, propertyId, NULL, &len);
2034 if (result != FG_OK) return result;
2035
2036 buffer = new(std::nothrow) char[len];
2037 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2038
2039 result = Fg_getParameterProperty(Fg, parameterId, propertyId, buffer, &len);
2040 if (result == FG_OK && len > 0) {
2041 buffer[len - 1] = '\0';
2042 Value = buffer;
2043 }
2044
2045 delete[] buffer;
2046 return result;
2047}
2048
2052static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint64_t *Value)
2053{
2054 std::string temp;
2055 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, temp);
2056 if (result == FG_OK) {
2057 std::istringstream is(temp);
2058 is >> (*Value);
2059 if (is.fail()) result = FG_INVALID_TYPE;
2060 }
2061
2062 return result;
2063}
2064
2068static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int64_t *Value)
2069{
2070 return Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, reinterpret_cast<uint64_t *>(Value));
2071}
2072
2076static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint32_t *Value)
2077{
2078 uint64_t temp = 0;
2079 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
2080 if (result == FG_OK) *Value = static_cast<uint32_t>(temp);
2081
2082 return result;
2083}
2084
2088static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int32_t *Value)
2089{
2090 uint64_t temp = 0;
2091 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
2092 if (result == FG_OK) *Value = static_cast<int32_t>(temp);
2093
2094 return result;
2095}
2096
2100static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, double *Value)
2101{
2102 std::string temp;
2103 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, temp);
2104 if (result == FG_OK) {
2105 std::istringstream is(temp);
2106 is >> (*Value);
2107 if (is.fail()) result = FG_INVALID_TYPE;
2108 }
2109
2110 return result;
2111}
2112
2116static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, float *Value)
2117{
2118 double temp = 0;
2119 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
2120 if (result == FG_OK) *Value = static_cast<float>(temp);
2121
2122 return result;
2123}
2124
2125extern "C" {
2126#endif /* __cplusplus */
2127
2155 const int parameterId,
2156 const enum FgProperty propertyId,
2157 const int DmaIndex,
2158 void* buffer, int* bufLen);
2159
2160#ifdef __cplusplus
2161}
2162
2166static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, std::string & Value, const unsigned int DmaIndex)
2167{
2168 char * buffer = 0;
2169 int len = 0;
2170
2171 int result = Fg_getParameterPropertyEx(Fg, parameterId, propertyId, static_cast<int>(DmaIndex), NULL, &len);
2172 if (result != FG_OK) return result;
2173
2174 buffer = new(std::nothrow) char[len];
2175 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2176
2177 result = Fg_getParameterPropertyEx(Fg, parameterId, propertyId, static_cast<int>(DmaIndex), buffer, &len);
2178 if (result == FG_OK && len > 0) {
2179 buffer[len - 1] = '\0';
2180 Value = buffer;
2181 }
2182
2183 delete[] buffer;
2184 return result;
2185}
2186
2190static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint64_t *Value, const unsigned int DmaIndex)
2191{
2192 std::string temp;
2193 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, temp, DmaIndex);
2194 if (result == FG_OK) {
2195 std::istringstream is(temp);
2196 is >> (*Value);
2197 if (is.fail()) result = FG_INVALID_TYPE;
2198 }
2199
2200 return result;
2201}
2202
2206static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int64_t *Value, const unsigned int DmaIndex)
2207{
2208 return Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, reinterpret_cast<uint64_t *>(Value), DmaIndex);
2209}
2210
2214static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint32_t *Value, const unsigned int DmaIndex)
2215{
2216 uint64_t temp = 0;
2217 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2218 if (result == FG_OK) *Value = static_cast<uint32_t>(temp);
2219
2220 return result;
2221}
2222
2226static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int32_t *Value, const unsigned int DmaIndex)
2227{
2228 uint64_t temp = 0;
2229 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2230 if (result == FG_OK) *Value = static_cast<int32_t>(temp);
2231
2232 return result;
2233}
2234
2238static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, double *Value, const unsigned int DmaIndex)
2239{
2240 std::string temp;
2241 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, temp, DmaIndex);
2242 if (result == FG_OK) {
2243 std::istringstream is(temp);
2244 is >> (*Value);
2245 if (is.fail()) result = FG_INVALID_TYPE;
2246 }
2247
2248 return result;
2249}
2250
2254static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, float *Value, const unsigned int DmaIndex)
2255{
2256 double temp = 0;
2257 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2258 if (result == FG_OK) *Value = static_cast<float>(temp);
2259
2260 return result;
2261}
2262
2263extern "C" {
2264#endif /* __cplusplus */
2265
2290PUBLIC_API int Fg_getSystemInformation(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int param1, void* buffer, unsigned int* bufLen);
2291
2292#ifdef __cplusplus
2293}
2294
2298static INLINE int Fg_getIntSystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2299{
2300 char * buffer = 0;
2301 unsigned int len = 0;
2302
2303 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, NULL, &len);
2304 if (result != FG_OK) return result;
2305
2306 buffer = new(std::nothrow) char[len];
2307 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2308
2309 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2310 if (result == FG_OK) {
2311 std::istringstream is(buffer);
2312 is >> (*val);
2313 if (is.fail()) result = FG_INVALID_TYPE;
2314 }
2315
2316 delete[] buffer;
2317 return result;
2318}
2319
2323static INLINE int Fg_getIntSystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2324{
2325 char * buffer = 0;
2326 unsigned int len = 0;
2327
2328 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), NULL, &len);
2329 if (result != FG_OK) return result;
2330
2331 buffer = new(std::nothrow) char[len];
2332 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2333
2334 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2335 if (result == FG_OK) {
2336 std::istringstream is(buffer);
2337 is >> (*val);
2338 if (is.fail()) result = FG_INVALID_TYPE;
2339 }
2340
2341 delete[] buffer;
2342 return result;
2343}
2344
2348static INLINE int Fg_getIntSystemInformationGlobal(const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2349{
2350 return Fg_getIntSystemInformationForBoardIndex(static_cast<unsigned>(-1), selector, propertyId, val);
2351}
2352
2356static INLINE int Fg_getInt64SystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int64_t * val)
2357{
2358 char * buffer = 0;
2359 unsigned int len = 0;
2360
2361 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, NULL, &len);
2362 if (result != FG_OK) return result;
2363
2364 buffer = new(std::nothrow) char[len];
2365 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2366
2367 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2368 if (result == FG_OK) {
2369 std::istringstream is(buffer);
2370 is >> (*val);
2371 if (is.fail()) result = FG_INVALID_TYPE;
2372 }
2373
2374 delete[] buffer;
2375 return result;
2376}
2377
2381static INLINE int Fg_getInt64SystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int64_t * val)
2382{
2383 char * buffer = 0;
2384 unsigned int len = 0;
2385
2386 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), NULL, &len);
2387 if (result != FG_OK) return result;
2388
2389 buffer = new(std::nothrow) char[len];
2390 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2391
2392 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2393 if (result == FG_OK) {
2394 std::istringstream is(buffer);
2395 is >> (*val);
2396 if (is.fail()) result = FG_INVALID_TYPE;
2397 }
2398
2399 delete[] buffer;
2400 return result;
2401}
2402
2406static INLINE int Fg_getStringSystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2407{
2408 char * buffer = 0;
2409 unsigned int len = 0;
2410
2411 if (arg.length()) {
2412 len = static_cast<unsigned int>(arg.length()) + 1;
2413 buffer = new(std::nothrow) char[len];
2414 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2415
2416#ifdef _WIN32
2417 strncpy_s(buffer, len, arg.c_str(), len - 1);
2418#else
2419 strncpy(buffer, arg.c_str(), len - 1);
2420#endif
2421 }
2422
2423 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2424
2425 if (result != FG_OK) {
2426 delete[] buffer;
2427 return result;
2428 }
2429
2430 if (!arg.empty() && len <= static_cast<unsigned int>(arg.length()) + 1) {
2431 // The buffer size was sufficient and it contains the requested value.
2432 val = buffer;
2433 delete[] buffer;
2434 return FG_OK;
2435 } else {
2436 // The buffer was too small. Create a suitable buffer and try again.
2437 // len has been set the required size.
2438 delete[] buffer;
2439 buffer = new(std::nothrow) char[len];
2440 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2441
2442 if (!arg.empty()) {
2443#ifdef _WIN32
2444 strncpy_s(buffer, len, arg.c_str(), arg.length());
2445#else
2446 strncpy(buffer, arg.c_str(), arg.length());
2447#endif
2448 }
2449
2450 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2451 if (result == FG_OK) {
2452 val = buffer;
2453 }
2454
2455 delete[] buffer;
2456 return result;
2457 }
2458}
2459
2463static INLINE int Fg_getStringSystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2464{
2465 char * buffer = 0;
2466 unsigned int len = 0;
2467
2468 if (!arg.empty()) {
2469 len = static_cast<unsigned int>(arg.length()) + 1;
2470 buffer = new(std::nothrow) char[len];
2471 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2472
2473#ifdef _WIN32
2474 strncpy_s(buffer, len, arg.c_str(), arg.length());
2475#else
2476 strncpy(buffer, arg.c_str(), arg.length());
2477#endif
2478 }
2479
2480 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2481 if (result != FG_OK) {
2482 delete[] buffer;
2483 return result;
2484 }
2485
2486 if (!arg.empty() && len <= static_cast<unsigned int>(arg.length()) + 1) {
2487 val = buffer;
2488 delete[] buffer;
2489 return FG_OK;
2490 } else {
2491 delete[] buffer;
2492 buffer = new(std::nothrow) char[len];
2493 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2494
2495 if (!arg.empty()) {
2496#ifdef _WIN32
2497 strncpy_s(buffer, len, arg.c_str(), arg.length());
2498#else
2499 strncpy(buffer, arg.c_str(), arg.length());
2500#endif
2501 }
2502
2503 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2504 if (!result) {
2505 val = buffer;
2506 }
2507
2508 delete[] buffer;
2509 return result;
2510 }
2511}
2512
2516static INLINE int Fg_getStringSystemInformationGlobal(const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2517{
2518 return Fg_getStringSystemInformationForBoardIndex(static_cast<unsigned>(-1), selector, propertyId, val, arg);
2519}
2520
2521extern "C" {
2522#endif
2523
2548PUBLIC_API int Fg_readUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, void * buffer);
2549
2574PUBLIC_API int Fg_writeUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, const void * buffer);
2575
2609PUBLIC_API frameindex_t Fg_getStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex);
2610
2645PUBLIC_API frameindex_t Fg_getStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem);
2646
2672PUBLIC_API int Fg_setStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex);
2673
2700PUBLIC_API int Fg_setStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem);
2701
2733PUBLIC_API int Fg_getAppletIterator(int boardIndex, const enum FgAppletIteratorSource src, Fg_AppletIteratorType * iter, int flags);
2734
2744
2762
2779
2794
2813
2833
2834#ifdef __cplusplus
2835} /* extern "C" */
2836
2840static INLINE int Fg_findApplet(const unsigned int BoardIndex, std::string & Path) {
2841
2842 // ensure a defined state of the output argument
2843 Path.clear();
2844
2846 int ret = Fg_getAppletIterator(BoardIndex, FG_AIS_FILESYSTEM, &iter, FG_AF_IS_LOADABLE);
2847
2848 const int numItems = ret;
2849 ret = FG_FILE_NOT_FOUND;
2850
2851 // Iterate over found applets in case there are more than one.
2852 for (int i = 0; i < numItems && ret != FG_OK; ++i) {
2853 const Fg_AppletIteratorItem item = Fg_getAppletIteratorItem(iter, i);
2854 if (item != nullptr) {
2855 const int64_t info = Fg_getAppletIntProperty(item, FG_AP_INT_INFO);
2856 if (info & FG_AI_IS_VALID) {
2858 ret = FG_OK;
2859 }
2860 }
2861 }
2863 return ret;
2864}
2865
2866extern "C" {
2867#endif /* __cplusplus */
2868
2888PUBLIC_API uint64_t Fg_getEventMask(Fg_Struct *Fg, const char *name);
2889
2903
2916PUBLIC_API const char * Fg_getEventName(Fg_Struct *Fg, uint64_t mask);
2917
2931
2948PUBLIC_API int Fg_activateEvents(Fg_Struct *Fg, uint64_t mask, int enable);
2949
2966PUBLIC_API int Fg_clearEvents(Fg_Struct *Fg, uint64_t mask);
2967
2998PUBLIC_API uint64_t Fg_eventWait(Fg_Struct *Fg, uint64_t mask, unsigned int timeout, unsigned int flags, struct fg_event_info *info);
2999
3045PUBLIC_API int Fg_registerEventCallback(Fg_Struct *Fg, uint64_t mask, Fg_EventFunc_t handler, void *data, unsigned int flags, struct fg_event_info *info);
3046
3047#ifdef __cplusplus
3048}
3049
3053static INLINE int Fg_unregisterEventCallback(Fg_Struct *Fg, uint64_t mask)
3054{
3055 return Fg_registerEventCallback(Fg, mask, NULL, NULL, FG_EVENT_DEFAULT_FLAGS, NULL);
3056}
3057
3058extern "C" {
3059#endif
3093
3114
3130PUBLIC_API int Fg_resetAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph);
3131
3146PUBLIC_API int Fg_setAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph);
3147
3170PUBLIC_API int DEPRECATED(Fg_setExsync(Fg_Struct *Fg, int Flag, const unsigned int CamPort));
3171
3194PUBLIC_API int DEPRECATED(Fg_setFlash(Fg_Struct *Fg, int Flag, const unsigned int CamPort));
3195
3227PUBLIC_API int Fg_sendSoftwareTrigger(Fg_Struct *Fg, const unsigned int CamPort);
3228
3264PUBLIC_API int Fg_sendSoftwareTriggerEx(Fg_Struct *Fg, const unsigned int CamPort, const unsigned int Triggers);
3265
3292PUBLIC_API ShadingMaster * Fg_AllocShading(Fg_Struct *Fg, int set, const unsigned int CamPort);
3293
3310
3331
3351
3370
3395PUBLIC_API int Shad_SetSubValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float sub);
3396
3421PUBLIC_API int Shad_SetMultValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float mult);
3422
3447PUBLIC_API int Shad_SetFixedPatternNoiseLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, int on);
3448
3470#ifdef __cplusplus
3471
3472struct VAdevice;
3473struct RegisterInfo;
3474class fpga_design;
3475
3484PUBLIC_API Fg_Struct * Fg_InitHandle(const char *appletName, struct VAdevice *hwhandle, fpga_design *deshandle);
3485
3495PUBLIC_API Fg_Struct * Fg_InitHandleSlaveAware(const char *appletName, struct VAdevice *hwhandle, fpga_design *deshandle, int isSlave);
3496
3504PUBLIC_API RegisterInfo * Fg_getParameterInfo(Fg_Struct *Fg, const unsigned int CamPort);
3505
3506#endif /* __cplusplus */
3507
3508/* Deprecated functions, do not use as they will eventually go away */
3509
3516PUBLIC_API int DEPRECATED(getLastErrorNumber());
3517
3518#ifdef __cplusplus
3519} /* extern "C" */
3520
3521#endif
3522
3523#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:55
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:57
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:34
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:2488
FgAppletIteratorSource
Applet Iterator Sources.
Definition fg_define.h:2493
@ FG_AIS_FILESYSTEM
Definition fg_define.h:2495
@ FG_AI_IS_VALID
Definition fg_define.h:2544
@ FG_EVENT_DEFAULT_FLAGS
Definition fg_define.h:1401
int(* Fg_EventFunc_t)(uint64_t events, void *data, const struct fg_event_info *info)
Definition fg_define.h:1395
FgParamTypes
Definition fg_define.h:210
@ FG_PARAM_TYPE_UINT32_T
Definition fg_define.h:213
@ FG_PARAM_TYPE_INT64_T
Definition fg_define.h:214
@ FG_PARAM_TYPE_DOUBLE
Definition fg_define.h:216
@ FG_PARAM_TYPE_CHAR_PTR_PTR
Definition fg_define.h:219
@ FG_PARAM_TYPE_INT32_T
Definition fg_define.h:212
@ FG_PARAM_TYPE_UINT64_T
Definition fg_define.h:215
@ FG_PARAM_TYPE_CHAR_PTR
Definition fg_define.h:217
int(* Fg_AsyncNotifyFunc_t)(int boardIndex, unsigned long notification, unsigned long pl, unsigned long ph, void *context)
Definition fg_define.h:1456
FgProperty
definitions for querying information about a certain field
Definition fg_define.h:1170
void * Fg_AppletIteratorType
Definition fg_define.h:2487
FgAppletStringProperty
Available String Applet Properties .
Definition fg_define.h:2575
@ FG_AP_STRING_APPLET_PATH
Definition fg_define.h:2582
FgAppletIntProperty
Available Integer Applet Properties .
Definition fg_define.h:2553
@ FG_AP_INT_INFO
Definition fg_define.h:2555
int(* Fg_ApcFunc_t)(frameindex_t imgNr, void *data)
Definition fg_define.h:1353
FgApcControlFlags
control flags for Fg_registerApcHandler()
Definition fg_define.h:1372
@ FG_APC_CONTROL_BASIC
Definition fg_define.h:1373
@ FG_AF_IS_LOADABLE
Definition fg_define.h:2508
Fg_Info_Selector
definitions of available system informations
Definition fg_define.h:1067
Constant and enum definitions.
#define FG_INVALID_TYPE
Definition fg_error_codes.h:113
#define FG_FILE_NOT_FOUND
Definition fg_error_codes.h:59
#define FG_NOT_ENOUGH_MEMORY
Definition fg_error_codes.h:89
#define FG_OK
Definition fg_error_codes.h:24
struct declarations.
struct Fg_Struct_s Fg_Struct
The structure for a framegrabber.
Definition fg_struct.h:156
Definitions for platform dependent types.
long frameindex_t
Definition os_type.h:78
Definition fg_struct.h:136
unsigned int flags
Definition fg_struct.h:142
unsigned int version
Definition fg_struct.h:137
Fg_ApcFunc_t func
Definition fg_struct.h:139
void * data
Definition fg_struct.h:140
unsigned int timeout
Definition fg_struct.h:141
Definition fg_struct.h:158
uint16_t data[254]
Definition fg_struct.h:164