RIP - Raster and Image Processor



class  RGBColor;

Digital implementation of RGB color format.


this(T, U, V)(T red, U green, V blue) if (allArithmetic!(T, U, V));

Parametrized ctor for working with any arithmetic types

Parameters
T red red componemt
U green green componemt
V blue blue componemt

void  setRed(T)(T red);
void  setGreen(T)(T green);
void  setBlue(T)(T blue);

Funcs for changing components of color


T  distance(T)(RGBColor rhs);

Parameters
RGBColor rhs second color
Returns
Distance between two colors in RGB space

RGBColor  opBinary(string op)(auto ref RGBColor rhs);
void  opOpAssign(string op)(auto ref RGBColor rhs);

Arithmetic operations for colors

Parameters
RGBColor rhs second color

RGBColor  opBinary(string op, T)(auto ref T rhs) if (allArithmetic!T);
RGBColor  opBinaryRight(string op, T)(auto ref T rhs) if (allArithmetic!T);

Arithmetic operations between color and arithmetic types

Parameters
T rhs variable

RGBColor  gamma(T, U)(T coefficient, U power) if (allArithmetic!(T, U));

Gamma correction

Parameters
T coefficient ...
U power ...
Returns
Corrected color

RGBColor  log(T)(T base = cast(T)2) if (allArithmetic!(T, U));

Logarithm of the color

Parameters
T base base of logarithm
Returns
New color - logarithm of the color

RGBColor  invert();

Inversion

Returns
New inverted color

string  toString();