Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
optris::ImageBuilder Class Reference

Creates false color images from thermal frames. More...

#include <ImageBuilder.h>

Collaboration diagram for optris::ImageBuilder:
Collaboration graph

Public Types

using LookupTable = std::array<unsigned int, 65536>
 Type for look up tables.
 

Public Member Functions

OTC_SDK_API ImageBuilder (ColorFormat colorFormat, WidthAlignment widthAlignment)
 Constructor.
 
OTC_SDK_API void setThermalFrame (const ThermalFrame &thermalFrame)
 Sets a new thermal frame.
 
const ThermalFramegetThermalFrame () const noexcept
 Grants read access to the stored thermal frame.
 
int getWidth () const noexcept
 Returns the width in pixels of the thermal frame.
 
int getHeight () const noexcept
 Returns the height in pixels of thermal frame.
 
OTC_SDK_API float getTemperature (int index) const
 Returns the temperature the from last acquired image at specified pixel index.
 
OTC_SDK_API float getTemperature (int x, int y) const
 Returns the temperature from last acquired image at specified pixel coordinates.
 
OTC_SDK_API bool getMeanTemperatureInRegion (TemperatureRegion &meanRegion)
 Returns the mean temperature in °C of a rectangular region.
 
OTC_SDK_API bool getMinMaxRegions (int radius, TemperatureRegion &minRegion, TemperatureRegion &maxRegion)
 Returns the region of minimum/maximum temperature in °C with the given radius.
 
OTC_SDK_API void setManualTemperatureRange (float min, float max)
 Sets the temperature range for the manual scaling method.
 
OTC_SDK_API float getIsothermalMin () const noexcept
 Returns the minimum temperature used to scale the image.
 
OTC_SDK_API float getIsothermalMax () const noexcept
 Returns the maximum temperature used to scale the image.
 
void setPaletteScalingMethod (PaletteScalingMethod method) noexcept
 Sets the scaling method for the false color conversion.
 
PaletteScalingMethod getPaletteScalingMethod () const noexcept
 Returns the current scaling method for the false color conversion.
 
void setPalette (ColoringPalette palette) noexcept
 Sets the palette for the false color conversion.
 
OTC_SDK_API ColoringPalette getPalette () const noexcept
 Returns the palette for the false color conversion.
 
const ImagegetImage () noexcept
 Grants read access to the generated false color image.
 
int getImageSizeInBytes () const noexcept
 Returns the image size in bytes including potential width padding.
 
int getImageStride () const noexcept
 Returns the image stride in bytes.
 
OTC_SDK_API void copyImageDataTo (unsigned char *destination, int size) const noexcept
 Copies the false color image data to the given destination array.
 
OTC_SDK_API LookupTable createLookupTable ()
 Creates a lookup table for the false color conversion..
 
OTC_SDK_API void convertTemperatureToPaletteImage ()
 Triggers the image conversion.
 
OTC_SDK_API void convertTemperatureToPaletteImage (const LookupTable &lut)
 Image conversion to RBG with lookup table. This method is efficient, but works only with fixed temperature ranges (manual mode).
 

Detailed Description

Creates false color images from thermal frames.

Constructor & Destructor Documentation

◆ ImageBuilder()

OTC_SDK_API optris::ImageBuilder::ImageBuilder ( ColorFormat colorFormat,
WidthAlignment widthAlignment )

Constructor.

Be mindful of which color format and width alignment you choose. Please refer to the documentation of the enums for more details.

Parameters
[in]colorFormatfor the generated false color image.
[in]widthAlignmentfor the generated false color image.

Member Function Documentation

◆ convertTemperatureToPaletteImage()

OTC_SDK_API void optris::ImageBuilder::convertTemperatureToPaletteImage ( const LookupTable & lut)

Image conversion to RBG with lookup table. This method is efficient, but works only with fixed temperature ranges (manual mode).

Parameters
[in]lutlookup table.

◆ copyImageDataTo()

OTC_SDK_API void optris::ImageBuilder::copyImageDataTo ( unsigned char * destination,
int size ) const
noexcept

Copies the false color image data to the given destination array.

Parameters
[out]destinationarray to copy the false color image data to.
[in]sizein bytes. The specified size is limited to [0, image size in bytes].

◆ createLookupTable()

OTC_SDK_API LookupTable optris::ImageBuilder::createLookupTable ( )

Creates a lookup table for the false color conversion..

Returns
lookup table.

◆ getHeight()

int optris::ImageBuilder::getHeight ( ) const
inlinenoexcept

Returns the height in pixels of thermal frame.

Returns
height in pixels of thermal frame.

◆ getImage()

const Image & optris::ImageBuilder::getImage ( )
inlinenoexcept

Grants read access to the generated false color image.

Returns
const reference to the generated false color image.

◆ getImageSizeInBytes()

int optris::ImageBuilder::getImageSizeInBytes ( ) const
inlinenoexcept

Returns the image size in bytes including potential width padding.

Returns
image size in bytes including potential width padding.

◆ getImageStride()

int optris::ImageBuilder::getImageStride ( ) const
inlinenoexcept

Returns the image stride in bytes.

The stride is the image width in bytes including potential padding.

Returns
image stride in bytes.

◆ getIsothermalMax()

OTC_SDK_API float optris::ImageBuilder::getIsothermalMax ( ) const
noexcept

Returns the maximum temperature used to scale the image.

Returns
Temperature in °C

◆ getIsothermalMin()

OTC_SDK_API float optris::ImageBuilder::getIsothermalMin ( ) const
noexcept

Returns the minimum temperature used to scale the image.

Returns
temperature in °C.

◆ getMeanTemperatureInRegion()

OTC_SDK_API bool optris::ImageBuilder::getMeanTemperatureInRegion ( TemperatureRegion & meanRegion)

Returns the mean temperature in °C of a rectangular region.

Before providing the region to this method you have to define the rectangular area it covers by specifying its upper left and lower right corners.

Parameters
[out]meanRegionin which to calculate the mean temperature.
Returns
true if a mean temperature could be calculated. False if no thermal data is available or if the region coordinates are inconstent or if the region is too large for the frame.

◆ getMinMaxRegions()

OTC_SDK_API bool optris::ImageBuilder::getMinMaxRegions ( int radius,
TemperatureRegion & minRegion,
TemperatureRegion & maxRegion )

Returns the region of minimum/maximum temperature in °C with the given radius.

The method will fill in all the data for the min and max temperature region.

Parameters
[in]radiusradius of the region.
[out]minRegionregion of minimum mean temperature.
[out]maxRegionregion of maximum mean temperature.
Returns
true if minimum/maximum temperature could be calculated. False if no thermal data is available or if the radius is to large for the frame.

◆ getPalette()

ColoringPalette optris::ImageBuilder::getPalette ( ) const
inlinenoexcept

Returns the palette for the false color conversion.

Returns
used coloring palette.

◆ getPaletteScalingMethod()

PaletteScalingMethod optris::ImageBuilder::getPaletteScalingMethod ( ) const
inlinenoexcept

Returns the current scaling method for the false color conversion.

Returns
scaling method.

◆ getTemperature() [1/2]

OTC_SDK_API float optris::ImageBuilder::getTemperature ( int index) const

Returns the temperature the from last acquired image at specified pixel index.

Parameters
[in]indexpixel index.
Returns
temperature in °C.
Exceptions
SDKExceptionif index is out of range.

◆ getTemperature() [2/2]

OTC_SDK_API float optris::ImageBuilder::getTemperature ( int x,
int y ) const

Returns the temperature from last acquired image at specified pixel coordinates.

The origin of coordinates is located in the upper left corner with the x-axis pointing right and the y-axis pointing downwards.

Parameters
[in]xcoordinates.
[in]ycoordinates.
Returns
temperature in °C.
Exceptions
SDKExceptionif coordinates are out of range.

◆ getThermalFrame()

const ThermalFrame & optris::ImageBuilder::getThermalFrame ( ) const
inlinenoexcept

Grants read access to the stored thermal frame.

Returns
const reference to the stored thermal frame.

◆ getWidth()

int optris::ImageBuilder::getWidth ( ) const
inlinenoexcept

Returns the width in pixels of the thermal frame.

Returns
width in pixels of the thermal frame.

◆ setManualTemperatureRange()

OTC_SDK_API void optris::ImageBuilder::setManualTemperatureRange ( float min,
float max )

Sets the temperature range for the manual scaling method.

Parameters
[in]minlower limit in °C.
[in]maxupper limit in °C.

◆ setPalette()

void optris::ImageBuilder::setPalette ( ColoringPalette palette)
inlinenoexcept

Sets the palette for the false color conversion.

Parameters
[in]palettecoloring palette to set.

◆ setPaletteScalingMethod()

void optris::ImageBuilder::setPaletteScalingMethod ( PaletteScalingMethod method)
inlinenoexcept

Sets the scaling method for the false color conversion.

Parameters
[in]methodscaling method.

◆ setThermalFrame()

OTC_SDK_API void optris::ImageBuilder::setThermalFrame ( const ThermalFrame & thermalFrame)

Sets a new thermal frame.

The provide frame will be copied to an internal buffer.

Parameters
[in]thermalFramedata.

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