#include <VP1ColorUtils.h>
|
| static void | setMatColorFromRGB (SoMaterial *mat, const std::string &type, const unsigned int r, const unsigned int g, const unsigned int b) |
| static SbColor | getSbColorFromRGB (const unsigned int r, const unsigned int g, const unsigned int b) |
| static float | getValFromRGB (const unsigned int rgb) |
Definition at line 25 of file VP1ColorUtils.h.
◆ getSbColorFromRGB()
| SbColor VP1ColorUtils::getSbColorFromRGB |
( |
const unsigned int | r, |
|
|
const unsigned int | g, |
|
|
const unsigned int | b ) |
|
static |
Definition at line 46 of file VP1ColorUtils.cxx.
47{
51 return SbColor(fr, fg, fb);
52}
static float getValFromRGB(const unsigned int rgb)
◆ getValFromRGB()
| float VP1ColorUtils::getValFromRGB |
( |
const unsigned int | rgb | ) |
|
|
static |
Definition at line 18 of file VP1ColorUtils.cxx.
19{
20 if (rgb > 255) {
21 std::cout << "ERROR! RGB color value is expected in the the range [0,255]. Here we get: " << rgb << ". Exiting..." << std::endl;
22 std::exit(EXIT_FAILURE);
23 }
24 return rgb/255.0;
25}
◆ setMatColorFromRGB()
| void VP1ColorUtils::setMatColorFromRGB |
( |
SoMaterial * | mat, |
|
|
const std::string & | type, |
|
|
const unsigned int | r, |
|
|
const unsigned int | g, |
|
|
const unsigned int | b ) |
|
static |
Definition at line 27 of file VP1ColorUtils.cxx.
28{
32 if (type == "ambient")
33 mat->ambientColor.setValue(fr, fg, fb);
34 else if (type == "diffuse")
35 mat->diffuseColor.setValue(fr, fg, fb);
36 else if (type == "specular")
37 mat->specularColor.setValue(fr, fg, fb);
38 else
39 std::cout <<
"ERROR! Color type not supported ==> " <<
type << std::endl;
40
41
42
43 return;
44}
The documentation for this class was generated from the following files: