MeteoIODoc 20241221.207bde49
mio::Legend Class Reference

Detailed Description

This creates a legend as pixels in a Grid2DObject. This should be used with/by a plugin that would then convert this Grid2DObject into a true graphic file (png, etc).

Author
Mathias Bavay
Date
2011-12-23

#include <Graphics.h>

Public Member Functions

 Legend (const unsigned int &height, const double &minimum, const double &maximum)
 Constructor. More...
 
const Array2D< double > getLegend () const
 Get the legend in an array The legend is coded as values between min and max (+background and text colors) in an array. This array can then be used alongside the data array to build the full plot. More...
 

Static Public Member Functions

static unsigned int getLegendWidth ()
 Get the actual width of the legend This is constant but depends on various parameters of the legend: font size, number of characters, spacing etc. More...
 

Static Public Attributes

static const double bg_color = IOUtils::nodata-1
 marker for solid background More...
 
static const double text_color = IOUtils::nodata-2
 marker for solid text More...
 

Constructor & Destructor Documentation

◆ Legend()

mio::Legend::Legend ( const unsigned int &  height,
const double &  minimum,
const double &  maximum 
)

Constructor.

Parameters
heightavailable height of the plot (for centering the legend)
minimumstart value of the legend
maximumend value of the legend

Member Function Documentation

◆ getLegend()

const Array2D< double > mio::Legend::getLegend ( ) const

Get the legend in an array The legend is coded as values between min and max (+background and text colors) in an array. This array can then be used alongside the data array to build the full plot.

Returns
legend array

◆ getLegendWidth()

unsigned int mio::Legend::getLegendWidth ( )
static

Get the actual width of the legend This is constant but depends on various parameters of the legend: font size, number of characters, spacing etc.

Returns
width of the legend

Member Data Documentation

◆ bg_color

const double mio::Legend::bg_color = IOUtils::nodata-1
static

marker for solid background

◆ text_color

const double mio::Legend::text_color = IOUtils::nodata-2
static

marker for solid text


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