50#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_COLOR_RGBA_H
51#define LASS_GUARDIAN_OF_INCLUSION_PRIM_COLOR_RGBA_H
67 typedef TVector::TValue TValue;
68 typedef TVector::TParam TParam;
69 typedef TVector::TReference TReference;
70 typedef TVector::TConstReference TConstReference;
71 typedef TVector::TNumTraits TNumTraits;
73 enum { dimension = 4 };
81 ColorRGBA(TParam red, TParam green, TParam blue,
82 TParam alpha = ColorRGBA::TNumTraits::one);
83 explicit ColorRGBA(TParam white, TParam alpha = ColorRGBA::TNumTraits::one);
84 explicit ColorRGBA(
const TVector& vector);
88 const TVector vector()
const {
return TVector(r, g, b, a); }
89 TConstReference operator[](
size_t index)
const {
return *(&r + index); }
90 TReference operator[](
size_t index) {
return *(&r + index); }
91 TConstReference at(
signed index)
const {
return *(&r + num::mod(index,
static_cast<unsigned>(dimension))); }
92 TReference at(
signed index) {
return *(&r + num::mod(index,
static_cast<unsigned>(dimension))); }
105 TValue brightness()
const;
131 static const ColorRGBA mapCustom(TParam value,
const std::vector<ColorRGBA>& colorMap);
163#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_COLOR_RGBA
164#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_PYOBJECT_PLUS_H
168#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_TRANSFORMATION_3D_H
an [0, 1] floating point RGB colour with Alpha channel.
ColorRGBA & operator-=(const ColorRGBA &other)
raw subtraction other from this color, including alpha channel
static const ColorRGBA mapWinter(TParam value)
convert a value in range [0, 1] to a color like in colormap 'winter' of matlab.
static const ColorRGBA mapHot(TParam value)
convert a value in range [0, 1] to a color like in colormap 'hot' of matlab.
static const ColorRGBA mapPink(TParam value)
convert a value in range [0, 1] to a color like in colormap 'pink' of matlab.
const ColorRGBA darkened(TParam factor) const
return darkened colour without changing the opaqueness.
static const ColorRGBA mapCopper(TParam value)
convert a value in range [0, 1] to a color like in colormap 'copper' of matlab.
bool isBlack() const
return true if all color components are zero
static const ColorRGBA mapCool(TParam value)
convert a value in range [0, 1] to a color like in colormap 'cool' of matlab.
const ColorRGBA exposed(TParam time) const
return exposed color.
static const ColorRGBA mapBone(TParam value)
convert a value in range [0, 1] to a color like in colormap 'bone' of matlab.
static const ColorRGBA mapJet(TParam value)
convert a value in range [0, 1] to a color like in colormap 'jet' of matlab.
static const ColorRGBA mapAutumn(TParam value)
convert a value in range [0, 1] to a color like in colormap 'autumn' of matlab.
ColorRGBA()
construct an unexisting color (black with zero alpha)
bool isNaN() const
Return true if at least one of the components is NaN.
const ColorRGBA invExposed(TParam time) const
return result of inverse exposure function
static const ColorRGBA mapGray(TParam value)
convert a value in range [0, 1] to a color like in colormap 'gray' of matlab.
static const ColorRGBA mapSummer(TParam value)
convert a value in range [0, 1] to a color like in colormap 'summer' of matlab.
const ColorRGBA clamped() const
clamp all channels (including alpha channel) to the range [0, 1].
ColorRGBA & operator*=(const ColorRGBA &other)
raw multiplication of other with this color, including alpha channel
const ColorRGBA gammaCorrected(TParam gamma) const
return gamma corrected color.
static const ColorRGBA mapCustom(TParam value, const std::vector< ColorRGBA > &colorMap)
convert a value in range [0, 1] to a color from a custom color map.
const ColorRGBA dissolved(TParam factor) const
return color with dissolved opaqueness
ColorRGBA & operator+=(const ColorRGBA &other)
raw addition of other to this color, including alpha channel
static const ColorRGBA mapHsv(TParam value)
convert a value to a color like in colormap 'hsv' of matlab.
ColorRGBA & operator/=(const ColorRGBA &other)
raw division of this color by other, including alpha channel
static const ColorRGBA mapSpring(TParam value)
convert a value in range [0, 1] to a color like in colormap 'spring' of matlab.
bool isZero() const
return true if all components are zero
#define LASS_SIMD_ALIGN
if LASS_SIMD_ALIGNMENT is set, use LASS_SIMD_ALIGN to align some structures on SIMD alignment boundar...
#define LASS_DLL
DLL interface: import or export symbols?
set of geometrical primitives
ColorRGBA plus(const ColorRGBA &a, const ColorRGBA &b)
ColorRGBA over(const ColorRGBA &a, const ColorRGBA &b)
placement of foreground a in front of background b.
ColorRGBA out(const ColorRGBA &a, const ColorRGBA &b)
a held out by b, part of a outside b.
ColorRGBA through(const ColorRGBA &a, const ColorRGBA &b)
a seen through color filter b.
ColorRGBA in(const ColorRGBA &a, const ColorRGBA &b)
part of a inside b.
ColorRGBA atop(const ColorRGBA &a, const ColorRGBA &b)
union of a in b and b out a.
Library for Assembled Shared Sources.