![]() |
IDS peak IPL v1.17.1
|
Stores the pixel format, width and height of an image and the pointer to the image buffer. More...
#include <peak_ipl/types/peak_ipl_image.hpp>
Public Member Functions | |
| Image () | |
| Creates an empty image. In other words, size is 0x0 and an invalid pixel format. | |
| Image (const peak::ipl::PixelFormat &pixelFormat, size_t width, size_t height) | |
| Creates an image with the given pixel format and size. | |
| Image (const peak::ipl::PixelFormat &pixelFormat, uint8_t *buffer, size_t bufferSize, size_t width, size_t height) | |
| Creates an image with the given pixel format and size from the given buffer. | |
| Image (const peak::ipl::PixelFormat &pixelFormat, size_t width, size_t height, uint64_t timestamp_ns) | |
| Creates an image with the given pixel format, size and timestamp. | |
| Image (const peak::ipl::PixelFormat &pixelFormat, uint8_t *buffer, size_t bufferSize, size_t width, size_t height, uint64_t timestamp_ns) | |
| Creates an image with the given pixel format, size and timestamp from the given buffer. | |
| Image (peak::common::IImageView &imageView) | |
| Creates an image from the given image view. | |
| ~Image () | |
| Destructor for the Image instance. | |
| Image (const Image &other) | |
| Copy Constructor for a new Image instance. | |
| Image & | operator= (const Image &other) |
| Copy assigment for Image instance. | |
| Image (Image &&other) noexcept | |
| Move constructor for Image instance. | |
| Image & | operator= (Image &&other) noexcept |
| Move assignment for Image instance. | |
| size_t | Width () const |
| Returns the width. | |
| size_t | Height () const |
| Returns the height. | |
| peak::ipl::Size2D | Size () const |
| Returns the Size. | |
| 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. | |
| template<typename T, typename = std::enable_if_t<std::is_arithmetic<T>::value>> | |
| 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. | |
| size_t | ByteCount () const |
| Returns the size of the given image in number of bytes. | |
| peak::ipl::PixelFormat | PixelFormat () const |
| Returns the pixel format. | |
| uint8_t * | Data () const |
| Returns the pointer to the first pixel position in dependency on the size of the pixel format. | |
| template<typename T, typename = std::enable_if_t<std::is_arithmetic<T>::value>> | |
| T * | Data () const |
| Returns the pointer to the first pixel position in dependency on the size of the pixel format. | |
| Image | ConvertTo (const peak::ipl::PixelFormat &outputPixelFormat, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const |
Converts the image to the specified outputPixelFormat. | |
| Image | ConvertTo (const peak::ipl::PixelFormat &outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const |
Converts the image to the specified outputPixelFormat into an existing outputImageBuffer. | |
| 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. | |
| Image | ConvertToWithFactor (const peak::ipl::PixelFormat &outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize, double factor, double offset=0.0, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const |
Converts the image to the specified outputPixelFormat into an existing outputImageBuffer and scales the pixel values by the factor. | |
| 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 the value range of the outputPixelFormat. All pixel values outside the interval will be clamped. | |
| Image | ConvertToFromInterval (const peak::ipl::PixelFormat &outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize, const peak::ipl::Interval< double > &interval, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const |
Converts the image to the specified outputPixelFormat into an existing outputImageBuffer. The pixel values are mapped from interval to the value range of the outputPixelFormat. All pixel values outside the interval will be clamped. | |
| template<typename Integer1, typename Integer2, typename std::enable_if_t< std::is_integral< Integer1 >::value, int > = 0, typename std::enable_if_t< std::is_integral< Integer2 >::value, int > = 0> | |
| 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. | |
| Image | Scale (const peak::ipl::Size2D &size, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const |
Scale the image to the supplied width and height using the supplied algorithm. | |
| Image | Scale (const peak::ipl::ScaleFactor &factor, peak::ipl::InterpolationAlgorithm algorithm=InterpolationAlgorithm::linear) const |
Scale the image to the supplied scale factors factor using the supplied algorithm. | |
| template<typename FloatingPoint1, typename FloatingPoint2, typename std::enable_if_t< std::is_floating_point< FloatingPoint1 >::value, int > = 0, typename std::enable_if_t< std::is_floating_point< FloatingPoint2 >::value, int > = 0> | |
| 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 algorithm. | |
| 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 supplied buffer. | |
| Image | Crop (const peak::ipl::Point2D &pos, const peak::ipl::Size2D &size) const |
Crop the image to the size starting at pos. | |
| Image | Crop (const peak::ipl::Size2D &size) const |
| Crop the image to the supplied size. Position is set to (0, 0) | |
| Image | Clone () const |
| Returns a new created image containing the data of the current image as deep copy. | |
| bool | Empty () const |
| Checks whether the image is empty. | |
| uint64_t | Timestamp () const |
| The timestamp in nanoseconds. | |
| bool | operator== (const Image &img) const |
| Checks whether the image is data-wise the same. | |
| bool | operator!= (const Image &img) const |
| Checks whether the image is data-wise different. | |
Stores the pixel format, width and height of an image and the pointer to the image buffer.
|
inline |
Creates an empty image. In other words, size is 0x0 and an invalid pixel format.
| Exception | An internal error has occurred. |
|
inline |
Creates an image with the given pixel format and size.
| [in] | pixelFormat | The pixel format. |
| [in] | width | The width. |
| [in] | height | The height. |
| OutOfRangeException | pixelFormat is valid but width or height is 0. |
| Exception | An internal error has occurred. |
|
inline |
Creates an image with the given pixel format and size from the given buffer.
| [in] | pixelFormat | The pixel format. |
| [in] | buffer | The buffer. |
| [in] | bufferSize | The size of the buffer. |
| [in] | width | The width. |
| [in] | height | The height. |
| InvalidArgumentException | bufferSize is too small for the specified pixel format and image dimension. |
| OutOfRangeException | pixelFormat is valid but width or height is 0. |
| Exception | An internal error has occurred. |
|
inline |
Creates an image with the given pixel format, size and timestamp.
| [in] | pixelFormat | The pixel format. |
| [in] | width | The width. |
| [in] | height | The height. |
| [in] | timestamp_ns | The timestamp in nanoseconds. |
| OutOfRangeException | pixelFormat is valid but width or height is 0. |
| Exception | An internal error has occurred. |
|
inline |
Creates an image with the given pixel format, size and timestamp from the given buffer.
| [in] | pixelFormat | The pixel format. |
| [in] | buffer | The buffer. |
| [in] | bufferSize | The size of the buffer. |
| [in] | width | The width. |
| [in] | height | The height. |
| [in] | timestamp_ns | The timestamp in nanoseconds. |
| InvalidArgumentException | bufferSize is too small for the specified pixel format and image dimension. |
| OutOfRangeException | pixelFormat is valid but width or height is 0. |
| Exception | An internal error has occurred. |
|
inlineexplicit |
Creates an image from the given image view.
| [in] | imageView | The image view into raw image memory. |
| Exception | An internal error has occurred. |
|
inline |
|
inline |
Copy Constructor for a new Image instance.
Creates a new Image instance.
| [in] | other | The other instance to acquire a reference for. |
|
inlinenoexcept |
Move constructor for Image instance.
Moves the instance from other to this. Afterwards other is invalid.
| [in] | other | The other instance to move. |
|
inline |
Returns the size of the given image in number of bytes.
| Exception | An internal error has occurred. |
|
inline |
Returns a new created image containing the data of the current image as deep copy.
| Exception | An internal error has occurred. |
|
inline |
Converts the image to the specified outputPixelFormat.
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | conversionMode | The conversion mode. |
outputPixelFormat.| Exception | An internal error has occurred. |
|
inline |
Converts the image to the specified outputPixelFormat into an existing outputImageBuffer.
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | outputImageBuffer | Pointer to the output buffer. |
| [in] | outputImageBufferSize | Size of the output buffer. |
| [in] | conversionMode | The conversion mode. |
outputImageBuffer. Note that the memory is not owned by the image object. Ensure the buffer is not deleted until you have finished working with the image.| BufferTooSmallException | The provided output buffer is too small for the output image. |
| InvalidArgumentException | The provided output buffer pointer is invalid. |
| Exception | An internal error has occurred. |
|
inline |
Converts the image to the specified outputPixelFormat. The pixel values are mapped from interval to the value range of the outputPixelFormat. All pixel values outside the interval will be clamped.
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | interval | The interval of the input range. |
| [in] | conversionMode | The conversion mode. |
outputPixelFormat with mapped pixel values.| ImageFormatNotSupportedException | The given input or output pixel format is not supported. |
| Exception | An internal error has occurred. |
|
inline |
Converts the image to the specified outputPixelFormat into an existing outputImageBuffer. The pixel values are mapped from interval to the value range of the outputPixelFormat. All pixel values outside the interval will be clamped.
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | outputImageBuffer | Pointer to the output buffer. |
| [in] | outputImageBufferSize | Size of the output buffer. |
| [in] | interval | The interval of the input range. |
| [in] | conversionMode | The conversion mode. |
outputImageBuffer with mapped pixel values. Note that the memory is not owned by the image object. Ensure the buffer is not deleted until you have finished working with the image.| ImageFormatNotSupportedException | The given input or output pixel format is not supported. |
| BufferTooSmallException | The provided buffer is too small for the output image. |
| InvalidArgumentException | The given output buffer pointer is invalid. |
| Exception | An internal error has occurred. |
|
inline |
Converts the image to the specified outputPixelFormat and scales the pixel values by the factor.
outputPixelFormat must be a float pixel format. | [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | factor | Scale factor that is applied to each pixel value. |
| [in] | offset | Offset that is applied to each pixel value. |
| [in] | conversionMode | The conversion mode. |
outputPixelFormat with pixel values scaled by factor (m) and offset (c) added according to y = m · x + c.| ImageFormatNotSupportedException | The given input or output pixel format is not supported. |
| Exception | An internal error has occurred. |
|
inline |
Converts the image to the specified outputPixelFormat into an existing outputImageBuffer and scales the pixel values by the factor.
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | outputImageBuffer | Pointer to the output buffer. |
| [in] | outputImageBufferSize | Size of the output buffer. |
| [in] | factor | Scale factor that is applied to each pixel value. |
| [in] | offset | Offset that is applied to each pixel value. |
| [in] | conversionMode | The conversion mode. |
outputImageBuffer with pixel values scaled by factor (m) and offset (c) added according to y = m · x + c. Note that the memory is not owned by the image object. Ensure the buffer is not deleted until you have finished working with the image.| ImageFormatNotSupportedException | The given input or output pixel format is not supported. |
| BufferTooSmallException | The provided buffer is too small for the output image. |
| InvalidArgumentException | The given output buffer pointer is invalid. |
| Exception | An internal error has occurred. |
|
inline |
Crop the image to the size starting at pos.
| [in] | pos | The starting position of the cropped image |
| [in] | size | The image size used for the cropped image |
| Exception | An internal error has occurred. |
|
inline |
Crop the image to the supplied size. Position is set to (0, 0)
| [in] | size | The output size. |
| Exception | An internal error has occurred. |
|
inline |
Returns the pointer to the first pixel position in dependency on the size of the pixel format.
| Exception | An internal error has occurred. |
|
inline |
Returns the pointer to the first pixel position in dependency on the size of the pixel format.
| T | Type of the underlying pixel format |
| Exception | An internal error has occurred. |
|
inline |
Checks whether the image is empty.
An image can be empty if its data have been moved.
|
inline |
|
inline |
Checks whether the image is data-wise different.
Copy assigment for Image instance.
Acquires a reference from other to this instance. If this instance already has a reference, it will be destroyed.
| [in] | other | The other instance to acquire a reference for. |
Move assignment for Image instance.
Moves the instance from other to this. Afterwards other is invalid.
| [in] | other | The other instance to move. |
|
inline |
Checks whether the image is data-wise the same.
|
inline |
Returns the pixel format.
| Exception | An internal error has occurred. |
|
inline |
Returns the pixel pointer to the given pixel position in relation to the size of the pixel format.
| [in] | xPos | The x position. |
| [in] | yPos | The y position. |
| OutOfRangeException | The pixel position is outside the image. |
| Exception | An internal error has occurred. |
|
inline |
Returns the pixel pointer to the given pixel position in relation to the size of the pixel format.
| [in] | xPos | The x position. |
| [in] | yPos | The y position. |
| T | Type of the underlying pixel format |
| OutOfRangeException | The pixel position is outside the image. |
| Exception | An internal error has occurred. |
|
inline |
Scale the image to the supplied scale factors factor using the supplied algorithm.
| [in] | factor | output image scale factors |
| [in] | algorithm | the used interpolation algorithm |
| Exception | An internal error has occurred. |
|
inline |
Scale the image to the supplied width and height using the supplied algorithm.
| [in] | size | output size of the image |
| [in] | algorithm | the used interpolation algorithm |
| Exception | An internal error has occurred. |
|
inline |
Scale the image to the supplied scale factors scaleFactorX and scaleFactorY using the supplied algorithm.
| [in] | scaleFactorX | output image scale factor for width |
| [in] | scaleFactorY | output image scale factor for height |
| [in] | algorithm | the used interpolation algorithm |
| Exception | An internal error has occurred. |
|
inline |
Scale the image to the supplied width and height using the supplied algorithm.
| [in] | width | output image width |
| [in] | height | output image height |
| [in] | algorithm | the used interpolation algorithm |
| Exception | An internal error has occurred. |
|
inline |
Scale the image to the supplied width and height using the supplied algorithm and save it into the supplied buffer.
| [in] | size | output size of the image |
| [in] | buffer | the used interpolation algorithm |
| [in] | bufferSize | the used interpolation algorithm |
| [in] | algorithm | the used interpolation algorithm |
| Exception | An internal error has occurred. |
|
inline |
|
inline |
The timestamp in nanoseconds.
The point in camera time at which the image was exposed.
|
inline |