IDS peak genericC++ v1.16.0
Loading...
Searching...
No Matches
peak_buffer.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
14
20#include <peak/dll_interface/peak_dll_interface_util.hpp>
22
23#include <cstddef>
24#include <cstdint>
25#include <memory>
26#include <string>
27#include <vector>
28
29
30namespace peak
31{
32
33namespace core
34{
35
58
74
75class DataStream;
76class NodeMap;
77
84class Buffer
86 , public std::enable_shared_from_this<Buffer>
87{
88public:
89 Buffer() = delete;
90 ~Buffer() override = default;
91 Buffer(const Buffer& other) = delete;
92 Buffer& operator=(const Buffer& other) = delete;
93 Buffer(Buffer&& other) = delete;
94 Buffer& operator=(Buffer&& other) = delete;
95
108
109
122
129
130 RawInformation Info(int32_t infoCommand) const;
131
133 std::string TLType() const;
134
144 void* BasePtr() const;
145
155 size_t Size() const;
156
170 void* UserPtr() const;
171
182
195 uint64_t PixelFormat() const;
196
207
218
228 size_t ExpectedDataSize() const;
229
239 size_t DeliveredDataSize() const;
240
257 uint64_t FrameID() const;
258
268 size_t ImageOffset() const;
269
279 size_t DeliveredImageHeight() const;
280
290 size_t DeliveredChunkPayloadSize() const;
291
301 uint64_t ChunkLayoutID() const;
302
320 std::string FileName() const;
321
331 size_t Width() const;
332
342 size_t Height() const;
343
354 size_t XOffset() const;
355
366 size_t YOffset() const;
367
377 size_t XPadding() const;
378
388 size_t YPadding() const;
389
399 uint64_t Timestamp_ticks() const;
400
420 uint64_t Timestamp_ns() const;
421
432 bool IsQueued() const;
433
445 bool IsAcquiring() const;
446
459 bool IsIncomplete() const;
460
471 bool HasNewData() const;
472
485 bool HasImage() const;
486
499 bool HasChunks() const;
500
513 bool HasParts() const;
514
515
548 uint64_t SystemTimestamp_ns() const;
549
551
563 std::vector<std::shared_ptr<BufferChunk>> Chunks();
564
574 std::vector<std::shared_ptr<BufferPart>> Parts();
575
585 std::shared_ptr<DataStream> ParentDataStream() const;
586
587private:
588 PEAK_MODULE_HANDLE ModuleHandle() const override;
590
591 void Revoke();
592
593 friend NodeMap;
594 friend ClassCreator<Buffer>;
595 Buffer(PEAK_BUFFER_HANDLE bufferHandle, const std::weak_ptr<DataStream>& parentDataStream);
596 PEAK_BUFFER_HANDLE m_backendHandle;
597
598 std::weak_ptr<DataStream> m_parentDataStream;
599
600 friend class DataStream;
601};
602
603} /* namespace core */
604} /* namespace peak */
605
606/* Implementation */
607namespace peak
608{
609namespace core
610{
611
612inline std::string ToString(BufferPayloadType entry)
613{
614 std::string entryString;
615
616 if (entry == BufferPayloadType::Unknown)
617 {
618 entryString = "Unknown";
619 }
620 else if (entry == BufferPayloadType::Image)
621 {
622 entryString = "Image";
623 }
624 else if (entry == BufferPayloadType::RawData)
625 {
626 entryString = "RawData";
627 }
628 else if (entry == BufferPayloadType::File)
629 {
630 entryString = "File";
631 }
632 else if (entry == BufferPayloadType::Chunk)
633 {
634 entryString = "Chunk";
635 }
636 else if (entry == BufferPayloadType::JPEG)
637 {
638 entryString = "JPEG";
639 }
640 else if (entry == BufferPayloadType::JPEG2000)
641 {
642 entryString = "JPEG2000";
643 }
644 else if (entry == BufferPayloadType::H264)
645 {
646 entryString = "H264";
647 }
648 else if (entry == BufferPayloadType::ChunkOnly)
649 {
650 entryString = "ChunkOnly";
651 }
652 else if (entry == BufferPayloadType::DeviceSpecific)
653 {
654 entryString = "DeviceSpecific";
655 }
656 else if (entry == BufferPayloadType::MultiPart)
657 {
658 entryString = "MultiPart";
659 }
660 else if (entry >= BufferPayloadType::Custom)
661 {
662 entryString = "Custom";
663 }
664
665 return entryString;
666}
667
668inline std::string ToString(PixelFormatNamespace entry)
669{
670 std::string entryString;
671
672 if (entry == PixelFormatNamespace::GEV)
673 {
674 entryString = "GEV";
675 }
676 else if (entry == PixelFormatNamespace::IIDC)
677 {
678 entryString = "IIDC";
679 }
680 else if (entry == PixelFormatNamespace::PFNC16Bit)
681 {
682 entryString = "PFNC16Bit";
683 }
684 else if (entry == PixelFormatNamespace::PFNC32Bit)
685 {
686 entryString = "PFNC32Bit";
687 }
688 else if (entry >= PixelFormatNamespace::Custom)
689 {
690 entryString = "Custom";
691 }
692
693 return entryString;
694}
695
696inline Buffer::Buffer(PEAK_BUFFER_HANDLE bufferHandle, const std::weak_ptr<DataStream>& parentDataStream)
697 : m_backendHandle(bufferHandle)
698 , m_parentDataStream(parentDataStream)
699{}
700
702{
703 return ImageView(shared_from_this());
704}
705
707{
708 return ImageView(shared_from_this(), mode);
709}
710
711
712inline RawInformation Buffer::Info(int32_t infoCommand) const
713{
714 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
715 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetInfo(m_backendHandle, infoCommand, dataType, buffer, bufferSize);
716 });
717}
718
719inline std::string Buffer::TLType() const
720{
721 return QueryStringFromCInterfaceFunction([&](char* tlType, size_t* tlTypeSize) {
722 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTLType(m_backendHandle, tlType, tlTypeSize);
723 });
724}
725
726inline void* Buffer::BasePtr() const
727{
728 return QueryNumericFromCInterfaceFunction<void*>(
729 [&](void** basePtr) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetBasePtr(m_backendHandle, basePtr); });
730}
731
732inline size_t Buffer::Size() const
733{
734 return QueryNumericFromCInterfaceFunction<size_t>(
735 [&](size_t* size) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetSize(m_backendHandle, size); });
736}
737
738inline void* Buffer::UserPtr() const
739{
740 return QueryNumericFromCInterfaceFunction<void*>(
741 [&](void** userPtr) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetUserPtr(m_backendHandle, userPtr); });
742}
743
745{
746 return static_cast<BufferPayloadType>(
747 QueryNumericFromCInterfaceFunction<PEAK_BUFFER_PAYLOAD_TYPE>([&](PEAK_BUFFER_PAYLOAD_TYPE* payloadType) {
748 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPayloadType(m_backendHandle, payloadType);
749 }));
750}
751
752inline uint64_t Buffer::PixelFormat() const
753{
754 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* pixelFormat) {
755 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPixelFormat(m_backendHandle, pixelFormat);
756 });
757}
758
760{
761 return static_cast<peak::core::PixelFormatNamespace>(
762 QueryNumericFromCInterfaceFunction<PEAK_PIXEL_FORMAT_NAMESPACE>(
763 [&](PEAK_PIXEL_FORMAT_NAMESPACE* pixelFormatNamespace) {
765 m_backendHandle, pixelFormatNamespace);
766 }));
767}
768
770{
771 return static_cast<Endianness>(
772 QueryNumericFromCInterfaceFunction<PEAK_ENDIANNESS>([&](PEAK_ENDIANNESS* pixelEndianness) {
773 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPixelEndianness(m_backendHandle, pixelEndianness);
774 }));
775}
776
777inline size_t Buffer::ExpectedDataSize() const
778{
779 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* expectedDataSize) {
780 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetExpectedDataSize(m_backendHandle, expectedDataSize);
781 });
782}
783
784inline size_t Buffer::DeliveredDataSize() const
785{
786 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredDataSize) {
787 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetDeliveredDataSize(m_backendHandle, deliveredDataSize);
788 });
789}
790
791inline uint64_t Buffer::FrameID() const
792{
793 return QueryNumericFromCInterfaceFunction<uint64_t>(
794 [&](uint64_t* frameId) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetFrameID(m_backendHandle, frameId); });
795}
796
797inline size_t Buffer::ImageOffset() const
798{
799 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* imageOffset) {
800 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetImageOffset(m_backendHandle, imageOffset);
801 });
802}
803
804inline size_t Buffer::DeliveredImageHeight() const
805{
806 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredImageHeight) {
807 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetDeliveredImageHeight(m_backendHandle, deliveredImageHeight);
808 });
809}
810
812{
813 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredChunkPayloadSize) {
815 m_backendHandle, deliveredChunkPayloadSize);
816 });
817}
818
819inline uint64_t Buffer::ChunkLayoutID() const
820{
821 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* chunkLayoutId) {
822 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetChunkLayoutID(m_backendHandle, chunkLayoutId);
823 });
824}
825
826inline std::string Buffer::FileName() const
827{
828 return QueryStringFromCInterfaceFunction([&](char* fileName, size_t* fileNameSize) {
829 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetFileName(m_backendHandle, fileName, fileNameSize);
830 });
831}
832
833inline size_t Buffer::Width() const
834{
835 return QueryNumericFromCInterfaceFunction<size_t>(
836 [&](size_t* width) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetWidth(m_backendHandle, width); });
837}
838
839inline size_t Buffer::Height() const
840{
841 return QueryNumericFromCInterfaceFunction<size_t>(
842 [&](size_t* height) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHeight(m_backendHandle, height); });
843}
844
845inline size_t Buffer::XOffset() const
846{
847 return QueryNumericFromCInterfaceFunction<size_t>(
848 [&](size_t* xOffset) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetXOffset(m_backendHandle, xOffset); });
849}
850
851inline size_t Buffer::YOffset() const
852{
853 return QueryNumericFromCInterfaceFunction<size_t>(
854 [&](size_t* yOffset) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetYOffset(m_backendHandle, yOffset); });
855}
856
857inline size_t Buffer::XPadding() const
858{
859 return QueryNumericFromCInterfaceFunction<size_t>(
860 [&](size_t* xPadding) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetXPadding(m_backendHandle, xPadding); });
861}
862
863inline size_t Buffer::YPadding() const
864{
865 return QueryNumericFromCInterfaceFunction<size_t>(
866 [&](size_t* yPadding) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetYPadding(m_backendHandle, yPadding); });
867}
868
869inline uint64_t Buffer::Timestamp_ticks() const
870{
871 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestamp_ticks) {
872 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTimestamp_ticks(m_backendHandle, timestamp_ticks);
873 });
874}
875
876inline uint64_t Buffer::Timestamp_ns() const
877{
878 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestamp_ns) {
879 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTimestamp_ns(m_backendHandle, timestamp_ns);
880 });
881}
882
883inline bool Buffer::IsQueued() const
884{
885 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isQueued) {
886 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsQueued(m_backendHandle, isQueued);
887 }) > 0;
888}
889
890inline bool Buffer::IsAcquiring() const
891{
892 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAcquiring) {
893 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsAcquiring(m_backendHandle, isAcquiring);
894 }) > 0;
895}
896
897inline bool Buffer::IsIncomplete() const
898{
899 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isIncomplete) {
900 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsIncomplete(m_backendHandle, isIncomplete);
901 }) > 0;
902}
903
904inline bool Buffer::HasNewData() const
905{
906 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasNewData) {
907 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasNewData(m_backendHandle, hasNewData);
908 }) > 0;
909}
910
911inline bool Buffer::HasImage() const
912{
913 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasImage) {
914 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasImage(m_backendHandle, hasImage);
915 }) > 0;
916}
917
918inline bool Buffer::HasChunks() const
919{
920 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasChunks) {
921 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasChunks(m_backendHandle, hasChunks);
922 }) > 0;
923}
924
925inline bool Buffer::HasParts() const
926{
927 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasParts) {
928 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasParts(m_backendHandle, hasParts);
929 }) > 0;
930}
931
932inline uint64_t Buffer::SystemTimestamp_ns() const
933{
934 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* systemTimestamp_ns) {
935 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetSystemTimestamp_ns(m_backendHandle, systemTimestamp_ns);
936 });
937}
938
939inline std::vector<std::shared_ptr<BufferChunk>> Buffer::Chunks()
940{
941 CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_Buffer_UpdateChunks(m_backendHandle); });
942
943 auto numChunks = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numChunks) {
944 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetNumChunks(m_backendHandle, _numChunks);
945 });
946
947 std::vector<std::shared_ptr<BufferChunk>> chunks;
948 for (size_t x = 0; x < numChunks; ++x)
949 {
950 auto bufferChunkHandle = QueryNumericFromCInterfaceFunction<PEAK_BUFFER_CHUNK_HANDLE>(
951 [&](PEAK_BUFFER_CHUNK_HANDLE* _bufferChunkHandle) {
952 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetChunk(m_backendHandle, x, _bufferChunkHandle);
953 });
954
955 chunks.emplace_back(std::make_shared<ClassCreator<BufferChunk>>(bufferChunkHandle, shared_from_this()));
956 }
957
958 return chunks;
959}
960
961inline std::vector<std::shared_ptr<BufferPart>> Buffer::Parts()
962{
963 CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_Buffer_UpdateParts(m_backendHandle); });
964
965 auto numParts = QueryNumericFromCInterfaceFunction<size_t>(
966 [&](size_t* _numParts) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetNumParts(m_backendHandle, _numParts); });
967
968 std::vector<std::shared_ptr<BufferPart>> parts;
969 for (size_t x = 0; x < numParts; ++x)
970 {
971 auto bufferPartHandle = QueryNumericFromCInterfaceFunction<PEAK_BUFFER_PART_HANDLE>(
972 [&](PEAK_BUFFER_PART_HANDLE* _bufferPartHandle) {
973 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPart(m_backendHandle, x, _bufferPartHandle);
974 });
975
976 parts.emplace_back(std::make_shared<ClassCreator<BufferPart>>(bufferPartHandle, shared_from_this()));
977 }
978
979 return parts;
980}
981
982inline std::shared_ptr<DataStream> Buffer::ParentDataStream() const
983{
984 return LockOrThrow(m_parentDataStream);
985}
986
987inline PEAK_MODULE_HANDLE Buffer::ModuleHandle() const
988{
989 auto moduleHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_HANDLE>(
990 [&](PEAK_MODULE_HANDLE* _moduleHandle) {
991 return PEAK_C_ABI_PREFIX PEAK_Buffer_ToModule(m_backendHandle, _moduleHandle);
992 });
993
994 return moduleHandle;
995}
996
997inline PEAK_EVENT_SUPPORTING_MODULE_HANDLE Buffer::EventSupportingModuleHandle() const
998{
999 auto eventSupportingModuleHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_SUPPORTING_MODULE_HANDLE>(
1000 [&](PEAK_EVENT_SUPPORTING_MODULE_HANDLE* _eventSupportingModuleHandle) {
1002 m_backendHandle, _eventSupportingModuleHandle);
1003 });
1004
1005 return eventSupportingModuleHandle;
1006}
1007
1008inline void Buffer::Revoke()
1009{
1010 m_parentDataStream.reset();
1011}
1012
1013inline bool NodeMap::HasBufferSupportedChunks(const std::shared_ptr<Buffer>& buffer) const
1014{
1015 if (buffer == nullptr)
1016 {
1017 throw InvalidArgumentException("The given buffer is a nullptr!");
1018 }
1019
1020 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasSupportedChunks) {
1022 m_backendHandle, buffer->m_backendHandle, hasSupportedChunks);
1023 }) > 0;
1024}
1025
1026inline void NodeMap::UpdateChunkNodes(const std::shared_ptr<Buffer>& buffer)
1027{
1028 if (buffer == nullptr)
1029 {
1030 throw InvalidArgumentException("The given buffer is a nullptr!");
1031 }
1032
1033 CallAndCheckCInterfaceFunction([&] {
1034 return PEAK_C_ABI_PREFIX PEAK_NodeMap_UpdateChunkNodes(m_backendHandle, buffer->m_backendHandle);
1035 });
1036}
1037
1038} /* namespace core */
1039} /* namespace peak */
bool IsQueued() const
Checks whether the buffer is queued or not.
Definition peak_buffer.hpp:883
size_t DeliveredImageHeight() const
Returns the delivered image height.
Definition peak_buffer.hpp:804
bool IsIncomplete() const
Checks whether the buffer is incomplete or not.
Definition peak_buffer.hpp:897
Buffer & operator=(Buffer &&other)=delete
void * BasePtr() const
Returns the base pointer.
Definition peak_buffer.hpp:726
uint64_t Timestamp_ticks() const
Returns the timestamp.
Definition peak_buffer.hpp:869
bool HasParts() const
Checks whether the buffer contains parts.
Definition peak_buffer.hpp:925
Buffer(Buffer &&other)=delete
uint64_t FrameID() const
Returns the identifier of the current frame.
Definition peak_buffer.hpp:791
bool IsAcquiring() const
Checks whether the buffer is currently being filled.
Definition peak_buffer.hpp:890
peak::core::PixelFormatNamespace PixelFormatNamespace() const
Returns the pixel format namespace, to allow interpretation of the PixelFormat().
Definition peak_buffer.hpp:759
bool HasNewData() const
Checks whether the buffer has new data since the last delivery.
Definition peak_buffer.hpp:904
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:845
void * UserPtr() const
Returns the pointer to custom user data attached to the buffer.
Definition peak_buffer.hpp:738
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition peak_buffer.hpp:712
size_t Size() const
Returns the size of the buffer in bytes.
Definition peak_buffer.hpp:732
size_t XPadding() const
Returns the x padding of the data in the buffer in number of bytes.
Definition peak_buffer.hpp:857
friend class DataStream
Definition peak_buffer.hpp:600
size_t Height() const
Returns the height.
Definition peak_buffer.hpp:839
std::shared_ptr< DataStream > ParentDataStream() const
Returns the parent data stream.
Definition peak_buffer.hpp:982
size_t DeliveredDataSize() const
Returns the delivered data size.
Definition peak_buffer.hpp:784
bool HasImage() const
Checks whether the buffer contains image data.
Definition peak_buffer.hpp:911
std::vector< std::shared_ptr< BufferChunk > > Chunks()
Returns the buffer's chunks if it contains chunks.
Definition peak_buffer.hpp:939
ImageView ToImageView()
Create an ImageView from this buffer.
Definition peak_buffer.hpp:701
uint64_t PixelFormat() const
Returns the pixel format of the data.
Definition peak_buffer.hpp:752
BufferPayloadType PayloadType() const
Returns the payload type.
Definition peak_buffer.hpp:744
uint64_t ChunkLayoutID() const
Returns the chunk layout ID.
Definition peak_buffer.hpp:819
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:851
Endianness PixelEndianness() const
Returns the pixel endianness.
Definition peak_buffer.hpp:769
size_t ImageOffset() const
Returns the offset of the image data from the beginning of the delivered buffer in bytes.
Definition peak_buffer.hpp:797
std::string TLType() const
Returns the TL (transport layer) type.
Definition peak_buffer.hpp:719
uint64_t SystemTimestamp_ns() const
Returns the system timestamp corresponding to this buffer.
Definition peak_buffer.hpp:932
size_t YPadding() const
Returns the y padding of the data in the buffer in number of bytes.
Definition peak_buffer.hpp:863
size_t DeliveredChunkPayloadSize() const
Returns the delivered chunk payload size.
Definition peak_buffer.hpp:811
size_t ExpectedDataSize() const
Returns the expected data size.
Definition peak_buffer.hpp:777
std::vector< std::shared_ptr< BufferPart > > Parts()
Returns all buffer parts for multipart buffers.
Definition peak_buffer.hpp:961
~Buffer() override=default
size_t Width() const
Returns the width.
Definition peak_buffer.hpp:833
Buffer(const Buffer &other)=delete
Buffer & operator=(const Buffer &other)=delete
uint64_t Timestamp_ns() const
Returns the timestamp associated with when the image was recorded.
Definition peak_buffer.hpp:876
std::string FileName() const
Retrieves the file name.
Definition peak_buffer.hpp:826
bool HasChunks() const
Checks whether the buffer contains chunks.
Definition peak_buffer.hpp:918
virtual PEAK_EVENT_SUPPORTING_MODULE_HANDLE EventSupportingModuleHandle() const =0
Implementation of the peak::common::IImageView interface for viewing image pixel data from arbitrary ...
Definition peak_image_view.hpp:84
The exception thrown for passing an invalid argument to a function.
Definition peak_exception.hpp:116
virtual PEAK_MODULE_HANDLE ModuleHandle() const =0
void UpdateChunkNodes(const std::shared_ptr< Buffer > &buffer)
Updates chunk information in the NodeMap.
Definition peak_buffer.hpp:1026
bool HasBufferSupportedChunks(const std::shared_ptr< Buffer > &buffer) const
Checks if the Buffer contains chunks corresponding to the NodeMap.
Definition peak_buffer.hpp:1013
BufferPayloadType
Payload type of buffer.
Definition peak_buffer.hpp:43
PixelFormatNamespace
The namespace needed to interpret the pixel format value of the buffer.
Definition peak_buffer.hpp:66
@ File
Definition peak_buffer.hpp:47
@ DeviceSpecific
Definition peak_buffer.hpp:53
@ MultiPart
Definition peak_buffer.hpp:54
@ Unknown
Definition peak_buffer.hpp:44
@ Chunk
Definition peak_buffer.hpp:48
@ H264
Definition peak_buffer.hpp:51
@ Custom
Definition peak_buffer.hpp:56
@ JPEG
Definition peak_buffer.hpp:49
@ JPEG2000
Definition peak_buffer.hpp:50
@ Image
Definition peak_buffer.hpp:45
@ RawData
Definition peak_buffer.hpp:46
@ ChunkOnly
Definition peak_buffer.hpp:52
@ GEV
Definition peak_buffer.hpp:67
@ PFNC16Bit
Definition peak_buffer.hpp:69
@ Custom
Definition peak_buffer.hpp:72
@ IIDC
Definition peak_buffer.hpp:68
@ PFNC32Bit
Definition peak_buffer.hpp:70
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:34
std::string ToString(BufferPayloadType entry)
Definition peak_buffer.hpp:612
MetadataExtractionMode
Controls how metadata is extracted when constructing an ImageView.
Definition peak_image_view.hpp:52
Endianness
Endianness of pixel data in a Buffer or the data in a Port.
Definition peak_common_enums.hpp:28
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:35
PEAK_C_API PEAK_Buffer_GetHasParts(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *hasParts)
Asks the given buffer whether it has parts.
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.
PEAK_C_API PEAK_Buffer_GetHasChunks(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *hasChunks)
Asks the given buffer whether it has chunks.
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.
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_GetFrameID(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *frameId)
Asks the given buffer for its frame ID.
struct PEAK_MODULE * PEAK_MODULE_HANDLE
Definition peak_backend.h:421
PEAK_C_API PEAK_Buffer_GetSystemTimestamp_ns(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *systemTimestamp_ns)
Asks the given buffer for its system timestamp in nanoseconds.
PEAK_C_API PEAK_Buffer_GetIsIncomplete(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *isIncomplete)
Asks the given buffer whether it is incomplete.
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.
PEAK_C_API PEAK_Buffer_GetSize(PEAK_BUFFER_HANDLE bufferHandle, size_t *size)
Asks the given buffer for its size.
PEAK_C_API PEAK_Buffer_GetNumChunks(PEAK_BUFFER_HANDLE bufferHandle, size_t *numChunks)
Asks the given buffer for its number of chunks.
struct PEAK_BUFFER_CHUNK * PEAK_BUFFER_CHUNK_HANDLE
Definition peak_backend.h:409
PEAK_C_API PEAK_Buffer_GetUserPtr(PEAK_BUFFER_HANDLE bufferHandle, void **userPtr)
Asks the given buffer for its user pointer.
PEAK_C_API PEAK_Buffer_UpdateParts(PEAK_BUFFER_HANDLE bufferHandle)
Tells the given buffer to update its parts.
PEAK_C_API PEAK_Buffer_GetTimestamp_ns(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *timestamp_ns)
Asks the given buffer for its timestamp in nanoseconds.
struct PEAK_BUFFER * PEAK_BUFFER_HANDLE
Definition peak_backend.h:405
struct PEAK_EVENT_SUPPORTING_MODULE * PEAK_EVENT_SUPPORTING_MODULE_HANDLE
Definition peak_backend.h:477
PEAK_C_API PEAK_Buffer_GetTimestamp_ticks(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *timestamp_ticks)
Asks the given buffer for its timestamp in ticks.
PEAK_C_API PEAK_Buffer_GetBasePtr(PEAK_BUFFER_HANDLE bufferHandle, void **basePtr)
Asks the given buffer for its base pointer.
PEAK_C_API PEAK_Buffer_GetPixelEndianness(PEAK_BUFFER_HANDLE bufferHandle, PEAK_ENDIANNESS *pixelEndianness)
Asks the given buffer for its pixel endianness.
PEAK_C_API PEAK_Buffer_GetImageOffset(PEAK_BUFFER_HANDLE bufferHandle, size_t *imageOffset)
Asks the given buffer for its image offset.
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_GetWidth(PEAK_BUFFER_HANDLE bufferHandle, size_t *width)
Asks the given buffer for its width.
struct PEAK_BUFFER_PART * PEAK_BUFFER_PART_HANDLE
Definition peak_backend.h:413
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.
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_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.
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_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_GetDeliveredChunkPayloadSize(PEAK_BUFFER_HANDLE bufferHandle, size_t *deliveredChunkPayloadSize)
Asks the given buffer for its delivered chunk payload size.
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.
int8_t PEAK_BOOL8
Definition peak_backend.h:43
int32_t PEAK_ENDIANNESS
Definition peak_backend.h:172
PEAK_C_API PEAK_Buffer_GetHeight(PEAK_BUFFER_HANDLE bufferHandle, size_t *height)
Asks the given buffer for its height.
int32_t PEAK_PIXEL_FORMAT_NAMESPACE
Definition peak_backend.h:318
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_ToModule(PEAK_BUFFER_HANDLE bufferHandle, PEAK_MODULE_HANDLE *moduleHandle)
Casts the given buffer to a module.
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_GetDeliveredImageHeight(PEAK_BUFFER_HANDLE bufferHandle, size_t *deliveredImageHeight)
Asks the given buffer for its delivered image height.
PEAK_C_API PEAK_Buffer_GetExpectedDataSize(PEAK_BUFFER_HANDLE bufferHandle, size_t *expectedDataSize)
Asks the given buffer for its expected data size.
PEAK_C_API PEAK_Buffer_GetIsQueued(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *isQueued)
Asks the given buffer whether it is queued.
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_GetTLType(PEAK_BUFFER_HANDLE bufferHandle, char *tlType, size_t *tlTypeSize)
Asks the given buffer for its TL type.
int32_t PEAK_BUFFER_PAYLOAD_TYPE
Definition peak_backend.h:99
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_GetPixelFormat(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *pixelFormat)
Asks the given buffer for its pixel format.
PEAK_C_API PEAK_Buffer_GetHasImage(PEAK_BUFFER_HANDLE bufferHandle, PEAK_BOOL8 *hasImage)
Asks the given buffer whether it is has an image.
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_GetNumParts(PEAK_BUFFER_HANDLE bufferHandle, size_t *numParts)
Asks the given buffer for its number of parts.
PEAK_C_API PEAK_Buffer_GetChunkLayoutID(PEAK_BUFFER_HANDLE bufferHandle, uint64_t *chunkLayoutId)
Asks the given buffer for its chunk layout ID.
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:16
The struct returned by all raw information functions.
Definition peak_common_structs.hpp:25