14#include <peak_ipl/peak_ipl.hpp>
42inline peak::ipl::Image
BufferPartTo(
const std::shared_ptr<peak::core::BufferPart>& part)
49 const auto partType = part->Type();
56 const size_t height = part->Height();
57 const size_t width = part->Width();
58 const size_t byteCount = part->Size();
59 uint8_t* firstPixelPtr =
static_cast<uint8_t*
>(part->BasePtr());
61 return peak::ipl::Image(
static_cast<peak::ipl::PixelFormatName
>(part->Format()),
62 firstPixelPtr, byteCount, width, height, part->ParentBuffer()->Timestamp_ns());
The exception thrown for passing an invalid argument to a function.
Definition peak_exception.hpp:74
The exception thrown for trying to apply an invalid cast.
Definition peak_exception.hpp:82
@ Image3D
Definition peak_buffer_part.hpp:40
@ ConfidenceMap
Definition peak_buffer_part.hpp:44
@ Image2D
Definition peak_buffer_part.hpp:36
@ Custom
Definition peak_buffer.hpp:67
@ IIDC
Definition peak_buffer.hpp:63
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:33
peak::ipl::Image BufferPartTo(const std::shared_ptr< peak::core::BufferPart > &part)
Converts a core::BufferPart into a peak::ipl::Image.
Definition peak_bufferpart_converter_ipl.hpp:42