NAP
Public Member Functions | List of all members
RColor< T > Class Template Reference

#include <color.h>

Public Member Functions

 RColor (T value)
 
 RColor ()
 
 RColor (const nap::BaseColor &source)
 
void setRed (T value)
 
getRed () const
 
- Public Member Functions inherited from Color< T, 1 >
 Color ()
 
 Color (const std::array< T, CHANNELS > &colors)
 
 Color (const nap::BaseColor &source)
 
rtti::TypeInfo getValueType () const override
 
bool isPointer () const override
 
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
 
- Public Member Functions inherited from BaseColor
 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 >
convert () const
 
int size () const
 

Additional Inherited Members

- Public Types inherited from Color< T, 1 >
using value_type = T
 
- Public Types inherited from BaseColor
using Converter = std::function< void(const BaseColor &, BaseColor &, int)>
 
- Static Public Member Functions inherited from BaseColor
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)
 
- Public Attributes inherited from Color< T, 1 >
std::array< T, CHANNELS > mValues
 

Description

template<typename T>
class nap::RColor< T >

Color that has only one value associated with it. The red color can be associated (for example) with height or a stencil value

Inheritance diagram for RColor< T >:
[legend]
Collaboration diagram for RColor< T >:
[legend]

Constructor & Destructor Documentation

◆ RColor() [1/3]

RColor ( value)

Constructor that creates an R color based on the given value

◆ RColor() [2/3]

RColor ( )

Default constructor

◆ RColor() [3/3]

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.

Parameters
sourcethe source color to convert.

Member Function Documentation

◆ getRed()

T getRed ( ) const

◆ setRed()

void setRed ( value)

Sets the red channel to the incoming value

Parameters
valuered color value