Version 8.9.0
 
Loading...
Searching...
No Matches
evo::ImageBuilder Class Reference

Image creation module for displaying purposes. More...

#include <ImageBuilder.h>

Collaboration diagram for evo::ImageBuilder:
Collaboration graph

Public Member Functions

 ImageBuilder (bool alignStride=true, short decimalPlaces=1)
 Standard constructor. More...
 
 ~ImageBuilder ()
 Destructor.
 
void setData (unsigned int width, unsigned int height, const unsigned short *data)
 Set new data. More...
 
unsigned int getWidth () const
 Get image width. More...
 
unsigned int getHeight () const
 Get image height. More...
 
float getTemperatureAt (int index) const
 Get temperature from last acquired image at specified image index. More...
 
float getTemperatureAt (int u, int v) const
 Get temperature from last acquired image at specified image coordinates. More...
 
float getMeanTemperature (unsigned int u1, unsigned int v1, unsigned int u2, unsigned int v2)
 Get mean temperature of rectangular measuring field. More...
 
void getMinMaxRegion (unsigned int radius, ExtremalRegion *minRegion, ExtremalRegion *maxRegion)
 Get region of minimum/maximum temperature with given radius. More...
 
void setManualTemperatureRange (float min, float max)
 Set temperature range for manual scaling method. More...
 
float getIsothermalMin () const
 Get minimum temperature used to scale image. More...
 
float getIsothermalMax () const
 Get maximum temperature used to scale image. More...
 
void setPaletteScalingMethod (EnumOptrisPaletteScalingMethod method)
 Scaling method of color conversion. More...
 
EnumOptrisPaletteScalingMethod getPaletteScalingMethod () const
 Accessor for activated color conversion mode. More...
 
unsigned int getStride (void) const
 If memory alignment is needed, this class provides a stride parameter configured with setSize(...). More...
 
void setPalette (EnumOptrisColoringPalette palette)
 Set palette for color conversion. More...
 
EnumOptrisColoringPalette getPalette () const
 Get palette for color conversion return coloring palette.
 
void getPaletteTable (paletteTable &table) const
 Get palette table for color conversion. More...
 
void fillPaletteLookup (unsigned int lut[65536])
 Fill lookup table for false color conversion. More...
 
void convertTemperatureToPaletteImage (unsigned char *dst, bool ignoreStride=false)
 Image conversion to rgb (bgr on windows) More...
 
void convertTemperatureToPaletteImage (unsigned int lut[65536], unsigned char *dst)
 Image conversion to rgb with lookup table. More...
 
void getPaletteBar (unsigned int w, unsigned int h, unsigned char *&img) const
 
void calcHistogram (unsigned int *hist, unsigned int histsize, int tMin, int tMax) const
 calculate histogram More...
 
void drawCrosshair (unsigned char *img, unsigned int x, unsigned int y, unsigned char rgb[3]=NULL) const
 Draw crosshair to the center of image. More...
 
void yuv422torgb24 (const unsigned char *src, unsigned char *dst, unsigned int w, unsigned int h) const
 Convert YUV422 image to RGB format (8-Bit per channel) More...
 
void convert2PPM (unsigned char *&ppm, unsigned int *size, unsigned char *buffer, unsigned int width, unsigned int height) const
 Convert palette image to ppm format. More...
 
int serializePPM (const char *filename, unsigned char *buffer, unsigned int width, unsigned int height) const
 Serialize data to PPM-format. More...
 
int readPPM3 (const char *filename, unsigned char **buffer, unsigned int *width, unsigned int *height)
 Read PPM (P3) format. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ ImageBuilder()

evo::ImageBuilder::ImageBuilder ( bool  alignStride = true,
short  decimalPlaces = 1 
)

Standard constructor.

Parameters
[in]alignStrideAlign to image stride
[in]decimalPlacesDecimal places of image data

Member Function Documentation

◆ calcHistogram()

void evo::ImageBuilder::calcHistogram ( unsigned int *  hist,
unsigned int  histsize,
int  tMin,
int  tMax 
) const

calculate histogram

Parameters
[out]histhistogram
[in]histsizenumber of quantization steps
[in]tMinminimum temperature
[in]tMaxmaximum temperature

◆ convert2PPM()

void evo::ImageBuilder::convert2PPM ( unsigned char *&  ppm,
unsigned int *  size,
unsigned char *  buffer,
unsigned int  width,
unsigned int  height 
) const

Convert palette image to ppm format.

Parameters
[out]ppmpointer to data container (is instantiated internally!). Delete pointer after use.
[out]sizesize of allocated data container
[in]bufferbuffer with palette image data
[in]widthwidth of palette image
[in]heightheight of palette image
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ convertTemperatureToPaletteImage() [1/2]

void evo::ImageBuilder::convertTemperatureToPaletteImage ( unsigned char *  dst,
bool  ignoreStride = false 
)

Image conversion to rgb (bgr on windows)

Parameters
[out]dstDestination image
[in]bydefault columns are multiple of 4, i.e., stride is added
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ convertTemperatureToPaletteImage() [2/2]

void evo::ImageBuilder::convertTemperatureToPaletteImage ( unsigned int  lut[65536],
unsigned char *  dst 
)

Image conversion to rgb with lookup table.

This method is efficient, but works only with fixed temperature ranges (manual mode).

Parameters
[in]lutlookup table
[out]dstDestination image

◆ drawCrosshair()

void evo::ImageBuilder::drawCrosshair ( unsigned char *  img,
unsigned int  x,
unsigned int  y,
unsigned char  rgb[3] = NULL 
) const

Draw crosshair to the center of image.

Parameters
[in/out]img image in RGB or RGBA format
[in]xx-position in image
[in]yy-position in image
[in]rgbRGB drawing color

◆ fillPaletteLookup()

void evo::ImageBuilder::fillPaletteLookup ( unsigned int  lut[65536])

Fill lookup table for false color conversion.

Parameters
[out]lutlookup table

◆ getHeight()

unsigned int evo::ImageBuilder::getHeight ( ) const

Get image height.

Returns
image height

◆ getIsothermalMax()

float evo::ImageBuilder::getIsothermalMax ( ) const

Get maximum temperature used to scale image.

Returns
Temperature in °C

◆ getIsothermalMin()

float evo::ImageBuilder::getIsothermalMin ( ) const

Get minimum temperature used to scale image.

Returns
Temperature in °C

◆ getMeanTemperature()

float evo::ImageBuilder::getMeanTemperature ( unsigned int  u1,
unsigned int  v1,
unsigned int  u2,
unsigned int  v2 
)

Get mean temperature of rectangular measuring field.

Parameters
[in]u1u-component of image coordinate, i. e. column of 1st point
[in]v1v-component of image coordinate, i. e. row of 1st point
[in]u2u-component of image coordinate, i. e. column of 2nd point
[in]v2v-component of image coordinate, i. e. row of 2nd point
Returns
mean temperature
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ getMinMaxRegion()

void evo::ImageBuilder::getMinMaxRegion ( unsigned int  radius,
ExtremalRegion minRegion,
ExtremalRegion maxRegion 
)

Get region of minimum/maximum temperature with given radius.

Parameters
[in]radiusRadius of region
[out]minRegionRegion of minimum mean temperature
[out]maxRegionRegion of maximum mean temperature
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ getPaletteBar()

void evo::ImageBuilder::getPaletteBar ( unsigned int  w,
unsigned int  h,
unsigned char *&  img 
) const
Parameters
[in]wwidth of palette bar
[in]hheight of palette bar
[out]imgpalette bar image. Methode allocates a array with size of 3*w*h. Free pointer with delete[].
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ getPaletteScalingMethod()

EnumOptrisPaletteScalingMethod evo::ImageBuilder::getPaletteScalingMethod ( ) const

Accessor for activated color conversion mode.

Returns
Scaling method

◆ getPaletteTable()

void evo::ImageBuilder::getPaletteTable ( paletteTable &  table) const

Get palette table for color conversion.

Returns
coloring palette table as rgb triple

◆ getStride()

unsigned int evo::ImageBuilder::getStride ( void  ) const

If memory alignment is needed, this class provides a stride parameter configured with setSize(...).

Memory will be aligned such that the image width is a multiple of 4

Examples
examples/linux/opengl/irimagerShow.cpp.

◆ getTemperatureAt() [1/2]

float evo::ImageBuilder::getTemperatureAt ( int  index) const

Get temperature from last acquired image at specified image index.

Parameters
[in]indexImage index (must be within [0; getWidth()*getHeight()]) return temperature in degree Celsius

◆ getTemperatureAt() [2/2]

float evo::ImageBuilder::getTemperatureAt ( int  u,
int  v 
) const

Get temperature from last acquired image at specified image coordinates.

Parameters
[in]uImage column (must be within [0; getWidth()])
[in]vImage row (must be within [0; getHeight()]) return temperature in degree Celsius

◆ getWidth()

unsigned int evo::ImageBuilder::getWidth ( ) const

Get image width.

Returns
image width

◆ readPPM3()

int evo::ImageBuilder::readPPM3 ( const char *  filename,
unsigned char **  buffer,
unsigned int *  width,
unsigned int *  height 
)

Read PPM (P3) format.

Parameters
[in]filenamefilename
[in]bufferRGB image buffer (instantiated in method)
[in]widthwidth of read image
[in]heightheight of read image

◆ serializePPM()

int evo::ImageBuilder::serializePPM ( const char *  filename,
unsigned char *  buffer,
unsigned int  width,
unsigned int  height 
) const

Serialize data to PPM-format.

Parameters
[in]filenamefilename
[in]bufferRGB image data
[in]widthwidth of image
[in]heightheight of image
Returns
success
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ setData()

void evo::ImageBuilder::setData ( unsigned int  width,
unsigned int  height,
const unsigned short *  data 
)

Set new data.

Parameters
[in]widthimage width
[in]heightimage height
[in]dataimage data
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ setManualTemperatureRange()

void evo::ImageBuilder::setManualTemperatureRange ( float  min,
float  max 
)

Set temperature range for manual scaling method.

Parameters
[in]minLower limit in °C
[in]maxUpper limit in °C
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ setPalette()

void evo::ImageBuilder::setPalette ( EnumOptrisColoringPalette  palette)

Set palette for color conversion.

Parameters
[in]palettecoloring palette
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ setPaletteScalingMethod()

void evo::ImageBuilder::setPaletteScalingMethod ( EnumOptrisPaletteScalingMethod  method)

Scaling method of color conversion.

Parameters
[in]methodScaling method
Examples
examples/linux/opengl/irimagerShow.cpp.

◆ yuv422torgb24()

void evo::ImageBuilder::yuv422torgb24 ( const unsigned char *  src,
unsigned char *  dst,
unsigned int  w,
unsigned int  h 
) const

Convert YUV422 image to RGB format (8-Bit per channel)

Parameters
[in]srcsource image
[out]dstdestination image
[in]wimage width
[in]himage height
Examples
examples/linux/opengl/irimagerShow.cpp.

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