IDSpeakIPL  v1.8.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  (void)PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Destruct(m_backendHandle);
626  m_backendHandle = other.m_backendHandle;
627  other.m_backendHandle = nullptr;
628  }
629 
630  return *this;
631 }
632 
633 inline size_t Image::Width() const
634 {
635  size_t width = 0;
636 
637  ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetWidth(m_backendHandle, &width); });
638 
639  return width;
640 }
641 
642 inline size_t Image::Height() const
643 {
644  size_t height = 0;
645 
646  ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetHeight(m_backendHandle, &height); });
647 
648  return height;
649 }
650 
652 {
653  return {Width(), Height()};
654 }
655 
656 inline uint8_t* Image::PixelPointer(size_t xPos, size_t yPos) const
657 {
658  uint8_t* pixelPosition = nullptr;
659 
661  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetPixelPointer(m_backendHandle, xPos, yPos, &pixelPosition);
662  });
663 
664  return pixelPosition;
665 }
666 
667 inline size_t Image::ByteCount() const
668 {
669  size_t byteCount = 0;
670 
672  [&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetByteCount(m_backendHandle, &byteCount); });
673 
674  return byteCount;
675 }
676 
678 {
680 
683  m_backendHandle, reinterpret_cast<PEAK_IPL_PIXEL_FORMAT*>(&pixelFormatName));
684  });
685 
686  return peak::ipl::PixelFormat{ pixelFormatName };
687 }
688 
689 inline uint8_t* Image::Data() const
690 {
691  uint8_t* data = nullptr;
692 
693  ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetData(m_backendHandle, &data); });
694 
695  return data;
696 }
697 
699  const peak::ipl::PixelFormat& outputPixelFormat, peak::ipl::ConversionMode conversionMode) const
700 {
701  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
703  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_ConvertTo(m_backendHandle,
704  static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()),
705  static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
706  });
707 
708  return ImageBackendAccessor::CreateImage(outputImageHandle);
709 }
710 
711 inline Image Image::ConvertTo(const peak::ipl::PixelFormat& outputPixelFormat, uint8_t* outputImageBuffer,
712  size_t outputImageBufferSize, peak::ipl::ConversionMode conversionMode) const
713 {
714  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
717  static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()), outputImageBuffer,
718  outputImageBufferSize, static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
719  });
720 
721  return ImageBackendAccessor::CreateImage(outputImageHandle);
722 }
723 
724 inline Image Image::Scale(const Size2D& size, peak::ipl::InterpolationAlgorithm algorithm) const
725 {
726  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
727  const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
728 
730  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Scale(m_backendHandle, &size_in, static_cast<PEAK_IPL_INTERPOLATION_ALGORITHM>(algorithm), &outputImageHandle);
731  });
732 
733  return ImageBackendAccessor::CreateImage(outputImageHandle);
734 }
735 
736 inline Image Image::Scale(const ScaleFactor& factor, peak::ipl::InterpolationAlgorithm algorithm) const
737 {
738  return Scale(Size2D{static_cast<size_t>(static_cast<double>(Width()) * factor.x), static_cast<size_t>(static_cast<double>(Height()) * factor.y)}, algorithm);
739 }
740 
741 inline void Image::ScaleInto(const Size2D& size, uint8_t* buffer, std::size_t bufferSize, peak::ipl::InterpolationAlgorithm algorithm) const
742 {
743  const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
744 
746  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_ScaleInto(m_backendHandle, &size_in, buffer, bufferSize, static_cast<PEAK_IPL_INTERPOLATION_ALGORITHM>(algorithm));
747  });
748 }
749 
750 
751 inline Image Image::Crop(const Point2D& pos, const Size2D& size) const
752 {
753  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
754  const PEAK_IPL_POINT_2D pos_in{pos.x, pos.y};
755  const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
756 
758  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Crop(m_backendHandle, &pos_in, &size_in, &outputImageHandle);
759  });
760 
761  return ImageBackendAccessor::CreateImage(outputImageHandle);
762 }
763 
764 inline Image Image::Crop(const Size2D& size) const
765 {
766  return Crop({0,0}, size);
767 }
768 
769 inline Image Image::Clone() const
770 {
771  PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
773  [&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Clone(m_backendHandle, &outputImageHandle); });
774 
775  return ImageBackendAccessor::CreateImage(outputImageHandle);
776 }
777 
778 inline bool Image::Empty() const
779 {
780  return (m_backendHandle == nullptr) || (PixelFormat().PixelFormatName() == PixelFormatName::Invalid);
781 }
782 
783 inline uint64_t Image::Timestamp() const
784 {
785  uint64_t timestamp_ns;
787  return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetTimestamp(m_backendHandle, &timestamp_ns);
788  });
789 
790  return timestamp_ns;
791 }
792 
793 inline bool Image::operator==(const peak::ipl::Image& img) const
794 {
795  if (img.ByteCount() != this->ByteCount())
796  {
797  return false;
798  }
799  if (img.Width() != this->Width())
800  {
801  return false;
802  }
803  if (img.Height() != this->Height())
804  {
805  return false;
806  }
807  if (img.PixelFormat().PixelFormatName() != this->PixelFormat().PixelFormatName())
808  {
809  return false;
810  }
811  if (img.Timestamp() != this->Timestamp())
812  {
813  return false;
814  }
815 
816  return memcmp(img.Data(), this->Data(), img.ByteCount()) == 0;
817 }
818 
819 inline bool Image::operator!=(const peak::ipl::Image& img) const
820 {
821  return !(*this == img);
822 }
823 
824 } /* namespace ipl */
825 } /* 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:741
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:203
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:698
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:667
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:819
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:226
2D size of an image.
Definition: peak_ipl_simple_types.hpp:200
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:251
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:224
PEAK_IPL_NO_DISCARD size_t Height() const
Returns the height.
Definition: peak_ipl_image.hpp:642
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:354
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:769
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:252
Scale Factors of an image.
Definition: peak_ipl_simple_types.hpp:249
PEAK_IPL_NO_DISCARD uint64_t Timestamp() const
The timestamp in nanoseconds.
Definition: peak_ipl_image.hpp:783
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:651
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:689
InterpolationAlgorithm
Enum holding the possible interpolation algorithm.
Definition: peak_ipl_simple_types.hpp:186
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:793
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:633
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:751
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:656
size_t width
Width of size.
Definition: peak_ipl_simple_types.hpp:202
Definition: peak_ipl_backend.h:258
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:264
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:778
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:677
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:227