![]() |
IDSpeakIPL
v1.9.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. More... | |
| Image (const peak::ipl::PixelFormat &pixelFormat, size_t width, size_t height) | |
| Creates an image with the given pixel format and size. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| ~Image () | |
| Destructor for the Image instance. More... | |
| Image (const Image &other) | |
| Copy Constructor for a new Image instance. More... | |
| Image & | operator= (const Image &other) |
| Copy assigment for Image instance. More... | |
| Image (Image &&other) noexcept | |
| Move constructor for Image instance. More... | |
| Image & | operator= (Image &&other) noexcept |
| Move assignment for Image instance. More... | |
| PEAK_IPL_NO_DISCARD size_t | Width () const |
| Returns the width. More... | |
| PEAK_IPL_NO_DISCARD size_t | Height () const |
| Returns the height. More... | |
| PEAK_IPL_NO_DISCARD peak::ipl::Size2D | Size () const |
| Returns the Size. More... | |
| 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. More... | |
| PEAK_IPL_NO_DISCARD size_t | ByteCount () const |
| Returns the size of the given image in number of bytes. More... | |
| PEAK_IPL_NO_DISCARD peak::ipl::PixelFormat | PixelFormat () const |
| Returns the pixel format. More... | |
| 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. More... | |
| 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 format. More... | |
| Image | ConvertTo (const peak::ipl::PixelFormat &outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize, peak::ipl::ConversionMode conversionMode=peak::ipl::ConversionMode::Fast) const |
| Saves the data of the current image converted to the given pixel format into a destination buffer and creates an image from that buffer. More... | |
| 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> | |
| 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. More... | |
| PEAK_IPL_NO_DISCARD 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. More... | |
| PEAK_IPL_NO_DISCARD 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. More... | |
| 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> | |
| 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 algorithm. More... | |
| 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. More... | |
| 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. More... | |
| PEAK_IPL_NO_DISCARD Image | Crop (const peak::ipl::Size2D &size) const |
| Crop the image to the supplied size. Position is set to (0, 0) More... | |
| PEAK_IPL_NO_DISCARD Image | Clone () const |
Returns a new created image containing the data of the current image as deep copy. More... | |
| PEAK_IPL_NO_DISCARD bool | Empty () const |
| Checks whether the image is empty. More... | |
| PEAK_IPL_NO_DISCARD uint64_t | Timestamp () const |
| The timestamp in nanoseconds. More... | |
| PEAK_IPL_NO_DISCARD bool | operator== (const Image &img) const |
| Checks whether the image is data-wise the same. More... | |
| PEAK_IPL_NO_DISCARD bool | operator!= (const Image &img) const |
| Checks whether the image is data-wise different. More... | |
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 ns. |
| 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 ns. |
| 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 |
|
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 |
Returns a new created image containing the data of the current image converted to the given pixel format.
| [in] | outputPixelFormat | The output pixel format. |
| [in] | conversionMode | The conversion mode. |
| Exception | An internal error has occurred. |
|
inline |
Saves the data of the current image converted to the given pixel format into a destination buffer and creates an image from that buffer.
| [in] | outputPixelFormat | The output pixel format. |
| [out] | outputImageBuffer | Pointer to destination buffer. |
| [in] | outputImageBufferSize | Size of destination buffer. |
| [in] | conversionMode | The conversion mode. |
| BufferTooSmallException | The provided buffer is too small for the output image. |
| Exception | An internal error has occurred. |
|
inline |
Crop the image to the size starting at pos.
| [in] | pos | the startting position |
| [in] | size | the used size |
| 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 |
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 |
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.
| [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 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 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 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 |