Public Types | Public Member Functions | Static Public Member Functions | Private Types
vcg::Color4< T > Class Template Reference

#include <color4.h>

Inheritance diagram for vcg::Color4< T >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ColorConstant {
  Black = 0xff000000, Gray = 0xff808080, White = 0xffffffff, Red = 0xff0000ff,
  Green = 0xff00ff00, Blue = 0xffff0000, Cyan = 0xffffff00, Yellow = 0xff00ffff,
  Magenta = 0xffff00ff, LightGray = 0xffc0c0c0, LightRed = 0xff8080ff, LightGreen = 0xff80ff80,
  LightBlue = 0xffff8080, DarkGray = 0xff404040, DarkRed = 0xff000040, DarkGreen = 0xff004000,
  DarkBlue = 0xff400000
}

Public Member Functions

 Color4 (const T nx, const T ny, const T nz, const T nw)
 Color4 (const Point4< T > &c)
 Color4 ()
 Color4 (ColorConstant cc)
 Color4 (unsigned int cc)
template<>
 Color4 (Color4< unsigned char >::ColorConstant cc)
template<>
 Color4 (Color4< float >::ColorConstant cc)
template<>
 Color4 (unsigned int cc)
template<>
 Color4 (unsigned int cc)
template<>
Color4< unsigned char > Construct (const Color4< float > &b)
template<>
Color4< float > Construct (const Color4< unsigned char > &b)
template<>
Color4< unsigned char > FromUnsignedB5G5R5 (unsigned short val)
template<>
Color4< unsigned char > FromUnsignedR5G5B5 (unsigned short val)
template<class Q >
void Import (const Color4< Q > &b)
template<class Q >
void Import (const Point4< Q > &b)
 importer from different Point4 types
template<>
void Import (const Color4< unsigned char > &b)
template<>
void Import (const Color4< float > &b)
template<>
void Import (const Point4< float > &b)
template<class ScalarInterpType >
void lerp (const Color4 &c0, const Color4 &c1, const ScalarInterpType x)
template<class ScalarInterpType >
void lerp (const Color4 &c0, const Color4 &c1, const Color4 &c2, const Point3< ScalarInterpType > &ip)
Color4 operator+ (const Color4 &p) const
template<>
Color4< unsigned char > operator+ (const Color4< unsigned char > &p) const
void SetColorRamp (const float &minf, const float &maxf, float v)
 given a float and a range set the corresponding color in the well known red->green->blue color ramp. To reverse the direction of the ramp just swap minf and maxf.
void SetColorRampParula (const float &minf, const float &maxf, float v)
void SetColorRampParula (float v)
void SetGrayShade (float f)
void SetHSVColor (float h, float s, float v)
template<>
unsigned short ToUnsignedB5G5R5 (Color4< unsigned char > &cc)
template<>
unsigned short ToUnsignedR5G5B5 (Color4< unsigned char > &cc)

Static Public Member Functions

static Color4 ColorRamp (const float &minf, const float &maxf, float v)
template<class Q >
static Color4 Construct (const Color4< Q > &b)
static Color4 FromUnsignedB5G5R5 (unsigned short)
static Color4 FromUnsignedR5G5B5 (unsigned short)
static Color4 GrayShade (float f)
static Color4 Scatter (int range, int value, float Sat=.3f, float Val=.9f)
static unsigned short ToUnsignedB5G5R5 (Color4 &)
static unsigned short ToUnsignedR5G5B5 (Color4 &)

Private Types

typedef Point4< TBase

Detailed Description

template<class T>
class vcg::Color4< T >

The templated class for representing 4 entity color. The class is templated over the ScalarType. class that is used to represent color with float or with unsigned chars. All the usual operator overloading (* + - ...) is present.

Definition at line 40 of file color4.h.


Member Typedef Documentation

template<class T>
typedef Point4<T> vcg::Color4< T >::Base [private]

Definition at line 42 of file color4.h.


Member Enumeration Documentation

template<class T>
enum vcg::Color4::ColorConstant

Constant for storing standard colors. Each color is stored in a simple in so that the bit pattern match with the one of Color4b.

Enumerator:
Black 
Gray 
White 
Red 
Green 
Blue 
Cyan 
Yellow 
Magenta 
LightGray 
LightRed 
LightGreen 
LightBlue 
DarkGray 
DarkRed 
DarkGreen 
DarkBlue 

Definition at line 46 of file color4.h.


Constructor & Destructor Documentation

template<class T>
vcg::Color4< T >::Color4 ( const T  nx,
const T  ny,
const T  nz,
const T  nw 
) [inline]

Definition at line 70 of file color4.h.

template<class T>
vcg::Color4< T >::Color4 ( const Point4< T > &  c) [inline]

Definition at line 71 of file color4.h.

template<class T>
vcg::Color4< T >::Color4 ( ) [inline]

Definition at line 72 of file color4.h.

template<class T>
vcg::Color4< T >::Color4 ( ColorConstant  cc) [inline]
template<class T>
vcg::Color4< T >::Color4 ( unsigned int  cc) [inline]
template<>
vcg::Color4< unsigned char >::Color4 ( Color4< unsigned char >::ColorConstant  cc) [inline]

Definition at line 321 of file color4.h.

template<>
vcg::Color4< float >::Color4 ( Color4< float >::ColorConstant  cc) [inline]

Definition at line 327 of file color4.h.

template<>
vcg::Color4< unsigned char >::Color4 ( unsigned int  cc) [inline]

Definition at line 333 of file color4.h.

template<>
vcg::Color4< float >::Color4 ( unsigned int  cc) [inline]

Definition at line 339 of file color4.h.


Member Function Documentation

template<class T>
static Color4 vcg::Color4< T >::ColorRamp ( const float &  minf,
const float &  maxf,
float  v 
) [inline, static]

Definition at line 252 of file color4.h.

template<class T>
template<class Q >
static Color4 vcg::Color4< T >::Construct ( const Color4< Q > &  b) [inline, static]

Definition at line 95 of file color4.h.

template<>
Color4< unsigned char > vcg::Color4< unsigned char >::Construct ( const Color4< float > &  b) [inline]

Definition at line 301 of file color4.h.

template<>
Color4< float > vcg::Color4< float >::Construct ( const Color4< unsigned char > &  b) [inline]

Definition at line 311 of file color4.h.

template<class T>
static Color4 vcg::Color4< T >::FromUnsignedB5G5R5 ( unsigned  short) [inline, static]

Definition at line 262 of file color4.h.

template<>
Color4< unsigned char > vcg::Color4< unsigned char >::FromUnsignedB5G5R5 ( unsigned short  val) [inline]

Definition at line 402 of file color4.h.

template<class T>
static Color4 vcg::Color4< T >::FromUnsignedR5G5B5 ( unsigned  short) [inline, static]

Definition at line 266 of file color4.h.

template<>
Color4< unsigned char > vcg::Color4< unsigned char >::FromUnsignedR5G5B5 ( unsigned short  val) [inline]

Definition at line 392 of file color4.h.

template<class T>
static Color4 vcg::Color4< T >::GrayShade ( float  f) [inline, static]

Definition at line 208 of file color4.h.

template<class T>
template<class Q >
void vcg::Color4< T >::Import ( const Color4< Q > &  b) [inline]

Definition at line 77 of file color4.h.

template<class T>
template<class Q >
void vcg::Color4< T >::Import ( const Point4< Q > &  b) [inline]

importer from different Point4 types

Reimplemented from vcg::Point4< T >.

Definition at line 86 of file color4.h.

template<>
void vcg::Color4< float >::Import ( const Color4< unsigned char > &  b) [inline]

Definition at line 274 of file color4.h.

template<>
void vcg::Color4< unsigned char >::Import ( const Color4< float > &  b) [inline]

Definition at line 283 of file color4.h.

template<>
void vcg::Color4< unsigned char >::Import ( const Point4< float > &  b) [inline]

Definition at line 292 of file color4.h.

template<class T>
template<class ScalarInterpType >
void vcg::Color4< T >::lerp ( const Color4< T > &  c0,
const Color4< T > &  c1,
const ScalarInterpType  x 
) [inline]

Definition at line 109 of file color4.h.

template<class T>
template<class ScalarInterpType >
void vcg::Color4< T >::lerp ( const Color4< T > &  c0,
const Color4< T > &  c1,
const Color4< T > &  c2,
const Point3< ScalarInterpType > &  ip 
) [inline]

Definition at line 121 of file color4.h.

template<class T>
Color4 vcg::Color4< T >::operator+ ( const Color4< T > &  p) const [inline]

Definition at line 103 of file color4.h.

template<>
Color4< unsigned char > vcg::Color4< unsigned char >::operator+ ( const Color4< unsigned char > &  p) const [inline]

Definition at line 354 of file color4.h.

template<class T>
static Color4 vcg::Color4< T >::Scatter ( int  range,
int  value,
float  Sat = .3f,
float  Val = .9f 
) [inline, static]

Given an integer returns a well ordering of colors so that every color differs as much as possible form the previous one params: range is the maximum expected value (max of the range) value is the requested position (it must be <range);

Definition at line 231 of file color4.h.

template<class T>
void vcg::Color4< T >::SetColorRamp ( const float &  minf,
const float &  maxf,
float  v 
) [inline]

given a float and a range set the corresponding color in the well known red->green->blue color ramp. To reverse the direction of the ramp just swap minf and maxf.

Definition at line 133 of file color4.h.

template<class T>
void vcg::Color4< T >::SetColorRampParula ( const float &  minf,
const float &  maxf,
float  v 
) [inline]

Definition at line 151 of file color4.h.

template<class T>
void vcg::Color4< T >::SetColorRampParula ( float  v) [inline]

Definition at line 157 of file color4.h.

template<class T>
void vcg::Color4< T >::SetGrayShade ( float  f) [inline]

Definition at line 216 of file color4.h.

template<class T>
void vcg::Color4< T >::SetHSVColor ( float  h,
float  s,
float  v 
) [inline]

Definition at line 172 of file color4.h.

template<class T>
static unsigned short vcg::Color4< T >::ToUnsignedB5G5R5 ( Color4< T > &  ) [inline, static]

Definition at line 259 of file color4.h.

template<>
unsigned short vcg::Color4< unsigned char >::ToUnsignedB5G5R5 ( Color4< unsigned char > &  cc) [inline]

Definition at line 371 of file color4.h.

template<class T>
static unsigned short vcg::Color4< T >::ToUnsignedR5G5B5 ( Color4< T > &  ) [inline, static]

Definition at line 260 of file color4.h.

template<>
unsigned short vcg::Color4< unsigned char >::ToUnsignedR5G5B5 ( Color4< unsigned char > &  cc) [inline]

Definition at line 381 of file color4.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:10