IDS peak genericC++  v1.4.0
peak_buffer.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
13 
19 #include <peak/dll_interface/peak_dll_interface_util.hpp>
20 
21 #include <cstddef>
22 #include <cstdint>
23 #include <memory>
24 #include <string>
25 #include <vector>
26 
27 
28 namespace peak
29 {
30 namespace core
31 {
32 
39 {
40  Unknown,
41  Image,
42  RawData,
43  File,
44  Chunk,
45  JPEG,
46  JPEG2000,
47  H264,
48  ChunkOnly,
50  MultiPart,
51 
52  Custom = 1000
53 };
54 
61 {
62  GEV = 1,
63  IIDC,
64  PFNC16Bit,
65  PFNC32Bit,
66 
67  Custom = 1000
68 };
69 
70 class DataStream;
71 class NodeMap;
72 
78 class Buffer
79  : public EventSupportingModule
80  , public std::enable_shared_from_this<Buffer>
81 {
82 public:
83  Buffer() = delete;
84  ~Buffer() override = default;
85  Buffer(const Buffer& other) = delete;
86  Buffer& operator=(const Buffer& other) = delete;
87  Buffer(Buffer&& other) = delete;
88  Buffer& operator=(Buffer&& other) = delete;
89 
95 
97  RawInformation Info(int32_t infoCommand) const;
99  std::string TLType() const;
109  void* BasePtr() const;
119  size_t Size() const;
133  void* UserPtr() const;
143  BufferPayloadType PayloadType() const;
156  uint64_t PixelFormat() const;
176  Endianness PixelEndianness() const;
186  size_t ExpectedDataSize() const;
196  size_t DeliveredDataSize() const;
206  uint64_t FrameID() const;
216  size_t ImageOffset() const;
226  size_t DeliveredImageHeight() const;
236  size_t DeliveredChunkPayloadSize() const;
246  uint64_t ChunkLayoutID() const;
256  std::string FileName() const;
266  size_t Width() const;
276  size_t Height() const;
287  size_t XOffset() const;
298  size_t YOffset() const;
308  size_t XPadding() const;
318  size_t YPadding() const;
328  uint64_t Timestamp_ticks() const;
338  uint64_t Timestamp_ns() const;
349  bool IsQueued() const;
361  bool IsAcquiring() const;
374  bool IsIncomplete() const;
385  bool HasNewData() const;
398  bool HasImage() const;
411  bool HasChunks() const;
413 
425  std::vector<std::shared_ptr<BufferChunk>> Chunks();
435  std::vector<std::shared_ptr<BufferPart>> Parts();
445  std::shared_ptr<DataStream> ParentDataStream() const;
446 
447 private:
448  PEAK_MODULE_HANDLE ModuleHandle() const override;
449  PEAK_EVENT_SUPPORTING_MODULE_HANDLE EventSupportingModuleHandle() const override;
450 
451  void Revoke();
452 
453  friend NodeMap;
454  friend ClassCreator<Buffer>;
455  Buffer(PEAK_BUFFER_HANDLE bufferHandle, const std::weak_ptr<DataStream>& parentDataStream);
456  PEAK_BUFFER_HANDLE m_backendHandle;
457 
458  std::weak_ptr<DataStream> m_parentDataStream;
459 
460  friend class DataStream;
461 };
462 
463 } /* namespace core */
464 } /* namespace peak */
465 
466 /* Implementation */
467 namespace peak
468 {
469 namespace core
470 {
471 
472 inline std::string ToString(BufferPayloadType entry)
473 {
474  std::string entryString;
475 
476  if (entry == BufferPayloadType::Unknown)
477  {
478  entryString = "Unknown";
479  }
480  else if (entry == BufferPayloadType::Image)
481  {
482  entryString = "Image";
483  }
484  else if (entry == BufferPayloadType::RawData)
485  {
486  entryString = "RawData";
487  }
488  else if (entry == BufferPayloadType::File)
489  {
490  entryString = "File";
491  }
492  else if (entry == BufferPayloadType::Chunk)
493  {
494  entryString = "Chunk";
495  }
496  else if (entry == BufferPayloadType::JPEG)
497  {
498  entryString = "JPEG";
499  }
500  else if (entry == BufferPayloadType::JPEG2000)
501  {
502  entryString = "JPEG2000";
503  }
504  else if (entry == BufferPayloadType::H264)
505  {
506  entryString = "H264";
507  }
508  else if (entry == BufferPayloadType::ChunkOnly)
509  {
510  entryString = "ChunkOnly";
511  }
512  else if (entry == BufferPayloadType::DeviceSpecific)
513  {
514  entryString = "DeviceSpecific";
515  }
516  else if (entry == BufferPayloadType::MultiPart)
517  {
518  entryString = "MultiPart";
519  }
520  else if (entry >= BufferPayloadType::Custom)
521  {
522  entryString = "Custom";
523  }
524 
525  return entryString;
526 }
527 
528 inline std::string ToString(PixelFormatNamespace entry)
529 {
530  std::string entryString;
531 
532  if (entry == PixelFormatNamespace::GEV)
533  {
534  entryString = "GEV";
535  }
536  else if (entry == PixelFormatNamespace::IIDC)
537  {
538  entryString = "IIDC";
539  }
540  else if (entry == PixelFormatNamespace::PFNC16Bit)
541  {
542  entryString = "PFNC16Bit";
543  }
544  else if (entry == PixelFormatNamespace::PFNC32Bit)
545  {
546  entryString = "PFNC32Bit";
547  }
548  else if (entry >= PixelFormatNamespace::Custom)
549  {
550  entryString = "Custom";
551  }
552 
553  return entryString;
554 }
555 
556 inline Buffer::Buffer(PEAK_BUFFER_HANDLE bufferHandle, const std::weak_ptr<DataStream>& parentDataStream)
557  : m_backendHandle(bufferHandle)
558  , m_parentDataStream(parentDataStream)
559 {}
560 
561 inline RawInformation Buffer::Info(int32_t infoCommand) const
562 {
563  return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
564  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetInfo(m_backendHandle, infoCommand, dataType, buffer, bufferSize);
565  });
566 }
567 
568 inline std::string Buffer::TLType() const
569 {
570  return QueryStringFromCInterfaceFunction([&](char* tlType, size_t* tlTypeSize) {
571  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTLType(m_backendHandle, tlType, tlTypeSize);
572  });
573 }
574 
575 inline void* Buffer::BasePtr() const
576 {
577  return QueryNumericFromCInterfaceFunction<void*>(
578  [&](void** basePtr) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetBasePtr(m_backendHandle, basePtr); });
579 }
580 
581 inline size_t Buffer::Size() const
582 {
583  return QueryNumericFromCInterfaceFunction<size_t>(
584  [&](size_t* size) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetSize(m_backendHandle, size); });
585 }
586 
587 inline void* Buffer::UserPtr() const
588 {
589  return QueryNumericFromCInterfaceFunction<void*>(
590  [&](void** userPtr) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetUserPtr(m_backendHandle, userPtr); });
591 }
592 
594 {
595  return static_cast<BufferPayloadType>(
596  QueryNumericFromCInterfaceFunction<PEAK_BUFFER_PAYLOAD_TYPE>([&](PEAK_BUFFER_PAYLOAD_TYPE* payloadType) {
597  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPayloadType(m_backendHandle, payloadType);
598  }));
599 }
600 
601 inline uint64_t Buffer::PixelFormat() const
602 {
603  return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* pixelFormat) {
604  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPixelFormat(m_backendHandle, pixelFormat);
605  });
606 }
607 
609 {
610  return static_cast<peak::core::PixelFormatNamespace>(
611  QueryNumericFromCInterfaceFunction<PEAK_PIXEL_FORMAT_NAMESPACE>(
612  [&](PEAK_PIXEL_FORMAT_NAMESPACE* pixelFormatNamespace) {
614  m_backendHandle, pixelFormatNamespace);
615  }));
616 }
617 
619 {
620  return static_cast<Endianness>(
621  QueryNumericFromCInterfaceFunction<PEAK_ENDIANNESS>([&](PEAK_ENDIANNESS* pixelEndianness) {
622  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPixelEndianness(m_backendHandle, pixelEndianness);
623  }));
624 }
625 
626 inline size_t Buffer::ExpectedDataSize() const
627 {
628  return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* expectedDataSize) {
629  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetExpectedDataSize(m_backendHandle, expectedDataSize);
630  });
631 }
632 
633 inline size_t Buffer::DeliveredDataSize() const
634 {
635  return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredDataSize) {
636  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetDeliveredDataSize(m_backendHandle, deliveredDataSize);
637  });
638 }
639 
640 inline uint64_t Buffer::FrameID() const
641 {
642  return QueryNumericFromCInterfaceFunction<uint64_t>(
643  [&](uint64_t* frameId) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetFrameID(m_backendHandle, frameId); });
644 }
645 
646 inline size_t Buffer::ImageOffset() const
647 {
648  return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* imageOffset) {
649  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetImageOffset(m_backendHandle, imageOffset);
650  });
651 }
652 
653 inline size_t Buffer::DeliveredImageHeight() const
654 {
655  return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredImageHeight) {
656  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetDeliveredImageHeight(m_backendHandle, deliveredImageHeight);
657  });
658 }
659 
661 {
662  return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredChunkPayloadSize) {
664  m_backendHandle, deliveredChunkPayloadSize);
665  });
666 }
667 
668 inline uint64_t Buffer::ChunkLayoutID() const
669 {
670  return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* chunkLayoutId) {
671  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetChunkLayoutID(m_backendHandle, chunkLayoutId);
672  });
673 }
674 
675 inline std::string Buffer::FileName() const
676 {
677  return QueryStringFromCInterfaceFunction([&](char* fileName, size_t* fileNameSize) {
678  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetFileName(m_backendHandle, fileName, fileNameSize);
679  });
680 }
681 
682 inline size_t Buffer::Width() const
683 {
684  return QueryNumericFromCInterfaceFunction<size_t>(
685  [&](size_t* width) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetWidth(m_backendHandle, width); });
686 }
687 
688 inline size_t Buffer::Height() const
689 {
690  return QueryNumericFromCInterfaceFunction<size_t>(
691  [&](size_t* height) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHeight(m_backendHandle, height); });
692 }
693 
694 inline size_t Buffer::XOffset() const
695 {
696  return QueryNumericFromCInterfaceFunction<size_t>(
697  [&](size_t* xOffset) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetXOffset(m_backendHandle, xOffset); });
698 }
699 
700 inline size_t Buffer::YOffset() const
701 {
702  return QueryNumericFromCInterfaceFunction<size_t>(
703  [&](size_t* yOffset) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetYOffset(m_backendHandle, yOffset); });
704 }
705 
706 inline size_t Buffer::XPadding() const
707 {
708  return QueryNumericFromCInterfaceFunction<size_t>(
709  [&](size_t* xPadding) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetXPadding(m_backendHandle, xPadding); });
710 }
711 
712 inline size_t Buffer::YPadding() const
713 {
714  return QueryNumericFromCInterfaceFunction<size_t>(
715  [&](size_t* yPadding) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetYPadding(m_backendHandle, yPadding); });
716 }
717 
718 inline uint64_t Buffer::Timestamp_ticks() const
719 {
720  return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestamp_ticks) {
721  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTimestamp_ticks(m_backendHandle, timestamp_ticks);
722  });
723 }
724 
725 inline uint64_t Buffer::Timestamp_ns() const
726 {
727  return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestamp_ns) {
728  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTimestamp_ns(m_backendHandle, timestamp_ns);
729  });
730 }
731 
732 inline bool Buffer::IsQueued() const
733 {
734  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isQueued) {
735  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsQueued(m_backendHandle, isQueued);
736  }) > 0;
737 }
738 
739 inline bool Buffer::IsAcquiring() const
740 {
741  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAcquiring) {
742  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsAcquiring(m_backendHandle, isAcquiring);
743  }) > 0;
744 }
745 
746 inline bool Buffer::IsIncomplete() const
747 {
748  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isIncomplete) {
749  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsIncomplete(m_backendHandle, isIncomplete);
750  }) > 0;
751 }
752 
753 inline bool Buffer::HasNewData() const
754 {
755  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasNewData) {
756  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasNewData(m_backendHandle, hasNewData);
757  }) > 0;
758 }
759 
760 inline bool Buffer::HasImage() const
761 {
762  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasImage) {
763  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasImage(m_backendHandle, hasImage);
764  }) > 0;
765 }
766 
767 inline bool Buffer::HasChunks() const
768 {
769  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasChunks) {
770  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasChunks(m_backendHandle, hasChunks);
771  }) > 0;
772 }
773 
774 inline std::vector<std::shared_ptr<BufferChunk>> Buffer::Chunks()
775 {
776  CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_Buffer_UpdateChunks(m_backendHandle); });
777 
778  auto numChunks = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numChunks) {
779  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetNumChunks(m_backendHandle, _numChunks);
780  });
781 
782  std::vector<std::shared_ptr<BufferChunk>> chunks;
783  for (size_t x = 0; x < numChunks; ++x)
784  {
785  auto bufferChunkHandle = QueryNumericFromCInterfaceFunction<PEAK_BUFFER_CHUNK_HANDLE>(
786  [&](PEAK_BUFFER_CHUNK_HANDLE* _bufferChunkHandle) {
787  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetChunk(m_backendHandle, x, _bufferChunkHandle);
788  });
789 
790  chunks.emplace_back(std::make_shared<ClassCreator<BufferChunk>>(bufferChunkHandle, shared_from_this()));
791  }
792 
793  return chunks;
794 }
795 
796 inline std::vector<std::shared_ptr<BufferPart>> Buffer::Parts()
797 {
798  CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_Buffer_UpdateParts(m_backendHandle); });
799 
800  auto numParts = QueryNumericFromCInterfaceFunction<size_t>(
801  [&](size_t* _numParts) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetNumParts(m_backendHandle, _numParts); });
802 
803  std::vector<std::shared_ptr<BufferPart>> parts;
804  for (size_t x = 0; x < numParts; ++x)
805  {
806  auto bufferPartHandle = QueryNumericFromCInterfaceFunction<PEAK_BUFFER_PART_HANDLE>(
807  [&](PEAK_BUFFER_PART_HANDLE* _bufferPartHandle) {
808  return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPart(m_backendHandle, x, _bufferPartHandle);
809  });
810 
811  parts.emplace_back(std::make_shared<ClassCreator<BufferPart>>(bufferPartHandle, shared_from_this()));
812  }
813 
814  return parts;
815 }
816 
817 inline std::shared_ptr<DataStream> Buffer::ParentDataStream() const
818 {
819  return LockOrThrow(m_parentDataStream);
820 }
821 
822 inline PEAK_MODULE_HANDLE Buffer::ModuleHandle() const
823 {
824  auto moduleHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_HANDLE>(
825  [&](PEAK_MODULE_HANDLE* _moduleHandle) {
826  return PEAK_C_ABI_PREFIX PEAK_Buffer_ToModule(m_backendHandle, _moduleHandle);
827  });
828 
829  return moduleHandle;
830 }
831 
832 inline PEAK_EVENT_SUPPORTING_MODULE_HANDLE Buffer::EventSupportingModuleHandle() const
833 {
834  auto eventSupportingModuleHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_SUPPORTING_MODULE_HANDLE>(
835  [&](PEAK_EVENT_SUPPORTING_MODULE_HANDLE* _eventSupportingModuleHandle) {
837  m_backendHandle, _eventSupportingModuleHandle);
838  });
839 
840  return eventSupportingModuleHandle;
841 }
842 
843 inline void Buffer::Revoke()
844 {
845  m_parentDataStream.reset();
846 }
847 
848 inline bool NodeMap::HasBufferSupportedChunks(const std::shared_ptr<Buffer>& buffer) const
849 {
850  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasSupportedChunks) {
852  m_backendHandle, buffer->m_backendHandle, hasSupportedChunks);
853  }) > 0;
854 }
855 
856 inline void NodeMap::UpdateChunkNodes(const std::shared_ptr<Buffer>& buffer)
857 {
858  CallAndCheckCInterfaceFunction([&] {
859  return PEAK_C_ABI_PREFIX PEAK_NodeMap_UpdateChunkNodes(m_backendHandle, buffer->m_backendHandle);
860  });
861 }
862 
863 } /* namespace core */
864 } /* namespace peak */
Represents a GenAPI node map.
Definition: peak_node_map.hpp:59
PEAK_C_API PEAK_Buffer_GetDeliveredImageHeight(PEAK_BUFFER_HANDLE bufferHandle, size_t *deliveredImageHeight)
Asks the given buffer for its delivered image height.
BufferPayloadType
Payload type of buffer.
Definition: peak_buffer.hpp:38
PEAK_C_API PEAK_Buffer_GetPayloadType(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BUFFER_PAYLOAD_TYPE *payloadType)
Asks the given buffer for its payload type.
PEAK_C_API PEAK_Buffer_GetUserPtr(PEAK_BUFFER_HANDLE bufferHandle, void **userPtr)
Asks the given buffer for its user pointer.
std::string FileName() const
Returns the file name.
Definition: peak_buffer.hpp:675
uint64_t FrameID() const
Returns the frame ID.
Definition: peak_buffer.hpp:640
std::vector< std::shared_ptr< BufferChunk > > Chunks()
Returns the buffer&#39;s chunks if it contains chunks.
Definition: peak_buffer.hpp:774
PEAK_C_API PEAK_Buffer_GetHasChunks(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *hasChunks)
Asks the given buffer whether it has chunks.
size_t XOffset() const
Returns the x offset of the data in the buffer in number of pixels from the image origin to handle ar...
Definition: peak_buffer.hpp:694
PEAK_C_API PEAK_Buffer_GetInfo(PEAK_BUFFER_HANDLE bufferHandle, int32_t infoCommand, int32_t *infoDataType, uint8_t *info, size_t *infoSize)
Asks the given buffer for an information based on a specific command.
void UpdateChunkNodes(const std::shared_ptr< Buffer > &buffer)
Updates chunk information in the NodeMap.
Definition: peak_buffer.hpp:856
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition: peak_buffer.hpp:561
PEAK_C_API PEAK_Buffer_GetHeight(PEAK_BUFFER_HANDLE bufferHandle, size_t *height)
Asks the given buffer for its height.
bool IsAcquiring() const
Checks whether the buffer is currently being filled.
Definition: peak_buffer.hpp:739
PEAK_C_API PEAK_Buffer_ToModule(PEAK_BUFFER_HANDLE bufferHandle, PEAK_MODULE_HANDLE *moduleHandle)
Casts the given buffer to a module.
bool IsQueued() const
Checks whether the buffer is queued or not.
Definition: peak_buffer.hpp:732
int8_t PEAK_BOOL8
Definition: peak_backend.h:26
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
size_t DeliveredChunkPayloadSize() const
Returns the delivered chunk payload size.
Definition: peak_buffer.hpp:660
struct PEAK_EVENT_SUPPORTING_MODULE * PEAK_EVENT_SUPPORTING_MODULE_HANDLE
Definition: peak_backend.h:457
PEAK_C_API PEAK_Buffer_GetTimestamp_ns(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *timestamp_ns)
Asks the given buffer for its timestamp in nanoseconds.
PEAK_C_API PEAK_Buffer_GetChunkLayoutID(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *chunkLayoutId)
Asks the given buffer for its chunk layout ID.
size_t Size() const
Returns the size of the buffer in bytes.
Definition: peak_buffer.hpp:581
size_t YOffset() const
Returns the y offset of the data in the buffer in number of lines from the image origin to handle are...
Definition: peak_buffer.hpp:700
std::string ToString(BufferPayloadType entry)
Definition: peak_buffer.hpp:472
uint64_t Timestamp_ticks() const
Returns the timestamp.
Definition: peak_buffer.hpp:718
PEAK_C_API PEAK_Buffer_GetPixelFormatNamespace(PEAK_BUFFER_HANDLE bufferHandle, PEAK_PIXEL_FORMAT_NAMESPACE *pixelFormatNamespace)
Asks the given buffer for its pixel format namespace.
PEAK_C_API PEAK_Buffer_GetExpectedDataSize(PEAK_BUFFER_HANDLE bufferHandle, size_t *expectedDataSize)
Asks the given buffer for its expected data size.
bool IsIncomplete() const
Checks whether the buffer is incomplete or not.
Definition: peak_buffer.hpp:746
Endianness
Endianness of pixel data in a Buffer or the data in a Port.
Definition: peak_common_enums.hpp:27
PEAK_C_API PEAK_Buffer_GetDeliveredChunkPayloadSize(PEAK_BUFFER_HANDLE bufferHandle, size_t *deliveredChunkPayloadSize)
Asks the given buffer for its delivered chunk payload size.
PEAK_C_API PEAK_Buffer_GetPart(PEAK_BUFFER_HANDLE bufferHandle, size_t index, PEAK_BUFFER_PART_HANDLE *bufferPartHandle)
Asks the given buffer for the part with the given index.
size_t Width() const
Returns the width.
Definition: peak_buffer.hpp:682
PEAK_C_API PEAK_Buffer_GetTimestamp_ticks(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *timestamp_ticks)
Asks the given buffer for its timestamp in ticks.
uint64_t PixelFormat() const
Returns the pixel format of the data.
Definition: peak_buffer.hpp:601
BufferPayloadType PayloadType() const
Returns the payload type.
Definition: peak_buffer.hpp:593
int32_t PEAK_ENDIANNESS
Definition: peak_backend.h:155
size_t DeliveredImageHeight() const
Returns the delivered image height.
Definition: peak_buffer.hpp:653
PEAK_C_API PEAK_NodeMap_GetHasBufferSupportedChunks(PEAK_NODE_MAP_HANDLE nodeMapHandle, PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *hasSupportedChunks)
Checks if the buffer contains chunks corresponding to the node map.
PEAK_C_API PEAK_Buffer_GetYOffset(PEAK_BUFFER_HANDLE bufferHandle, size_t *yOffset)
Asks the given buffer for its Y offset.
PEAK_C_API PEAK_Buffer_GetXPadding(PEAK_BUFFER_HANDLE bufferHandle, size_t *xPadding)
Asks the given buffer for its X padding.
PEAK_C_API PEAK_Buffer_GetFileName(PEAK_BUFFER_HANDLE bufferHandle, char *fileName, size_t *fileNameSize)
Asks the given buffer for its file name.
PEAK_C_API PEAK_Buffer_GetHasNewData(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *hasNewData)
Asks the given buffer whether it has new data since the last delivery.
PEAK_C_API PEAK_Buffer_GetNumParts(PEAK_BUFFER_HANDLE bufferHandle, size_t *numParts)
Asks the given buffer for its number of parts.
PEAK_C_API PEAK_Buffer_GetIsQueued(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *isQueued)
Asks the given buffer whether it is queued.
Endianness PixelEndianness() const
Returns the pixel endianness.
Definition: peak_buffer.hpp:618
PEAK_C_API PEAK_Buffer_GetDeliveredDataSize(PEAK_BUFFER_HANDLE bufferHandle, size_t *deliveredDataSize)
Asks the given buffer for its delivered data size.
PEAK_C_API PEAK_Buffer_GetImageOffset(PEAK_BUFFER_HANDLE bufferHandle, size_t *imageOffset)
Asks the given buffer for its image offset.
struct PEAK_BUFFER * PEAK_BUFFER_HANDLE
Definition: peak_backend.h:385
PEAK_C_API PEAK_Buffer_ToEventSupportingModule(PEAK_BUFFER_HANDLE bufferHandle, PEAK_EVENT_SUPPORTING_MODULE_HANDLE *eventSupportingModuleHandle)
Casts the given buffer to an event-supporting module.
void * BasePtr() const
Returns the base pointer.
Definition: peak_buffer.hpp:575
size_t Height() const
Returns the height.
Definition: peak_buffer.hpp:688
void * UserPtr() const
Returns the pointer to custom user data attached to the buffer.
Definition: peak_buffer.hpp:587
PEAK_C_API PEAK_Buffer_UpdateParts(PEAK_BUFFER_HANDLE bufferHandle)
Tells the given buffer to update its parts.
std::string TLType() const
Returns the TL (transport layer) type.
Definition: peak_buffer.hpp:568
Represents a GenTL buffer module.
Definition: peak_buffer.hpp:78
PEAK_C_API PEAK_Buffer_GetBasePtr(PEAK_BUFFER_HANDLE bufferHandle, void **basePtr)
Asks the given buffer for its base pointer.
Represents a GenTL DataStream module.
Definition: peak_data_stream.hpp:181
bool HasImage() const
Checks whether the buffer contains image data.
Definition: peak_buffer.hpp:760
bool HasNewData() const
Checks whether the buffer has new data since the last delivery.
Definition: peak_buffer.hpp:753
size_t ExpectedDataSize() const
Returns the expected data size.
Definition: peak_buffer.hpp:626
PEAK_C_API PEAK_NodeMap_UpdateChunkNodes(PEAK_NODE_MAP_HANDLE nodeMapHandle, PEAK_BUFFER_HANDLE bufferHandle)
Updates chunk information in the node map.
PEAK_C_API PEAK_Buffer_GetIsAcquiring(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *isAcquiring)
Asks the given buffer whether it is acquiring.
PEAK_C_API PEAK_Buffer_GetXOffset(PEAK_BUFFER_HANDLE bufferHandle, size_t *xOffset)
Asks the given buffer for its X offset.
PEAK_C_API PEAK_Buffer_UpdateChunks(PEAK_BUFFER_HANDLE bufferHandle)
Tells the given buffer to update its chunks.
size_t YPadding() const
Returns the y padding of the data in the buffer in number of bytes.
Definition: peak_buffer.hpp:712
size_t XPadding() const
Returns the x padding of the data in the buffer in number of bytes.
Definition: peak_buffer.hpp:706
PEAK_C_API PEAK_Buffer_GetNumChunks(PEAK_BUFFER_HANDLE bufferHandle, size_t *numChunks)
Asks the given buffer for its number of chunks.
PEAK_C_API PEAK_Buffer_GetHasImage(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *hasImage)
Asks the given buffer whether it is has an image.
#define PEAK_C_ABI_PREFIX
Definition: peak_dll_defines.h:16
peak::core::PixelFormatNamespace PixelFormatNamespace() const
Returns the pixel format namespace, to allow interpretation of the PixelFormat(). ...
Definition: peak_buffer.hpp:608
PixelFormatNamespace
The namespace needed to interpret the pixel format value of the buffer.
Definition: peak_buffer.hpp:60
int32_t PEAK_BUFFER_PAYLOAD_TYPE
Definition: peak_backend.h:82
uint64_t ChunkLayoutID() const
Returns the chunk layout ID.
Definition: peak_buffer.hpp:668
std::vector< std::shared_ptr< BufferPart > > Parts()
Returns all buffer parts for multipart buffers.
Definition: peak_buffer.hpp:796
std::shared_ptr< DataStream > ParentDataStream() const
Returns the parent data stream.
Definition: peak_buffer.hpp:817
int32_t PEAK_PIXEL_FORMAT_NAMESPACE
Definition: peak_backend.h:301
PEAK_C_API PEAK_Buffer_GetTLType(PEAK_BUFFER_HANDLE bufferHandle, char *tlType, size_t *tlTypeSize)
Asks the given buffer for its TL type.
struct PEAK_BUFFER_CHUNK * PEAK_BUFFER_CHUNK_HANDLE
Definition: peak_backend.h:389
The struct returned by all raw information functions.
Definition: peak_common_structs.hpp:24
PEAK_C_API PEAK_Buffer_GetPixelFormat(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *pixelFormat)
Asks the given buffer for its pixel format.
PEAK_C_API PEAK_Buffer_GetIsIncomplete(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *isIncomplete)
Asks the given buffer whether it is incomplete.
struct PEAK_MODULE * PEAK_MODULE_HANDLE
Definition: peak_backend.h:401
PEAK_C_API PEAK_Buffer_GetSize(PEAK_BUFFER_HANDLE bufferHandle, size_t *size)
Asks the given buffer for its size.
bool HasBufferSupportedChunks(const std::shared_ptr< Buffer > &buffer) const
Checks if the Buffer contains chunks corresponding to the NodeMap.
Definition: peak_buffer.hpp:848
PEAK_C_API PEAK_Buffer_GetWidth(PEAK_BUFFER_HANDLE bufferHandle, size_t *width)
Asks the given buffer for its width.
size_t DeliveredDataSize() const
Returns the delivered data size.
Definition: peak_buffer.hpp:633
bool HasChunks() const
Checks whether the buffer contains chunks.
Definition: peak_buffer.hpp:767
PEAK_C_API PEAK_Buffer_GetFrameID(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *frameId)
Asks the given buffer for its frame ID.
The base class for all modules being able to raise events.
Definition: peak_event_supporting_module.hpp:33
PEAK_C_API PEAK_Buffer_GetYPadding(PEAK_BUFFER_HANDLE bufferHandle, size_t *yPadding)
Asks the given buffer for its Y padding.
PEAK_C_API PEAK_Buffer_GetChunk(PEAK_BUFFER_HANDLE bufferHandle, size_t index, PEAK_BUFFER_CHUNK_HANDLE *bufferChunkHandle)
Asks the given buffer for the chunk with the given index.
struct PEAK_BUFFER_PART * PEAK_BUFFER_PART_HANDLE
Definition: peak_backend.h:393
size_t ImageOffset() const
Returns the offset of the image data from the beginning of the delivered buffer in bytes...
Definition: peak_buffer.hpp:646
uint64_t Timestamp_ns() const
Returns the timestamp.
Definition: peak_buffer.hpp:725
PEAK_C_API PEAK_Buffer_GetPixelEndianness(PEAK_BUFFER_HANDLE bufferHandle, PEAK_ENDIANNESS *pixelEndianness)
Asks the given buffer for its pixel endianness.