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
1470
1495PUBLIC_API int Fg_stopAcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *memHandle, int nFlag);
1496
1528PUBLIC_API frameindex_t Fg_getImage(Fg_Struct *Fg, const int Param, const frameindex_t PicNr, const unsigned int DmaIndex, const unsigned int Timeout);
1529
1562PUBLIC_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);
1563
1679PUBLIC_API int Fg_registerApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex, const struct FgApcControl *control, enum FgApcControlFlags flags);
1680
1681#ifdef __cplusplus
1682}
1683
1687static 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)
1688{
1689 FgApcControl control;
1690 control.version = 0;
1691 control.func = func;
1692 control.data = data;
1693 control.timeout = timeout;
1694 control.flags = flags;
1695 return Fg_registerApcHandler(Fg, DmaIndex, &control, FG_APC_CONTROL_BASIC);
1696}
1697
1698static INLINE int Fg_unregisterApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex)
1699{
1700 return Fg_registerApcHandler(Fg, DmaIndex, NULL, FG_APC_CONTROL_BASIC);
1701}
1702
1703extern "C" {
1704#endif
1719
1730PUBLIC_API const char * getErrorDescription(int ErrorNumber);
1731
1745
1758PUBLIC_API const char * Fg_getErrorDescription(Fg_Struct *Fg, int ErrorNumber);
1759
1788PUBLIC_API int Fg_getBoardType(int BoardIndex);
1789
1803PUBLIC_API const char * Fg_getBoardNameByType(const int BoardType, const int UseShortName);
1804
1816
1826
1838PUBLIC_API const char * Fg_getAppletVersion(Fg_Struct *Fg, int AppletId);
1839
1854PUBLIC_API int Fg_getAppletId(Fg_Struct *Fg, const char *ignored);
1855
1856
1857
1858
1885 const int parameterId,
1886 const enum FgProperty propertyId,
1887 void* buffer, int* bufLen);
1888
1889#ifdef __cplusplus
1890}
1891
1895static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, std::string & Value)
1896{
1897 char * buffer = 0;
1898 int len = 0;
1899
1900 int result = Fg_getParameterProperty(Fg, parameterId, propertyId, NULL, &len);
1901 if (result != FG_OK) return result;
1902
1903 buffer = new(std::nothrow) char[len];
1904 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
1905
1906 result = Fg_getParameterProperty(Fg, parameterId, propertyId, buffer, &len);
1907 if (result == FG_OK && len > 0) {
1908 buffer[len - 1] = '\0';
1909 Value = buffer;
1910 }
1911
1912 delete[] buffer;
1913 return result;
1914}
1915
1919static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint64_t *Value)
1920{
1921 std::string temp;
1922 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, temp);
1923 if (result == FG_OK) {
1924 std::istringstream is(temp);
1925 is >> (*Value);
1926 if (is.fail()) result = FG_INVALID_TYPE;
1927 }
1928
1929 return result;
1930}
1931
1935static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int64_t *Value)
1936{
1937 return Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, reinterpret_cast<uint64_t *>(Value));
1938}
1939
1943static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint32_t *Value)
1944{
1945 uint64_t temp = 0;
1946 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
1947 if (result == FG_OK) *Value = static_cast<uint32_t>(temp);
1948
1949 return result;
1950}
1951
1955static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int32_t *Value)
1956{
1957 uint64_t temp = 0;
1958 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
1959 if (result == FG_OK) *Value = static_cast<int32_t>(temp);
1960
1961 return result;
1962}
1963
1967static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, double *Value)
1968{
1969 std::string temp;
1970 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, temp);
1971 if (result == FG_OK) {
1972 std::istringstream is(temp);
1973 is >> (*Value);
1974 if (is.fail()) result = FG_INVALID_TYPE;
1975 }
1976
1977 return result;
1978}
1979
1983static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, float *Value)
1984{
1985 double temp = 0;
1986 int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
1987 if (result == FG_OK) *Value = static_cast<float>(temp);
1988
1989 return result;
1990}
1991
1992extern "C" {
1993#endif /* __cplusplus */
1994
2022 const int parameterId,
2023 const enum FgProperty propertyId,
2024 const int DmaIndex,
2025 void* buffer, int* bufLen);
2026
2027#ifdef __cplusplus
2028}
2029
2033static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, std::string & Value, const unsigned int DmaIndex)
2034{
2035 char * buffer = 0;
2036 int len = 0;
2037
2038 int result = Fg_getParameterPropertyEx(Fg, parameterId, propertyId, static_cast<int>(DmaIndex), NULL, &len);
2039 if (result != FG_OK) return result;
2040
2041 buffer = new(std::nothrow) char[len];
2042 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2043
2044 result = Fg_getParameterPropertyEx(Fg, parameterId, propertyId, static_cast<int>(DmaIndex), buffer, &len);
2045 if (result == FG_OK && len > 0) {
2046 buffer[len - 1] = '\0';
2047 Value = buffer;
2048 }
2049
2050 delete[] buffer;
2051 return result;
2052}
2053
2057static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint64_t *Value, const unsigned int DmaIndex)
2058{
2059 std::string temp;
2060 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, temp, DmaIndex);
2061 if (result == FG_OK) {
2062 std::istringstream is(temp);
2063 is >> (*Value);
2064 if (is.fail()) result = FG_INVALID_TYPE;
2065 }
2066
2067 return result;
2068}
2069
2073static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int64_t *Value, const unsigned int DmaIndex)
2074{
2075 return Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, reinterpret_cast<uint64_t *>(Value), DmaIndex);
2076}
2077
2081static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint32_t *Value, const unsigned int DmaIndex)
2082{
2083 uint64_t temp = 0;
2084 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2085 if (result == FG_OK) *Value = static_cast<uint32_t>(temp);
2086
2087 return result;
2088}
2089
2093static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int32_t *Value, const unsigned int DmaIndex)
2094{
2095 uint64_t temp = 0;
2096 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2097 if (result == FG_OK) *Value = static_cast<int32_t>(temp);
2098
2099 return result;
2100}
2101
2105static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, double *Value, const unsigned int DmaIndex)
2106{
2107 std::string temp;
2108 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, temp, DmaIndex);
2109 if (result == FG_OK) {
2110 std::istringstream is(temp);
2111 is >> (*Value);
2112 if (is.fail()) result = FG_INVALID_TYPE;
2113 }
2114
2115 return result;
2116}
2117
2121static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, float *Value, const unsigned int DmaIndex)
2122{
2123 double temp = 0;
2124 int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2125 if (result == FG_OK) *Value = static_cast<float>(temp);
2126
2127 return result;
2128}
2129
2130extern "C" {
2131#endif /* __cplusplus */
2132
2157PUBLIC_API int Fg_getSystemInformation(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int param1, void* buffer, unsigned int* bufLen);
2158
2159#ifdef __cplusplus
2160}
2161
2165static INLINE int Fg_getIntSystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2166{
2167 char * buffer = 0;
2168 unsigned int len = 0;
2169
2170 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, NULL, &len);
2171 if (result != FG_OK) return result;
2172
2173 buffer = new(std::nothrow) char[len];
2174 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2175
2176 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2177 if (result == FG_OK) {
2178 std::istringstream is(buffer);
2179 is >> (*val);
2180 if (is.fail()) result = FG_INVALID_TYPE;
2181 }
2182
2183 delete[] buffer;
2184 return result;
2185}
2186
2190static INLINE int Fg_getIntSystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2191{
2192 char * buffer = 0;
2193 unsigned int len = 0;
2194
2195 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), NULL, &len);
2196 if (result != FG_OK) return result;
2197
2198 buffer = new(std::nothrow) char[len];
2199 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2200
2201 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2202 if (result == FG_OK) {
2203 std::istringstream is(buffer);
2204 is >> (*val);
2205 if (is.fail()) result = FG_INVALID_TYPE;
2206 }
2207
2208 delete[] buffer;
2209 return result;
2210}
2211
2215static INLINE int Fg_getIntSystemInformationGlobal(const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2216{
2217 return Fg_getIntSystemInformationForBoardIndex(static_cast<unsigned>(-1), selector, propertyId, val);
2218}
2219
2223static INLINE int Fg_getInt64SystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int64_t * val)
2224{
2225 char * buffer = 0;
2226 unsigned int len = 0;
2227
2228 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, NULL, &len);
2229 if (result != FG_OK) return result;
2230
2231 buffer = new(std::nothrow) char[len];
2232 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2233
2234 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2235 if (result == FG_OK) {
2236 std::istringstream is(buffer);
2237 is >> (*val);
2238 if (is.fail()) result = FG_INVALID_TYPE;
2239 }
2240
2241 delete[] buffer;
2242 return result;
2243}
2244
2248static INLINE int Fg_getInt64SystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int64_t * val)
2249{
2250 char * buffer = 0;
2251 unsigned int len = 0;
2252
2253 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), NULL, &len);
2254 if (result != FG_OK) return result;
2255
2256 buffer = new(std::nothrow) char[len];
2257 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2258
2259 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2260 if (result == FG_OK) {
2261 std::istringstream is(buffer);
2262 is >> (*val);
2263 if (is.fail()) result = FG_INVALID_TYPE;
2264 }
2265
2266 delete[] buffer;
2267 return result;
2268}
2269
2273static INLINE int Fg_getStringSystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2274{
2275 char * buffer = 0;
2276 unsigned int len = 0;
2277
2278 if (arg.length()) {
2279 len = static_cast<unsigned int>(arg.length()) + 1;
2280 buffer = new(std::nothrow) char[len];
2281 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2282
2283#ifdef _WIN32
2284 strncpy_s(buffer, len, arg.c_str(), len - 1);
2285#else
2286 strncpy(buffer, arg.c_str(), len - 1);
2287#endif
2288 }
2289
2290 int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2291
2292 if (result != FG_OK) {
2293 delete[] buffer;
2294 return result;
2295 }
2296
2297 if (!arg.empty() && len <= static_cast<unsigned int>(arg.length()) + 1) {
2298 // The buffer size was sufficient and it contains the requested value.
2299 val = buffer;
2300 delete[] buffer;
2301 return FG_OK;
2302 } else {
2303 // The buffer was too small. Create a suitable buffer and try again.
2304 // len has been set the required size.
2305 delete[] buffer;
2306 buffer = new(std::nothrow) char[len];
2307 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2308
2309 if (!arg.empty()) {
2310#ifdef _WIN32
2311 strncpy_s(buffer, len, arg.c_str(), arg.length());
2312#else
2313 strncpy(buffer, arg.c_str(), arg.length());
2314#endif
2315 }
2316
2317 result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2318 if (result == FG_OK) {
2319 val = buffer;
2320 }
2321
2322 delete[] buffer;
2323 return result;
2324 }
2325}
2326
2330static INLINE int Fg_getStringSystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2331{
2332 char * buffer = 0;
2333 unsigned int len = 0;
2334
2335 if (!arg.empty()) {
2336 len = static_cast<unsigned int>(arg.length()) + 1;
2337 buffer = new(std::nothrow) char[len];
2338 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2339
2340#ifdef _WIN32
2341 strncpy_s(buffer, len, arg.c_str(), arg.length());
2342#else
2343 strncpy(buffer, arg.c_str(), arg.length());
2344#endif
2345 }
2346
2347 int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2348 if (result != FG_OK) {
2349 delete[] buffer;
2350 return result;
2351 }
2352
2353 if (!arg.empty() && len <= static_cast<unsigned int>(arg.length()) + 1) {
2354 val = buffer;
2355 delete[] buffer;
2356 return FG_OK;
2357 } else {
2358 delete[] buffer;
2359 buffer = new(std::nothrow) char[len];
2360 if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2361
2362 if (!arg.empty()) {
2363#ifdef _WIN32
2364 strncpy_s(buffer, len, arg.c_str(), arg.length());
2365#else
2366 strncpy(buffer, arg.c_str(), arg.length());
2367#endif
2368 }
2369
2370 result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2371 if (!result) {
2372 val = buffer;
2373 }
2374
2375 delete[] buffer;
2376 return result;
2377 }
2378}
2379
2383static INLINE int Fg_getStringSystemInformationGlobal(const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2384{
2385 return Fg_getStringSystemInformationForBoardIndex(static_cast<unsigned>(-1), selector, propertyId, val, arg);
2386}
2387
2388extern "C" {
2389#endif
2390
2415PUBLIC_API int Fg_readUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, void * buffer);
2416
2441PUBLIC_API int Fg_writeUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, const void * buffer);
2442
2476PUBLIC_API frameindex_t Fg_getStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex);
2477
2512PUBLIC_API frameindex_t Fg_getStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem);
2513
2539PUBLIC_API int Fg_setStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex);
2540
2567PUBLIC_API int Fg_setStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem);
2568
2600PUBLIC_API int Fg_getAppletIterator(int boardIndex, const enum FgAppletIteratorSource src, Fg_AppletIteratorType * iter, int flags);
2601
2611
2629
2646
2661
2680
2700
2701#ifdef __cplusplus
2702} /* extern "C" */
2703
2707static INLINE int Fg_findApplet(const unsigned int BoardIndex, std::string & Path) {
2708
2709 // ensure a defined state of the output argument
2710 Path.clear();
2711
2713 int ret = Fg_getAppletIterator(BoardIndex, FG_AIS_FILESYSTEM, &iter, FG_AF_IS_LOADABLE);
2714
2715 const int numItems = ret;
2716 ret = FG_FILE_NOT_FOUND;
2717
2718 // Iterate over found applets in case there are more than one.
2719 for (int i = 0; i < numItems && ret != FG_OK; ++i) {
2720 const Fg_AppletIteratorItem item = Fg_getAppletIteratorItem(iter, i);
2721 if (item != nullptr) {
2722 const int64_t info = Fg_getAppletIntProperty(item, FG_AP_INT_INFO);
2723 if (info & FG_AI_IS_VALID) {
2725 ret = FG_OK;
2726 }
2727 }
2728 }
2730 return ret;
2731}
2732
2733extern "C" {
2734#endif /* __cplusplus */
2735
2755PUBLIC_API uint64_t Fg_getEventMask(Fg_Struct *Fg, const char *name);
2756
2770
2783PUBLIC_API const char * Fg_getEventName(Fg_Struct *Fg, uint64_t mask);
2784
2798
2815PUBLIC_API int Fg_activateEvents(Fg_Struct *Fg, uint64_t mask, int enable);
2816
2833PUBLIC_API int Fg_clearEvents(Fg_Struct *Fg, uint64_t mask);
2834
2865PUBLIC_API uint64_t Fg_eventWait(Fg_Struct *Fg, uint64_t mask, unsigned int timeout, unsigned int flags, struct fg_event_info *info);
2866
2912PUBLIC_API int Fg_registerEventCallback(Fg_Struct *Fg, uint64_t mask, Fg_EventFunc_t handler, void *data, unsigned int flags, struct fg_event_info *info);
2913
2914#ifdef __cplusplus
2915}
2916
2920static INLINE int Fg_unregisterEventCallback(Fg_Struct *Fg, uint64_t mask)
2921{
2922 return Fg_registerEventCallback(Fg, mask, NULL, NULL, FG_EVENT_DEFAULT_FLAGS, NULL);
2923}
2924
2925extern "C" {
2926#endif
2960
2981
2997PUBLIC_API int Fg_resetAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph);
2998
3013PUBLIC_API int Fg_setAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph);
3014
3037PUBLIC_API int DEPRECATED(Fg_setExsync(Fg_Struct *Fg, int Flag, const unsigned int CamPort));
3038
3061PUBLIC_API int DEPRECATED(Fg_setFlash(Fg_Struct *Fg, int Flag, const unsigned int CamPort));
3062
3094PUBLIC_API int Fg_sendSoftwareTrigger(Fg_Struct *Fg, const unsigned int CamPort);
3095
3131PUBLIC_API int Fg_sendSoftwareTriggerEx(Fg_Struct *Fg, const unsigned int CamPort, const unsigned int Triggers);
3132
3159PUBLIC_API ShadingMaster * Fg_AllocShading(Fg_Struct *Fg, int set, const unsigned int CamPort);
3160
3177
3198
3218
3237
3262PUBLIC_API int Shad_SetSubValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float sub);
3263
3288PUBLIC_API int Shad_SetMultValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float mult);
3289
3314PUBLIC_API int Shad_SetFixedPatternNoiseLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, int on);
3315
3337#ifdef __cplusplus
3338
3339struct VAdevice;
3340struct RegisterInfo;
3341class fpga_design;
3342
3351PUBLIC_API Fg_Struct * Fg_InitHandle(const char *appletName, struct VAdevice *hwhandle, fpga_design *deshandle);
3352
3362PUBLIC_API Fg_Struct * Fg_InitHandleSlaveAware(const char *appletName, struct VAdevice *hwhandle, fpga_design *deshandle, int isSlave);
3363
3371PUBLIC_API RegisterInfo * Fg_getParameterInfo(Fg_Struct *Fg, const unsigned int CamPort);
3372
3373#endif /* __cplusplus */
3374
3375/* Deprecated functions, do not use as they will eventually go away */
3376
3383PUBLIC_API int DEPRECATED(getLastErrorNumber());
3384
3385#ifdef __cplusplus
3386} /* extern "C" */
3387
3388#endif
3389
3390#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 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_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_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:2237
FgAppletIteratorSource
Applet Iterator Sources.
Definition: fg_define.h:2242
@ FG_AIS_FILESYSTEM
Definition: fg_define.h:2244
@ FG_AI_IS_VALID
Definition: fg_define.h:2292
@ FG_EVENT_DEFAULT_FLAGS
Definition: fg_define.h:1384
int(* Fg_EventFunc_t)(uint64_t events, void *data, const struct fg_event_info *info)
Definition: fg_define.h:1378
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:1438
FgProperty
definitions for querying information about a certain field
Definition: fg_define.h:1154
void * Fg_AppletIteratorType
Definition: fg_define.h:2236
FgAppletStringProperty
Available String Applet Properties .
Definition: fg_define.h:2323
@ FG_AP_STRING_APPLET_PATH
Definition: fg_define.h:2330
FgAppletIntProperty
Available Integer Applet Properties .
Definition: fg_define.h:2301
@ FG_AP_INT_INFO
Definition: fg_define.h:2303
int(* Fg_ApcFunc_t)(frameindex_t imgNr, void *data)
Definition: fg_define.h:1336
FgApcControlFlags
control flags for Fg_registerApcHandler()
Definition: fg_define.h:1355
@ FG_APC_CONTROL_BASIC
Definition: fg_define.h:1356
@ FG_AF_IS_LOADABLE
Definition: fg_define.h:2257
Fg_Info_Selector
definitions of available system informations
Definition: fg_define.h:1051
Constant and enum definitions.
#define FG_INVALID_TYPE
Definition: fg_error_codes.h:119
#define FG_FILE_NOT_FOUND
Definition: fg_error_codes.h:65
#define FG_NOT_ENOUGH_MEMORY
Definition: fg_error_codes.h:95
#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