IDS peak IPL v1.17.0
Loading...
Searching...
No Matches
peak::ipl::Image Class Reference

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.
 

Detailed Description

Stores the pixel format, width and height of an image and the pointer to the image buffer.

Constructor & Destructor Documentation

◆ Image() [1/8]

peak::ipl::Image::Image ( )
inline

Creates an empty image. In other words, size is 0x0 and an invalid pixel format.

Exceptions
ExceptionAn internal error has occurred.
Since
1.1

◆ Image() [2/8]

peak::ipl::Image::Image ( const peak::ipl::PixelFormat & pixelFormat,
size_t width,
size_t height )
inline

Creates an image with the given pixel format and size.

Parameters
[in]pixelFormatThe pixel format.
[in]widthThe width.
[in]heightThe height.
Exceptions
OutOfRangeExceptionpixelFormat is valid but width or height is 0.
ExceptionAn internal error has occurred.
Since
1.0

◆ Image() [3/8]

peak::ipl::Image::Image ( const peak::ipl::PixelFormat & pixelFormat,
uint8_t * buffer,
size_t bufferSize,
size_t width,
size_t height )
inline

Creates an image with the given pixel format and size from the given buffer.

Parameters
[in]pixelFormatThe pixel format.
[in]bufferThe buffer.
[in]bufferSizeThe size of the buffer.
[in]widthThe width.
[in]heightThe height.
Note
The given buffer doesn't get copied and the memory is not owned by the image object. Ensure the buffer is not deleted until you have finished working with the image.
Exceptions
InvalidArgumentExceptionbufferSize is too small for the specified pixel format and image dimension.
OutOfRangeExceptionpixelFormat is valid but width or height is 0.
ExceptionAn internal error has occurred.
Since
1.0

◆ Image() [4/8]

peak::ipl::Image::Image ( const peak::ipl::PixelFormat & pixelFormat,
size_t width,
size_t height,
uint64_t timestamp_ns )
inline

Creates an image with the given pixel format, size and timestamp.

Parameters
[in]pixelFormatThe pixel format.
[in]widthThe width.
[in]heightThe height.
[in]timestamp_nsThe timestamp in nanoseconds.
Exceptions
OutOfRangeExceptionpixelFormat is valid but width or height is 0.
ExceptionAn internal error has occurred.
Since
1.5

◆ Image() [5/8]

peak::ipl::Image::Image ( const peak::ipl::PixelFormat & pixelFormat,
uint8_t * buffer,
size_t bufferSize,
size_t width,
size_t height,
uint64_t timestamp_ns )
inline

Creates an image with the given pixel format, size and timestamp from the given buffer.

Parameters
[in]pixelFormatThe pixel format.
[in]bufferThe buffer.
[in]bufferSizeThe size of the buffer.
[in]widthThe width.
[in]heightThe height.
[in]timestamp_nsThe timestamp in nanoseconds.
Note
The given buffer doesn't get copied and the memory is not owned by the image object. Ensure the buffer is not deleted until you have finished working with the image.
Exceptions
InvalidArgumentExceptionbufferSize is too small for the specified pixel format and image dimension.
OutOfRangeExceptionpixelFormat is valid but width or height is 0.
ExceptionAn internal error has occurred.
Since
1.5

◆ Image() [6/8]

peak::ipl::Image::Image ( peak::common::IImageView & imageView)
inlineexplicit

Creates an image from the given image view.

Parameters
[in]imageViewThe image view into raw image memory.
Note
The given image view doesn't get copied and the memory is not owned by the image object. Ensure the underlying memory is not deleted until you have finished working with the image.
Exceptions
ExceptionAn internal error has occurred.
Since
1.17

◆ ~Image()

peak::ipl::Image::~Image ( )
inline

Destructor for the Image instance.

Destroys an Image instance.

Since
1.0

◆ Image() [7/8]

peak::ipl::Image::Image ( const Image & other)
inline

Copy Constructor for a new Image instance.

Creates a new Image instance.

Note
This only creates a shallow copy. To create a deepcopy, see Image::Clone. See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.0 Deleted
1.8 Implemented as shallow copy

◆ Image() [8/8]

peak::ipl::Image::Image ( Image && other)
inlinenoexcept

Move constructor for Image instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.0

Member Function Documentation

◆ ByteCount()

size_t peak::ipl::Image::ByteCount ( ) const
inline

Returns the size of the given image in number of bytes.

Returns
ByteCount
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ Clone()

Image peak::ipl::Image::Clone ( ) const
inline

Returns a new created image containing the data of the current image as deep copy.

Returns
The copied image
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ ConvertTo() [1/2]

Image peak::ipl::Image::ConvertTo ( const peak::ipl::PixelFormat & outputPixelFormat,
peak::ipl::ConversionMode conversionMode = peak::ipl::ConversionMode::Fast ) const
inline

Converts the image to the specified outputPixelFormat.

Note
This function allocates memory on every use. For faster processing, consider using ImageConverter::Convert instead.
Parameters
[in]outputPixelFormatThe desired pixel format for the output image.
[in]conversionModeThe conversion mode.
Returns
A new peak::ipl::Image containing the content of the image in the specified outputPixelFormat.
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ ConvertTo() [2/2]

Image peak::ipl::Image::ConvertTo ( const peak::ipl::PixelFormat & outputPixelFormat,
uint8_t * outputImageBuffer,
size_t outputImageBufferSize,
peak::ipl::ConversionMode conversionMode = peak::ipl::ConversionMode::Fast ) const
inline

Converts the image to the specified outputPixelFormat into an existing outputImageBuffer.

Note
This function allocates memory on every use. For faster processing, consider using ImageConverter::Convert instead.
Parameters
[in]outputPixelFormatThe desired pixel format for the output image.
[in]outputImageBufferPointer to the output buffer.
[in]outputImageBufferSizeSize of the output buffer.
[in]conversionModeThe conversion mode.
Returns
A peak::ipl::Image object representing the converted image. The returned Image object encapsulates the 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.
Exceptions
BufferTooSmallExceptionThe provided output buffer is too small for the output image.
InvalidArgumentExceptionThe provided output buffer pointer is invalid.
ExceptionAn internal error has occurred.
Since
1.1

◆ ConvertToFromInterval() [1/2]

Image peak::ipl::Image::ConvertToFromInterval ( const peak::ipl::PixelFormat & outputPixelFormat,
const peak::ipl::Interval< double > & interval,
peak::ipl::ConversionMode conversionMode = peak::ipl::ConversionMode::Fast ) const
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.

Note
This function allocates memory on every use. For faster processing, consider using ImageConverter::Convert instead.
The pixel format of the image must be a float pixel format.
Parameters
[in]outputPixelFormatThe desired pixel format for the output image.
[in]intervalThe interval of the input range.
[in]conversionModeThe conversion mode.
Returns
A new peak::ipl::Image containing the content of the image in the specified outputPixelFormat with mapped pixel values.
Exceptions
ImageFormatNotSupportedExceptionThe given input or output pixel format is not supported.
ExceptionAn internal error has occurred.
Since
1.15

◆ ConvertToFromInterval() [2/2]

Image peak::ipl::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
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.

Note
This function allocates memory on every use. For faster processing, consider using ImageConverter::Convert instead.
The pixel format of the image must be a float pixel format.
Parameters
[in]outputPixelFormatThe desired pixel format for the output image.
[in]outputImageBufferPointer to the output buffer.
[in]outputImageBufferSizeSize of the output buffer.
[in]intervalThe interval of the input range.
[in]conversionModeThe conversion mode.
Returns
A peak::ipl::Image object representing the converted image. The returned Image object encapsulates the 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.
Exceptions
ImageFormatNotSupportedExceptionThe given input or output pixel format is not supported.
BufferTooSmallExceptionThe provided buffer is too small for the output image.
InvalidArgumentExceptionThe given output buffer pointer is invalid.
ExceptionAn internal error has occurred.
Since
1.15

◆ ConvertToWithFactor() [1/2]

Image peak::ipl::Image::ConvertToWithFactor ( const peak::ipl::PixelFormat & outputPixelFormat,
double factor,
double offset = 0.0,
peak::ipl::ConversionMode conversionMode = peak::ipl::ConversionMode::Fast ) const
inline

Converts the image to the specified outputPixelFormat and scales the pixel values by the factor.

Note
This function allocates memory on every use. For faster processing, consider using ImageConverter::Convert instead.
The outputPixelFormat must be a float pixel format.
This function allocates memory on every use. For faster processing, consider using ImageConverter::Convert instead.
Parameters
[in]outputPixelFormatThe desired pixel format for the output image.
[in]factorScale factor that is applied to each pixel value.
[in]offsetOffset that is applied to each pixel value.
[in]conversionModeThe conversion mode.
Returns
A new peak::ipl::Image containing the content of the image in the specified outputPixelFormat with pixel values scaled by factor (m) and offset (c) added according to y = m · x + c.
Exceptions
ImageFormatNotSupportedExceptionThe given input or output pixel format is not supported.
ExceptionAn internal error has occurred.
Since
1.12

◆ ConvertToWithFactor() [2/2]

Image peak::ipl::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
inline

Converts the image to the specified outputPixelFormat into an existing outputImageBuffer and scales the pixel values by the factor.

Note
This function allocates memory on every use. For faster processing, consider using ImageConverter::Convert instead.
Parameters
[in]outputPixelFormatThe desired pixel format for the output image.
[in]outputImageBufferPointer to the output buffer.
[in]outputImageBufferSizeSize of the output buffer.
[in]factorScale factor that is applied to each pixel value.
[in]offsetOffset that is applied to each pixel value.
[in]conversionModeThe conversion mode.
Returns
A peak::ipl::Image object representing the converted image. The returned Image object encapsulates the 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.
Exceptions
ImageFormatNotSupportedExceptionThe given input or output pixel format is not supported.
BufferTooSmallExceptionThe provided buffer is too small for the output image.
InvalidArgumentExceptionThe given output buffer pointer is invalid.
ExceptionAn internal error has occurred.
Since
1.15

◆ Crop() [1/2]

Image peak::ipl::Image::Crop ( const peak::ipl::Point2D & pos,
const peak::ipl::Size2D & size ) const
inline

Crop the image to the size starting at pos.

Parameters
[in]posThe starting position of the cropped image
[in]sizeThe image size used for the cropped image
Returns
The cropped image
Exceptions
ExceptionAn internal error has occurred.
Since
1.7

◆ Crop() [2/2]

Image peak::ipl::Image::Crop ( const peak::ipl::Size2D & size) const
inline

Crop the image to the supplied size. Position is set to (0, 0)

Parameters
[in]sizeThe output size.
Returns
The cropped image
Exceptions
ExceptionAn internal error has occurred.
Since
1.7

◆ Data() [1/2]

uint8_t * peak::ipl::Image::Data ( ) const
inline

Returns the pointer to the first pixel position in dependency on the size of the pixel format.

Note
Accessing the raw data pointer isn't thread safe. Ensure data is read/written only by one thread concurrently. Also note that the buffer may be freed in the meantime.
Returns
Buffer data.
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ Data() [2/2]

template<typename T, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
T * peak::ipl::Image::Data ( ) const
inline

Returns the pointer to the first pixel position in dependency on the size of the pixel format.

Note
Accessing the raw data pointer isn't thread safe. Ensure data is read/written only by one thread concurrently. Also note that the buffer may be freed in the meantime.
Template Parameters
TType of the underlying pixel format
Returns
Buffer data as T.
Exceptions
ExceptionAn internal error has occurred.
Since
1.10

◆ Empty()

bool peak::ipl::Image::Empty ( ) const
inline

Checks whether the image is empty.

An image can be empty if its data have been moved.

Returns
True if the image is empty
Since
1.0

◆ Height()

size_t peak::ipl::Image::Height ( ) const
inline

Returns the height.

Returns
Height
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ operator!=()

bool peak::ipl::Image::operator!= ( const Image & img) const
inline

Checks whether the image is data-wise different.

Returns
True if image is data-wise different, false if not.

◆ operator=() [1/2]

Image & peak::ipl::Image::operator= ( const Image & other)
inline

Copy assigment for Image instance.

Acquires a reference from other to this instance. If this instance already has a reference, it will be destroyed.

Note
See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.0 Deleted
1.8 Implemented as shallow copy

◆ operator=() [2/2]

Image & peak::ipl::Image::operator= ( Image && other)
inlinenoexcept

Move assignment for Image instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.0

◆ operator==()

bool peak::ipl::Image::operator== ( const Image & img) const
inline

Checks whether the image is data-wise the same.

Returns
True if image is data-wise the same, false if not.

◆ PixelFormat()

peak::ipl::PixelFormat peak::ipl::Image::PixelFormat ( ) const
inline

Returns the pixel format.

Returns
Pixel format
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ PixelPointer() [1/2]

uint8_t * peak::ipl::Image::PixelPointer ( size_t xPos,
size_t yPos ) const
inline

Returns the pixel pointer to the given pixel position in relation to the size of the pixel format.

Note
Accessing the raw data pointer isn't thread safe. Ensure data is read/written only by one thread concurrently. Also note that the buffer may be freed in the meantime.
Parameters
[in]xPosThe x position.
[in]yPosThe y position.
Returns
PixelPointer
Exceptions
OutOfRangeExceptionThe pixel position is outside the image.
ExceptionAn internal error has occurred.
Since
1.0

◆ PixelPointer() [2/2]

template<typename T, typename = std::enable_if_t<std::is_arithmetic<T>::value>>
T * peak::ipl::Image::PixelPointer ( size_t xPos,
size_t yPos ) const
inline

Returns the pixel pointer to the given pixel position in relation to the size of the pixel format.

Note
Accessing the raw data pointer isn't thread safe. Ensure data is read/written only by one thread concurrently. Also note that the buffer may be freed in the meantime.
Parameters
[in]xPosThe x position.
[in]yPosThe y position.
Template Parameters
TType of the underlying pixel format
Returns
PixelPointer of type T
Exceptions
OutOfRangeExceptionThe pixel position is outside the image.
ExceptionAn internal error has occurred.
Since
1.10

◆ Scale() [1/4]

Image peak::ipl::Image::Scale ( const peak::ipl::ScaleFactor & factor,
peak::ipl::InterpolationAlgorithm algorithm = InterpolationAlgorithm::linear ) const
inline

Scale the image to the supplied scale factors factor using the supplied algorithm.

Parameters
[in]factoroutput image scale factors
[in]algorithmthe used interpolation algorithm
Returns
The scaled image
Note
the image size is { input_image.width * factor.X, input_image.height * factor.Y }
Exceptions
ExceptionAn internal error has occurred.
Since
1.7

◆ Scale() [2/4]

Image peak::ipl::Image::Scale ( const peak::ipl::Size2D & size,
peak::ipl::InterpolationAlgorithm algorithm = InterpolationAlgorithm::linear ) const
inline

Scale the image to the supplied width and height using the supplied algorithm.

Parameters
[in]sizeoutput size of the image
[in]algorithmthe used interpolation algorithm
Returns
The scaled image
Exceptions
ExceptionAn internal error has occurred.
Since
1.7

◆ Scale() [3/4]

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 peak::ipl::Image::Scale ( FloatingPoint1 scaleFactorX,
FloatingPoint2 scaleFactorY,
peak::ipl::InterpolationAlgorithm algorithm = InterpolationAlgorithm::linear ) const
inline

Scale the image to the supplied scale factors scaleFactorX and scaleFactorY using the supplied algorithm.

Parameters
[in]scaleFactorXoutput image scale factor for width
[in]scaleFactorYoutput image scale factor for height
[in]algorithmthe used interpolation algorithm
Returns
The scaled image
Note
the image size is { input_image.width * scaleFactorX, input_image.height * scaleFactorY }
Exceptions
ExceptionAn internal error has occurred.
Since
1.7

◆ Scale() [4/4]

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 peak::ipl::Image::Scale ( Integer1 width,
Integer2 height,
peak::ipl::InterpolationAlgorithm algorithm = InterpolationAlgorithm::linear ) const
inline

Scale the image to the supplied width and height using the supplied algorithm.

Parameters
[in]widthoutput image width
[in]heightoutput image height
[in]algorithmthe used interpolation algorithm
Returns
The scaled image
Exceptions
ExceptionAn internal error has occurred.
Since
1.7

◆ ScaleInto()

void peak::ipl::Image::ScaleInto ( const peak::ipl::Size2D & size,
uint8_t * buffer,
std::size_t bufferSize,
peak::ipl::InterpolationAlgorithm algorithm = InterpolationAlgorithm::linear ) const
inline

Scale the image to the supplied width and height using the supplied algorithm and save it into the supplied buffer.

Parameters
[in]sizeoutput size of the image
[in]bufferthe used interpolation algorithm
[in]bufferSizethe used interpolation algorithm
[in]algorithmthe used interpolation algorithm
Exceptions
ExceptionAn internal error has occurred.
Since
1.7

◆ Size()

peak::ipl::Size2D peak::ipl::Image::Size ( ) const
inline

Returns the Size.

Returns
Size
Exceptions
ExceptionAn internal error has occurred.
Since
1.7

◆ Timestamp()

uint64_t peak::ipl::Image::Timestamp ( ) const
inline

The timestamp in nanoseconds.

The point in camera time at which the image was exposed.

Returns
Timestamp in nanoseconds
Since
1.6

◆ Width()

size_t peak::ipl::Image::Width ( ) const
inline

Returns the width.

Returns
Width
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

The documentation for this class was generated from the following file: