Thea
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ColorL Class Reference

Monochrome luminance value in [0, 1], with automatic scaling by 255 when switching between integer (ColorL8) and floating point (ColorL) formats. More...

#include <ColorL.hpp>

Public Types

typedef Real value_type
 The numerical type of the luminance value. More...
 

Public Member Functions

 ColorL ()
 Default constructor, initializes color to 0. More...
 
 ColorL (Real v)
 Initializing constructor. More...
 
 ColorL (ColorL8 const &other)
 Initialize from an integer color, automatically dividing by 255. More...
 
 ColorL (ColorRgba const &other)
 Initialize from a 32-bit RGBA color. More...
 
Real const * data () const
 Get the address of the color value. More...
 
Real * data ()
 Get the address of the color value. More...
 
void fill (Real v)
 Set the luminance value, for consistency with multi-channel colors. More...
 
ColorL max (ColorL const &other) const
 Get the maximum of two color values. More...
 
ColorL min (ColorL const &other) const
 Get the minimum of two color values. More...
 
ColorL operator* (ColorL const &other) const
 Multiplication operator. More...
 
ColorL operator* (Real other) const
 Multiply by a scalar. More...
 
ColorLoperator*= (ColorL const &other)
 Multiply-and-assign. More...
 
ColorLoperator*= (Real other)
 Multiply by a scalar and assign. More...
 
ColorL operator+ (ColorL const &other) const
 Addition operator. More...
 
ColorLoperator+= (ColorL const &other)
 Add-and-assign. More...
 
ColorL operator- () const
 Negation operator. More...
 
ColorL operator- (ColorL const &other) const
 Subtraction operator. More...
 
ColorLoperator-= (ColorL const &other)
 Subtract-and-assign. More...
 
ColorL operator/ (ColorL const &other) const
 Division operator. More...
 
ColorL operator/ (Real other) const
 Divide by a scalar. More...
 
ColorLoperator/= (ColorL const &other)
 Divide-and-assign. More...
 
ColorLoperator/= (Real other)
 Divide by a scalar and assign. More...
 
template<typename IntegerT >
Real const & operator[] (IntegerT channel) const
 Array-style channel access. More...
 
template<typename IntegerT >
Real & operator[] (IntegerT channel)
 Array-style channel access. More...
 
std::string toString () const
 Get a string representation of the color. More...
 
Real value () const
 The value of the color. More...
 
Real & value ()
 The value of the color. More...
 

Static Public Member Functions

static ColorL const & zero ()
 Color with zero luminance (black). More...
 

Detailed Description

Monochrome luminance value in [0, 1], with automatic scaling by 255 when switching between integer (ColorL8) and floating point (ColorL) formats.

Derived from the G3D library: http://g3d.sourceforge.net

Definition at line 46 of file ColorL.hpp.

Member Typedef Documentation

typedef Real value_type

The numerical type of the luminance value.

Definition at line 52 of file ColorL.hpp.

Constructor & Destructor Documentation

ColorL ( )

Default constructor, initializes color to 0.

Definition at line 55 of file ColorL.hpp.

ColorL ( Real  v)
explicit

Initializing constructor.

Definition at line 58 of file ColorL.hpp.

ColorL ( ColorL8 const &  other)

Initialize from an integer color, automatically dividing by 255.

Definition at line 34 of file ColorL.cpp.

ColorL ( ColorRgba const &  other)

Initialize from a 32-bit RGBA color.

For conversion from a consistent source type.

Definition at line 38 of file ColorL.cpp.

Member Function Documentation

Real const* data ( ) const

Get the address of the color value.

Definition at line 73 of file ColorL.hpp.

Real* data ( )

Get the address of the color value.

Definition at line 76 of file ColorL.hpp.

void fill ( Real  v)

Set the luminance value, for consistency with multi-channel colors.

Definition at line 93 of file ColorL.hpp.

ColorL max ( ColorL const &  other) const

Get the maximum of two color values.

Definition at line 180 of file ColorL.hpp.

ColorL min ( ColorL const &  other) const

Get the minimum of two color values.

Definition at line 186 of file ColorL.hpp.

ColorL operator* ( ColorL const &  other) const

Multiplication operator.

Definition at line 114 of file ColorL.hpp.

ColorL operator* ( Real  other) const

Multiply by a scalar.

Definition at line 120 of file ColorL.hpp.

ColorL& operator*= ( ColorL const &  other)

Multiply-and-assign.

Definition at line 152 of file ColorL.hpp.

ColorL& operator*= ( Real  other)

Multiply by a scalar and assign.

Definition at line 166 of file ColorL.hpp.

ColorL operator+ ( ColorL const &  other) const

Addition operator.

Definition at line 102 of file ColorL.hpp.

ColorL& operator+= ( ColorL const &  other)

Add-and-assign.

Definition at line 138 of file ColorL.hpp.

ColorL operator- ( ) const

Negation operator.

Definition at line 96 of file ColorL.hpp.

ColorL operator- ( ColorL const &  other) const

Subtraction operator.

Definition at line 108 of file ColorL.hpp.

ColorL& operator-= ( ColorL const &  other)

Subtract-and-assign.

Definition at line 145 of file ColorL.hpp.

ColorL operator/ ( ColorL const &  other) const

Division operator.

Definition at line 126 of file ColorL.hpp.

ColorL operator/ ( Real  other) const

Divide by a scalar.

Definition at line 132 of file ColorL.hpp.

ColorL& operator/= ( ColorL const &  other)

Divide-and-assign.

Definition at line 159 of file ColorL.hpp.

ColorL& operator/= ( Real  other)

Divide by a scalar and assign.

Definition at line 173 of file ColorL.hpp.

Real const& operator[] ( IntegerT  channel) const

Array-style channel access.

Definition at line 79 of file ColorL.hpp.

Real& operator[] ( IntegerT  channel)

Array-style channel access.

Definition at line 86 of file ColorL.hpp.

std::string toString ( ) const

Get a string representation of the color.

Definition at line 43 of file ColorL.cpp.

Real value ( ) const

The value of the color.

Definition at line 67 of file ColorL.hpp.

Real& value ( )

The value of the color.

Definition at line 70 of file ColorL.hpp.

static ColorL const& zero ( )
static

Color with zero luminance (black).

Definition at line 192 of file ColorL.hpp.


The documentation for this class was generated from the following files: