IDS peak genericC++ v1.9.0
Loading...
Searching...
No Matches
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
28namespace peak
29{
30namespace core
31{
32
39{
40 Unknown,
41 Image,
42 RawData,
43 File,
44 Chunk,
45 JPEG,
47 H264,
51
52 Custom = 1000
53};
54
61{
62 GEV = 1,
63 IIDC,
66
67 Custom = 1000
68};
69
70class DataStream;
71class NodeMap;
72
78class Buffer
80 , public std::enable_shared_from_this<Buffer>
81{
82public:
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
96
97 RawInformation Info(int32_t infoCommand) const;
98
100 std::string TLType() const;
101
111 void* BasePtr() const;
112
122 size_t Size() const;
123
137 void* UserPtr() const;
138
149
162 uint64_t PixelFormat() const;
163
174
185
195 size_t ExpectedDataSize() const;
196
206 size_t DeliveredDataSize() const;
207
217 uint64_t FrameID() const;
218
228 size_t ImageOffset() const;
229
239 size_t DeliveredImageHeight() const;
240
250 size_t DeliveredChunkPayloadSize() const;
251
261 uint64_t ChunkLayoutID() const;
262
272 std::string FileName() const;
273
283 size_t Width() const;
284
294 size_t Height() const;
295
306 size_t XOffset() const;
307
318 size_t YOffset() const;
319
329 size_t XPadding() const;
330
340 size_t YPadding() const;
341
351 uint64_t Timestamp_ticks() const;
352
362 uint64_t Timestamp_ns() const;
363
374 bool IsQueued() const;
375
387 bool IsAcquiring() const;
388
401 bool IsIncomplete() const;
402
413 bool HasNewData() const;
414
427 bool HasImage() const;
428
441 bool HasChunks() const;
442
455 bool HasParts() const;
456
458
470 std::vector<std::shared_ptr<BufferChunk>> Chunks();
471
481 std::vector<std::shared_ptr<BufferPart>> Parts();
482
492 std::shared_ptr<DataStream> ParentDataStream() const;
493
494private:
495 PEAK_MODULE_HANDLE ModuleHandle() const override;
496 PEAK_EVENT_SUPPORTING_MODULE_HANDLE EventSupportingModuleHandle() const override;
497
498 void Revoke();
499
500 friend NodeMap;
501 friend ClassCreator<Buffer>;
502 Buffer(PEAK_BUFFER_HANDLE bufferHandle, const std::weak_ptr<DataStream>& parentDataStream);
503 PEAK_BUFFER_HANDLE m_backendHandle;
504
505 std::weak_ptr<DataStream> m_parentDataStream;
506
507 friend class DataStream;
508};
509
510} /* namespace core */
511} /* namespace peak */
512
513/* Implementation */
514namespace peak
515{
516namespace core
517{
518
519inline std::string ToString(BufferPayloadType entry)
520{
521 std::string entryString;
522
523 if (entry == BufferPayloadType::Unknown)
524 {
525 entryString = "Unknown";
526 }
527 else if (entry == BufferPayloadType::Image)
528 {
529 entryString = "Image";
530 }
531 else if (entry == BufferPayloadType::RawData)
532 {
533 entryString = "RawData";
534 }
535 else if (entry == BufferPayloadType::File)
536 {
537 entryString = "File";
538 }
539 else if (entry == BufferPayloadType::Chunk)
540 {
541 entryString = "Chunk";
542 }
543 else if (entry == BufferPayloadType::JPEG)
544 {
545 entryString = "JPEG";
546 }
547 else if (entry == BufferPayloadType::JPEG2000)
548 {
549 entryString = "JPEG2000";
550 }
551 else if (entry == BufferPayloadType::H264)
552 {
553 entryString = "H264";
554 }
555 else if (entry == BufferPayloadType::ChunkOnly)
556 {
557 entryString = "ChunkOnly";
558 }
559 else if (entry == BufferPayloadType::DeviceSpecific)
560 {
561 entryString = "DeviceSpecific";
562 }
563 else if (entry == BufferPayloadType::MultiPart)
564 {
565 entryString = "MultiPart";
566 }
567 else if (entry >= BufferPayloadType::Custom)
568 {
569 entryString = "Custom";
570 }
571
572 return entryString;
573}
574
575inline std::string ToString(PixelFormatNamespace entry)
576{
577 std::string entryString;
578
579 if (entry == PixelFormatNamespace::GEV)
580 {
581 entryString = "GEV";
582 }
583 else if (entry == PixelFormatNamespace::IIDC)
584 {
585 entryString = "IIDC";
586 }
587 else if (entry == PixelFormatNamespace::PFNC16Bit)
588 {
589 entryString = "PFNC16Bit";
590 }
591 else if (entry == PixelFormatNamespace::PFNC32Bit)
592 {
593 entryString = "PFNC32Bit";
594 }
595 else if (entry >= PixelFormatNamespace::Custom)
596 {
597 entryString = "Custom";
598 }
599
600 return entryString;
601}
602
603inline Buffer::Buffer(PEAK_BUFFER_HANDLE bufferHandle, const std::weak_ptr<DataStream>& parentDataStream)
604 : m_backendHandle(bufferHandle)
605 , m_parentDataStream(parentDataStream)
606{}
607
608inline RawInformation Buffer::Info(int32_t infoCommand) const
609{
610 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
611 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetInfo(m_backendHandle, infoCommand, dataType, buffer, bufferSize);
612 });
613}
614
615inline std::string Buffer::TLType() const
616{
617 return QueryStringFromCInterfaceFunction([&](char* tlType, size_t* tlTypeSize) {
618 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTLType(m_backendHandle, tlType, tlTypeSize);
619 });
620}
621
622inline void* Buffer::BasePtr() const
623{
624 return QueryNumericFromCInterfaceFunction<void*>(
625 [&](void** basePtr) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetBasePtr(m_backendHandle, basePtr); });
626}
627
628inline size_t Buffer::Size() const
629{
630 return QueryNumericFromCInterfaceFunction<size_t>(
631 [&](size_t* size) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetSize(m_backendHandle, size); });
632}
633
634inline void* Buffer::UserPtr() const
635{
636 return QueryNumericFromCInterfaceFunction<void*>(
637 [&](void** userPtr) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetUserPtr(m_backendHandle, userPtr); });
638}
639
641{
642 return static_cast<BufferPayloadType>(
643 QueryNumericFromCInterfaceFunction<PEAK_BUFFER_PAYLOAD_TYPE>([&](PEAK_BUFFER_PAYLOAD_TYPE* payloadType) {
644 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPayloadType(m_backendHandle, payloadType);
645 }));
646}
647
648inline uint64_t Buffer::PixelFormat() const
649{
650 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* pixelFormat) {
651 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPixelFormat(m_backendHandle, pixelFormat);
652 });
653}
654
656{
657 return static_cast<peak::core::PixelFormatNamespace>(
658 QueryNumericFromCInterfaceFunction<PEAK_PIXEL_FORMAT_NAMESPACE>(
659 [&](PEAK_PIXEL_FORMAT_NAMESPACE* pixelFormatNamespace) {
661 m_backendHandle, pixelFormatNamespace);
662 }));
663}
664
666{
667 return static_cast<Endianness>(
668 QueryNumericFromCInterfaceFunction<PEAK_ENDIANNESS>([&](PEAK_ENDIANNESS* pixelEndianness) {
669 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPixelEndianness(m_backendHandle, pixelEndianness);
670 }));
671}
672
673inline size_t Buffer::ExpectedDataSize() const
674{
675 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* expectedDataSize) {
676 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetExpectedDataSize(m_backendHandle, expectedDataSize);
677 });
678}
679
680inline size_t Buffer::DeliveredDataSize() const
681{
682 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredDataSize) {
683 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetDeliveredDataSize(m_backendHandle, deliveredDataSize);
684 });
685}
686
687inline uint64_t Buffer::FrameID() const
688{
689 return QueryNumericFromCInterfaceFunction<uint64_t>(
690 [&](uint64_t* frameId) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetFrameID(m_backendHandle, frameId); });
691}
692
693inline size_t Buffer::ImageOffset() const
694{
695 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* imageOffset) {
696 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetImageOffset(m_backendHandle, imageOffset);
697 });
698}
699
700inline size_t Buffer::DeliveredImageHeight() const
701{
702 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredImageHeight) {
703 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetDeliveredImageHeight(m_backendHandle, deliveredImageHeight);
704 });
705}
706
708{
709 return QueryNumericFromCInterfaceFunction<size_t>([&](size_t* deliveredChunkPayloadSize) {
711 m_backendHandle, deliveredChunkPayloadSize);
712 });
713}
714
715inline uint64_t Buffer::ChunkLayoutID() const
716{
717 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* chunkLayoutId) {
718 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetChunkLayoutID(m_backendHandle, chunkLayoutId);
719 });
720}
721
722inline std::string Buffer::FileName() const
723{
724 return QueryStringFromCInterfaceFunction([&](char* fileName, size_t* fileNameSize) {
725 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetFileName(m_backendHandle, fileName, fileNameSize);
726 });
727}
728
729inline size_t Buffer::Width() const
730{
731 return QueryNumericFromCInterfaceFunction<size_t>(
732 [&](size_t* width) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetWidth(m_backendHandle, width); });
733}
734
735inline size_t Buffer::Height() const
736{
737 return QueryNumericFromCInterfaceFunction<size_t>(
738 [&](size_t* height) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHeight(m_backendHandle, height); });
739}
740
741inline size_t Buffer::XOffset() const
742{
743 return QueryNumericFromCInterfaceFunction<size_t>(
744 [&](size_t* xOffset) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetXOffset(m_backendHandle, xOffset); });
745}
746
747inline size_t Buffer::YOffset() const
748{
749 return QueryNumericFromCInterfaceFunction<size_t>(
750 [&](size_t* yOffset) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetYOffset(m_backendHandle, yOffset); });
751}
752
753inline size_t Buffer::XPadding() const
754{
755 return QueryNumericFromCInterfaceFunction<size_t>(
756 [&](size_t* xPadding) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetXPadding(m_backendHandle, xPadding); });
757}
758
759inline size_t Buffer::YPadding() const
760{
761 return QueryNumericFromCInterfaceFunction<size_t>(
762 [&](size_t* yPadding) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetYPadding(m_backendHandle, yPadding); });
763}
764
765inline uint64_t Buffer::Timestamp_ticks() const
766{
767 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestamp_ticks) {
768 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTimestamp_ticks(m_backendHandle, timestamp_ticks);
769 });
770}
771
772inline uint64_t Buffer::Timestamp_ns() const
773{
774 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestamp_ns) {
775 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetTimestamp_ns(m_backendHandle, timestamp_ns);
776 });
777}
778
779inline bool Buffer::IsQueued() const
780{
781 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isQueued) {
782 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsQueued(m_backendHandle, isQueued);
783 }) > 0;
784}
785
786inline bool Buffer::IsAcquiring() const
787{
788 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAcquiring) {
789 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsAcquiring(m_backendHandle, isAcquiring);
790 }) > 0;
791}
792
793inline bool Buffer::IsIncomplete() const
794{
795 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isIncomplete) {
796 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetIsIncomplete(m_backendHandle, isIncomplete);
797 }) > 0;
798}
799
800inline bool Buffer::HasNewData() const
801{
802 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasNewData) {
803 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasNewData(m_backendHandle, hasNewData);
804 }) > 0;
805}
806
807inline bool Buffer::HasImage() const
808{
809 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasImage) {
810 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasImage(m_backendHandle, hasImage);
811 }) > 0;
812}
813
814inline bool Buffer::HasChunks() const
815{
816 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasChunks) {
817 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasChunks(m_backendHandle, hasChunks);
818 }) > 0;
819}
820
821inline bool Buffer::HasParts() const
822{
823 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasParts) {
824 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetHasParts(m_backendHandle, hasParts);
825 }) > 0;
826}
827
828inline std::vector<std::shared_ptr<BufferChunk>> Buffer::Chunks()
829{
830 CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_Buffer_UpdateChunks(m_backendHandle); });
831
832 auto numChunks = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numChunks) {
833 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetNumChunks(m_backendHandle, _numChunks);
834 });
835
836 std::vector<std::shared_ptr<BufferChunk>> chunks;
837 for (size_t x = 0; x < numChunks; ++x)
838 {
839 auto bufferChunkHandle = QueryNumericFromCInterfaceFunction<PEAK_BUFFER_CHUNK_HANDLE>(
840 [&](PEAK_BUFFER_CHUNK_HANDLE* _bufferChunkHandle) {
841 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetChunk(m_backendHandle, x, _bufferChunkHandle);
842 });
843
844 chunks.emplace_back(std::make_shared<ClassCreator<BufferChunk>>(bufferChunkHandle, shared_from_this()));
845 }
846
847 return chunks;
848}
849
850inline std::vector<std::shared_ptr<BufferPart>> Buffer::Parts()
851{
852 CallAndCheckCInterfaceFunction([&] { return PEAK_C_ABI_PREFIX PEAK_Buffer_UpdateParts(m_backendHandle); });
853
854 auto numParts = QueryNumericFromCInterfaceFunction<size_t>(
855 [&](size_t* _numParts) { return PEAK_C_ABI_PREFIX PEAK_Buffer_GetNumParts(m_backendHandle, _numParts); });
856
857 std::vector<std::shared_ptr<BufferPart>> parts;
858 for (size_t x = 0; x < numParts; ++x)
859 {
860 auto bufferPartHandle = QueryNumericFromCInterfaceFunction<PEAK_BUFFER_PART_HANDLE>(
861 [&](PEAK_BUFFER_PART_HANDLE* _bufferPartHandle) {
862 return PEAK_C_ABI_PREFIX PEAK_Buffer_GetPart(m_backendHandle, x, _bufferPartHandle);
863 });
864
865 parts.emplace_back(std::make_shared<ClassCreator<BufferPart>>(bufferPartHandle, shared_from_this()));
866 }
867
868 return parts;
869}
870
871inline std::shared_ptr<DataStream> Buffer::ParentDataStream() const
872{
873 return LockOrThrow(m_parentDataStream);
874}
875
876inline PEAK_MODULE_HANDLE Buffer::ModuleHandle() const
877{
878 auto moduleHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_HANDLE>(
879 [&](PEAK_MODULE_HANDLE* _moduleHandle) {
880 return PEAK_C_ABI_PREFIX PEAK_Buffer_ToModule(m_backendHandle, _moduleHandle);
881 });
882
883 return moduleHandle;
884}
885
886inline PEAK_EVENT_SUPPORTING_MODULE_HANDLE Buffer::EventSupportingModuleHandle() const
887{
888 auto eventSupportingModuleHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_SUPPORTING_MODULE_HANDLE>(
889 [&](PEAK_EVENT_SUPPORTING_MODULE_HANDLE* _eventSupportingModuleHandle) {
891 m_backendHandle, _eventSupportingModuleHandle);
892 });
893
894 return eventSupportingModuleHandle;
895}
896
897inline void Buffer::Revoke()
898{
899 m_parentDataStream.reset();
900}
901
902inline bool NodeMap::HasBufferSupportedChunks(const std::shared_ptr<Buffer>& buffer) const
903{
904 if (buffer == nullptr)
905 {
906 throw InvalidArgumentException("The given buffer is a nullptr!");
907 }
908
909 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasSupportedChunks) {
911 m_backendHandle, buffer->m_backendHandle, hasSupportedChunks);
912 }) > 0;
913}
914
915inline void NodeMap::UpdateChunkNodes(const std::shared_ptr<Buffer>& buffer)
916{
917 if (buffer == nullptr)
918 {
919 throw InvalidArgumentException("The given buffer is a nullptr!");
920 }
921
922 CallAndCheckCInterfaceFunction([&] {
923 return PEAK_C_ABI_PREFIX PEAK_NodeMap_UpdateChunkNodes(m_backendHandle, buffer->m_backendHandle);
924 });
925}
926
927} /* namespace core */
928} /* namespace peak */
Represents a GenTL buffer module.
Definition peak_buffer.hpp:81
bool IsQueued() const
Checks whether the buffer is queued or not.
Definition peak_buffer.hpp:779
size_t DeliveredImageHeight() const
Returns the delivered image height.
Definition peak_buffer.hpp:700
bool IsIncomplete() const
Checks whether the buffer is incomplete or not.
Definition peak_buffer.hpp:793
Buffer & operator=(Buffer &&other)=delete
void * BasePtr() const
Returns the base pointer.
Definition peak_buffer.hpp:622
uint64_t Timestamp_ticks() const
Returns the timestamp.
Definition peak_buffer.hpp:765
bool HasParts() const
Checks whether the buffer contains parts.
Definition peak_buffer.hpp:821
Buffer(Buffer &&other)=delete
uint64_t FrameID() const
Returns the frame ID.
Definition peak_buffer.hpp:687
bool IsAcquiring() const
Checks whether the buffer is currently being filled.
Definition peak_buffer.hpp:786
peak::core::PixelFormatNamespace PixelFormatNamespace() const
Returns the pixel format namespace, to allow interpretation of the PixelFormat().
Definition peak_buffer.hpp:655
bool HasNewData() const
Checks whether the buffer has new data since the last delivery.
Definition peak_buffer.hpp:800
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:741
void * UserPtr() const
Returns the pointer to custom user data attached to the buffer.
Definition peak_buffer.hpp:634
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition peak_buffer.hpp:608
size_t Size() const
Returns the size of the buffer in bytes.
Definition peak_buffer.hpp:628
size_t XPadding() const
Returns the x padding of the data in the buffer in number of bytes.
Definition peak_buffer.hpp:753
size_t Height() const
Returns the height.
Definition peak_buffer.hpp:735
std::shared_ptr< DataStream > ParentDataStream() const
Returns the parent data stream.
Definition peak_buffer.hpp:871
size_t DeliveredDataSize() const
Returns the delivered data size.
Definition peak_buffer.hpp:680
bool HasImage() const
Checks whether the buffer contains image data.
Definition peak_buffer.hpp:807
std::vector< std::shared_ptr< BufferChunk > > Chunks()
Returns the buffer's chunks if it contains chunks.
Definition peak_buffer.hpp:828
uint64_t PixelFormat() const
Returns the pixel format of the data.
Definition peak_buffer.hpp:648
BufferPayloadType PayloadType() const
Returns the payload type.
Definition peak_buffer.hpp:640
uint64_t ChunkLayoutID() const
Returns the chunk layout ID.
Definition peak_buffer.hpp:715
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:747
Endianness PixelEndianness() const
Returns the pixel endianness.
Definition peak_buffer.hpp:665
size_t ImageOffset() const
Returns the offset of the image data from the beginning of the delivered buffer in bytes.
Definition peak_buffer.hpp:693
std::string TLType() const
Returns the TL (transport layer) type.
Definition peak_buffer.hpp:615
size_t YPadding() const
Returns the y padding of the data in the buffer in number of bytes.
Definition peak_buffer.hpp:759
size_t DeliveredChunkPayloadSize() const
Returns the delivered chunk payload size.
Definition peak_buffer.hpp:707
size_t ExpectedDataSize() const
Returns the expected data size.
Definition peak_buffer.hpp:673
std::vector< std::shared_ptr< BufferPart > > Parts()
Returns all buffer parts for multipart buffers.
Definition peak_buffer.hpp:850
~Buffer() override=default
size_t Width() const
Returns the width.
Definition peak_buffer.hpp:729
Buffer(const Buffer &other)=delete
Buffer & operator=(const Buffer &other)=delete
uint64_t Timestamp_ns() const
Returns the timestamp.
Definition peak_buffer.hpp:772
std::string FileName() const
Returns the file name.
Definition peak_buffer.hpp:722
bool HasChunks() const
Checks whether the buffer contains chunks.
Definition peak_buffer.hpp:814
Represents a GenTL DataStream module.
Definition peak_data_stream.hpp:184
The base class for all modules being able to raise events.
Definition peak_event_supporting_module.hpp:34
The exception thrown for passing an invalid argument to a function.
Definition peak_exception.hpp:74
Represents a GenAPI node map.
Definition peak_node_map.hpp:62
void UpdateChunkNodes(const std::shared_ptr< Buffer > &buffer)
Updates chunk information in the NodeMap.
Definition peak_buffer.hpp:915
bool HasBufferSupportedChunks(const std::shared_ptr< Buffer > &buffer) const
Checks if the Buffer contains chunks corresponding to the NodeMap.
Definition peak_buffer.hpp:902
Endianness
Endianness of pixel data in a Buffer or the data in a Port.
Definition peak_common_enums.hpp:28
BufferPayloadType
Payload type of buffer.
Definition peak_buffer.hpp:39
PixelFormatNamespace
The namespace needed to interpret the pixel format value of the buffer.
Definition peak_buffer.hpp:61
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:404
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:392
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:388
struct PEAK_EVENT_SUPPORTING_MODULE * PEAK_EVENT_SUPPORTING_MODULE_HANDLE
Definition peak_backend.h:460
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:396
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:26
int32_t PEAK_ENDIANNESS
Definition peak_backend.h:155
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:301
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:82
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