Image creation module for displaying purposes. More...
#include <ImageBuilder.h>
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... | |
Image creation module for displaying purposes.
evo::ImageBuilder::ImageBuilder | ( | bool | alignStride = true , |
short | decimalPlaces = 1 |
||
) |
Standard constructor.
[in] | alignStride | Align to image stride |
[in] | decimalPlaces | Decimal places of image data |
void evo::ImageBuilder::calcHistogram | ( | unsigned int * | hist, |
unsigned int | histsize, | ||
int | tMin, | ||
int | tMax | ||
) | const |
calculate histogram
[out] | hist | histogram |
[in] | histsize | number of quantization steps |
[in] | tMin | minimum temperature |
[in] | tMax | maximum temperature |
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.
[out] | ppm | pointer to data container (is instantiated internally!). Delete pointer after use. |
[out] | size | size of allocated data container |
[in] | buffer | buffer with palette image data |
[in] | width | width of palette image |
[in] | height | height of palette image |
void evo::ImageBuilder::convertTemperatureToPaletteImage | ( | unsigned char * | dst, |
bool | ignoreStride = false |
||
) |
Image conversion to rgb (bgr on windows)
[out] | dst | Destination image |
[in] | by | default columns are multiple of 4, i.e., stride is added |
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).
[in] | lut | lookup table |
[out] | dst | Destination image |
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.
[in/out] | img image in RGB or RGBA format | |
[in] | x | x-position in image |
[in] | y | y-position in image |
[in] | rgb | RGB drawing color |
void evo::ImageBuilder::fillPaletteLookup | ( | unsigned int | lut[65536] | ) |
Fill lookup table for false color conversion.
[out] | lut | lookup table |
unsigned int evo::ImageBuilder::getHeight | ( | ) | const |
Get image height.
float evo::ImageBuilder::getIsothermalMax | ( | ) | const |
Get maximum temperature used to scale image.
float evo::ImageBuilder::getIsothermalMin | ( | ) | const |
Get minimum temperature used to scale image.
float evo::ImageBuilder::getMeanTemperature | ( | unsigned int | u1, |
unsigned int | v1, | ||
unsigned int | u2, | ||
unsigned int | v2 | ||
) |
Get mean temperature of rectangular measuring field.
[in] | u1 | u-component of image coordinate, i. e. column of 1st point |
[in] | v1 | v-component of image coordinate, i. e. row of 1st point |
[in] | u2 | u-component of image coordinate, i. e. column of 2nd point |
[in] | v2 | v-component of image coordinate, i. e. row of 2nd point |
void evo::ImageBuilder::getMinMaxRegion | ( | unsigned int | radius, |
ExtremalRegion * | minRegion, | ||
ExtremalRegion * | maxRegion | ||
) |
Get region of minimum/maximum temperature with given radius.
[in] | radius | Radius of region |
[out] | minRegion | Region of minimum mean temperature |
[out] | maxRegion | Region of maximum mean temperature |
void evo::ImageBuilder::getPaletteBar | ( | unsigned int | w, |
unsigned int | h, | ||
unsigned char *& | img | ||
) | const |
[in] | w | width of palette bar |
[in] | h | height of palette bar |
[out] | img | palette bar image. Methode allocates a array with size of 3*w*h. Free pointer with delete[]. |
EnumOptrisPaletteScalingMethod evo::ImageBuilder::getPaletteScalingMethod | ( | ) | const |
Accessor for activated color conversion mode.
void evo::ImageBuilder::getPaletteTable | ( | paletteTable & | table | ) | const |
Get palette table for color conversion.
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
float evo::ImageBuilder::getTemperatureAt | ( | int | index | ) | const |
Get temperature from last acquired image at specified image index.
[in] | index | Image index (must be within [0; getWidth()*getHeight()]) return temperature in degree Celsius |
float evo::ImageBuilder::getTemperatureAt | ( | int | u, |
int | v | ||
) | const |
Get temperature from last acquired image at specified image coordinates.
[in] | u | Image column (must be within [0; getWidth()]) |
[in] | v | Image row (must be within [0; getHeight()]) return temperature in degree Celsius |
unsigned int evo::ImageBuilder::getWidth | ( | ) | const |
Get image width.
int evo::ImageBuilder::readPPM3 | ( | const char * | filename, |
unsigned char ** | buffer, | ||
unsigned int * | width, | ||
unsigned int * | height | ||
) |
Read PPM (P3) format.
[in] | filename | filename |
[in] | buffer | RGB image buffer (instantiated in method) |
[in] | width | width of read image |
[in] | height | height of read image |
int evo::ImageBuilder::serializePPM | ( | const char * | filename, |
unsigned char * | buffer, | ||
unsigned int | width, | ||
unsigned int | height | ||
) | const |
Serialize data to PPM-format.
[in] | filename | filename |
[in] | buffer | RGB image data |
[in] | width | width of image |
[in] | height | height of image |
void evo::ImageBuilder::setData | ( | unsigned int | width, |
unsigned int | height, | ||
const unsigned short * | data | ||
) |
Set new data.
[in] | width | image width |
[in] | height | image height |
[in] | data | image data |
void evo::ImageBuilder::setManualTemperatureRange | ( | float | min, |
float | max | ||
) |
Set temperature range for manual scaling method.
[in] | min | Lower limit in °C |
[in] | max | Upper limit in °C |
void evo::ImageBuilder::setPalette | ( | EnumOptrisColoringPalette | palette | ) |
Set palette for color conversion.
[in] | palette | coloring palette |
void evo::ImageBuilder::setPaletteScalingMethod | ( | EnumOptrisPaletteScalingMethod | method | ) |
Scaling method of color conversion.
[in] | method | Scaling method |
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)
[in] | src | source image |
[out] | dst | destination image |
[in] | w | image width |
[in] | h | image height |