PylonCEnums.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /*-----------------------------------------------------------------------------
  2. Basler pylon C SDK
  3. Copyright (c) 2012-2021 Basler AG
  4. http://www.baslerweb.com
  5. -----------------------------------------------------------------------------*/
  6. #ifndef PYLON_ENUMS_H
  7. #define PYLON_ENUMS_H
  8. #include <genapic/GenApiCDefines.h>
  9. /**
  10. * \file
  11. * \brief pylon enumeration types.
  12. *
  13. * Definitions of enumerated types used by pylon C functions.
  14. */
  15. /**
  16. * \addtogroup pylon pylon Interface
  17. * @{
  18. */
  19. /**
  20. * \brief The reason why a wait operation terminated.
  21. */
  22. typedef enum
  23. {
  24. waitex_timeout = 0, /*!< \brief The time-out interval elapsed */
  25. waitex_signaled = 1, /*!< \brief The wait operation completed successfully */
  26. waitex_abandoned = 2, /*!< \brief Windows only (see MSDN for more information) */
  27. waitex_alerted = -1 /*!< \brief The wait was interrupted (Windows: queued APC or I/O completion routine; UNIX: signal) */
  28. } EPylonWaitExResult;
  29. /**
  30. * \brief The grab status.
  31. */
  32. typedef enum
  33. {
  34. UndefinedGrabStatus = -1, /*!< \brief status not defined */
  35. Idle, /*!< \brief currently not used */
  36. Queued, /*!< \brief in the input queue */
  37. Grabbed, /*!< \brief filled with data */
  38. Canceled, /*!< \brief request was canceled */
  39. Failed /*!< \brief request failed */
  40. } EPylonGrabStatus;
  41. /**
  42. * \brief PayloadType for PylonGrabResult_t
  43. */
  44. typedef enum
  45. {
  46. PayloadType_Undefined = -1, /*!< \brief The buffer content is undefined. */
  47. PayloadType_Image, /*!< \brief The buffer contains image data. */
  48. PayloadType_RawData, /*!< \brief The buffer contains raw data. */
  49. PayloadType_File, /*!< \brief The buffer contains file data. */
  50. PayloadType_ChunkData, /*!< \brief The buffer contains chunk data. */
  51. PayloadType_GenDC, /*!< \brief The buffer contains GenDC container. */
  52. PayloadType_DeviceSpecific = 0x8000 /*!< \brief The buffer contains device specific data. */
  53. } EPylonPayloadType;
  54. #define PIXEL_MONO (0x01000000)
  55. #define PIXEL_COLOR (0x02000000)
  56. #define PIXEL_CUSTOMTYPE (0x80000000)
  57. #define PIXEL_BIT_COUNT(n) ((n) << 16)
  58. /*! \brief List all possible pixel formats. See the camera User's Manual for a detailed description of the available pixel formats. */
  59. typedef enum
  60. {
  61. PixelType_Undefined = -1, /*!< \brief Indicates that the pixel format is undefined or not valid. */
  62. PixelType_Mono8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0001, /*!< \brief Indicates the Mono 8 pixel format. */
  63. PixelType_Mono8signed = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0002, /*!< \brief Indicates the Mono 8 Signed pixel format. */
  64. PixelType_Mono10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0003, /*!< \brief Indicates the Mono 10 pixel format. */
  65. PixelType_Mono10packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0004, /*!< \brief Indicates the Mono 10 Packed pixel format. The memory layout of PixelType_Mono10packed and PixelType_Mono10p is different*/
  66. PixelType_Mono10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0046, /*!< \brief Indicates the Mono10p pixel format. The memory layout of PixelType_Mono10packed and PixelType_Mono10p is different*/
  67. PixelType_Mono12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0005, /*!< \brief Indicates the Mono 12 pixel format. */
  68. PixelType_Mono12packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0006, /*!< \brief Indicates the Mono 12 Packed pixel format. The memory layout of PixelType_Mono12packed and PixelType_Mono12p is different.*/
  69. PixelType_Mono12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0047, /*!< \brief Indicates the Mono12p pixel format. The memory layout of PixelType_Mono12packed and PixelType_Mono12p is different.*/
  70. PixelType_Mono16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0007, /*!< \brief Indicates the Mono 16 pixel format. */
  71. PixelType_BayerGR8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0008, /*!< \brief Indicates the Bayer GR 8 pixel format. */
  72. PixelType_BayerRG8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0009, /*!< \brief Indicates the Bayer RG 8 pixel format. */
  73. PixelType_BayerGB8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x000a, /*!< \brief Indicates the Bayer GB 8 pixel format. */
  74. PixelType_BayerBG8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x000b, /*!< \brief Indicates the Bayer BG 8 pixel format. */
  75. PixelType_BayerGR10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x000c, /*!< \brief Indicates the Bayer GR 10 pixel format. */
  76. PixelType_BayerRG10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x000d, /*!< \brief Indicates the Bayer RG 10 pixel format. */
  77. PixelType_BayerGB10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x000e, /*!< \brief Indicates the Bayer GB 10 pixel format. */
  78. PixelType_BayerBG10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x000f, /*!< \brief Indicates the Bayer BG 10 pixel format. */
  79. PixelType_BayerGR12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0010, /*!< \brief Indicates the Bayer GR 12 pixel format. */
  80. PixelType_BayerRG12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0011, /*!< \brief Indicates the Bayer RG 12 pixel format. */
  81. PixelType_BayerGB12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0012, /*!< \brief Indicates the Bayer GB 12 pixel format. */
  82. PixelType_BayerBG12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0013, /*!< \brief Indicates the Bayer BG 12 pixel format. */
  83. PixelType_RGB8packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0014, /*!< \brief Indicates the RGB 8 Packed pixel format. */
  84. PixelType_BGR8packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0015, /*!< \brief Indicates the BGR 8 Packed pixel format. */
  85. PixelType_RGBA8packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 32 ) | 0x0016, /*!< \brief Indicates the RGBA 8 Packed pixel format. */
  86. PixelType_BGRA8packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 32 ) | 0x0017, /*!< \brief Indicates the BGRA 8 Packed pixel format. */
  87. PixelType_RGB10packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0018, /*!< \brief Indicates the RGB 10 Packed pixel format. */
  88. PixelType_BGR10packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0019, /*!< \brief Indicates the BGR 10 Packed pixel format. */
  89. PixelType_RGB12packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x001a, /*!< \brief Indicates the RGB 12 Packed pixel format. */
  90. PixelType_BGR12packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x001b, /*!< \brief Indicates the BGR 12 Packed pixel format. */
  91. PixelType_RGB16packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0033, /*!< \brief Indicates the RGB 16 Packed pixel format. */
  92. PixelType_BGR10V1packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 32 ) | 0x001c, /*!< \brief Indicates the BGR 10 V1 Packed pixel format. */
  93. PixelType_BGR10V2packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 32 ) | 0x001d, /*!< \brief Indicates the BGR 10 V2 Packed pixel format. */
  94. PixelType_YUV411packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 12 ) | 0x001e, /*!< \brief Indicates the YUV 411 Packed pixel format. */
  95. PixelType_YUV422packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 16 ) | 0x001f, /*!< \brief Indicates the YUV 422 Packed pixel format. */
  96. PixelType_YUV444packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0020, /*!< \brief Indicates the YUV 444 Packed pixel format. */
  97. PixelType_RGB8planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0021, /*!< \brief Indicates the RGB 8 Planar pixel format. */
  98. PixelType_RGB10planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0022, /*!< \brief Indicates the RGB 10 Planar pixel format. */
  99. PixelType_RGB12planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0023, /*!< \brief Indicates the RGB 12 Planar pixel format. */
  100. PixelType_RGB16planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0024, /*!< \brief Indicates the RGB 16 Planar pixel format. */
  101. PixelType_YUV422_YUYV_Packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 16 ) | 0x0032, /*!< \brief Indicates the YUV 422 (YUYV) Packed pixel format. */
  102. PixelType_YUV444planar = PIXEL_CUSTOMTYPE | PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0044, /*!< \brief Indicates the 8 bit / channel YUV 444 planar YY YY UU UU VV VV pixel format. */
  103. PixelType_YUV422planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 16 ) | 0x0042, /*!< \brief Indicates the 8 bit / channel YUV 422 planar YY YY U U V V pixel format. */
  104. PixelType_YUV420planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 12 ) | 0x0040, /*!< \brief Indicates the 8 bit / channel YUV 420 planar YY YY U V pixel format. */
  105. PixelType_YCbCr422_8_YY_CbCr_Semiplanar = PIXEL_COLOR | PIXEL_BIT_COUNT( 16 ) | 0x0113, /*!< \brief Indicates the 8 bit / channel YUV 422 semiplanar YY YY UV UV pixel format previously known as PixelType_YCbCr422_8_YY_CbCr_Semiplanar 4:2:2 image with a plane of 8 bit Y samples followed by an interleaved U/V plane. */
  106. PixelType_YCbCr420_8_YY_CbCr_Semiplanar = PIXEL_COLOR | PIXEL_BIT_COUNT( 12 ) | 0x0112, /*!< \brief Indicates the 8 bit / channel YUV 420 semiplanar YY YY UV pixel format. */
  107. PixelType_BayerGR12Packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x002A, /*!< \brief Indicates the Bayer GR 12 Packed pixel format. The memory layout of PixelType_BayerGR12Packed and PixelType_BayerGR12p is different.*/
  108. PixelType_BayerRG12Packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x002B, /*!< \brief Indicates the Bayer RG 12 Packed pixel format. The memory layout of PixelType_BayerRG12Packed and PixelType_BayerRG12p is different.*/
  109. PixelType_BayerGB12Packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x002C, /*!< \brief Indicates the Bayer GB 12 Packed pixel format. The memory layout of PixelType_BayerGB12Packed and PixelType_BayerGB12p is different.*/
  110. PixelType_BayerBG12Packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x002D, /*!< \brief Indicates the Bayer BG 12 Packed pixel format. The memory layout of PixelType_BayerBG12Packed and PixelType_BayerBG12p is different.*/
  111. PixelType_BayerGR10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0056, /*!< \brief Indicates the BayerGR10p pixel format. */
  112. PixelType_BayerRG10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0058, /*!< \brief Indicates the BayerRG10p pixel format. */
  113. PixelType_BayerGB10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0054, /*!< \brief Indicates the BayerGB10p pixel format. */
  114. PixelType_BayerBG10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0052, /*!< \brief Indicates the BayerBG10p pixel format. */
  115. PixelType_BayerGR12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0057, /*!< \brief Indicates the BayerGR12p pixel format. The memory layout of PixelType_BayerGR12Packed and PixelType_BayerGR12p is different.*/
  116. PixelType_BayerRG12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0059, /*!< \brief Indicates the BayerRG12p pixel format. The memory layout of PixelType_BayerRG12Packed and PixelType_BayerRG12p is different.*/
  117. PixelType_BayerGB12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0055, /*!< \brief Indicates the BayerGB12p pixel format. The memory layout of PixelType_BayerGB12Packed and PixelType_BayerGB12p is different.*/
  118. PixelType_BayerBG12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0053, /*!< \brief Indicates the BayerBG12p pixel format. The memory layout of PixelType_BayerBG12Packed and PixelType_BayerBG12p is different.*/
  119. PixelType_BayerGR16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x002E, /*!< \brief Indicates the Bayer GR 16 pixel format. */
  120. PixelType_BayerRG16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x002F, /*!< \brief Indicates the Bayer RG 16 pixel format. */
  121. PixelType_BayerGB16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0030, /*!< \brief Indicates the Bayer GB 16 pixel format. */
  122. PixelType_BayerBG16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0031, /*!< \brief Indicates the Bayer BG 16 pixel format. */
  123. PixelType_RGB12V1packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 36 ) | 0X0034, /*!< \brief Indicates the RGB 12 V1 packed pixel format. */
  124. /* floating point*/
  125. PixelType_Data32f = PIXEL_MONO | PIXEL_BIT_COUNT( 32 ) | 0x011C, /*!< \brief Indicates the 32 bit floating point pixel format. */
  126. /* custom codes */
  127. PixelType_Double = PIXEL_CUSTOMTYPE | PIXEL_MONO | PIXEL_BIT_COUNT( 64 ) | 0x100 /*!< \brief Indicates the Double pixel format. */
  128. } EPylonPixelType;
  129. /*! \brief Lists the available file formats */
  130. #if defined(GENAPIC_WIN_BUILD)
  131. typedef enum
  132. {
  133. ImageFileFormat_Bmp = 0, /*!< \brief Windows Bitmap, no compression. */
  134. ImageFileFormat_Tiff = 1, /*!< \brief Tagged Image File Format, no compression, supports mono images with more than 8 bit bit depth. */
  135. ImageFileFormat_Jpeg = 2, /*!< \brief Joint Photographic Experts Group, lossy data compression. */
  136. ImageFileFormat_Png = 3, /*!< \brief Portable Network Graphics, lossless data compression. */
  137. ImageFileFormat_Raw = 4 /*!< \brief Saves the raw image buffer data. Packed image formats are unpacked. In the format used for saving, the data cannot be loaded using PylonImagePersistenceLoad. */
  138. ///< The data cannot be loaded in this format.
  139. } EPylonImageFileFormat;
  140. #elif defined(GENAPIC_LINUX_BUILD)
  141. typedef enum
  142. {
  143. ImageFileFormat_Tiff = 1, /*!< \brief Tagged Image File Format, no compression, supports mono images with more than 8 bit bit depth. */
  144. ImageFileFormat_Png = 3, /*!< \brief Portable Network Graphics, lossless data compression. */
  145. ImageFileFormat_Raw = 4 /*!< \brief Saves the raw image buffer data. Packed image formats are unpacked. This format cannot be loaded using PylonImagePersistenceLoad.*/
  146. } EPylonImageFileFormat;
  147. #else
  148. # error unsupported platform
  149. #endif
  150. /*! \brief Defines the vertical orientation of an image in memory. */
  151. typedef enum
  152. {
  153. ImageOrientation_TopDown, /*!< \brief The first row of the image is located at the start of the image buffer. This is the default for images taken by a camera. */
  154. ImageOrientation_BottomUp /*!< \brief The last row of the image is located at the start of the image buffer. */
  155. } EPylonImageOrientation;
  156. #if defined(GENAPIC_WIN_BUILD)
  157. /*! \brief Lists the possibilities for selecting a key frame when using compression. */
  158. typedef enum
  159. {
  160. KeyFrameSelection_NoKeyFrame, /*!< \brief Indicates that an image is not a key frame. */
  161. KeyFrameSelection_KeyFrame, /*!< \brief Indicates that an image is a key frame. */
  162. KeyFrameSelection_Auto /*!< \brief Every nth frame is a key frame. The value of n is specified by passing its value in the SAviCompressionOptions in the autoKeyFrameInsertionRate member when opening the AVI Writer. */
  163. } EPylonKeyFrameSelection;
  164. /*! \brief Lists the possibilities for selecting a show window command. */
  165. typedef enum
  166. {
  167. EPylonShowWindow_SW_HIDE = 0, /*!< \brief Same as SW_HIDE in WinUser.h */
  168. EPylonShowWindow_SW_SHOWNORMAL = 1, /*!< \brief Same as SW_SHOWNORMAL and SW_NORMAL in WinUser.h */
  169. EPylonShowWindow_SW_SHOWMINIMIZED = 2, /*!< \brief Same as SW_SHOWMINIMIZED in WinUser.h */
  170. EPylonShowWindow_SW_SHOWMAXIMIZED = 3, /*!< \brief Same as SW_SHOWMAXIMIZED and SW_MAXIMIZE in WinUser.h */
  171. EPylonShowWindow_SW_SHOWNOACTIVATE = 4, /*!< \brief Same as SW_SHOWNOACTIVATE in WinUser.h */
  172. EPylonShowWindow_SW_SHOW = 5, /*!< \brief Same as SW_SHOWNOACTIVATE in WinUser.h */
  173. EPylonShowWindow_SW_MINIMIZE = 6, /*!< \brief Same as SW_MINIMIZE in WinUser.h */
  174. EPylonShowWindow_SW_SHOWMINNOACTIVE = 7, /*!< \brief Same as SW_SHOWMINNOACTIVE in WinUser.h */
  175. EPylonShowWindow_SW_SHOWNA = 8, /*!< \brief Same as SW_SHOWNA in WinUser.h */
  176. EPylonShowWindow_SW_RESTORE = 9, /*!< \brief Same as SW_RESTORE in WinUser.h */
  177. EPylonShowWindow_SW_SHOWDEFAULT = 10, /*!< \brief Same as SW_SHOWDEFAULT in WinUser.h */
  178. EPylonShowWindow_SW_FORCEMINIMIZE = 11 /*!< \brief Same as SW_FORCEMINIMIZE in WinUser.h */
  179. } EPylonShowWindow;
  180. #endif
  181. /*!
  182. \brief Lists possible status codes returned by PylonGigEIssueActionCommand() or PylonGigEIssueScheduledActionCommand().
  183. */
  184. typedef enum
  185. {
  186. /**
  187. \brief The device acknowledged the command.
  188. */
  189. PylonGigEActionCommandStatus_Ok = 0,
  190. /**
  191. \brief The device is not synchronized to a master clock to be used as time reference.
  192. Typically used when scheduled action commands cannot be scheduled for
  193. a future time since the reference time coming from IEEE 1588 is not locked.
  194. The action command has been ignored by the device.
  195. */
  196. PylonGigEActionCommandStatus_NoRefTime = -519995373,
  197. /**
  198. \brief Returned when the scheduled action commands queue is full and the device cannot accept the additional request.
  199. The action command has been discarded by the device.
  200. */
  201. PylonGigEActionCommandStatus_Overflow = -519995371,
  202. /**
  203. \brief The requested scheduled action command was requested at a point in time that is in the past.
  204. If the time tag of the scheduled action command is in the past (relative to the device timestamp), and if it is a valid action
  205. command, then the device will execute this action command immediately and return \c PylonGigEActionCommandStatus_ActionLate.
  206. This status code is used as an indicator to the application requesting the action command that a mis-synchronization might have
  207. occurred.
  208. */
  209. PylonGigEActionCommandStatus_ActionLate = -519995370
  210. } EPylonGigEActionCommandStatus;
  211. /*!
  212. \brief Status of a compressed grab buffer/result in PylonCompressionInfo_t.
  213. */
  214. typedef enum
  215. {
  216. CompressionStatus_Ok, /*!< Buffer was compressed properly. */
  217. CompressionStatus_BufferOverflow, /*!< Size of compressed image exceeded desired compression ratio. */
  218. CompressionStatus_Error /*!< Generic error. */
  219. } EPylonCompressionStatus;
  220. /*!
  221. \brief Mode used for transferring images.
  222. The compression mode can have three states. Either compression is disabled in the camera (CompressionMode_Off)
  223. or the camera compresses the images in one of two ways (CompressionMode_BaslerLossless or CompressionMode_BaslerFixRatio).
  224. */
  225. typedef enum tag_EPylonCompressionMode
  226. {
  227. CompressionMode_Off, /*!< Images are transferred uncompressed. */
  228. CompressionMode_BaslerLossless, /*!< Images are transferred with Basler lossless compression. */
  229. CompressionMode_BaslerFixRatio /*!< Images are transferred with Basler fixed ratio compression (which may lead to lossily compressed images). */
  230. } EPylonCompressionMode;
  231. /**
  232. * @}
  233. */
  234. #endif /* PYLON_ENUMS_H */