Silicon Software Logo

fgrab_prototyp.h Source File

fgrab_prototyp.h
Go to the documentation of this file.
1 
13 #ifndef __FGRAB_PROTOTYP_H
14 #define __FGRAB_PROTOTYP_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 "fgrab_struct.h"
28 #include "fgrab_define.h"
29 #include "os_type.h"
30 #include "os_funcs.h"
31 
32 #include "SisoDisplay.h"
33 
34 // For GCC, we control visibility of symbols via attributes
35 // For MSVC this is done via a .def file.
36 // TODO: Move this to a common place for all libraries?
37 #if defined(__GNUC__) && (__GNUC__ >= 4)
38  #define PUBLIC_API __attribute__ ((visibility ("default")))
39 #else
40  #define PUBLIC_API
41 #endif
42 
43 #ifdef __cplusplus
44 #include <string>
45 #include <sstream>
46 #include <new>
47 #include <cstring>
48 
49 #if defined(__GNUC__) || defined(_MSC_VER) || defined(__clang__)
50 #define INLINE inline
51 #else /* __GNUC__ || _MSC_VER || __clang__ */
52 #define INLINE
53 #endif /* __GNUC__ || _MSC_VER || __clang__ */
54 
55 extern "C"
56 {
57 class dma_mem;
58 class ShadingMaster;
59 #else
60 struct dma_mem_s;
61 typedef struct dma_mem_s dma_mem;
62 struct ShadingMaster_s;
63 typedef struct ShadingMaster_s ShadingMaster;
64 #endif
65 
66 struct fg_event_data;
67 struct fg_event_info;
68 
69 
70 
78 
99 PUBLIC_API int Fg_InitLibraries(const char * sisoDir);
100 
143 PUBLIC_API int Fg_InitLibrariesEx(const char * sisoDir, unsigned int flags, const char * id, unsigned int timeout);
144 
159 
172 
194 
219 PUBLIC_API int Fg_findApplet(const unsigned int BoardIndex, char * Path, size_t Size);
220 
238 PUBLIC_API Fg_Struct * Fg_Init(const char *FileName, unsigned int BoardIndex);
239 
263 PUBLIC_API Fg_Struct * Fg_InitConfig(const char *Config_Name, unsigned int BoardIndex);
264 
265 
306 PUBLIC_API Fg_Struct * Fg_InitEx(const char *FileName, unsigned int BoardIndex, int flags);
307 
349 PUBLIC_API Fg_Struct * Fg_InitConfigEx(const char *Config_Name, unsigned int BoardIndex, int flags);
350 
403 PUBLIC_API void * Fg_AllocMem(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt, const unsigned int DmaIndex);
404 
429 PUBLIC_API dma_mem * Fg_AllocMemEx(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt);
430 
444 PUBLIC_API int Fg_FreeMem(Fg_Struct *Fg, const unsigned int DmaIndex);
445 
462 
509 PUBLIC_API dma_mem * Fg_AllocMemHead(Fg_Struct *Fg, const size_t Size, const frameindex_t BufCnt);
510 
532 PUBLIC_API int Fg_FreeMemHead(Fg_Struct *Fg, dma_mem *memHandle);
533 
555 PUBLIC_API int Fg_AddMem(Fg_Struct *Fg, void *pBuffer, const size_t Size, const frameindex_t bufferIndex, dma_mem *memHandle);
556 
573 PUBLIC_API int Fg_DelMem(Fg_Struct *Fg, dma_mem *memHandle, const frameindex_t bufferIndex);
574 
592 PUBLIC_API void * Fg_NumaAllocDmaBuffer(Fg_Struct * Fg, size_t Size);
593 
607 PUBLIC_API int Fg_NumaFreeDmaBuffer(Fg_Struct * Fg, void * Buffer);
608 
620 
636 
651 PUBLIC_API int Fg_getParameterId(Fg_Struct *fg, int index);
652 
663 PUBLIC_API const char * Fg_getParameterName(Fg_Struct *fg, int index);
664 
699 PUBLIC_API int Fg_getParameterIdByName(Fg_Struct *fg, const char *name);
700 
712 PUBLIC_API const char * Fg_getParameterNameById(Fg_Struct *fg, const unsigned int id, const unsigned int dma);
713 
725 
737 PUBLIC_API enum FgParamTypes Fg_getParameterTypeById(Fg_Struct *fg, const unsigned int id, const unsigned int dma);
738 
776 PUBLIC_API int Fg_setParameter(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex);
777 
787 PUBLIC_API int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
788 
789 #ifdef __cplusplus
790 }
791 
795 static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const uint64_t Value, const unsigned int DmaIndex)
796 {
797  return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_UINT64_T);
798 }
799 
803 static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const int64_t Value, const unsigned int DmaIndex)
804 {
805  return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_INT64_T);
806 }
807 
811 static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const uint32_t Value, const unsigned int DmaIndex)
812 {
813  return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_UINT32_T);
814 }
815 
819 static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const int32_t Value, const unsigned int DmaIndex)
820 {
821  return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_INT32_T);
822 }
823 
827 static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const float Value, const unsigned int DmaIndex)
828 {
829  double val = Value;
830  return Fg_setParameterWithType(Fg, Parameter, &val, DmaIndex, FG_PARAM_TYPE_DOUBLE);
831 }
832 
836 static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const double Value, const unsigned int DmaIndex)
837 {
838  return Fg_setParameterWithType(Fg, Parameter, &Value, DmaIndex, FG_PARAM_TYPE_DOUBLE);
839 }
840 
841 
845 static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const char *Value, const unsigned int DmaIndex)
846 {
847  return Fg_setParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_CHAR_PTR);
848 }
849 
853 static INLINE int Fg_setParameterWithType(Fg_Struct *Fg, const int Parameter, const std::string & Value, const unsigned int DmaIndex)
854 {
855  return Fg_setParameterWithType(Fg, Parameter, Value.c_str(), DmaIndex, FG_PARAM_TYPE_CHAR_PTR);
856 }
857 
858 extern "C" {
859 #endif /* __cplusplus */
860 
893 PUBLIC_API int Fg_getParameter(Fg_Struct *Fg, int Parameter, void *Value, const unsigned int DmaIndex);
894 
913 PUBLIC_API int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
914 
931 PUBLIC_API int Fg_freeParameterStringWithType(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, const enum FgParamTypes type);
932 
933 #ifdef __cplusplus
934 }
935 
939 static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, uint64_t *Value, const unsigned int DmaIndex)
940 {
941  return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_UINT64_T);
942 }
943 
947 static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, int64_t *Value, const unsigned int DmaIndex)
948 {
949  return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_INT64_T);
950 }
951 
955 static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, uint32_t *Value, const unsigned int DmaIndex)
956 {
957  return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_UINT32_T);
958 }
959 
963 static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, int32_t *Value, const unsigned int DmaIndex)
964 {
965  return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_INT32_T);
966 }
967 
971 static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, float *Value, const unsigned int DmaIndex)
972 {
973  double val = 0;
974  int result = Fg_getParameterWithType(Fg, Parameter, &val, DmaIndex, FG_PARAM_TYPE_DOUBLE);
975  if (result == FG_OK)
976  *Value = static_cast<float>(val);
977  return result;
978 }
979 
983 static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, double *Value, const unsigned int DmaIndex)
984 {
985  return Fg_getParameterWithType(Fg, Parameter, Value, DmaIndex, FG_PARAM_TYPE_DOUBLE);
986 }
987 
991 static INLINE int Fg_getParameterWithType(Fg_Struct *Fg, const int Parameter, std::string & Value, const unsigned int DmaIndex)
992 {
993  char * cstr = NULL;
994  int result = Fg_getParameterWithType(Fg, Parameter, &cstr, DmaIndex, FG_PARAM_TYPE_CHAR_PTR_PTR);
995  if (result != 0) {
996  return result;
997  }
998 
999  Value = cstr;
1000  Fg_freeParameterStringWithType(Fg, Parameter, cstr, DmaIndex, FG_PARAM_TYPE_CHAR_PTR_PTR);
1001  return 0;
1002 }
1003 
1004 extern "C" {
1005 #endif /* __cplusplus */
1006 
1040 PUBLIC_API int Fg_getParameterEx(Fg_Struct *Fg, const int Parameter, void *Value, const unsigned int DmaIndex, dma_mem *pMem, const frameindex_t ImgNr);
1041 
1067 PUBLIC_API int Fg_getParameterInfoXML(Fg_Struct *Fg, int port, char * infoBuffer, size_t *infoBufferSize);
1068 
1077 PUBLIC_API int Fg_getBitsPerPixel(int format);
1078 
1098 PUBLIC_API int Fg_saveConfig(Fg_Struct *Fg, const char *Filename);
1099 
1124 PUBLIC_API int Fg_saveFieldParameterToFile(Fg_Struct * Fg, const int Parameter, const unsigned int DmaIndex, const char * FileName);
1125 
1147 PUBLIC_API int Fg_loadConfig(Fg_Struct *Fg, const char *Filename);
1148 
1172 PUBLIC_API int Fg_loadFieldParameterFromFile(Fg_Struct * Fg, const int Parameter, const unsigned int DmaIndex, const char * FileName);
1173 
1212 PUBLIC_API int Fg_Acquire(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount);
1213 
1235 PUBLIC_API int Fg_stopAcquire(Fg_Struct *Fg, const unsigned int DmaIndex);
1236 
1264 PUBLIC_API frameindex_t Fg_getLastPicNumberBlocking(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, const int Timeout);
1265 
1284 PUBLIC_API frameindex_t Fg_getLastPicNumber(Fg_Struct *Fg, const unsigned int DmaIndex);
1285 
1314 PUBLIC_API frameindex_t Fg_getLastPicNumberBlockingEx(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, const int Timeout, dma_mem *pMem);
1315 
1335 PUBLIC_API frameindex_t Fg_getLastPicNumberEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *pMem);
1336 
1360 PUBLIC_API void * Fg_getImagePtr(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex);
1361 
1386 PUBLIC_API void * Fg_getImagePtrEx(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex, dma_mem *pMem);
1387 
1438 PUBLIC_API int Fg_AcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount, const int nFlag, dma_mem *memHandle);
1439 
1455 PUBLIC_API int Fg_sendImage(Fg_Struct *Fg, const frameindex_t startImage, const frameindex_t PicCount, const int nFlag, const unsigned int DmaIndex);
1471 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);
1472 
1473 
1498 PUBLIC_API int Fg_stopAcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *memHandle, int nFlag);
1499 
1531 PUBLIC_API frameindex_t Fg_getImage(Fg_Struct *Fg, const int Param, const frameindex_t PicNr, const unsigned int DmaIndex, const unsigned int Timeout);
1532 
1565 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);
1566 
1682 PUBLIC_API int Fg_registerApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex, const struct FgApcControl *control, enum FgApcControlFlags flags);
1683 
1684 #ifdef __cplusplus
1685 }
1686 
1690 static 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)
1691 {
1692  FgApcControl control;
1693  control.version = 0;
1694  control.func = func;
1695  control.data = data;
1696  control.timeout = timeout;
1697  control.flags = flags;
1698  return Fg_registerApcHandler(Fg, DmaIndex, &control, FG_APC_CONTROL_BASIC);
1699 }
1700 
1701 static INLINE int Fg_unregisterApcHandler(Fg_Struct *Fg, const unsigned int DmaIndex)
1702 {
1703  return Fg_registerApcHandler(Fg, DmaIndex, NULL, FG_APC_CONTROL_BASIC);
1704 }
1705 
1706 extern "C" {
1707 #endif
1708 
1722 
1733 PUBLIC_API const char * getErrorDescription(int ErrorNumber);
1734 
1748 
1761 PUBLIC_API const char * Fg_getErrorDescription(Fg_Struct *Fg, int ErrorNumber);
1762 
1791 PUBLIC_API int Fg_getBoardType(int BoardIndex);
1792 
1806 PUBLIC_API const char * Fg_getBoardNameByType(const int BoardType, const int UseShortName);
1807 
1818 PUBLIC_API unsigned int Fg_getSerialNumber(Fg_Struct *Fg);
1819 
1828 PUBLIC_API const char * Fg_getSWVersion();
1829 
1841 PUBLIC_API const char * Fg_getAppletVersion(Fg_Struct *Fg, int AppletId);
1842 
1857 PUBLIC_API int Fg_getAppletId(Fg_Struct *Fg, const char *ignored);
1858 
1859 
1860 
1861 
1888  const int parameterId,
1889  const enum FgProperty propertyId,
1890  void* buffer, int* bufLen);
1891 
1892 #ifdef __cplusplus
1893 }
1894 
1898 static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, std::string & Value)
1899 {
1900  char * buffer = 0;
1901  int len = 0;
1902 
1903  int result = Fg_getParameterProperty(Fg, parameterId, propertyId, NULL, &len);
1904  if (result != FG_OK) return result;
1905 
1906  buffer = new(std::nothrow) char[len];
1907  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
1908 
1909  result = Fg_getParameterProperty(Fg, parameterId, propertyId, buffer, &len);
1910  if (result == FG_OK && len > 0) {
1911  buffer[len - 1] = '\0';
1912  Value = buffer;
1913  }
1914 
1915  delete[] buffer;
1916  return result;
1917 }
1918 
1922 static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint64_t *Value)
1923 {
1924  std::string temp;
1925  int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, temp);
1926  if (result == FG_OK) {
1927  std::istringstream is(temp);
1928  is >> (*Value);
1929  if (is.fail()) result = FG_INVALID_TYPE;
1930  }
1931 
1932  return result;
1933 }
1934 
1938 static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int64_t *Value)
1939 {
1940  return Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, reinterpret_cast<uint64_t *>(Value));
1941 }
1942 
1946 static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint32_t *Value)
1947 {
1948  uint64_t temp = 0;
1949  int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
1950  if (result == FG_OK) *Value = static_cast<uint32_t>(temp);
1951 
1952  return result;
1953 }
1954 
1958 static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int32_t *Value)
1959 {
1960  uint64_t temp = 0;
1961  int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
1962  if (result == FG_OK) *Value = static_cast<int32_t>(temp);
1963 
1964  return result;
1965 }
1966 
1970 static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, double *Value)
1971 {
1972  std::string temp;
1973  int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, temp);
1974  if (result == FG_OK) {
1975  std::istringstream is(temp);
1976  is >> (*Value);
1977  if (is.fail()) result = FG_INVALID_TYPE;
1978  }
1979 
1980  return result;
1981 }
1982 
1986 static INLINE int Fg_getParameterPropertyWithType(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, float *Value)
1987 {
1988  double temp = 0;
1989  int result = Fg_getParameterPropertyWithType(Fg, parameterId, propertyId, &temp);
1990  if (result == FG_OK) *Value = static_cast<float>(temp);
1991 
1992  return result;
1993 }
1994 
1995 extern "C" {
1996 #endif /* __cplusplus */
1997 
2025  const int parameterId,
2026  const enum FgProperty propertyId,
2027  const int DmaIndex,
2028  void* buffer, int* bufLen);
2029 
2030 #ifdef __cplusplus
2031 }
2032 
2036 static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, std::string & Value, const unsigned int DmaIndex)
2037 {
2038  char * buffer = 0;
2039  int len = 0;
2040 
2041  int result = Fg_getParameterPropertyEx(Fg, parameterId, propertyId, static_cast<int>(DmaIndex), NULL, &len);
2042  if (result != FG_OK) return result;
2043 
2044  buffer = new(std::nothrow) char[len];
2045  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2046 
2047  result = Fg_getParameterPropertyEx(Fg, parameterId, propertyId, static_cast<int>(DmaIndex), buffer, &len);
2048  if (result == FG_OK && len > 0) {
2049  buffer[len - 1] = '\0';
2050  Value = buffer;
2051  }
2052 
2053  delete[] buffer;
2054  return result;
2055 }
2056 
2060 static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint64_t *Value, const unsigned int DmaIndex)
2061 {
2062  std::string temp;
2063  int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, temp, DmaIndex);
2064  if (result == FG_OK) {
2065  std::istringstream is(temp);
2066  is >> (*Value);
2067  if (is.fail()) result = FG_INVALID_TYPE;
2068  }
2069 
2070  return result;
2071 }
2072 
2076 static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int64_t *Value, const unsigned int DmaIndex)
2077 {
2078  return Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, reinterpret_cast<uint64_t *>(Value), DmaIndex);
2079 }
2080 
2084 static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, uint32_t *Value, const unsigned int DmaIndex)
2085 {
2086  uint64_t temp = 0;
2087  int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2088  if (result == FG_OK) *Value = static_cast<uint32_t>(temp);
2089 
2090  return result;
2091 }
2092 
2096 static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, int32_t *Value, const unsigned int DmaIndex)
2097 {
2098  uint64_t temp = 0;
2099  int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2100  if (result == FG_OK) *Value = static_cast<int32_t>(temp);
2101 
2102  return result;
2103 }
2104 
2108 static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, double *Value, const unsigned int DmaIndex)
2109 {
2110  std::string temp;
2111  int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, temp, DmaIndex);
2112  if (result == FG_OK) {
2113  std::istringstream is(temp);
2114  is >> (*Value);
2115  if (is.fail()) result = FG_INVALID_TYPE;
2116  }
2117 
2118  return result;
2119 }
2120 
2124 static INLINE int Fg_getParameterPropertyWithTypeEx(Fg_Struct *Fg, const int parameterId, const enum FgProperty propertyId, float *Value, const unsigned int DmaIndex)
2125 {
2126  double temp = 0;
2127  int result = Fg_getParameterPropertyWithTypeEx(Fg, parameterId, propertyId, &temp, DmaIndex);
2128  if (result == FG_OK) *Value = static_cast<float>(temp);
2129 
2130  return result;
2131 }
2132 
2133 extern "C" {
2134 #endif /* __cplusplus */
2135 
2160 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);
2161 
2162 #ifdef __cplusplus
2163 }
2164 
2168 static INLINE int Fg_getIntSystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2169 {
2170  char * buffer = 0;
2171  unsigned int len = 0;
2172 
2173  int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, NULL, &len);
2174  if (result != FG_OK) return result;
2175 
2176  buffer = new(std::nothrow) char[len];
2177  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2178 
2179  result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2180  if (result == FG_OK) {
2181  std::istringstream is(buffer);
2182  is >> (*val);
2183  if (is.fail()) result = FG_INVALID_TYPE;
2184  }
2185 
2186  delete[] buffer;
2187  return result;
2188 }
2189 
2193 static INLINE int Fg_getIntSystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2194 {
2195  char * buffer = 0;
2196  unsigned int len = 0;
2197 
2198  int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), NULL, &len);
2199  if (result != FG_OK) return result;
2200 
2201  buffer = new(std::nothrow) char[len];
2202  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2203 
2204  result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2205  if (result == FG_OK) {
2206  std::istringstream is(buffer);
2207  is >> (*val);
2208  if (is.fail()) result = FG_INVALID_TYPE;
2209  }
2210 
2211  delete[] buffer;
2212  return result;
2213 }
2214 
2218 static INLINE int Fg_getIntSystemInformationGlobal(const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int * val)
2219 {
2220  return Fg_getIntSystemInformationForBoardIndex(static_cast<unsigned>(-1), selector, propertyId, val);
2221 }
2222 
2226 static INLINE int Fg_getInt64SystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int64_t * val)
2227 {
2228  char * buffer = 0;
2229  unsigned int len = 0;
2230 
2231  int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, NULL, &len);
2232  if (result != FG_OK) return result;
2233 
2234  buffer = new(std::nothrow) char[len];
2235  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2236 
2237  result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2238  if (result == FG_OK) {
2239  std::istringstream is(buffer);
2240  is >> (*val);
2241  if (is.fail()) result = FG_INVALID_TYPE;
2242  }
2243 
2244  delete[] buffer;
2245  return result;
2246 }
2247 
2251 static INLINE int Fg_getInt64SystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, int64_t * val)
2252 {
2253  char * buffer = 0;
2254  unsigned int len = 0;
2255 
2256  int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), NULL, &len);
2257  if (result != FG_OK) return result;
2258 
2259  buffer = new(std::nothrow) char[len];
2260  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2261 
2262  result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2263  if (result == FG_OK) {
2264  std::istringstream is(buffer);
2265  is >> (*val);
2266  if (is.fail()) result = FG_INVALID_TYPE;
2267  }
2268 
2269  delete[] buffer;
2270  return result;
2271 }
2272 
2276 static INLINE int Fg_getStringSystemInformationForFgHandle(Fg_Struct *Fg, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2277 {
2278  char * buffer = 0;
2279  unsigned int len = 0;
2280 
2281  if (arg.length()) {
2282  len = static_cast<unsigned int>(arg.length()) + 1;
2283  buffer = new(std::nothrow) char[len];
2284  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2285 
2286 #ifdef _WIN32
2287  strncpy_s(buffer, len, arg.c_str(), len - 1);
2288 #else
2289  strncpy(buffer, arg.c_str(), len - 1);
2290 #endif
2291  }
2292 
2293  int result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2294 
2295  if (result != FG_OK) {
2296  delete[] buffer;
2297  return result;
2298  }
2299 
2300  if (!arg.empty() && len <= static_cast<unsigned int>(arg.length()) + 1) {
2301  // The buffer size was sufficient and it contains the requested value.
2302  val = buffer;
2303  delete[] buffer;
2304  return FG_OK;
2305  } else {
2306  // The buffer was too small. Create a suitable buffer and try again.
2307  // len has been set the required size.
2308  delete[] buffer;
2309  buffer = new(std::nothrow) char[len];
2310  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2311 
2312  if (!arg.empty()) {
2313 #ifdef _WIN32
2314  strncpy_s(buffer, len, arg.c_str(), arg.length());
2315 #else
2316  strncpy(buffer, arg.c_str(), arg.length());
2317 #endif
2318  }
2319 
2320  result = Fg_getSystemInformation(Fg, selector, propertyId, -1, buffer, &len);
2321  if (result == FG_OK) {
2322  val = buffer;
2323  }
2324 
2325  delete[] buffer;
2326  return result;
2327  }
2328 }
2329 
2333 static INLINE int Fg_getStringSystemInformationForBoardIndex(unsigned int BoardIndex, const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2334 {
2335  char * buffer = 0;
2336  unsigned int len = 0;
2337 
2338  if (!arg.empty()) {
2339  len = static_cast<unsigned int>(arg.length()) + 1;
2340  buffer = new(std::nothrow) char[len];
2341  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2342 
2343 #ifdef _WIN32
2344  strncpy_s(buffer, len, arg.c_str(), arg.length());
2345 #else
2346  strncpy(buffer, arg.c_str(), arg.length());
2347 #endif
2348  }
2349 
2350  int result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2351  if (result != FG_OK) {
2352  delete[] buffer;
2353  return result;
2354  }
2355 
2356  if (!arg.empty() && len <= static_cast<unsigned int>(arg.length()) + 1) {
2357  val = buffer;
2358  delete[] buffer;
2359  return FG_OK;
2360  } else {
2361  delete[] buffer;
2362  buffer = new(std::nothrow) char[len];
2363  if (!buffer) return FG_NOT_ENOUGH_MEMORY;
2364 
2365  if (!arg.empty()) {
2366 #ifdef _WIN32
2367  strncpy_s(buffer, len, arg.c_str(), arg.length());
2368 #else
2369  strncpy(buffer, arg.c_str(), arg.length());
2370 #endif
2371  }
2372 
2373  result = Fg_getSystemInformation(NULL, selector, propertyId, static_cast<int>(BoardIndex), buffer, &len);
2374  if (!result) {
2375  val = buffer;
2376  }
2377 
2378  delete[] buffer;
2379  return result;
2380  }
2381 }
2382 
2386 static INLINE int Fg_getStringSystemInformationGlobal(const enum Fg_Info_Selector selector, const enum FgProperty propertyId, std::string & val, const std::string & arg = "")
2387 {
2388  return Fg_getStringSystemInformationForBoardIndex(static_cast<unsigned>(-1), selector, propertyId, val, arg);
2389 }
2390 
2391 extern "C" {
2392 #endif
2393 
2418 PUBLIC_API int Fg_readUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, void * buffer);
2419 
2444 PUBLIC_API int Fg_writeUserDataArea(Fg_Struct *Fg, const int boardId, const unsigned int offs, const unsigned int size, const void * buffer);
2445 
2479 PUBLIC_API frameindex_t Fg_getStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex);
2480 
2515 PUBLIC_API frameindex_t Fg_getStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem);
2516 
2542 PUBLIC_API int Fg_setStatus(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex);
2543 
2570 PUBLIC_API int Fg_setStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem);
2571 
2603 PUBLIC_API int Fg_getAppletIterator(int boardIndex, const enum FgAppletIteratorSource src, Fg_AppletIteratorType * iter, int flags);
2604 
2614 
2632 
2649 
2663 PUBLIC_API Fg_AppletIteratorItem Fg_addAppletIteratorItem(Fg_AppletIteratorType iter, const char * path, int * numItems);
2664 
2683 
2703 
2704 #ifdef __cplusplus
2705 } /* extern "C" */
2706 
2710 static INLINE int Fg_findApplet(const unsigned int BoardIndex, std::string & Path) {
2711 
2712  // ensure a defined state of the output argument
2713  Path.clear();
2714 
2715  Fg_AppletIteratorType iter;
2717 
2718  if (ret < 0) {
2719  return ret;
2720  }
2721 
2722  const int numItems = ret;
2723  ret = FG_FILE_NOT_FOUND;
2724 
2725  // Iterate over found applets in case there are more than one (althought this should not be the case).
2726  for (int i = 0; i < numItems && ret != FG_OK; ++i) {
2728  if (item != NULL) {
2729  int64_t info = Fg_getAppletIntProperty(item, FG_AP_INT_INFO);
2730  if (info & FG_AI_IS_VALID) {
2732  ret = FG_OK;
2733  }
2734  }
2735  }
2736 
2737  Fg_freeAppletIterator(iter);
2738  return ret;
2739 }
2740 
2741 extern "C" {
2742 #endif /* __cplusplus */
2743 
2763 PUBLIC_API uint64_t Fg_getEventMask(Fg_Struct *Fg, const char *name);
2764 
2777 PUBLIC_API int Fg_getEventPayload(Fg_Struct *Fg, uint64_t mask);
2778 
2791 PUBLIC_API const char * Fg_getEventName(Fg_Struct *Fg, uint64_t mask);
2792 
2806 
2823 PUBLIC_API int Fg_activateEvents(Fg_Struct *Fg, uint64_t mask, int enable);
2824 
2841 PUBLIC_API int Fg_clearEvents(Fg_Struct *Fg, uint64_t mask);
2842 
2873 PUBLIC_API uint64_t Fg_eventWait(Fg_Struct *Fg, uint64_t mask, unsigned int timeout, unsigned int flags, struct fg_event_info *info);
2874 
2920 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);
2921 
2922 #ifdef __cplusplus
2923 }
2924 
2928 static INLINE int Fg_unregisterEventCallback(Fg_Struct *Fg, uint64_t mask)
2929 {
2930  return Fg_registerEventCallback(Fg, mask, NULL, NULL, FG_EVENT_DEFAULT_FLAGS, NULL);
2931 }
2932 
2933 extern "C" {
2934 #endif
2935 
2968 
2989 
3005 PUBLIC_API int Fg_resetAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph);
3006 
3021 PUBLIC_API int Fg_setAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph);
3022 
3045 PUBLIC_API int DEPRECATED(Fg_setExsync(Fg_Struct *Fg, int Flag, const unsigned int CamPort));
3046 
3069 PUBLIC_API int DEPRECATED(Fg_setFlash(Fg_Struct *Fg, int Flag, const unsigned int CamPort));
3070 
3102 PUBLIC_API int Fg_sendSoftwareTrigger(Fg_Struct *Fg, const unsigned int CamPort);
3103 
3139 PUBLIC_API int Fg_sendSoftwareTriggerEx(Fg_Struct *Fg, const unsigned int CamPort, const unsigned int Triggers);
3140 
3167 PUBLIC_API ShadingMaster * Fg_AllocShading(Fg_Struct *Fg, int set, const unsigned int CamPort);
3168 
3185 
3206 
3226 
3245 
3270 PUBLIC_API int Shad_SetSubValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float sub);
3271 
3296 PUBLIC_API int Shad_SetMultValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float mult);
3297 
3322 PUBLIC_API int Shad_SetFixedPatternNoiseLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, int on);
3323 
3342 PUBLIC_API int Shad_WriteActLine(Fg_Struct *Fg, ShadingMaster *sh, int Line);
3345 #ifdef __cplusplus
3346 
3347 struct VAdevice;
3348 struct RegisterInfo;
3349 class fpga_design;
3350 
3359 PUBLIC_API Fg_Struct * Fg_InitHandle(const char *appletName, struct VAdevice *hwhandle, fpga_design *deshandle);
3360 
3370 PUBLIC_API Fg_Struct * Fg_InitHandleSlaveAware(const char *appletName, struct VAdevice *hwhandle, fpga_design *deshandle, int isSlave);
3371 
3379 PUBLIC_API RegisterInfo * Fg_getParameterInfo(Fg_Struct *Fg, const unsigned int CamPort);
3380 
3381 #endif /* __cplusplus */
3382 
3383 /* Deprecated functions, do not use as they will eventually go away */
3384 
3391 PUBLIC_API int DEPRECATED(getLastErrorNumber());
3392 
3393 #ifdef __cplusplus
3394 } /* extern "C" */
3395 
3396 #endif
3397 
3398 #endif /* __FGRAB_PROTOTYP_H */
#define FG_INVALID_TYPE
Definition: fgrab_define.h:1346
long frameindex_t
Definition: os_type.h:78
Definition: fgrab_define.h:2499
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_setStatusEx(Fg_Struct *Fg, const int Param, const frameindex_t Data, const unsigned int DmaIndex, dma_mem *pMem)
Setting the status of frame buffer.
unsigned int flags
Definition: fgrab_struct.h:138
PUBLIC_API int Fg_setAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph)
trigger an asynchronous notifications
#define FG_NOT_ENOUGH_MEMORY
Definition: fgrab_define.h:1321
PUBLIC_API int Fg_activateEvents(Fg_Struct *Fg, uint64_t mask, int enable)
activates/disable event generation
Definition: fgrab_define.h:2461
PUBLIC_API int Fg_getParameterId(Fg_Struct *fg, int index)
The function Fg_getParameterId() returns the parameter ID of the parameter referenced by index.
Definition: fgrab_define.h:2472
PUBLIC_API int Fg_sendSoftwareTrigger(Fg_Struct *Fg, const unsigned int CamPort)
send trigger signal to the camera
#define FG_FILE_NOT_FOUND
Definition: fgrab_define.h:1290
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...
FgAppletIntProperty
Available Integer Applet Properties.
Definition: fgrab_define.h:2470
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 int DEPRECATED(Fg_setExsync(Fg_Struct *Fg, int Flag, const unsigned int CamPort))
set Exsync camera signal
Definition: fgrab_define.h:2426
PUBLIC_API int Fg_stopAcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *memHandle, int nFlag)
Stopping image grabbing.
PUBLIC_API int Fg_InitLibraries(const char *sisoDir)
The function Fg_InitLibraries() initializes internal structures of the library.
void * data
Definition: fgrab_struct.h:136
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 uint64_t Fg_eventWait(Fg_Struct *Fg, uint64_t mask, unsigned int timeout, unsigned int flags, struct fg_event_info *info)
wait for events
Constant and enum definitions.
FgProperty
definitions for querying information about a certain field
Definition: fgrab_define.h:1160
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.
Definitions for platform dependent types.
Fg_Info_Selector
definitions of available system informations
Definition: fgrab_define.h:1057
PUBLIC_API Fg_AppletIteratorItem Fg_addAppletIteratorItem(Fg_AppletIteratorType iter, const char *path, int *numItems)
Add an applet to applet iterator.
PUBLIC_API int Fg_getBoardType(int BoardIndex)
Board type.
int(* Fg_EventFunc_t)(uint64_t events, void *data, const struct fg_event_info *info)
Definition: fgrab_define.h:1578
const PUBLIC_API char * Fg_getAppletVersion(Fg_Struct *Fg, int AppletId)
Get the version of the currently running applet.
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 int Fg_getAppletIterator(int boardIndex, const enum FgAppletIteratorSource src, Fg_AppletIteratorType *iter, int flags)
Gets an applet iterator.
PUBLIC_API int Shad_GetAccess(Fg_Struct *Fg, ShadingMaster *sh)
activate shading object
PUBLIC_API int Shad_SetSubValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float sub)
set substractive correction value for shading correction
Definition: fgrab_struct.h:132
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.
uint16_t data[254]
Definition: fgrab_struct.h:160
Definition: fgrab_define.h:220
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 int Fg_getParameter(Fg_Struct *Fg, int Parameter, void *Value, const unsigned int DmaIndex)
Getting special parameter settings.
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_getLastErrorNumber(Fg_Struct *Fg)
Getting the last error code.
PUBLIC_API int Fg_registerAsyncNotifyCallback(Fg_Struct *Fg, Fg_AsyncNotifyFunc_t handler, void *context)
register callback for asynchronous notifications
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 Shad_SetMultValueLine(Fg_Struct *Fg, ShadingMaster *sh, int x, int channel, float mult)
set multiplicative correction value for shading correction
FgParamTypes
Definition: fgrab_define.h:217
PUBLIC_API uint64_t Fg_getEventMask(Fg_Struct *Fg, const char *name)
get the event mask for the named event
#define FG_OK
Definition: fgrab_define.h:1258
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_resetAsyncNotify(Fg_Struct *Fg, unsigned long notification, unsigned long pl, unsigned long ph)
acknowledge an asynchronous notifications
Definition: fgrab_struct.h:154
PUBLIC_API int Fg_clearEvents(Fg_Struct *Fg, uint64_t mask)
drop all already queued events
Definition: fgrab_define.h:223
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.
PUBLIC_API Fg_AppletIteratorItem Fg_getAppletIteratorItem(Fg_AppletIteratorType iter, int index)
Gets an item from applet iterator by index.
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 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...
unsigned int timeout
Definition: fgrab_struct.h:137
const PUBLIC_API char * Fg_getEventName(Fg_Struct *Fg, uint64_t mask)
get the name for the event represented by the event mask
PUBLIC_API int Fg_getEventCount(Fg_Struct *Fg)
get the number of available event types
PUBLIC_API int Fg_FreeMemHead(Fg_Struct *Fg, dma_mem *memHandle)
Releasing memory.
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_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 int Fg_AcquireEx(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount, const int nFlag, dma_mem *memHandle)
Starting image grabbing.
FgApcControlFlags
control flags for Fg_registerApcHandler()
Definition: fgrab_define.h:1554
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 unsigned int Fg_getSerialNumber(Fg_Struct *Fg)
Serial number.
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 int64_t Fg_getAppletIntProperty(Fg_AppletIteratorItem item, const enum FgAppletIntProperty property)
Gets an integer applet properties.
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 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 int Shad_FreeAccess(Fg_Struct *Fg, ShadingMaster *sh)
deactivate shading object
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_getAppletId(Fg_Struct *Fg, const char *ignored)
Get the ID of the currently running applet.
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.
const PUBLIC_API char * Fg_getAppletStringProperty(Fg_AppletIteratorItem item, const enum FgAppletStringProperty property)
Gets string applet properties.
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_NumaPinThread(Fg_Struct *Fg)
NUMA aware pinning of thread affinity.
const PUBLIC_API char * Fg_getLastErrorDescription(Fg_Struct *Fg)
Description of last error message.
#define PUBLIC_API
Definition: fgrab_prototyp.h:40
void * Fg_AppletIteratorType
Definition: fgrab_define.h:2405
Definition: fgrab_define.h:1584
Definition: fgrab_define.h:224
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_freeAppletIterator(Fg_AppletIteratorType iter)
This function releases an applet iterator.
PUBLIC_API Fg_Struct * Fg_Init(const char *FileName, unsigned int BoardIndex)
The function Fg_Init() initializes the frame grabber.
PUBLIC_API int Fg_getNrOfParameter(Fg_Struct *Fg)
The function Fg_getNrOfParameter() returns the number of parameters available within the loaded apple...
FgAppletIteratorSource
Applet Iterator Sources.
Definition: fgrab_define.h:2411
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 frameindex_t Fg_getLastPicNumberEx(Fg_Struct *Fg, const unsigned int DmaIndex, dma_mem *pMem)
Requesting the current image number (non-blocking).
Definition: fgrab_define.h:226
PUBLIC_API int Fg_unregisterAsyncNotifyCallback(Fg_Struct *Fg, Fg_AsyncNotifyFunc_t handler, void *context)
unregister callback for asynchronous notifications
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 enum FgParamTypes Fg_getParameterType(Fg_Struct *fg, int index)
The function Fg_getParameterType() informs about the type of a special parameter by index.
Header file for all display lib public functions.
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_FreeShading(Fg_Struct *Fg, ShadingMaster *sh)
release shading control object
PUBLIC_API void * Fg_getImagePtr(Fg_Struct *Fg, const frameindex_t PicNr, const unsigned int DmaIndex)
Access on frame buffer.
struct declarations.
Definition: fgrab_define.h:1555
PUBLIC_API int Fg_saveFieldParameterToFile(Fg_Struct *Fg, const int Parameter, const unsigned int DmaIndex, const char *FileName)
Saving applet field parameter.
Fg_ApcFunc_t func
Definition: fgrab_struct.h:135
Definition: fgrab_define.h:219
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_FreeMem(Fg_Struct *Fg, const unsigned int DmaIndex)
Releasing a frame buffer.
Definition: fgrab_define.h:2413
Definition: fgrab_define.h:222
const PUBLIC_API char * Fg_getErrorDescription(Fg_Struct *Fg, int ErrorNumber)
Description of error message to an error code.
PUBLIC_API int Fg_Acquire(Fg_Struct *Fg, const unsigned int DmaIndex, const frameindex_t PicCount)
Starting image grabbing.
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_loadConfig(Fg_Struct *Fg, const char *Filename)
Loading a frame grabber configuration.
PUBLIC_API int Shad_GetMaxLine(Fg_Struct *Fg, ShadingMaster *sh)
query current line number 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 int Fg_FreeMemEx(Fg_Struct *Fg, dma_mem *mem)
Releasing frame buffers.
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)
const PUBLIC_API char * Fg_getBoardNameByType(const int BoardType, const int UseShortName)
Board name from type.
PUBLIC_API void * Fg_NumaAllocDmaBuffer(Fg_Struct *Fg, size_t Size)
NUMA aware allocation of memory.
PUBLIC_API int Fg_stopAcquire(Fg_Struct *Fg, const unsigned int DmaIndex)
Stopping image grabbing.
PUBLIC_API frameindex_t Fg_getLastPicNumber(Fg_Struct *Fg, const unsigned int DmaIndex)
Requesting the current image number (non-blocking).
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...
void * Fg_AppletIteratorItem
Definition: fgrab_define.h:2406
PUBLIC_API int Fg_NumaFreeDmaBuffer(Fg_Struct *Fg, void *Buffer)
NUMA aware freeing of memory.
Definition: fgrab_define.h:2425
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_getBitsPerPixel(int format)
Calculate the bits per pixel for a specific output format (FG_GRAY, FG_COL24, etc....
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 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_FreeGrabber(Fg_Struct *Fg)
Releasing frame grabber resources.
PUBLIC_API void Fg_AbortInitLibraries()
The function Fg_AbortInitLibraries() aborts and fails the initialization of internal structures and t...
struct ShadingMaster_s ShadingMaster
Shading control object.
Definition: fgrab_prototyp.h:63
const PUBLIC_API char * Fg_getSWVersion()
Software version number.
const PUBLIC_API 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 Fg_setParameter(Fg_Struct *Fg, const int Parameter, const void *Value, const unsigned int DmaIndex)
Setting frame grabber parameters.
struct Fg_Struct_s Fg_Struct
The structure for a framegrabber.
Definition: fgrab_struct.h:152
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 ShadingMaster * Fg_AllocShading(Fg_Struct *Fg, int set, const unsigned int CamPort)
allocate shading control object
PUBLIC_API void Fg_InitLibrariesStartNextSlave()
The function Fg_InitLibrariesStartNextSlave() signals the next slave process to start.
PUBLIC_API Fg_Struct * Fg_InitEx(const char *FileName, unsigned int BoardIndex, int flags)
Initialize a frame grabber in master or slave mode.
unsigned int version
Definition: fgrab_struct.h:133
FgAppletStringProperty
Available String Applet Properties.
Definition: fgrab_define.h:2492
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 Fg_saveConfig(Fg_Struct *Fg, const char *Filename)
Saving a frame grabber configuration.
const PUBLIC_API 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_FreeLibraries()
The function Fg_FreeLibraries() releases internal structures of the library.
PUBLIC_API int Fg_DelMem(Fg_Struct *Fg, dma_mem *memHandle, const frameindex_t bufferIndex)
Deleting user memory,.
Definition: fgrab_define.h:221
struct dma_mem_s dma_mem
DMA buffer head control object.
Definition: fgrab_prototyp.h:61
int(* Fg_AsyncNotifyFunc_t)(int boardIndex, unsigned long notification, unsigned long pl, unsigned long ph, void *context)
Definition: fgrab_define.h:1638
int(* Fg_ApcFunc_t)(frameindex_t imgNr, void *data)
Definition: fgrab_define.h:1535
const PUBLIC_API char * getErrorDescription(int ErrorNumber)
Description of error message.