GenDC.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. // *******************************************************************************
  2. // GenDC.h
  3. // GenDC structures and defines header.
  4. // Version 1.1.0.00
  5. //
  6. //-----------------------------------------------------------------------------
  7. // Copyright (c) 2018 by Matrox Electronic Systems Ltd.
  8. // Section: GenDC
  9. // Project: GenICam
  10. // Author: Stephane Maurice
  11. // $Header$ GenDC.H
  12. //
  13. // License: This file is published under the license of the EMVA GenICam Standard Group.
  14. // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
  15. // If for some reason you are missing this file please contact the EMVA or visit the website
  16. // (http://www.genicam.org) for a full copy.
  17. //
  18. // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
  19. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  20. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  21. // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
  22. // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  23. // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  24. // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  25. // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  26. // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  27. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  28. // POSSIBILITY OF SUCH DAMAGE.
  29. //-----------------------------------------------------------------------------
  30. #pragma once
  31. // Prevent multiple GenDC.H inclusion.
  32. #ifndef GenDCH
  33. #define GenDCH
  34. // Headers:
  35. #ifndef _STDINT
  36. #include <stdint.h>
  37. #endif
  38. #ifndef PFNC_H
  39. #include "PFNC.h"
  40. #endif
  41. #include <stddef.h> // size_t
  42. // GenDC standard values:
  43. // -----------------------------------
  44. // -----------------------------------
  45. #define GDC_SIGNATURE 0x43444E47 // "GNDC" Signature (not null terminated)
  46. #define GDC_VERSION_MAJOR 0x01
  47. #define GDC_VERSION_MINOR 0x00
  48. #define GDC_VERSION_SUBMINOR 0x00
  49. // Header Types
  50. #define GDC_HEADER_TYPE_MASK 0xF000
  51. #define GDC_GENERIC_HEADER 0x0000
  52. #define GDC_CONTAINER_HEADER 0x1000
  53. #define GDC_COMPONENT_HEADER 0x2000
  54. #define GDC_PART_HEADER 0x4000 // 0x4000-0x4FFF reserved for sub Part Headers type.
  55. #define GDC_FLOW_TABLE_HEADER 0x7000
  56. // Component Types (from SFNC)
  57. #define GDC_UNDEFINED_COMPONENT 0x00
  58. #define GDC_INTENSITY 0x01
  59. #define GDC_INFRARED 0x02
  60. #define GDC_ULTRAVIOLET 0x03
  61. #define GDC_RANGE 0x04
  62. #define GDC_REFLECTANCE 0x05
  63. #define GDC_CONFIDENCE 0x06
  64. #define GDC_DISPARITY 0x07
  65. #define GDC_SCATTER 0x08
  66. #define GDC_MULTISPECTRAL 0x09
  67. #define GDC_EXTENDED_COMPONENT 0x8000
  68. #define GDC_METADATA GDC_EXTENDED_COMPONENT+0x0001
  69. #define GDC_CUSTOM_COMPONENT GDC_EXTENDED_COMPONENT+0x7F00 // + 0x0-0xFE valid
  70. #define GDC_RESERVED_COMPONENT GDC_EXTENDED_COMPONENT+0x7FFF
  71. // Part types
  72. #define GDC_GENERIC_PART_TYPE_MASK GDC_PART_HEADER+0x0F00
  73. #define GDC_GENERIC_PART_METADATA GDC_PART_HEADER+0x0000
  74. #define GDC_GENERIC_PART_1D GDC_PART_HEADER+0x0100
  75. #define GDC_GENERIC_PART_2D GDC_PART_HEADER+0x0200
  76. #define GDC_GENERIC_PART_CUSTOM GDC_PART_HEADER+0x0F00
  77. #define GDC_METADATA_GENICAM_CHUNK GDC_GENERIC_PART_METADATA+0
  78. #define GDC_METADATA_GENICAM_XML GDC_GENERIC_PART_METADATA+1
  79. #define GDC_METADATA_CUSTOM(x) GDC_GENERIC_PART_METADATA+0xF0+x // + 0x0-0xF valid
  80. #define GDC_1D GDC_GENERIC_PART_1D+0x00
  81. #define GDC_1D_CUSTOM(x) GDC_GENERIC_PART_1D+0xF0+x // + 0x0-0xF valid
  82. #define GDC_2D GDC_GENERIC_PART_2D+0x00
  83. #define GDC_2D_JPEG GDC_GENERIC_PART_2D+0x01
  84. #define GDC_2D_JPEG2000 GDC_GENERIC_PART_2D+0x02
  85. #define GDC_2D_H264 GDC_GENERIC_PART_2D+0x03
  86. #define GDC_2D_CUSTOM(x) GDC_GENERIC_PART_2D+0xF0+x // + 0x0-0xF valid
  87. #define GDC_CUSTOM(x) GDC_GENERIC_PART_CUSTOM+x // + 0x0-0xFE valid
  88. // GenDC objects forward declarations:
  89. // -----------------------------------
  90. // -----------------------------------
  91. struct GenDCContainerHeader;
  92. struct GenDCComponentHeader;
  93. struct GenDCPartHeader;
  94. // GenDC types definitions.
  95. // ------------------------
  96. // ------------------------
  97. // Pack all the structures.
  98. #pragma pack(push, 1)
  99. // GenDC Container typedef and enumerations.
  100. enum GenDCSignature : uint32_t { Signature_GNDC = GDC_SIGNATURE };
  101. typedef uint8_t GenDCVersionField;
  102. enum GenDCVersionValue : GenDCVersionField { VersionMajorCurrent = GDC_VERSION_MAJOR,
  103. VersionMinorCurrent = GDC_VERSION_MINOR,
  104. VersionSubMinorCurrent = GDC_VERSION_SUBMINOR
  105. }; // Ex: Version 01.01.00
  106. enum GenDCReservedValue { ReservedDefaultValue = 0x00 };
  107. typedef uint16_t GenDCHeaderTypeShared;
  108. enum GenDCHeaderType : GenDCHeaderTypeShared { TypeHeaderMask = GDC_HEADER_TYPE_MASK,
  109. TypeGeneric = GDC_GENERIC_HEADER,
  110. TypeContainer = GDC_CONTAINER_HEADER,
  111. TypeComponent = GDC_COMPONENT_HEADER,
  112. TypePart = GDC_PART_HEADER,
  113. TypeFlowTable = GDC_FLOW_TABLE_HEADER
  114. };
  115. typedef uint32_t GenDCHeaderSize;
  116. typedef uint16_t GenDCHeaderFlags;
  117. union GenDCContainerFlagsGroup;
  118. typedef uint64_t GenDCContainerId;
  119. typedef uint64_t GenDCDataSize;
  120. typedef int64_t GenDCOffset;
  121. typedef uint32_t GenDCDescriptorSize;
  122. typedef GenDCContainerHeader GenDCDescriptor;
  123. typedef uint32_t GenDCContainerSectionFlag;
  124. typedef uint32_t GenDCComponentCount;
  125. typedef uint8_t GenDCContainerBuffer;
  126. typedef uint64_t GenDCContainerBufferSize;
  127. typedef uint8_t GenDCData;
  128. typedef uint8_t GenDCDataU8;
  129. typedef uint16_t GenDCDataU16;
  130. typedef uint32_t GenDCDataU32;
  131. typedef uint64_t GenDCDataU64;
  132. typedef void GenDCDataVoid;
  133. typedef struct uint24_t /* 3 bytes pixel. Ex: RGB8. */
  134. {
  135. // Storage for the RGB or BGR 8 bit values
  136. uint8_t PixelValue[3];
  137. // Default copy constructor.
  138. uint24_t(const uint24_t &GenDCDataU24Source)
  139. {
  140. for (int j = 0; j < 3; j++)
  141. PixelValue[j] = GenDCDataU24Source.PixelValue[j];
  142. };
  143. // Default conversion.
  144. operator uint32_t() const
  145. {
  146. uint32_t PixelValue32;
  147. for (int j = 0; j < 3; j++)
  148. ((uint8_t*)(&PixelValue32))[j] = PixelValue[j];
  149. return (PixelValue32);
  150. };
  151. } uint24_t;
  152. typedef uint24_t GenDCDataU24;
  153. // GenDC Component typedef and enumerations.
  154. typedef uint16_t GenDCGroupId;
  155. typedef uint16_t GenDCSourceId;
  156. typedef uint16_t GenDCRegionId;
  157. typedef uint32_t GenDCRegionOffset;
  158. typedef int64_t GenDCTimestamp;
  159. typedef uint64_t GenDCComponentTypeId;
  160. typedef PfncFormat GenDCFormat;
  161. typedef uint16_t GenDCPartCount;
  162. enum GenDCComponentType : GenDCComponentTypeId
  163. {
  164. TypeUndefined = GDC_UNDEFINED_COMPONENT, TypeIntensity = GDC_INTENSITY,
  165. TypeInfrared = GDC_INFRARED, TypeUltraviolet = GDC_ULTRAVIOLET,
  166. TypeRange = GDC_RANGE, TypeReflectance = GDC_REFLECTANCE,
  167. TypeConfidence = GDC_CONFIDENCE, TypeDisparity = GDC_DISPARITY,
  168. TypeScatter = GDC_SCATTER, TypeMultispectral = GDC_MULTISPECTRAL,
  169. TypeExtended = GDC_EXTENDED_COMPONENT, TypeMetadata = GDC_METADATA,
  170. TypeCustomComponent = GDC_CUSTOM_COMPONENT, TypeReservedComponent = GDC_RESERVED_COMPONENT
  171. };
  172. // GenDC Part typedef and enumerations.
  173. typedef uint64_t GenDCSize1D;
  174. typedef int64_t GenDCSize1DSigned;
  175. typedef uint32_t GenDCSize2D;
  176. typedef GenDCSize1D GenDCSize;
  177. typedef uint16_t GenDCPadding;
  178. typedef uint64_t GenDCDataSize;
  179. typedef uint16_t GenDCFlowId;
  180. typedef uint32_t GenDCFlowCount;
  181. typedef GenDCOffset GenDCFlowOffset;
  182. enum GenDCGenericPartType : GenDCHeaderTypeShared
  183. {
  184. TypeGenericPart = GDC_PART_HEADER, TypeGenericMetadata = GDC_GENERIC_PART_METADATA,
  185. TypeGenericPart1D = GDC_GENERIC_PART_1D, TypeGenericPart2D = GDC_GENERIC_PART_2D,
  186. TypeGenericCustom = GDC_GENERIC_PART_CUSTOM, TypeGenericPartMask = GDC_GENERIC_PART_TYPE_MASK,
  187. };
  188. enum GenDCPartType : GenDCHeaderTypeShared
  189. {
  190. TypeMetadataGenICamChunk = GDC_METADATA_GENICAM_CHUNK, TypeMetadataGenICamXML = GDC_METADATA_GENICAM_XML,
  191. TypeMetadataCustom = GDC_METADATA_CUSTOM(0), Type1D = GDC_1D,
  192. Type1DCustom = GDC_1D_CUSTOM(0), Type2D = GDC_2D,
  193. TypeJPEG = GDC_2D_JPEG, TypeJPEG2000 = GDC_2D_JPEG2000,
  194. TypeH264 = GDC_2D_H264,
  195. Type2DCustom = GDC_2D_CUSTOM(0)
  196. };
  197. // General utility types and enumerations.
  198. typedef uint8_t GenDCReserved8;
  199. typedef uint16_t GenDCReserved16;
  200. typedef uint32_t GenDCReserved32;
  201. typedef uint64_t GenDCReserved64;
  202. typedef const char* GenDCErrorMessage;
  203. enum GenDCPredefinedValue32 : GenDCComponentCount { GenDCAllComponents = 0xFFFFFFFF, GenDCAllFlows = 0xFFFFFFFF };
  204. enum GenDCPredefinedValue16 : GenDCPartCount { GenDCAllParts = 0xFFFF };
  205. enum GenDCPredefinedValue64 : uint64_t { GenDCAllData = 0x8FFFFFFFFFFFFFFF, GenDCCenter = 0x8FFFFFFFFFFFFFFE };
  206. enum GenDCPredefinedComponentValue : GenDCComponentCount { GenDCInvalidComponentIndex = 0xFFFFFFFF };
  207. enum GenDCPredefinedPartValue : GenDCPartCount { GenDCInvalidPartIndex = 0xFFFF };
  208. // Typedef to avoid warning for 32 or 64 bit compilation.
  209. #ifndef WIN32
  210. typedef GenDCDataSize GenDCAllocationDataSize;
  211. #else
  212. typedef unsigned GenDCAllocationDataSize;
  213. #endif
  214. //GenDC headers structures:
  215. //-----------------------------------------
  216. //-----------------------------------------
  217. // Container's Flags bit fields structure.
  218. // ---------------------------------------
  219. union GenDCContainerFlagsGroup // Container's Flags.
  220. {
  221. GenDCHeaderFlags Value;
  222. struct
  223. {
  224. GenDCHeaderFlags TimestampPTP : 1;
  225. GenDCHeaderFlags ComponentInvalid : 1;
  226. GenDCHeaderFlags Reserved : 14;
  227. } Field;
  228. };
  229. // Container's VariableFields flags bit fields structure.
  230. // ------------------------------------------------------
  231. union GenDCContainerVariableFieldsGroup // Container's Flags.
  232. {
  233. GenDCHeaderFlags Value;
  234. struct
  235. {
  236. GenDCHeaderFlags DataSize : 1;
  237. GenDCHeaderFlags SizeX : 1;
  238. GenDCHeaderFlags SizeY : 1;
  239. GenDCHeaderFlags RegionOffset : 1;
  240. GenDCHeaderFlags Format : 1;
  241. GenDCHeaderFlags Timestamp : 1;
  242. GenDCHeaderFlags ComponentCount : 1;
  243. GenDCHeaderFlags ComponentInvalid: 1;
  244. GenDCHeaderFlags Reserved : 8;
  245. } Field;
  246. };
  247. // GenDC Container header base.
  248. //-----------------------------
  249. struct GenDCContainerHeaderBase
  250. {
  251. GenDCSignature Signature;
  252. GenDCVersionField VersionMajor;
  253. GenDCVersionField VersionMinor;
  254. GenDCVersionField VersionSubMinor;
  255. GenDCReserved8 Reserved;
  256. GenDCHeaderType HeaderType;
  257. GenDCContainerFlagsGroup Flags;
  258. GenDCHeaderSize HeaderSize;
  259. GenDCContainerId Id;
  260. GenDCContainerVariableFieldsGroup VariableFields;
  261. GenDCReserved16 Reserved16;
  262. GenDCReserved32 Reserved32;
  263. GenDCDataSize DataSize;
  264. GenDCOffset DataOffset;
  265. GenDCDescriptorSize DescriptorSize;
  266. GenDCComponentCount ComponentCount;
  267. // GenDCOffset ComponentOffsets[ComponentCount]; field not included in base class.
  268. };
  269. // GenDC Container header (including a Component PartOffset array member).
  270. //------------------------------------------------------------------------
  271. #define GDC_CONTAINER_COMPONENT_COUNT_MIN 1
  272. struct GenDCContainerHeader : GenDCContainerHeaderBase
  273. {
  274. // GenDCOffset ComponentOffsets[ComponentCount]; minimal Component Offset(s) included.
  275. // This allow to use Container.ComponentOffsets[ComponentIndex].
  276. // Note: sizeof(GenDCContainerHeader) must not be used if ComponentCount > 1.
  277. // Note: Only GenDCContaineHeader reference (GenDCContainerHeader &) can be used as destination to operator =
  278. // since the default copy constructor will not copy all the ComponentOffset members;
  279. // Use only GenDCContaineHeader &Container = AnotherGenDCContaineHeader.
  280. GenDCOffset ComponentOffsets[GDC_CONTAINER_COMPONENT_COUNT_MIN];
  281. // Default constructor for "ContainerHeader &".
  282. // GenDCContainerHeader() {;};
  283. // Deleted default copy constructor since it will not copy all the ComponentOffsets[] members.
  284. // It would also not point to the real Container header memory Offset.
  285. // Use a reference instead (Ex: GenDCContainerHeader& MyContainer = ...;) or a pointer.
  286. // GenDCContainerHeader(GenDCContainerHeader &) = delete;
  287. };
  288. // Component's Flags bit fields structure.
  289. // ---------------------------------------
  290. union GenDCComponentFlagsGroup // Component's Flags.
  291. {
  292. GenDCHeaderFlags Value;
  293. struct
  294. {
  295. GenDCHeaderFlags Invalid : 1;
  296. GenDCHeaderFlags Unallocated : 15;
  297. } Field;
  298. };
  299. // GenDC Component header base.
  300. // ----------------------------
  301. struct GenDCComponentHeaderBase
  302. {
  303. GenDCHeaderType HeaderType;
  304. GenDCComponentFlagsGroup Flags;
  305. GenDCHeaderSize HeaderSize;
  306. GenDCReserved16 Reserved;
  307. GenDCGroupId GroupId;
  308. GenDCSourceId SourceId;
  309. GenDCRegionId RegionId;
  310. GenDCRegionOffset RegionOffsetX;
  311. GenDCRegionOffset RegionOffsetY;
  312. GenDCTimestamp Timestamp;
  313. GenDCComponentTypeId TypeId;
  314. GenDCFormat Format;
  315. GenDCReserved16 Reserved2;
  316. GenDCPartCount PartCount;
  317. // GenDCOffset PartOffsets[PartCount]; // This field is not included in base class.
  318. };
  319. // GenDC Component header (including a PartOffset[] array member).
  320. //-----------------------------------------------------------------
  321. #define GDC_COMPONENT_PART_COUNT_MIN 1
  322. struct GenDCComponentHeader : GenDCComponentHeaderBase
  323. {
  324. // GenDCOffset PartOffsets[PartCount]; minimal Component Offset(s) included.
  325. // This allow to use Component.PartOffsets[ComponentIndex].
  326. // Note: sizeof(GenDCComponent Header) must not be used if ComponentCount > 1.
  327. // Note: Only GenDCComponent header reference (GenDCPart Header &) can be used as destination to operator =
  328. // since the default copy constructor will not copy all the PartOffsets members;
  329. // Use only GenDCComponentHeader &Component = AnotherGenDCComponentHeader.
  330. GenDCOffset PartOffsets[GDC_COMPONENT_PART_COUNT_MIN];
  331. // Default constructor for "ComponentHeader &".
  332. GenDCComponentHeader() { ; };
  333. // Deleted default copy constructor since it will not copy all the Parts header members.
  334. // It would also not point to the real Component header memory Offset.
  335. // Use a reference instead (Ex: GenDCCoponenHeader& MyComponent = ...;) or a pointer.
  336. GenDCComponentHeader(GenDCComponentHeader &) = delete;
  337. };
  338. // Part's Flags bit fields structure.
  339. // ---------------------------------------
  340. union GenDCPartFlagsGroup // Part's Flags.
  341. {
  342. GenDCHeaderFlags Value;
  343. struct
  344. {
  345. GenDCHeaderFlags Unallocated : 16;
  346. } Field;
  347. };
  348. // GenDC Part header common fields.
  349. // --------------------------------
  350. struct GenDCPartHeaderBase
  351. {
  352. GenDCPartType HeaderType;
  353. GenDCPartFlagsGroup Flags;
  354. GenDCHeaderSize HeaderSize;
  355. GenDCFormat Format;
  356. GenDCReserved16 Reserved;
  357. GenDCFlowId FlowId;
  358. GenDCFlowOffset FlowOffset;
  359. GenDCDataSize DataSize;
  360. GenDCOffset DataOffset;
  361. };
  362. // GenDC generic standard Part header.
  363. //------------------------------------
  364. struct GenDCPartHeader : public GenDCPartHeaderBase // Add no field compared to base class.
  365. {
  366. // Default constructor for "PartHeader &".
  367. GenDCPartHeader() { ; };
  368. // Deleted default copy constructor since it will not copy all Part type specific members.
  369. // It would also not point to the real Part header memory Offset.
  370. // Use a reference instead (Ex: GenDCPartHeader& MyPart = ...;) or a pointer.
  371. GenDCPartHeader(GenDCPartHeader &) = delete;
  372. };
  373. // GenDC 2D Part header base
  374. //---------------------------
  375. struct GenDCPartHeader2DBase : public GenDCPartHeader
  376. {
  377. GenDCSize2D SizeX;
  378. GenDCSize2D SizeY;
  379. GenDCPadding PaddingX;
  380. GenDCPadding PaddingY;
  381. GenDCReserved32 InfoReserved;
  382. };
  383. // GenDC 2D uncompressed Part header
  384. //-----------------------------------
  385. #define GDC_1D_2D_IMAGE_INFO_RESERVED_COUNT 1
  386. struct GenDCPartHeader2D : public GenDCPartHeader2DBase
  387. {
  388. };
  389. // GenDC 2D JPEG and JPEG200 standard Type specific info.
  390. //-------------------------------------------------------
  391. struct GenDCInfoTypeSpecificJPEG
  392. {
  393. };
  394. // GenDC 2D JPEG standard Part header.
  395. //------------------------------------
  396. struct GenDCPartHeaderJPEG : public GenDCPartHeader2DBase
  397. {
  398. };
  399. // GenDC 2D JPEG2000 standard Part header.
  400. //----------------------------------------
  401. struct GenDCPartHeaderJPEG2000 : public GenDCPartHeader2DBase
  402. {
  403. };
  404. // Part Info field interpretation structure for H.264.
  405. struct GenDCInfoTypeSpecificH264
  406. {
  407. uint8_t Reserved;
  408. uint8_t ProfileIDC;
  409. union H264Flags
  410. {
  411. uint8_t CS_set0_flag : 1;
  412. uint8_t CS_set1_flag : 1;
  413. uint8_t CS_set2_flag : 1;
  414. uint8_t CS_set3_flag : 1;
  415. uint8_t PM : 2;
  416. uint8_t RF : 2;
  417. } Flags;
  418. uint8_t LevelIDC;
  419. uint16_t SpropInterleavingDepth;
  420. uint16_t SpropMaxDonDiff;
  421. uint32_t SpropDeintBufReq;
  422. uint32_t SpropInitBufTime;
  423. };
  424. // GenDC 2D H.264 compressed Part header.
  425. // --------------------------------------
  426. struct GenDCPartHeaderH264 : public GenDCPartHeader2DBase
  427. {
  428. GenDCInfoTypeSpecificH264 InfoTypeSpecific;
  429. };
  430. // GenDC 1D uncompressed Part header.
  431. // ----------------------------------
  432. struct GenDCPartHeader1DBase : GenDCPartHeader
  433. {
  434. GenDCSize1D SizeX;
  435. GenDCPadding PaddingX;
  436. GenDCReserved16 PaddingReserved;
  437. GenDCReserved32 InfoReserved;
  438. uint64_t InfoTypeSpecific;
  439. };
  440. // GenDC 1D uncompressed Part header.
  441. // ----------------------------------
  442. struct GenDCPartHeader1D : GenDCPartHeader1DBase
  443. {
  444. };
  445. // GenDC GenICam Chunk Metadata Part header.
  446. // -----------------------------------------
  447. struct GenDCPartHeaderGenICamChunk : GenDCPartHeader1DBase
  448. {
  449. // For GenICam Chunk metadata Part, InfoTypeSpecific[] should contain the GenICam chunk_layout_id.
  450. };
  451. // GenDC GenICam XML Metadata Part header.
  452. // ---------------------------------------
  453. struct GenDCPartHeaderGenICamXML: GenDCPartHeader1DBase
  454. {
  455. // For GenICam XML metadata Part, InfoTypeSpecific[] should contain the GenICam XML_layout_id.
  456. };
  457. // GenDC Container Descriptor Template declaration.
  458. // Assuming that all the Components and their 2D Parts are all symmetrical.
  459. template<size_t _ComponentCount, size_t _PartCount>
  460. struct ContainerDescriptorTemplate2D : GenDCContainerHeaderBase
  461. {
  462. // Container header base fields followed by the ComponentOffset.
  463. GenDCOffset ComponentOffsets[_ComponentCount];
  464. // Including a Component header base followed by the PartOffset.
  465. struct : GenDCComponentHeaderBase
  466. {
  467. GenDCOffset PartOffsets[_PartCount];
  468. // Including Part headers.
  469. struct : GenDCPartHeader2D
  470. {
  471. } Parts[_PartCount];
  472. } Components[_ComponentCount];
  473. };
  474. // GenDC Container Descriptor for a single 2D Component declaration.
  475. // Assuming 1 Components and 1 2D Part.
  476. struct ContainerDescriptorSingleComponent2D : GenDCContainerHeaderBase
  477. {
  478. // Container header base fields followed by a single ComponentOffset.
  479. GenDCOffset ComponentOffsets[1];
  480. // Including a Component header base followed by a single PartOffset.
  481. struct : GenDCComponentHeaderBase
  482. {
  483. GenDCOffset PartOffsets[1];
  484. // Including a Part header.
  485. struct : GenDCPartHeader2D
  486. {
  487. } Part;
  488. } Component;
  489. };
  490. // Flow table base header.
  491. // -------------------------
  492. struct GenDCFlowTableHeader
  493. {
  494. GenDCHeaderType HeaderType;
  495. GenDCHeaderFlags Flags;
  496. GenDCHeaderSize HeaderSize;
  497. GenDCVersionField VersionMajor;
  498. GenDCVersionField VersionMinor;
  499. GenDCReserved16 Reserved;
  500. GenDCFlowCount FlowCount;
  501. };
  502. // Flow table with one entry (Note: sizeof(GenDCFlowTable) invalid).
  503. // -------------------------
  504. struct GenDCFlowTable : GenDCFlowTableHeader
  505. {
  506. uint64_t FlowSize[1]; // Stub array field for easy access using FlowTable.FlowSize[n].
  507. };
  508. // Flow table template.
  509. // -------------------------
  510. template<GenDCPartCount _FlowCount>
  511. struct GenDCFlowTableTemplate : GenDCFlowTableHeader
  512. {
  513. uint64_t FlowSize[_FlowCount];
  514. };
  515. // Restore packing.
  516. #pragma pack(pop)
  517. #endif // #ifndef GenDCH