23 class ImageBackendAccessor;
80 const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer,
size_t bufferSize,
size_t width,
size_t height);
83 const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer,
size_t bufferSize,
size_t width,
size_t height, uint64_t timestamp_ns);
158 uint8_t*
Data()
const;
196 size_t outputImageBufferSize,
242 friend ImageBackendAccessor;
254 class ImageBackendAccessor
259 return image.m_backendHandle;
287 static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormat.
PixelFormatName()), width, height, &m_backendHandle);
292 const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer,
size_t bufferSize,
size_t width,
size_t height)
296 static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormat.
PixelFormatName()), buffer, bufferSize, width, height,
310 const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer,
size_t bufferSize,
size_t width,
size_t height, uint64_t timestamp_ns) :
311 Image::
Image(pixelFormat, buffer, bufferSize, width, height)
319 : m_backendHandle(imageHandle)
329 *
this = std::move(other);
337 m_backendHandle = other.m_backendHandle;
338 other.m_backendHandle =
nullptr;
364 uint8_t* pixelPosition =
nullptr;
370 return pixelPosition;
375 size_t byteCount = 0;
389 m_backendHandle, reinterpret_cast<PEAK_IPL_PIXEL_FORMAT*>(&pixelFormatName));
397 uint8_t* data =
nullptr;
410 static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.
PixelFormatName()),
411 static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
414 return ImageBackendAccessor::CreateImage(outputImageHandle);
423 static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.
PixelFormatName()), outputImageBuffer,
424 outputImageBufferSize, static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
427 return ImageBackendAccessor::CreateImage(outputImageHandle);
436 return ImageBackendAccessor::CreateImage(outputImageHandle);
446 uint64_t timestamp_ns;
482 return !(*
this == img);
PEAK_IPL_C_API PEAK_IPL_Image_GetData(PEAK_IPL_IMAGE_HANDLE imageHandle, uint8_t **data)
Queries the data pointer of the given image.
PEAK_IPL_C_API PEAK_IPL_Image_GetPixelFormat(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_PIXEL_FORMAT *pixelFormat)
Queries the pixel format of the given image.
PEAK_IPL_C_API PEAK_IPL_Image_ConvertToBuffer(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_PIXEL_FORMAT outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize, PEAK_IPL_CONVERSION_MODE conversionMode, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Stores the data of the current image converted to the given pixel format into a destination buffer an...
#define PEAK_IPL_C_ABI_PREFIX
Definition: peak_ipl_dll_defines.h:16
Image()
Creates an empty image, i.e. with size 0x0 and invalid pixel format.
Definition: peak_ipl_image.hpp:276
Image ConvertTo(const peak::ipl::PixelFormat &outputPixelFormat, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const
Returns a new created image containing the data of the current image converted to the given pixel for...
Definition: peak_ipl_image.hpp:404
PixelFormatName
Enum holding the possible pixel format names.
Definition: peak_ipl_simple_types.hpp:38
size_t ByteCount() const
Returns the size of the given image in number of bytes.
Definition: peak_ipl_image.hpp:373
PEAK_IPL_C_API PEAK_IPL_Image_Clone(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Returns a new created image containing the data of the current image as deep copy.
The "peak::ipl" namespace contains the whole image processing library.
Definition: peak_ipl_binning.hpp:16
bool operator!=(const Image &img) const
Checks whether the image is data wise different.
Definition: peak_ipl_image.hpp:480
Definition: peak_ipl_backend.h:59
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition: peak_ipl_exception.hpp:182
Stores the pixel format, width and height of an image and the pointer to the image buffer...
Definition: peak_ipl_image.hpp:37
PEAK_IPL_C_API PEAK_IPL_Image_GetTimestamp(PEAK_IPL_IMAGE_HANDLE imageHandle, uint64_t *timestamp_ns)
Get the timestamp for an image in nanoseconds.
PEAK_IPL_C_API PEAK_IPL_Image_GetHeight(PEAK_IPL_IMAGE_HANDLE imageHandle, size_t *height)
Queries the height of the given image.
ConversionMode
Enum holding the possible conversion modes.
Definition: peak_ipl_simple_types.hpp:28
size_t Height() const
Returns the height.
Definition: peak_ipl_image.hpp:353
PEAK_IPL_C_API PEAK_IPL_Image_GetPixelPointer(PEAK_IPL_IMAGE_HANDLE imageHandle, size_t xPos, size_t yPos, uint8_t **pixelPointer)
Queries the pointer to the given pixel position.
struct PEAK_IPL_IMAGE * PEAK_IPL_IMAGE_HANDLE
Definition: peak_ipl_backend.h:307
PEAK_IPL_C_API PEAK_IPL_Image_ConvertTo(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_PIXEL_FORMAT outputPixelFormat, PEAK_IPL_CONVERSION_MODE conversionMode, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Creates a new image containing the data of the current image converted to the given pixel format...
~Image()
Definition: peak_ipl_image.hpp:322
Image Clone() const
Returns a new created image containing the data of the current image as deep copy.
Definition: peak_ipl_image.hpp:430
uint64_t Timestamp() const
The timestamp in nanoseconds.
Definition: peak_ipl_image.hpp:444
PEAK_IPL_C_API PEAK_IPL_Image_ConstructFromBuffer(PEAK_IPL_PIXEL_FORMAT pixelFormat, uint8_t *buffer, uint64_t bufferSize, size_t width, size_t height, PEAK_IPL_IMAGE_HANDLE *imageHandle)
Creates an image from a given buffer.
PEAK_IPL_C_API PEAK_IPL_Image_GetWidth(PEAK_IPL_IMAGE_HANDLE imageHandle, size_t *width)
Queries the width of the given image.
uint8_t * Data() const
Returns the pointer to the first pixel position in dependency on the size of the pixel format...
Definition: peak_ipl_image.hpp:395
bool operator==(const Image &img) const
Checks whether the image is data wise the same.
Definition: peak_ipl_image.hpp:454
PEAK_IPL_C_API PEAK_IPL_Image_GetByteCount(PEAK_IPL_IMAGE_HANDLE imageHandle, size_t *byteCount)
Queries the size of the given image in number of bytes.
size_t Width() const
Returns the width.
Definition: peak_ipl_image.hpp:344
uint8_t * PixelPointer(size_t xPos, size_t yPos) const
Returns the pixel pointer to the given pixel position in dependency of the size of the pixel format...
Definition: peak_ipl_image.hpp:362
PEAK_IPL_C_API PEAK_IPL_Image_SetTimestamp(PEAK_IPL_IMAGE_HANDLE imageHandle, uint64_t timestamp_ns)
Set the timestamp for an image in nanoseconds.
bool Empty() const
Checks whether the image is empty.
Definition: peak_ipl_image.hpp:439
PEAK_IPL_C_API PEAK_IPL_Image_Construct(PEAK_IPL_PIXEL_FORMAT pixelFormat, size_t width, size_t height, PEAK_IPL_IMAGE_HANDLE *imageHandle)
Creates an image.
peak::ipl::PixelFormat PixelFormat() const
Returns the pixel format.
Definition: peak_ipl_image.hpp:383
PEAK_IPL_C_API PEAK_IPL_Image_Destruct(PEAK_IPL_IMAGE_HANDLE imageHandle)
Destroys the image associated with the given handle.
Image & operator=(const Image &other)=delete