Scroom  0.14
color.hh File Reference
#include <cmath>
#include <cstdint>
#include <iomanip>
#include <sstream>
#include <boost/operators.hpp>
#include <gdk/gdk.h>
#include <cairo.h>
Include dependency graph for color.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Color
 

Namespaces

 Detail
 

Functions

uint8_t byteFromDouble (double d)
 
double doubleFromByte (uint8_t b)
 
uint16_t shortFromDouble (double d)
 
double Detail::computeC (double c)
 
Color mix (const Color &a, const Color &b, double alpha)
 

Function Documentation

◆ byteFromDouble()

uint8_t byteFromDouble ( double  d)
inline
21 { return uint8_t(255 * d); }

Referenced by Color::getARGB32(), Color::getHex(), and Color::getRGB24().

Here is the caller graph for this function:

◆ doubleFromByte()

double doubleFromByte ( uint8_t  b)
inline
22 { return b / 255.0; }
Here is the call graph for this function:

◆ mix()

Color mix ( const Color a,
const Color b,
double  alpha 
)
inline
133 { return a * alpha + b * (1.0 - alpha); }

Referenced by Operations8bpp::cache(), OperationsColormapped::cache(), Operations8bpp::draw(), and MonochromeColormapHelper::regenerateColormap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shortFromDouble()

uint16_t shortFromDouble ( double  d)
inline
23 { return uint16_t(0xFFFF * d); }

Referenced by Color::getGdkColor().

Here is the caller graph for this function:
b
static void b(const B::Ptr &)
Definition: gtkhelper-tests.cc:32