![]() |
Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
|
Encapsulates false color images with 8-bit color depth. More...
#include <Image.h>
Public Member Functions | |
OTC_SDK_API | Image (ColorFormat colorFormat, WidthAlignment widthAlignment) noexcept |
Constructor. | |
OTC_SDK_API Pixel | getPixel (int index) const |
Returns the pixel at the given index. | |
OTC_SDK_API Pixel | getPixel (int x, int y) const |
Returns the pixel at the given coordinates. | |
OTC_SDK_API void | setPixel (int index, const Pixel &pixel) |
Sets the pixel at the given index. | |
OTC_SDK_API void | setPixel (int x, int y, const Pixel &pixel) |
Sets the pixel at the given coordinates. | |
OTC_SDK_API ImageIterator | getIterator () noexcept |
Returns an iterator with read and write access. | |
OTC_SDK_API ConstImageIterator | getConstIterator () const noexcept |
Returns an iterator with read access. | |
OTC_SDK_API int | getWidth () const noexcept |
Returns the width of the image in pixels. | |
OTC_SDK_API int | getStride () const noexcept |
Returns the stride of the image in bytes. | |
OTC_SDK_API int | getHeight () const noexcept |
Returns the height of the image in pixels. | |
OTC_SDK_API int | getSize () const noexcept |
Returns the size of the image as total number of pixels. | |
OTC_SDK_API int | getSizeInBytes () const noexcept |
Returns the size of the internal storage in bytes. | |
OTC_SDK_API bool | isEmpty () const noexcept |
Returns whether the image is empty. | |
OTC_SDK_API void | clear () |
Clears the image. | |
OTC_SDK_API void | resize (int width, int height) |
Resizes the image to the given dimensions. | |
OTC_SDK_API ColorFormat | getColorFormat () const noexcept |
Returns the color format. | |
OTC_SDK_API WidthAlignment | getWidthAlignment () const noexcept |
Returns the width alignment. | |
OTC_SDK_API Image | clone () const noexcept |
Returns a complete copy of this image. | |
OTC_SDK_API void | copyDataTo (unsigned char *destination, int size) const noexcept |
Copies the internally stored pixel values to the given array. | |
OTC_SDK_API const unsigned char * | getData () const noexcept |
Returns a pointer to the first element of the internal array. | |
Friends | |
class | ImageIterator |
class | ConstImageIterator |
Encapsulates false color images with 8-bit color depth.
The individual pixel values, like red, green or blue, are stored in a one-dimensional array.
Depending on the width alignment additional bytes may be added at the end of each row to ensure that its size in bytes respects this alignment. The setter and getter functions as well as the iterators will skip this padding.
The origin of coordinates is located in the upper left corner with the x-axis pointing right and the y-axis pointing down.
|
noexcept |
Constructor.
[in] | colorFormat | defines the sequence in which the pixel values are stored internally. |
[in] | widthAlignment | defines the alignment of the row size in bytes. If, e.g., it is set to four bytes, the row size will potentially be padded at the end so that it is a multiple of four. |
|
inlinenoexcept |
Returns a complete copy of this image.
|
noexcept |
Copies the internally stored pixel values to the given array.
This includes potential width padding.
[out] | destination | array to copy the data to. |
[in] | size | in bytes. The specified size is limited to [0, frame size in bytes]. |
|
inlinenoexcept |
Returns the color format.
|
inlinenoexcept |
Returns an iterator with read access.
The iterator traverses the image in a row major fashion and skips potential width padding.
|
inlinenoexcept |
Returns a pointer to the first element of the internal array.
The size of the array can be acquired via the getSizeInBytes() function.
|
inlinenoexcept |
Returns the height of the image in pixels.
|
inlinenoexcept |
Returns an iterator with read and write access.
The iterator traverses the image in a row major fashion and skips potential width padding.
OTC_SDK_API Pixel optris::Image::getPixel | ( | int | index | ) | const |
Returns the pixel at the given index.
[in] | index | of the desired pixel. |
SDKException | if the index is out of bounds. |
OTC_SDK_API Pixel optris::Image::getPixel | ( | int | x, |
int | y ) const |
Returns the pixel at the given coordinates.
[in] | x | coordinate. |
[in] | y | coordinate. |
SDKException | if the coordinates are out of bounds. |
|
inlinenoexcept |
Returns the size of the image as total number of pixels.
|
inlinenoexcept |
Returns the size of the internal storage in bytes.
This includes potential width padding.
|
inlinenoexcept |
Returns the stride of the image in bytes.
The stride is the image width in bytes including potential padding.
|
inlinenoexcept |
Returns the width of the image in pixels.
|
inlinenoexcept |
Returns the width alignment.
|
inlinenoexcept |
Returns whether the image is empty.
OTC_SDK_API void optris::Image::resize | ( | int | width, |
int | height ) |
Resizes the image to the given dimensions.
[in] | width | in pixels. |
[in] | height | in pixels. |
OTC_SDK_API void optris::Image::setPixel | ( | int | index, |
const Pixel & | pixel ) |
Sets the pixel at the given index.
[in] | index | of the pixel to set. |
[in] | pixel | to set. |
SDKException | if the index is out of bounds. |
OTC_SDK_API void optris::Image::setPixel | ( | int | x, |
int | y, | ||
const Pixel & | pixel ) |
Sets the pixel at the given coordinates.
[in] | x | coordinate. |
[in] | y | coordinate. |
[in] | pixel | to set. |
SDKException | if the coordinates are out of bounds. |