IDS peak genericC++ v1.13.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
102
109
110 RawInformation Info(int32_t infoCommand) const;
111
113 std::string TLType() const;
114
124 void* BasePtr() const;
125
135 size_t Size() const;
136
150 void* UserPtr() const;
151
162
175 uint64_t PixelFormat() const;
176
187
198
208 size_t ExpectedDataSize() const;
209
219 size_t DeliveredDataSize() const;
220
237 uint64_t FrameID() const;
238
248 size_t ImageOffset() const;
249
259 size_t DeliveredImageHeight() const;
260
270 size_t DeliveredChunkPayloadSize() const;
271
281 uint64_t ChunkLayoutID() const;
282
300 std::string FileName() const;
301
311 size_t Width() const;
312
322 size_t Height() const;
323
334 size_t XOffset() const;
335
346 size_t YOffset() const;
347
357 size_t XPadding() const;
358
368 size_t YPadding() const;
369
379 uint64_t Timestamp_ticks() const;
380
400 uint64_t Timestamp_ns() const;
401
412 bool IsQueued() const;
413
425 bool IsAcquiring() const;
426
439 bool IsIncomplete() const;
440
451 bool HasNewData() const;
452
465 bool HasImage() const;
466
479 bool HasChunks() const;
480
493 bool HasParts() const;
494
496
508 std::vector<std::shared_ptr<BufferChunk>> Chunks();
509
519 std::vector<std::shared_ptr<BufferPart>> Parts();
520
530 std::shared_ptr<DataStream> ParentDataStream() const;
531
532private:
533 PEAK_MODULE_HANDLE ModuleHandle() const override;
535
536 void Revoke();
537
538 friend NodeMap;
539 friend ClassCreator<Buffer>;
540 Buffer(PEAK_BUFFER_HANDLE bufferHandle, const std::weak_ptr<DataStream>& parentDataStream);
541 PEAK_BUFFER_HANDLE m_backendHandle;
542
543 std::weak_ptr<DataStream> m_parentDataStream;
544
545 friend class DataStream;
546};
547
548} /* namespace core */
549} /* namespace peak */
550
551/* Implementation */
552namespace peak
553{
554namespace core
555{
556
557inline std::string ToString(BufferPayloadType entry)
558{
559 std::string entryString;
560
561 if (entry == BufferPayloadType::Unknown)
562 {
563 entryString = "Unknown";
564 }
565 else if (entry == BufferPayloadType::Image)
566 {
567 entryString = "Image";
568 }
569 else if (entry == BufferPayloadType::RawData)
570 {
571 entryString = "RawData";
572 }
573 else if (entry == BufferPayloadType::File)
574 {
575 entryString = "File";
576 }
577 else if (entry == BufferPayloadType::Chunk)
578 {
579 entryString = "Chunk";
580 }
581 else if (entry == BufferPayloadType::JPEG)
582 {
583 entryString = "JPEG";
584 }
585 else if (entry == BufferPayloadType::JPEG2000)
586 {
587 entryString = "JPEG2000";
588 }
589 else if (entry == BufferPayloadType::H264)
590 {
591 entryString = "H264";
592 }
593 else if (entry == BufferPayloadType::ChunkOnly)
594 {
595 entryString = "ChunkOnly";
596 }
597 else if (entry == BufferPayloadType::DeviceSpecific)
598 {
599 entryString = "DeviceSpecific";
600 }
601 else if (entry == BufferPayloadType::MultiPart)
602 {
603 entryString = "MultiPart";
604 }
605 else if (entry >= BufferPayloadType::Custom)
606 {
607 entryString = "Custom";
608 }
609
610 return entryString;
611}
612
613inline std::string ToString(PixelFormatNamespace entry)
614{
615 std::string entryString;
616
617 if (entry == PixelFormatNamespace::GEV)
618 {
619 entryString = "GEV";
620 }
621 else if (entry == PixelFormatNamespace::IIDC)
622 {
623 entryString = "IIDC";
624 }
625 else if (entry == PixelFormatNamespace::PFNC16Bit)
626 {
627 entryString = "PFNC16Bit";
628 }
629 else if (entry == PixelFormatNamespace::PFNC32Bit)
630 {
631 entryString = "PFNC32Bit";
632 }
633 else if (entry >= PixelFormatNamespace::Custom)
634 {
635 entryString = "Custom";
636 }
637
638 return entryString;
639}
640
641inline Buffer::Buffer(PEAK_BUFFER_HANDLE bufferHandle, const std::weak_ptr<DataStream>& parentDataStream)
642 : m_backendHandle(bufferHandle)
643 , m_parentDataStream(parentDataStream)
644{}
645
647{
648 return ImageView(shared_from_this());
649}
650
651inline RawInformation Buffer::Info(int32_t infoCommand) const
652{
653 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
654 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetInfo(m_backendHandle, infoCommand, dataType, buffer, bufferSize);
655 });
656}
657
658inline std::string Buffer::TLType() const
659{
660 return QueryStringFromCInterfaceFunction([&](char* tlType, size_t* tlTypeSize) {
661 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTLType(m_backendHandle, tlType, tlTypeSize);
662 });
663}
664
665inline void* Buffer::BasePtr() const
666{
667 return QueryNumericFromCInterfaceFunction<void*>(
668 [&](void** basePtr) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetBasePtr(m_backendHandle, basePtr); });
669}
670
671inline size_t Buffer::Size() const
672{
673 return QueryNumericFromCInterfaceFunction<size_t>(
674 [&](size_t* size) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetSize(m_backendHandle, size); });
675}
676
677inline void* Buffer::UserPtr() const
678{
679 return QueryNumericFromCInterfaceFunction<void*>(
680 [&](void** userPtr) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetUserPtr(m_backendHandle, userPtr); });
681}
682
684{
685 return static_cast<BufferPayloadType>(
686 QueryNumericFromCInterfaceFunction<PEAK_BUFFER_PAYLOAD_TYPE>([&](PEAK_BUFFER_PAYLOAD_TYPE* payloadType) {
687 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPayloadType(m_backendHandle, payloadType);
688 }));
689}
690
691inline uint64_t Buffer::PixelFormat() const
692{
693 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* pixelFormat) {
694 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPixelFormat(m_backendHandle, pixelFormat);
695 });
696}
697
699{
700 return static_cast<peak::core::PixelFormatNamespace>(
701 QueryNumericFromCInterfaceFunction<PEAK_PIXEL_FORMAT_NAMESPACE>(
702 [&](PEAK_PIXEL_FORMAT_NAMESPACE* pixelFormatNamespace) {
704 m_backendHandle, pixelFormatNamespace);
705 }));
706}
707
709{
710 return static_cast<Endianness>(
711 QueryNumericFromCInterfaceFunction<PEAK_ENDIANNESS>([&](PEAK_ENDIANNESS* pixelEndianness) {
712 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPixelEndianness(m_backendHandle, pixelEndianness);
713 }));
714}
715
716inline size_t Buffer::ExpectedDataSize() const
717{
718 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* expectedDataSize) {
719 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetExpectedDataSize(m_backendHandle, expectedDataSize);
720 });
721}
722
723inline size_t Buffer::DeliveredDataSize() const
724{
725 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredDataSize) {
726 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetDeliveredDataSize(m_backendHandle, deliveredDataSize);
727 });
728}
729
730inline uint64_t Buffer::FrameID() const
731{
732 return QueryNumericFromCInterfaceFunction<uint64_t>(
733 [&](uint64_t* frameId) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetFrameID(m_backendHandle, frameId); });
734}
735
736inline size_t Buffer::ImageOffset() const
737{
738 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* imageOffset) {
739 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetImageOffset(m_backendHandle, imageOffset);
740 });
741}
742
743inline size_t Buffer::DeliveredImageHeight() const
744{
745 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredImageHeight) {
746 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetDeliveredImageHeight(m_backendHandle, deliveredImageHeight);
747 });
748}
749
751{
752 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredChunkPayloadSize) {
754 m_backendHandle, deliveredChunkPayloadSize);
755 });
756}
757
758inline uint64_t Buffer::ChunkLayoutID() const
759{
760 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* chunkLayoutId) {
761 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetChunkLayoutID(m_backendHandle, chunkLayoutId);
762 });
763}
764
765inline std::string Buffer::FileName() const
766{
767 return QueryStringFromCInterfaceFunction([&](char* fileName, size_t* fileNameSize) {
768 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetFileName(m_backendHandle, fileName, fileNameSize);
769 });
770}
771
772inline size_t Buffer::Width() const
773{
774 return QueryNumericFromCInterfaceFunction<size_t>(
775 [&](size_t* width) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetWidth(m_backendHandle, width); });
776}
777
778inline size_t Buffer::Height() const
779{
780 return QueryNumericFromCInterfaceFunction<size_t>(
781 [&](size_t* height) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHeight(m_backendHandle, height); });
782}
783
784inline size_t Buffer::XOffset() const
785{
786 return QueryNumericFromCInterfaceFunction<size_t>(
787 [&](size_t* xOffset) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetXOffset(m_backendHandle, xOffset); });
788}
789
790inline size_t Buffer::YOffset() const
791{
792 return QueryNumericFromCInterfaceFunction<size_t>(
793 [&](size_t* yOffset) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetYOffset(m_backendHandle, yOffset); });
794}
795
796inline size_t Buffer::XPadding() const
797{
798 return QueryNumericFromCInterfaceFunction<size_t>(
799 [&](size_t* xPadding) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetXPadding(m_backendHandle, xPadding); });
800}
801
802inline size_t Buffer::YPadding() const
803{
804 return QueryNumericFromCInterfaceFunction<size_t>(
805 [&](size_t* yPadding) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetYPadding(m_backendHandle, yPadding); });
806}
807
808inline uint64_t Buffer::Timestamp_ticks() const
809{
810 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestamp_ticks) {
811 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTimestamp_ticks(m_backendHandle, timestamp_ticks);
812 });
813}
814
815inline uint64_t Buffer::Timestamp_ns() const
816{
817 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestamp_ns) {
818 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTimestamp_ns(m_backendHandle, timestamp_ns);
819 });
820}
821
822inline bool Buffer::IsQueued() const
823{
824 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isQueued) {
825 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsQueued(m_backendHandle, isQueued);
826 }) > 0;
827}
828
829inline bool Buffer::IsAcquiring() const
830{
831 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAcquiring) {
832 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsAcquiring(m_backendHandle, isAcquiring);
833 }) > 0;
834}
835
836inline bool Buffer::IsIncomplete() const
837{
838 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isIncomplete) {
839 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsIncomplete(m_backendHandle, isIncomplete);
840 }) > 0;
841}
842
843inline bool Buffer::HasNewData() const
844{
845 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasNewData) {
846 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasNewData(m_backendHandle, hasNewData);
847 }) > 0;
848}
849
850inline bool Buffer::HasImage() const
851{
852 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasImage) {
853 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasImage(m_backendHandle, hasImage);
854 }) > 0;
855}
856
857inline bool Buffer::HasChunks() const
858{
859 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasChunks) {
860 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasChunks(m_backendHandle, hasChunks);
861 }) > 0;
862}
863
864inline bool Buffer::HasParts() const
865{
866 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasParts) {
867 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasParts(m_backendHandle, hasParts);
868 }) > 0;
869}
870
871inline std::vector<std::shared_ptr<BufferChunk>> Buffer::Chunks()
872{
873 CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_Buffer_UpdateChunks(m_backendHandle); });
874
875 auto numChunks = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numChunks) {
876 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetNumChunks(m_backendHandle, _numChunks);
877 });
878
879 std::vector<std::shared_ptr<BufferChunk>> chunks;
880 for (size_t x = 0; x < numChunks; ++x)
881 {
882 auto bufferChunkHandle = QueryNumericFromCInterfaceFunction<PEAK_BUFFER_CHUNK_HANDLE>(
883 [&](PEAK_BUFFER_CHUNK_HANDLE* _bufferChunkHandle) {
884 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetChunk(m_backendHandle, x, _bufferChunkHandle);
885 });
886
887 chunks.emplace_back(std::make_shared<ClassCreator<BufferChunk>>(bufferChunkHandle, shared_from_this()));
888 }
889
890 return chunks;
891}
892
893inline std::vector<std::shared_ptr<BufferPart>> Buffer::Parts()
894{
895 CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_Buffer_UpdateParts(m_backendHandle); });
896
897 auto numParts = QueryNumericFromCInterfaceFunction<size_t>(
898 [&](size_t* _numParts) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetNumParts(m_backendHandle, _numParts); });
899
900 std::vector<std::shared_ptr<BufferPart>> parts;
901 for (size_t x = 0; x < numParts; ++x)
902 {
903 auto bufferPartHandle = QueryNumericFromCInterfaceFunction<PEAK_BUFFER_PART_HANDLE>(
904 [&](PEAK_BUFFER_PART_HANDLE* _bufferPartHandle) {
905 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPart(m_backendHandle, x, _bufferPartHandle);
906 });
907
908 parts.emplace_back(std::make_shared<ClassCreator<BufferPart>>(bufferPartHandle, shared_from_this()));
909 }
910
911 return parts;
912}
913
914inline std::shared_ptr<DataStream> Buffer::ParentDataStream() const
915{
916 return LockOrThrow(m_parentDataStream);
917}
918
919inline PEAK_MODULE_HANDLE Buffer::ModuleHandle() const
920{
921 auto moduleHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_HANDLE>(
922 [&](PEAK_MODULE_HANDLE* _moduleHandle) {
923 return PEAK_C_ABI_PREFIX PEAK_Buffer_ToModule(m_backendHandle, _moduleHandle);
924 });
925
926 return moduleHandle;
927}
928
929inline PEAK_EVENT_SUPPORTING_MODULE_HANDLE Buffer::EventSupportingModuleHandle() const
930{
931 auto eventSupportingModuleHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_SUPPORTING_MODULE_HANDLE>(
932 [&](PEAK_EVENT_SUPPORTING_MODULE_HANDLE* _eventSupportingModuleHandle) {
934 m_backendHandle, _eventSupportingModuleHandle);
935 });
936
937 return eventSupportingModuleHandle;
938}
939
940inline void Buffer::Revoke()
941{
942 m_parentDataStream.reset();
943}
944
945inline bool NodeMap::HasBufferSupportedChunks(const std::shared_ptr<Buffer>& buffer) const
946{
947 if (buffer == nullptr)
948 {
949 throw InvalidArgumentException("The given buffer is a nullptr!");
950 }
951
952 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasSupportedChunks) {
954 m_backendHandle, buffer->m_backendHandle, hasSupportedChunks);
955 }) > 0;
956}
957
958inline void NodeMap::UpdateChunkNodes(const std::shared_ptr<Buffer>& buffer)
959{
960 if (buffer == nullptr)
961 {
962 throw InvalidArgumentException("The given buffer is a nullptr!");
963 }
964
965 CallAndCheckCInterfaceFunction([&] {
966 return PEAK_C_ABI_PREFIX PEAK_NodeMap_UpdateChunkNodes(m_backendHandle, buffer->m_backendHandle);
967 });
968}
969
970} /* namespace core */
971} /* namespace peak */
bool IsQueued() const
Checks whether the buffer is queued or not.
Definition peak_buffer.hpp:822
size_t DeliveredImageHeight() const
Returns the delivered image height.
Definition peak_buffer.hpp:743
bool IsIncomplete() const
Checks whether the buffer is incomplete or not.
Definition peak_buffer.hpp:836
Buffer & operator=(Buffer &&other)=delete
void * BasePtr() const
Returns the base pointer.
Definition peak_buffer.hpp:665
uint64_t Timestamp_ticks() const
Returns the timestamp.
Definition peak_buffer.hpp:808
bool HasParts() const
Checks whether the buffer contains parts.
Definition peak_buffer.hpp:864
Buffer(Buffer &&other)=delete
uint64_t FrameID() const
Returns the identifier of the current frame.
Definition peak_buffer.hpp:730
bool IsAcquiring() const
Checks whether the buffer is currently being filled.
Definition peak_buffer.hpp:829
peak::core::PixelFormatNamespace PixelFormatNamespace() const
Returns the pixel format namespace, to allow interpretation of the PixelFormat().
Definition peak_buffer.hpp:698
bool HasNewData() const
Checks whether the buffer has new data since the last delivery.
Definition peak_buffer.hpp:843
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:784
void * UserPtr() const
Returns the pointer to custom user data attached to the buffer.
Definition peak_buffer.hpp:677
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition peak_buffer.hpp:651
size_t Size() const
Returns the size of the buffer in bytes.
Definition peak_buffer.hpp:671
size_t XPadding() const
Returns the x padding of the data in the buffer in number of bytes.
Definition peak_buffer.hpp:796
friend class DataStream
Definition peak_buffer.hpp:545
size_t Height() const
Returns the height.
Definition peak_buffer.hpp:778
std::shared_ptr< DataStream > ParentDataStream() const
Returns the parent data stream.
Definition peak_buffer.hpp:914
size_t DeliveredDataSize() const
Returns the delivered data size.
Definition peak_buffer.hpp:723
bool HasImage() const
Checks whether the buffer contains image data.
Definition peak_buffer.hpp:850
std::vector< std::shared_ptr< BufferChunk > > Chunks()
Returns the buffer's chunks if it contains chunks.
Definition peak_buffer.hpp:871
ImageView ToImageView()
Create an ImageView object from this buffer.
Definition peak_buffer.hpp:646
uint64_t PixelFormat() const
Returns the pixel format of the data.
Definition peak_buffer.hpp:691
BufferPayloadType PayloadType() const
Returns the payload type.
Definition peak_buffer.hpp:683
uint64_t ChunkLayoutID() const
Returns the chunk layout ID.
Definition peak_buffer.hpp:758
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:790
Endianness PixelEndianness() const
Returns the pixel endianness.
Definition peak_buffer.hpp:708
size_t ImageOffset() const
Returns the offset of the image data from the beginning of the delivered buffer in bytes.
Definition peak_buffer.hpp:736
std::string TLType() const
Returns the TL (transport layer) type.
Definition peak_buffer.hpp:658
size_t YPadding() const
Returns the y padding of the data in the buffer in number of bytes.
Definition peak_buffer.hpp:802
size_t DeliveredChunkPayloadSize() const
Returns the delivered chunk payload size.
Definition peak_buffer.hpp:750
size_t ExpectedDataSize() const
Returns the expected data size.
Definition peak_buffer.hpp:716
std::vector< std::shared_ptr< BufferPart > > Parts()
Returns all buffer parts for multipart buffers.
Definition peak_buffer.hpp:893
~Buffer() override=default
size_t Width() const
Returns the width.
Definition peak_buffer.hpp:772
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:815
std::string FileName() const
Retrieves the file name.
Definition peak_buffer.hpp:765
bool HasChunks() const
Checks whether the buffer contains chunks.
Definition peak_buffer.hpp:857
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:55
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:958
bool HasBufferSupportedChunks(const std::shared_ptr< Buffer > &buffer) const
Checks if the Buffer contains chunks corresponding to the NodeMap.
Definition peak_buffer.hpp:945
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:557
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:33
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_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