Fesapi 2.9.0.1
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
resqml2::AbstractColorMap Class Referenceabstract

Map of abstract colors. More...

#include <AbstractColorMap.h>

Inheritance diagram for resqml2::AbstractColorMap:
resqml2::ContinuousColorMap resqml2::DiscreteColorMap

Public Member Functions

virtual void setHsvColors (unsigned int colorCount, double const *hsvColors, double const *alphas=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >(), double const *indices=nullptr)=0
 
void setRgbColors (unsigned int colorCount, double const *rgbColors, double const *alphas=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >(), double const *indices=nullptr)
 
void setRgbColors (unsigned int colorCount, unsigned int const *rgbColors, double const *alphas=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >(), double const *indices=nullptr)
 
virtual uint64_t getColorCount () const =0
 Gets color count.
 
double getHue (double colorIndex) const
 
double getSaturation (double colorIndex) const
 
double getValue (double colorIndex) const
 
double getAlpha (double colorIndex) const
 
void getRgbColor (double colorIndex, double &red, double &green, double &blue) const
 
void getRgbColor (double colorIndex, unsigned int &red, unsigned int &green, unsigned int &blue) const
 
bool hasColorTitle (double colorIndex) const
 Queries if 'colorIndex' has color title.
 
std::string getColorTitle (double colorIndex) const
 Gets color title.
 
void loadTargetRelationships ()
 

Detailed Description

Map of abstract colors.

Member Function Documentation

◆ getAlpha()

double resqml2::AbstractColorMap::getAlpha ( double colorIndex) const
Parameters
colorIndexindex of a color in the color map. It is cast to unsigned int in the case of a discrete color map
Returns
alpha in the range [0, 1] (0 means transparent and 1 means opaque)

◆ getColorCount()

virtual uint64_t resqml2::AbstractColorMap::getColorCount ( ) const
pure virtual

Gets color count.

Returns
The color count.

Implemented in resqml2::ContinuousColorMap, and resqml2::DiscreteColorMap.

◆ getColorTitle()

std::string resqml2::AbstractColorMap::getColorTitle ( double colorIndex) const

Gets color title.

Parameters
colorIndexZero-based index of the color.
Returns
The color title.

◆ getHue()

double resqml2::AbstractColorMap::getHue ( double colorIndex) const
Parameters
colorIndexindex of a color in the color map. It is cast to unsigned int in the case of a discrete color map
Returns
hue in the range [0, 360]

◆ getRgbColor() [1/2]

void resqml2::AbstractColorMap::getRgbColor ( double colorIndex,
double & red,
double & green,
double & blue ) const
Parameters
colorIndexindex of a color in the color map. It is cast to unsigned int in the case of a discrete color map
red(output parameter) red value in the range [0, 1]
green(output parameter) green value in the range [0, 1]
blue(output parameter) blue value in the range [0, 1]

◆ getRgbColor() [2/2]

void resqml2::AbstractColorMap::getRgbColor ( double colorIndex,
unsigned int & red,
unsigned int & green,
unsigned int & blue ) const
Parameters
colorIndexindex of a color in the color map. It is cast to unsigned int in the case of a discrete color map
red(output parameter) red value in the range [0, 1]
green(output parameter) green value in the range [0, 1]
blue(output parameter) blue value in the range [0, 1]

◆ getSaturation()

double resqml2::AbstractColorMap::getSaturation ( double colorIndex) const
Parameters
colorIndexindex of a color in the color map. It is cast to unsigned int in the case of a discrete color map
Returns
saturation in the range [0, 1]

◆ getValue()

double resqml2::AbstractColorMap::getValue ( double colorIndex) const
Parameters
colorIndexindex of a color in the color map. It is cast to unsigned int in the case of a discrete color map
Returns
value in the range [0, 1]

◆ hasColorTitle()

bool resqml2::AbstractColorMap::hasColorTitle ( double colorIndex) const

Queries if 'colorIndex' has color title.

Parameters
colorIndexZero-based index of the color.
Returns
True if color title, false if not.

◆ setHsvColors()

virtual void resqml2::AbstractColorMap::setHsvColors ( unsigned int colorCount,
double const * hsvColors,
double const * alphas = nullptr,
std::vector< std::string > const & colorTitles = std::vector< std::string >(),
double const * indices = nullptr )
pure virtual

https://en.wikipedia.org/wiki/HSV_color_space

Parameters
colorCountthe size (number of colors) of the color map
hsvColorsarray (of size colorCount * 3) of HSV colors with hsvColors[3*i] is the hue, hsvColors[3*i + 1] is the saturation and hsvColors[3*i + 2] is the value of the ith color (hue is in range [0, 360] while saturation and value are in range [0, 1])
alphasarray (of size colorCount) of numeric values in the range [0, 1] for alpha transparency channel (0 means transparent and 1 means opaque). If alphas == nullptr (default value), default alpha value is 1.
colorTitlesvector (of size colorCount) of color titles. Titles are not set if colorTitles == nullptr (default value)
indicesarray (of size solorCount) of color indices. These indices are cast to unsigned int in the case of a discrete color map. If indices == nullptr (default value), indices are set from 0 to colorCount - 1

Implemented in resqml2::ContinuousColorMap, and resqml2::DiscreteColorMap.

◆ setRgbColors() [1/2]

void resqml2::AbstractColorMap::setRgbColors ( unsigned int colorCount,
double const * rgbColors,
double const * alphas = nullptr,
std::vector< std::string > const & colorTitles = std::vector< std::string >(),
double const * indices = nullptr )

https://en.wikipedia.org/wiki/HSV_color_space

Parameters
colorCountthe size (number of colors) of the color map
rgbColorsarray (of size colorCount * 3) of RGB colors with hsvColors[3*i] is red componant, hsvColors[3*i + 1] is green component and hsvColors[3*i + 2] is blue component of the ith color (red, green and blue are in range [0, 1])
alphasarray (of size colorCount) of numeric values in the range [0, 1] for alpha transparency channel (0 means transparent and 1 means opaque). If alphas == nullptr (default value), default alpha value is 1.
colorTitlesvector (of size colorCount) of color titles. Titles are not set if colorTitles == nullptr (default value)
indicesarray (of size solorCount) of color indices. These indices are cast to unsigned int in the case of a discrete color map. If indices == nullptr (default value), indices are set from 0 to colorCount - 1

◆ setRgbColors() [2/2]

void resqml2::AbstractColorMap::setRgbColors ( unsigned int colorCount,
unsigned int const * rgbColors,
double const * alphas = nullptr,
std::vector< std::string > const & colorTitles = std::vector< std::string >(),
double const * indices = nullptr )

https://en.wikipedia.org/wiki/HSV_color_space

Parameters
colorCountthe size (number of colors) of the color map
rgbColorsarray (of size colorCount * 3) of RGB colors with hsvColors[3*i] is red componant, hsvColors[3*i + 1] is green component and hsvColors[3*i + 2] is blue component of the ith color (red, green and blue are in range [0, 255])
alphasarray (of size colorCount) of numeric values in the range [0, 1] for alpha transparency channel (0 means transparent and 1 means opaque). If alphas == nullptr (default value), default alpha value is 1.
colorTitlesvector (of size colorCount) of color titles. Titles are not set if colorTitles == nullptr (default value)
indicesarray (of size solorCount) of color indices. These indices are cast to unsigned int in the case of a discrete color map. If indices == nullptr (default value), indices are set from 0 to colorCount - 1

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