IDS peak IPL v1.16.0
Loading...
Searching...
No Matches
peak_ipl_image.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
18
19#include <cstddef>
20#include <cstdint>
21#include <utility>
22#include <type_traits>
23
24namespace
25{
26class ImageBackendAccessor;
27}
28
32namespace peak
33{
34namespace ipl
35{
36
40class Image
41{
42public:
50 Image();
51
64 Image(const peak::ipl::PixelFormat& pixelFormat, size_t width, size_t height);
65
84 Image(
85 const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer, size_t bufferSize, size_t width, size_t height);
86
100 Image(const peak::ipl::PixelFormat& pixelFormat, size_t width, size_t height, uint64_t timestamp_ns);
101
122 Image(const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer, size_t bufferSize, size_t width, size_t height, uint64_t timestamp_ns);
123
130 ~Image();
131
143 Image(const Image& other);
144
156 Image& operator=(const Image& other);
157
166 Image(Image&& other) noexcept;
167
176 Image& operator=(Image&& other) noexcept;
177
187 PEAK_IPL_NO_DISCARD size_t Width() const;
188
198 PEAK_IPL_NO_DISCARD size_t Height() const;
199
210
227 PEAK_IPL_NO_DISCARD uint8_t* PixelPointer(size_t xPos, size_t yPos) const;
228
246 template<typename T, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
247 PEAK_IPL_NO_DISCARD T* PixelPointer(size_t xPos, size_t yPos) const
248 {
249 return reinterpret_cast<T*>(PixelPointer(xPos, yPos));
250 }
251
261 PEAK_IPL_NO_DISCARD size_t ByteCount() const;
262
273
286 PEAK_IPL_NO_DISCARD uint8_t* Data() const;
287
302 template<typename T, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
304 {
305 return reinterpret_cast<T*>(Data());
306 }
307
325
346 Image ConvertTo(const peak::ipl::PixelFormat& outputPixelFormat, uint8_t* outputImageBuffer,
347 size_t outputImageBufferSize,
349
374 double factor, double offset = 0.0, peak::ipl::ConversionMode conversionMode = peak::ipl::ConversionMode::Fast) const;
375
402 uint8_t* outputImageBuffer, size_t outputImageBufferSize, double factor, double offset = 0.0,
404
424 inline Image ConvertToFromInterval(const peak::ipl::PixelFormat& outputPixelFormat, const peak::ipl::Interval<double>& interval,
426
452 inline Image ConvertToFromInterval(const peak::ipl::PixelFormat& outputPixelFormat, uint8_t* outputImageBuffer,
453 size_t outputImageBufferSize, const peak::ipl::Interval<double>& interval, peak::ipl::ConversionMode conversionMode = peak::ipl::ConversionMode::Fast) const;
454
468 template <typename Integer1, typename Integer2,
469 typename std::enable_if_t<std::is_integral<Integer1>::value, int> = 0,
470 typename std::enable_if_t<std::is_integral<Integer2>::value, int> = 0>
472 {
473 return Scale(peak::ipl::Size2D{static_cast<std::size_t>(width), static_cast<std::size_t>(height)}, algorithm);
474 }
475
489
505
521 template<typename FloatingPoint1, typename FloatingPoint2,
522 typename std::enable_if_t<std::is_floating_point<FloatingPoint1>::value, int> = 0,
523 typename std::enable_if_t<std::is_floating_point<FloatingPoint2>::value, int> = 0>
524 PEAK_IPL_NO_DISCARD inline Image Scale(FloatingPoint1 scaleFactorX, FloatingPoint2 scaleFactorY, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const
525 {
526 return Scale(peak::ipl::ScaleFactor{static_cast<double>(scaleFactorX), static_cast<double>(scaleFactorY)}, algorithm);
527 }
528
541 void ScaleInto(const peak::ipl::Size2D& size, uint8_t* buffer, std::size_t bufferSize, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const;
542
556
569
580
590 PEAK_IPL_NO_DISCARD bool Empty() const;
591
600 PEAK_IPL_NO_DISCARD uint64_t Timestamp() const;
601
606 PEAK_IPL_NO_DISCARD bool operator==(const Image& img) const;
607
612 PEAK_IPL_NO_DISCARD bool operator!=(const Image& img) const;
613
614private:
615 friend ImageBackendAccessor;
616
617 explicit Image(PEAK_IPL_IMAGE_HANDLE imageHandle, bool acquireReference=false);
618
619 PEAK_IPL_IMAGE_HANDLE m_backendHandle{};
620};
621
622} /* namespace ipl */
623} /* namespace peak */
624
625namespace
626{
627
629class ImageBackendAccessor
630{
631public:
639 PEAK_IPL_NO_DISCARD static PEAK_IPL_IMAGE_HANDLE BackendHandle(const peak::ipl::Image& image)
640 {
641 return image.m_backendHandle;
642 }
643
653 PEAK_IPL_NO_DISCARD static peak::ipl::Image CreateImage(PEAK_IPL_IMAGE_HANDLE imageHandle)
654 {
655 return peak::ipl::Image(imageHandle, false);
656 }
657
667 PEAK_IPL_NO_DISCARD static peak::ipl::Image CreateImageReference(PEAK_IPL_IMAGE_HANDLE imageHandle)
668 {
669 return peak::ipl::Image(imageHandle, true);
670 }
671};
672
673} /* namespace */
674
675namespace peak
676{
677namespace ipl
678{
680{
683 });
684}
685
686inline Image::Image(const peak::ipl::PixelFormat& pixelFormat, size_t width, size_t height)
687{
690 static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormat.PixelFormatName()), width, height, &m_backendHandle);
691 });
692}
693
695 const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer, size_t bufferSize, size_t width, size_t height)
696{
699 static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormat.PixelFormatName()), buffer, bufferSize, width, height,
700 &m_backendHandle);
701 });
702}
703
704inline Image::Image(const peak::ipl::PixelFormat& pixelFormat, size_t width, size_t height, uint64_t timestamp_ns) :
705 Image::Image(pixelFormat, width, height)
706{
708 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_SetTimestamp(m_backendHandle, timestamp_ns);
709 });
710}
711
713 const peak::ipl::PixelFormat& pixelFormat, uint8_t* buffer, size_t bufferSize, size_t width, size_t height, uint64_t timestamp_ns) :
714 Image::Image(pixelFormat, buffer, bufferSize, width, height)
715{
717 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_SetTimestamp(m_backendHandle, timestamp_ns);
718 });
719}
720
721inline Image::Image(PEAK_IPL_IMAGE_HANDLE imageHandle, bool acquireReference)
722 : m_backendHandle(imageHandle)
723{
724 if (acquireReference && m_backendHandle)
725 {
727 }
728}
729
731{
732 if (m_backendHandle)
733 {
734 (void)PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Destruct(m_backendHandle);
735 }
736}
737
738inline Image::Image(const Image& other)
739{
740 if (other.m_backendHandle)
741 {
742 ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Acquire(other.m_backendHandle); });
743 }
744
745 m_backendHandle = other.m_backendHandle;
746}
747
748inline Image& Image::operator=(const Image& other)
749{
750 if (this != &other)
751 {
752 if (m_backendHandle)
753 {
754 (void)PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Destruct(m_backendHandle);
755 }
756
757 if (other.m_backendHandle)
758 {
759 ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Acquire(other.m_backendHandle); });
760 }
761 }
762
763 m_backendHandle = other.m_backendHandle;
764
765 return *this;
766}
767
768inline Image::Image(Image&& other) noexcept
769{
770 *this = std::move(other);
771}
772
773inline Image& Image::operator=(Image&& other) noexcept
774{
775 if (this != &other)
776 {
777 if (m_backendHandle != nullptr)
778 {
779 (void)PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Destruct(m_backendHandle);
780 }
781 m_backendHandle = other.m_backendHandle;
782 other.m_backendHandle = nullptr;
783 }
784
785 return *this;
786}
787
788inline size_t Image::Width() const
789{
790 size_t width = 0;
791
792 ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetWidth(m_backendHandle, &width); });
793
794 return width;
795}
796
797inline size_t Image::Height() const
798{
799 size_t height = 0;
800
801 ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetHeight(m_backendHandle, &height); });
802
803 return height;
804}
805
807{
808 return {Width(), Height()};
809}
810
811inline uint8_t* Image::PixelPointer(size_t xPos, size_t yPos) const
812{
813 uint8_t* pixelPosition = nullptr;
814
816 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetPixelPointer(m_backendHandle, xPos, yPos, &pixelPosition);
817 });
818
819 return pixelPosition;
820}
821
822inline size_t Image::ByteCount() const
823{
824 size_t byteCount = 0;
825
827 [&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetByteCount(m_backendHandle, &byteCount); });
828
829 return byteCount;
830}
831
833{
835
838 m_backendHandle, reinterpret_cast<PEAK_IPL_PIXEL_FORMAT*>(&pixelFormatName));
839 });
840
841 return peak::ipl::PixelFormat{ pixelFormatName };
842}
843
844inline uint8_t* Image::Data() const
845{
846 uint8_t* data = nullptr;
847
848 ExecuteAndMapReturnCodes([&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetData(m_backendHandle, &data); });
849
850 return data;
851}
852
854 const peak::ipl::PixelFormat& outputPixelFormat, peak::ipl::ConversionMode conversionMode) const
855{
856 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
858 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_ConvertTo(m_backendHandle,
859 static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()),
860 static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
861 });
862
863 return ImageBackendAccessor::CreateImage(outputImageHandle);
864}
865
866inline Image Image::ConvertTo(const peak::ipl::PixelFormat& outputPixelFormat, uint8_t* outputImageBuffer,
867 size_t outputImageBufferSize, peak::ipl::ConversionMode conversionMode) const
868{
869 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
872 static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()), outputImageBuffer,
873 outputImageBufferSize, static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
874 });
875
876 return ImageBackendAccessor::CreateImage(outputImageHandle);
877}
878
880 const peak::ipl::PixelFormat& outputPixelFormat, double factor, double offset, peak::ipl::ConversionMode conversionMode) const
881{
882 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
885 static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()), factor, offset,
886 static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
887 });
888
889 return ImageBackendAccessor::CreateImage(outputImageHandle);
890}
891
893 const peak::ipl::PixelFormat& outputPixelFormat, uint8_t* outputImageBuffer, size_t outputImageBufferSize,
894 double factor, double offset, peak::ipl::ConversionMode conversionMode) const
895{
896 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
899 static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()), factor, offset, outputImageBuffer, outputImageBufferSize,
900 static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
901 });
902
903 return ImageBackendAccessor::CreateImage(outputImageHandle);
904}
905
907 const peak::ipl::Interval<double>& interval, peak::ipl::ConversionMode conversionMode) const
908{
909 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
912 static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()), interval.Start(), interval.End(),
913 static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
914 });
915
916 return ImageBackendAccessor::CreateImage(outputImageHandle);
917}
918
920 uint8_t* outputImageBuffer, size_t outputImageBufferSize, const peak::ipl::Interval<double>& interval,
921 peak::ipl::ConversionMode conversionMode) const
922{
923 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
926 static_cast<PEAK_IPL_PIXEL_FORMAT>(outputPixelFormat.PixelFormatName()), interval.Start(), interval.End(), outputImageBuffer,
927 outputImageBufferSize, static_cast<PEAK_IPL_CONVERSION_MODE>(conversionMode), &outputImageHandle);
928 });
929
930 return ImageBackendAccessor::CreateImage(outputImageHandle);
931}
932
933inline Image Image::Scale(const Size2D& size, peak::ipl::InterpolationAlgorithm algorithm) const
934{
935 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
936 const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
937
939 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Scale(m_backendHandle, &size_in, static_cast<PEAK_IPL_INTERPOLATION_ALGORITHM>(algorithm), &outputImageHandle);
940 });
941
942 return ImageBackendAccessor::CreateImage(outputImageHandle);
943}
944
946{
947 return Scale(Size2D{static_cast<size_t>(static_cast<double>(Width()) * factor.x), static_cast<size_t>(static_cast<double>(Height()) * factor.y)}, algorithm);
948}
949
950inline void Image::ScaleInto(const Size2D& size, uint8_t* buffer, std::size_t bufferSize, peak::ipl::InterpolationAlgorithm algorithm) const
951{
952 const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
953
955 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_ScaleInto(m_backendHandle, &size_in, buffer, bufferSize, static_cast<PEAK_IPL_INTERPOLATION_ALGORITHM>(algorithm));
956 });
957}
958
959
960inline Image Image::Crop(const Point2D& pos, const Size2D& size) const
961{
962 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
963 const PEAK_IPL_POINT_2D pos_in{pos.x, pos.y};
964 const PEAK_IPL_SIZE_2D size_in{size.width, size.height};
965
967 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Crop(m_backendHandle, &pos_in, &size_in, &outputImageHandle);
968 });
969
970 return ImageBackendAccessor::CreateImage(outputImageHandle);
971}
972
973inline Image Image::Crop(const Size2D& size) const
974{
975 return Crop({0,0}, size);
976}
977
978inline Image Image::Clone() const
979{
980 PEAK_IPL_IMAGE_HANDLE outputImageHandle = nullptr;
982 [&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_Clone(m_backendHandle, &outputImageHandle); });
983
984 return ImageBackendAccessor::CreateImage(outputImageHandle);
985}
986
987inline bool Image::Empty() const
988{
989 return (m_backendHandle == nullptr) || (PixelFormat().PixelFormatName() == PixelFormatName::Invalid);
990}
991
992inline uint64_t Image::Timestamp() const
993{
994 uint64_t timestamp_ns;
996 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_Image_GetTimestamp(m_backendHandle, &timestamp_ns);
997 });
998
999 return timestamp_ns;
1000}
1001
1002inline bool Image::operator==(const peak::ipl::Image& img) const
1003{
1004 if (img.ByteCount() != this->ByteCount())
1005 {
1006 return false;
1007 }
1008 if (img.Width() != this->Width())
1009 {
1010 return false;
1011 }
1012 if (img.Height() != this->Height())
1013 {
1014 return false;
1015 }
1016 if (img.PixelFormat().PixelFormatName() != this->PixelFormat().PixelFormatName())
1017 {
1018 return false;
1019 }
1020 if (img.Timestamp() != this->Timestamp())
1021 {
1022 return false;
1023 }
1024
1025 return memcmp(img.Data(), this->Data(), img.ByteCount()) == 0;
1026}
1027
1028inline bool Image::operator!=(const peak::ipl::Image& img) const
1029{
1030 return !(*this == img);
1031}
1032
1033} /* namespace ipl */
1034} /* namespace peak */
Stores the pixel format, width and height of an image and the pointer to the image buffer.
Definition peak_ipl_image.hpp:41
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:247
bool operator!=(const Image &img) const
Checks whether the image is data-wise different.
Definition peak_ipl_image.hpp:1028
Image & operator=(const Image &other)
Copy assigment for Image instance.
Definition peak_ipl_image.hpp:748
size_t Width() const
Returns the width.
Definition peak_ipl_image.hpp:788
bool Empty() const
Checks whether the image is empty.
Definition peak_ipl_image.hpp:987
peak::ipl::Size2D Size() const
Returns the Size.
Definition peak_ipl_image.hpp:806
Image ConvertToWithFactor(const peak::ipl::PixelFormat &outputPixelFormat, double factor, double offset=0.0, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const
Converts the image to the specified outputPixelFormat and scales the pixel values by the factor.
Definition peak_ipl_image.hpp:879
peak::ipl::PixelFormat PixelFormat() const
Returns the pixel format.
Definition peak_ipl_image.hpp:832
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:811
size_t ByteCount() const
Returns the size of the given image in number of bytes.
Definition peak_ipl_image.hpp:822
bool operator==(const Image &img) const
Checks whether the image is data-wise the same.
Definition peak_ipl_image.hpp:1002
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:844
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:950
Image ConvertToFromInterval(const peak::ipl::PixelFormat &outputPixelFormat, const peak::ipl::Interval< double > &interval, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const
Converts the image to the specified outputPixelFormat. The pixel values are mapped from interval to t...
Definition peak_ipl_image.hpp:906
size_t Height() const
Returns the height.
Definition peak_ipl_image.hpp:797
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:960
Image Clone() const
Returns a new created image containing the data of the current image as deep copy.
Definition peak_ipl_image.hpp:978
~Image()
Destructor for the Image instance.
Definition peak_ipl_image.hpp:730
Image()
Creates an empty image. In other words, size is 0x0 and an invalid pixel format.
Definition peak_ipl_image.hpp:679
Image ConvertTo(const peak::ipl::PixelFormat &outputPixelFormat, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const
Converts the image to the specified outputPixelFormat.
Definition peak_ipl_image.hpp:853
uint64_t Timestamp() const
The timestamp in nanoseconds.
Definition peak_ipl_image.hpp:992
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:471
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:524
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:303
Interval support and convenience class.
Definition peak_ipl_interval.hpp:35
constexpr T End() const
Get the end value (inclusive) for the interval.
Definition peak_ipl_interval.hpp:78
constexpr T Start() const
Get the start value (inclusive) for the interval.
Definition peak_ipl_interval.hpp:66
Represents a pixel format and its specific properties.
Definition peak_ipl_pixel_format.hpp:32
peak::ipl::PixelFormatName PixelFormatName() const
Returns the name of the pixel format as enum value.
Definition peak_ipl_pixel_format.hpp:122
Definition peak_ipl_binning.hpp:25
InterpolationAlgorithm
Enum holding the possible interpolation algorithm.
Definition peak_ipl_simple_types.hpp:202
@ linear
bilinear interpolation
Definition peak_ipl_simple_types.hpp:204
PixelFormatName
Enum holding the possible pixel format names.
Definition peak_ipl_simple_types.hpp:39
@ Invalid
Invalid Pixel Format.
Definition peak_ipl_simple_types.hpp:40
ConversionMode
Enum holding the possible conversion modes.
Definition peak_ipl_simple_types.hpp:29
@ Fast
Fast conversion mode.
Definition peak_ipl_simple_types.hpp:30
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition peak_ipl_exception.hpp:182
The "peak::ipl" namespace contains the whole image processing library.
Definition peak_ipl_binning.hpp:23
#define PEAK_IPL_NO_DISCARD
Definition peak_ipl_attribute_defines.h:25
PEAK_IPL_C_API PEAK_IPL_Image_Destruct(PEAK_IPL_IMAGE_HANDLE imageHandle)
Destroys the image associated with the given handle.
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_Construct(PEAK_IPL_PIXEL_FORMAT pixelFormat, size_t width, size_t height, PEAK_IPL_IMAGE_HANDLE *imageHandle)
Creates an image.
PEAK_IPL_C_API PEAK_IPL_Image_ConvertToFromInterval(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_PIXEL_FORMAT outputPixelFormat, double start, double end, PEAK_IPL_CONVERSION_MODE conversionMode, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Converts the given imageHandle to the specified outputPixelFormat. The pixel values are mapped from t...
PEAK_IPL_C_API PEAK_IPL_Image_ConvertToBufferWithFactorAndOffset(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_PIXEL_FORMAT outputPixelFormat, double factor, double offset, uint8_t *outputImageBuffer, size_t outputImageBufferSize, PEAK_IPL_CONVERSION_MODE conversionMode, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Converts the given imageHandle to the specified outputPixelFormat into an existing outputImageBuffer ...
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.
int32_t PEAK_IPL_CONVERSION_MODE
Definition peak_ipl_backend.h:55
PEAK_IPL_C_API PEAK_IPL_Image_ConvertToBufferFromInterval(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_PIXEL_FORMAT outputPixelFormat, double start, double end, uint8_t *outputImageBuffer, size_t outputImageBufferSize, PEAK_IPL_CONVERSION_MODE conversionMode, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Converts the given imageHandle to the specified outputPixelFormat into an existing outputImageBuffer....
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_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.
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.
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_C_API PEAK_IPL_Image_GetPixelFormat(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_PIXEL_FORMAT *pixelFormat)
Queries the pixel format of the given image.
struct PEAK_IPL_IMAGE * PEAK_IPL_IMAGE_HANDLE
Definition peak_ipl_backend.h:405
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_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_PIXEL_FORMAT_INVALID
Definition peak_ipl_backend.h:60
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.
PEAK_IPL_C_API PEAK_IPL_Image_GetData(PEAK_IPL_IMAGE_HANDLE imageHandle, uint8_t **data)
Queries the data pointer of the given image.
int32_t PEAK_IPL_INTERPOLATION_ALGORITHM
Definition peak_ipl_backend.h:303
PEAK_IPL_C_API PEAK_IPL_Image_GetHeight(PEAK_IPL_IMAGE_HANDLE imageHandle, size_t *height)
Queries the height of the given image.
int32_t PEAK_IPL_PIXEL_FORMAT
Definition peak_ipl_backend.h:173
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_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_C_API PEAK_IPL_Image_ConvertToWithFactorAndOffset(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_PIXEL_FORMAT outputPixelFormat, double factor, double offset, 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 mult...
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
Definition peak_ipl_backend.h:259
Definition peak_ipl_backend.h:265
2D position in an image.
Definition peak_ipl_simple_types.hpp:240
size_t x
X position.
Definition peak_ipl_simple_types.hpp:241
size_t y
Y position.
Definition peak_ipl_simple_types.hpp:242
Scale Factors of an image.
Definition peak_ipl_simple_types.hpp:265
double y
Y factor.
Definition peak_ipl_simple_types.hpp:267
double x
X factor.
Definition peak_ipl_simple_types.hpp:266
2D size of an image.
Definition peak_ipl_simple_types.hpp:216
size_t height
Height of size.
Definition peak_ipl_simple_types.hpp:218
size_t width
Width of size.
Definition peak_ipl_simple_types.hpp:217