IDSpeakIPL  v1.9.0
peak_ipl_image.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
17 
18 #include <cstddef>
19 #include <cstdint>
20 #include <utility>
21 #include <type_traits>
22 
23 namespace
24 {
25 class ImageBackendAccessor;
26 }
27 
31 namespace peak
32 {
33 namespace ipl
34 {
35 
39 class Image
40 {
41 public:
49  Image();
50 
63  Image(const peak::ipl::PixelFormat& pixelFormat, size_t width, size_t height);
64 
83  Image(
84  const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer, size_t bufferSize, size_t width, size_t height);
85 
99  Image(const peak::ipl::PixelFormat& pixelFormat, size_t width, size_t height, uint64_t timestamp_ns);
100 
121  Image(const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer, size_t bufferSize, size_t width, size_t height, uint64_t timestamp_ns);
122 
129  ~Image();
130 
142  Image(const Image& other);
143 
155  Image& operator=(const Image& other);
156 
165  Image(Image&& other) noexcept;
166 
175  Image& operator=(Image&& other) noexcept;
176 
186  PEAK_IPL_NO_DISCARD size_t Width() const;
187 
197  PEAK_IPL_NO_DISCARD size_t Height() const;
198 
209 
226  PEAK_IPL_NO_DISCARD uint8_t* PixelPointer(size_t xPos, size_t yPos) const;
227 
237  PEAK_IPL_NO_DISCARD size_t ByteCount() const;
238 
249 
262  PEAK_IPL_NO_DISCARD uint8_t* Data() const;
263 
280 
299  Image ConvertTo(const peak::ipl::PixelFormat& outputPixelFormat, uint8_t* outputImageBuffer,
300  size_t outputImageBufferSize,
302 
316  template <typename Integer1, typename Integer2,
317  typename std::enable_if_t<std::is_integral<Integer1>::value, int> = 0,
318  typename std::enable_if_t<std::is_integral<Integer2>::value, int> = 0>
319  PEAK_IPL_NO_DISCARD inline Image Scale(Integer1 width, Integer2 height, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const
320  {
321  return Scale(peak::ipl::Size2D{static_cast<std::size_t>(width), static_cast<std::size_t>(height)}, algorithm);
322  }
323 
337 
353 
369  template<typename FloatingPoint1, typename FloatingPoint2,
370  typename std::enable_if_t<std::is_floating_point<FloatingPoint1>::value, int> = 0,
371  typename std::enable_if_t<std::is_floating_point<FloatingPoint2>::value, int> = 0>
372  PEAK_IPL_NO_DISCARD inline Image Scale(FloatingPoint1 scaleFactorX, FloatingPoint2 scaleFactorY, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const
373  {
374  return Scale(peak::ipl::ScaleFactor{static_cast<double>(scaleFactorX), static_cast<double>(scaleFactorY)}, algorithm);
375  }
376 
389  void ScaleInto(const peak::ipl::Size2D& size, uint8_t* buffer, std::size_t bufferSize, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const;
390 
403  PEAK_IPL_NO_DISCARD Image Crop(const peak::ipl::Point2D& pos, const peak::ipl::Size2D& size) const;
404 
416  PEAK_IPL_NO_DISCARD Image Crop(const peak::ipl::Size2D& size) const;
417 
428 
438  PEAK_IPL_NO_DISCARD bool Empty() const;
439 
448  PEAK_IPL_NO_DISCARD uint64_t Timestamp() const;
449 
454  PEAK_IPL_NO_DISCARD bool operator==(const Image& img) const;
455 
460  PEAK_IPL_NO_DISCARD bool operator!=(const Image& img) const;
461 
462 private:
463  friend ImageBackendAccessor;
464 
465  explicit Image(PEAK_IPL_IMAGE_HANDLE imageHandle, bool acquireReference=false);
466 
467  PEAK_IPL_IMAGE_HANDLE m_backendHandle{};
468 };
469 
470 } /* namespace ipl */
471 } /* namespace peak */
472 
473 namespace
474 {
475 
477 class ImageBackendAccessor
478 {
479 public:
487  PEAK_IPL_NO_DISCARD static PEAK_IPL_IMAGE_HANDLE BackendHandle(const peak::ipl::Image& image)
488  {
489  return image.m_backendHandle;
490  }
491 
501  PEAK_IPL_NO_DISCARD static peak::ipl::Image CreateImage(PEAK_IPL_IMAGE_HANDLE imageHandle)
502  {
503  return peak::ipl::Image(imageHandle, false);
504  }
505 
515  PEAK_IPL_NO_DISCARD static peak::ipl::Image CreateImageReference(PEAK_IPL_IMAGE_HANDLE imageHandle)
516  {
517  return peak::ipl::Image(imageHandle, true);
518  }
519 };
520 
521 } /* namespace */
522 
523 namespace peak
524 {
525 namespace ipl
526 {
527 inline Image::Image()
528 {
531  });
532 }
533 
534 inline Image::Image(const peak::ipl::PixelFormat& pixelFormat, size_t width, size_t height)
535 {
538  static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormat.PixelFormatName()), width, height, &m_backendHandle);
539  });
540 }
541 
543  const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer, size_t bufferSize, size_t width, size_t height)
544 {
547  static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormat.PixelFormatName()), buffer, bufferSize, width, height,
548  &m_backendHandle);
549  });
550 }
551 
552 inline Image::Image(const peak::ipl::PixelFormat& pixelFormat, size_t width, size_t height, uint64_t timestamp_ns) :
553  Image::Image(pixelFormat, width, height)
554 {
556  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_SetTimestamp(m_backendHandle, timestamp_ns);
557  });
558 }
559 
561  const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer, size_t bufferSize, size_t width, size_t height, uint64_t timestamp_ns) :
562  Image::Image(pixelFormat, buffer, bufferSize, width, height)
563 {
565  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_SetTimestamp(m_backendHandle, timestamp_ns);
566  });
567 }
568 
569 inline Image::Image(PEAK_IPL_IMAGE_HANDLE imageHandle, bool acquireReference)
570  : m_backendHandle(imageHandle)
571 {
572  if (acquireReference && m_backendHandle)
573  {
575  }
576 }
577 
579 {
580  if (m_backendHandle)
581  {
582  (void)PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Destruct(m_backendHandle);
583  }
584 }
585 
586 inline Image::Image(const Image& other)
587 {
588  if (other.m_backendHandle)
589  {
590  ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Acquire(other.m_backendHandle); });
591  }
592 
593  m_backendHandle = other.m_backendHandle;
594 }
595 
596 inline Image& Image::operator=(const Image& other)
597 {
598  if (this != &other)
599  {
600  if (m_backendHandle)
601  {
602  (void)PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Destruct(m_backendHandle);
603  }
604 
605  if (other.m_backendHandle)
606  {
607  ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Acquire(other.m_backendHandle); });
608  }
609  }
610 
611  m_backendHandle = other.m_backendHandle;
612 
613  return *this;
614 }
615 
616 inline Image::Image(Image&& other) noexcept
617 {
618  *this = std::move(other);
619 }
620 
621 inline Image& Image::operator=(Image&& other) noexcept
622 {
623  if (this != &other)
624  {
625  if (m_backendHandle != nullptr)
626  {
627  (void)PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Destruct(m_backendHandle);
628  }
629  m_backendHandle = other.m_backendHandle;
630  other.m_backendHandle = nullptr;
631  }
632 
633  return *this;
634 }
635 
636 inline size_t Image::Width() const
637 {
638  size_t width = 0;
639 
640  ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetWidth(m_backendHandle, &width); });
641 
642  return width;
643 }
644 
645 inline size_t Image::Height() const
646 {
647  size_t height = 0;
648 
649  ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetHeight(m_backendHandle, &height); });
650 
651  return height;
652 }
653 
655 {
656  return {Width(), Height()};
657 }
658 
659 inline uint8_t* Image::PixelPointer(size_t xPos, size_t yPos) const
660 {
661  uint8_t* pixelPosition = nullptr;
662 
664  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetPixelPointer(m_backendHandle, xPos, yPos, &pixelPosition);
665  });
666 
667  return pixelPosition;
668 }
669 
670 inline size_t Image::ByteCount() const
671 {
672  size_t byteCount = 0;
673 
675  [&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetByteCount(m_backendHandle, &byteCount); });
676 
677  return byteCount;
678 }
679 
681 {
683 
686  m_backendHandle, reinterpret_cast<PEAK_IPL_PIXEL_FORMAT*>(&pixelFormatName));
687  });
688 
689  return peak::ipl::PixelFormat{ pixelFormatName };
690 }
691 
692 inline uint8_t* Image::Data() const
693 {
694  uint8_t* data = nullptr;
695 
696  ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetData(m_backendHandle, &data); });
697 
698  return data;
699 }
700 
702  const peak::ipl::PixelFormat& outputPixelFormat, peak::ipl::ConversionMode conversionMode) const
703 {
704  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
706  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_ConvertTo(m_backendHandle,
707  static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()),
708  static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
709  });
710 
711  return ImageBackendAccessor::CreateImage(outputImageHandle);
712 }
713 
714 inline Image Image::ConvertTo(const peak::ipl::PixelFormat& outputPixelFormat, uint8_t* outputImageBuffer,
715  size_t outputImageBufferSize, peak::ipl::ConversionMode conversionMode) const
716 {
717  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
720  static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()), outputImageBuffer,
721  outputImageBufferSize, static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
722  });
723 
724  return ImageBackendAccessor::CreateImage(outputImageHandle);
725 }
726 
727 inline Image Image::Scale(const Size2D& size, peak::ipl::InterpolationAlgorithm algorithm) const
728 {
729  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
730  const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
731 
733  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Scale(m_backendHandle, &size_in, static_cast<PEAK_IPL_INTERPOLATION_ALGORITHM>(algorithm), &outputImageHandle);
734  });
735 
736  return ImageBackendAccessor::CreateImage(outputImageHandle);
737 }
738 
739 inline Image Image::Scale(const ScaleFactor& factor, peak::ipl::InterpolationAlgorithm algorithm) const
740 {
741  return Scale(Size2D{static_cast<size_t>(static_cast<double>(Width()) * factor.x), static_cast<size_t>(static_cast<double>(Height()) * factor.y)}, algorithm);
742 }
743 
744 inline void Image::ScaleInto(const Size2D& size, uint8_t* buffer, std::size_t bufferSize, peak::ipl::InterpolationAlgorithm algorithm) const
745 {
746  const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
747 
749  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_ScaleInto(m_backendHandle, &size_in, buffer, bufferSize, static_cast<PEAK_IPL_INTERPOLATION_ALGORITHM>(algorithm));
750  });
751 }
752 
753 
754 inline Image Image::Crop(const Point2D& pos, const Size2D& size) const
755 {
756  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
757  const PEAK_IPL_POINT_2D pos_in{pos.x, pos.y};
758  const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
759 
761  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Crop(m_backendHandle, &pos_in, &size_in, &outputImageHandle);
762  });
763 
764  return ImageBackendAccessor::CreateImage(outputImageHandle);
765 }
766 
767 inline Image Image::Crop(const Size2D& size) const
768 {
769  return Crop({0,0}, size);
770 }
771 
772 inline Image Image::Clone() const
773 {
774  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
776  [&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Clone(m_backendHandle, &outputImageHandle); });
777 
778  return ImageBackendAccessor::CreateImage(outputImageHandle);
779 }
780 
781 inline bool Image::Empty() const
782 {
783  return (m_backendHandle == nullptr) || (PixelFormat().PixelFormatName() == PixelFormatName::Invalid);
784 }
785 
786 inline uint64_t Image::Timestamp() const
787 {
788  uint64_t timestamp_ns;
790  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetTimestamp(m_backendHandle, &timestamp_ns);
791  });
792 
793  return timestamp_ns;
794 }
795 
796 inline bool Image::operator==(const peak::ipl::Image& img) const
797 {
798  if (img.ByteCount() != this->ByteCount())
799  {
800  return false;
801  }
802  if (img.Width() != this->Width())
803  {
804  return false;
805  }
806  if (img.Height() != this->Height())
807  {
808  return false;
809  }
810  if (img.PixelFormat().PixelFormatName() != this->PixelFormat().PixelFormatName())
811  {
812  return false;
813  }
814  if (img.Timestamp() != this->Timestamp())
815  {
816  return false;
817  }
818 
819  return memcmp(img.Data(), this->Data(), img.ByteCount()) == 0;
820 }
821 
822 inline bool Image::operator!=(const peak::ipl::Image& img) const
823 {
824  return !(*this == img);
825 }
826 
827 } /* namespace ipl */
828 } /* namespace peak */
#define PEAK_IPL_NO_DISCARD
Definition: peak_ipl_backend.h:26
PEAK_IPL_C_API PEAK_IPL_Image_GetData(PEAK_IPL_IMAGE_HANDLE imageHandle, uint8_t **data)
Queries the data pointer of the given image.
void ScaleInto(const peak::ipl::Size2D &size, uint8_t *buffer, std::size_t bufferSize, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const
Scale the image to the supplied width and height using the supplied algorithm and save it into the su...
Definition: peak_ipl_image.hpp:744
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...
PEAK_IPL_C_API PEAK_IPL_Image_Scale(PEAK_IPL_IMAGE_HANDLE imageHandle, const struct PEAK_IPL_SIZE_2D *size, PEAK_IPL_INTERPOLATION_ALGORITHM algorithm, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Creates a new image scaled to size using algorithm.
#define PEAK_IPL_C_ABI_PREFIX
Definition: peak_ipl_dll_defines.h:16
Image()
Creates an empty image. In other words, size is 0x0 and an invalid pixel format.
Definition: peak_ipl_image.hpp:527
size_t height
Height of size.
Definition: peak_ipl_simple_types.hpp:206
PEAK_IPL_NO_DISCARD 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:701
PixelFormatName
Enum holding the possible pixel format names.
Definition: peak_ipl_simple_types.hpp:38
PEAK_IPL_NO_DISCARD size_t ByteCount() const
Returns the size of the given image in number of bytes.
Definition: peak_ipl_image.hpp:670
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:22
PEAK_IPL_NO_DISCARD bool operator!=(const Image &img) const
Checks whether the image is data-wise different.
Definition: peak_ipl_image.hpp:822
Definition: peak_ipl_backend.h:75
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition: peak_ipl_exception.hpp:182
size_t x
X position.
Definition: peak_ipl_simple_types.hpp:229
2D size of an image.
Definition: peak_ipl_simple_types.hpp:203
Stores the pixel format, width and height of an image and the pointer to the image buffer...
Definition: peak_ipl_image.hpp:39
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.
double x
X factor.
Definition: peak_ipl_simple_types.hpp:254
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
2D position in an image.
Definition: peak_ipl_simple_types.hpp:227
PEAK_IPL_NO_DISCARD size_t Height() const
Returns the height.
Definition: peak_ipl_image.hpp:645
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.
PEAK_IPL_NO_DISCARD peak::ipl::PixelFormatName PixelFormatName() const
Returns the name of the pixel format as enum value.
Definition: peak_ipl_pixel_format.hpp:122
struct PEAK_IPL_IMAGE * PEAK_IPL_IMAGE_HANDLE
Definition: peak_ipl_backend.h:357
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()
Destructor for the Image instance.
Definition: peak_ipl_image.hpp:578
PEAK_IPL_NO_DISCARD Image Clone() const
Returns a new created image containing the data of the current image as deep copy.
Definition: peak_ipl_image.hpp:772
Image & operator=(const Image &other)
Copy assigment for Image instance.
Definition: peak_ipl_image.hpp:596
Fast conversion mode.
double y
Y factor.
Definition: peak_ipl_simple_types.hpp:255
Scale Factors of an image.
Definition: peak_ipl_simple_types.hpp:252
PEAK_IPL_NO_DISCARD uint64_t Timestamp() const
The timestamp in nanoseconds.
Definition: peak_ipl_image.hpp:786
PEAK_IPL_NO_DISCARD Image Scale(FloatingPoint1 scaleFactorX, FloatingPoint2 scaleFactorY, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const
Scale the image to the supplied scale factors scaleFactorX and scaleFactorY using the supplied algori...
Definition: peak_ipl_image.hpp:372
PEAK_IPL_NO_DISCARD peak::ipl::Size2D Size() const
Returns the Size.
Definition: peak_ipl_image.hpp:654
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_Acquire(PEAK_IPL_IMAGE_HANDLE imageHandle)
Increase the reference count of an image object.
PEAK_IPL_C_API PEAK_IPL_Image_GetWidth(PEAK_IPL_IMAGE_HANDLE imageHandle, size_t *width)
Queries the width of the given image.
PEAK_IPL_NO_DISCARD 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:692
InterpolationAlgorithm
Enum holding the possible interpolation algorithm.
Definition: peak_ipl_simple_types.hpp:189
PEAK_IPL_C_API PEAK_IPL_Image_ScaleInto(PEAK_IPL_IMAGE_HANDLE imageHandle, const struct PEAK_IPL_SIZE_2D *size, uint8_t *buffer, size_t bufferSize, PEAK_IPL_INTERPOLATION_ALGORITHM algorithm)
Creates a new image scaled to size using algorithm into the supplied buffer.
PEAK_IPL_NO_DISCARD bool operator==(const Image &img) const
Checks whether the image is data-wise the same.
Definition: peak_ipl_image.hpp:796
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.
PEAK_IPL_NO_DISCARD size_t Width() const
Returns the width.
Definition: peak_ipl_image.hpp:636
PEAK_IPL_NO_DISCARD Image Crop(const peak::ipl::Point2D &pos, const peak::ipl::Size2D &size) const
Crop the image to the size starting at pos.
Definition: peak_ipl_image.hpp:754
PEAK_IPL_NO_DISCARD uint8_t * PixelPointer(size_t xPos, size_t yPos) const
Returns the pixel pointer to the given pixel position in relation to the size of the pixel format...
Definition: peak_ipl_image.hpp:659
size_t width
Width of size.
Definition: peak_ipl_simple_types.hpp:205
Definition: peak_ipl_backend.h:261
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.
PEAK_IPL_NO_DISCARD Image Scale(Integer1 width, Integer2 height, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const
Scale the image to the supplied width and height using the supplied algorithm.
Definition: peak_ipl_image.hpp:319
Definition: peak_ipl_backend.h:267
PEAK_IPL_C_API PEAK_IPL_Image_Crop(PEAK_IPL_IMAGE_HANDLE imageHandle, const struct PEAK_IPL_POINT_2D *pos, const struct PEAK_IPL_SIZE_2D *size, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Creates a new image cropped to size starting at position.
PEAK_IPL_NO_DISCARD bool Empty() const
Checks whether the image is empty.
Definition: peak_ipl_image.hpp:781
Represents a pixel format and its specific properties.
Definition: peak_ipl_pixel_format.hpp:31
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_NO_DISCARD peak::ipl::PixelFormat PixelFormat() const
Returns the pixel format.
Definition: peak_ipl_image.hpp:680
PEAK_IPL_C_API PEAK_IPL_Image_Destruct(PEAK_IPL_IMAGE_HANDLE imageHandle)
Destroys the image associated with the given handle.
size_t y
Y position.
Definition: peak_ipl_simple_types.hpp:230