#include <color.h>
Public Member Functions | |
RColor (T value) | |
RColor () | |
RColor (const nap::BaseColor &source) | |
void | setRed (T value) |
T | getRed () const |
![]() | |
Color () | |
Color (const std::array< T, CHANNELS > &colors) | |
Color (const nap::BaseColor &source) | |
rtti::TypeInfo | getValueType () const override |
bool | isPointer () const override |
T | getValue (EColorChannel channel) const |
T & | getValue (EColorChannel channel) |
void | setValue (EColorChannel channel, T value) |
const std::array< T, CHANNELS > & | getValues () const |
T * | getData () |
const T * | getData () const |
void | setData (const T *data) |
float | getDistance (const Color< T, CHANNELS > &other) const |
bool | operator== (const Color< T, CHANNELS > &rhs) const |
bool | operator!= (const Color< T, CHANNELS > &rhs) const |
bool | operator< (const Color< T, CHANNELS > &rhs) const |
bool | operator> (const Color< T, CHANNELS > &rhs) const |
bool | operator<= (const Color< T, CHANNELS > &rhs) const |
bool | operator>= (const Color< T, CHANNELS > &rhs) const |
T & | operator[] (std::size_t index) |
const T & | operator[] (std::size_t index) const |
![]() | |
BaseColor (int channels, int size) | |
virtual | ~BaseColor ()=default |
bool | operator== (const BaseColor &rhs)=delete |
bool | operator!= (const BaseColor &rhs)=delete |
int | getNumberOfChannels () const |
int | valueSize () const |
virtual rtti::TypeInfo | getValueType () const =0 |
virtual bool | isPointer () const =0 |
void | convert (BaseColor &target) const |
Converter | getConverter (const BaseColor &target) const |
template<typename T > | |
T | convert () const |
int | size () const |
Additional Inherited Members | |
![]() | |
using | value_type = T |
![]() | |
using | Converter = std::function< void(const BaseColor &, BaseColor &, int)> |
![]() | |
static void | convertColor (const BaseColor &source, BaseColor &target) |
static void | convertColor (const BaseColor &source, BaseColor &target, const Converter &converter) |
static Converter | getConverter (const BaseColor &source, const BaseColor &target) |
![]() | |
std::array< T, CHANNELS > | mValues |
Color that has only one value associated with it. The red color can be associated (for example) with height or a stencil value
RColor | ( | T | value | ) |
Constructor that creates an R color based on the given value
RColor | ( | ) |
Default constructor
RColor | ( | const nap::BaseColor & | source | ) |
Initialize using a different type of color. Colors are converted. The source color must have an equal or higher amount of channels.
source | the source color to convert. |
T getRed | ( | ) | const |
void setRed | ( | T | value | ) |
Sets the red channel to the incoming value
value | red color value |