Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
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

namespace  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; }
Blob::Ptr const b
Definition blob-tests.cc:118

◆ mix()

Color mix ( const Color a,
const Color b,
double  alpha 
)
inline
133{ return a * alpha + b * (1.0 - alpha); }
std::shared_ptr< A > a
Definition async-deleter-tests.cc:60

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

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: