Public Types | Public Member Functions | List of all members
icmm::CFastColor Class Reference

Color implementation with variable components number and fixed maximal number of components. More...

#include <CFastColor.h>

Inheritance diagram for icmm::CFastColor:
imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >

Public Types

typedef imath::TFastVector
< MAX_COLOR_COMPONENTS_COUNT
BaseClass
 
- Public Types inherited from imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >
enum  
 
typedef double ElementType
 

Public Member Functions

 CFastColor ()
 Default constructor. More...
 
 CFastColor (int componentsCount, double value=0)
 Constructor with explicit initialization of number of elements. More...
 
 CFastColor (const CFastColor &color)
 Copy constructor. More...
 
template<int Size>
 CFastColor (const imath::TVector< Size > &vector)
 
 CFastColor (const icmm::CVarColor &color)
 
icmm::CLab GetAsLab () const
 
void SetAsLab (const icmm::CLab &lab)
 
bool EnsureElementsCount (int count, double value=0)
 
void GetRounded (const imath::IDoubleManip &manipulator, CFastColor &result)
 Get color after components value rounding with specified precision. More...
 
bool IsRoundedEqual (const CFastColor &color, const imath::IDoubleManip &manipulator) const
 Check if two values are equal after rounding. More...
 
bool IsSimilar (const CFastColor &color, double tolerance=I_BIG_EPSILON) const
 Allows to compare two colors with tolerance. More...
 
bool IsNormalized () const
 Check if this color value is normalized. More...
 
void Normalize ()
 Make this color to be normalized. More...
 
void GetNormalized (CFastColor &result) const
 Get normalized color. More...
 
 operator icmm::CVarColor () const
 
bool operator== (const CFastColor &vector) const
 
bool operator!= (const CFastColor &vector) const
 
bool operator< (const CFastColor &vector) const
 
bool operator> (const CFastColor &vector) const
 
bool operator<= (const CFastColor &vector) const
 
bool operator>= (const CFastColor &vector) const
 
CFastColor operator+ (const CFastColor &color) const
 
CFastColor operator- (const CFastColor &color) const
 
CFastColor operator* (const CFastColor &color) const
 
CFastColor operator/ (const CFastColor &color) const
 
CFastColor operator* (double value) const
 
CFastColor operator/ (double value) const
 
CFastColoroperator= (const CFastColor &color)
 
const CFastColoroperator+= (const CFastColor &color)
 
const CFastColoroperator-= (const CFastColor &color)
 
const CFastColoroperator*= (const CFastColor &color)
 
const CFastColoroperator/= (const CFastColor &color)
 
const CFastColoroperator*= (double value)
 
const CFastColoroperator/= (double value)
 
bool Serialize (iser::IArchive &archive)
 
- Public Member Functions inherited from imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >
 TFastVector ()
 Create an uninitialized point. More...
 
 TFastVector (int componentsCount, const double &value=double())
 Create vector and initialize number of components. More...
 
 TFastVector (const TFastVector< MaxSize, double > &vector)
 Copy constructor. More...
 
 TFastVector (const imath::TVector< Size, double > &vector)
 
int GetElementsCount () const
 Get number of elements. More...
 
bool SetElementsCount (int count, const double &value=double())
 Set number of elements. More...
 
bool EnsureElementsCount (int count, const double &value=double())
 Ensure, that number of elements vector cannot be smaller that some value. More...
 
const double & GetElement (int i) const
 Get element at specified i. More...
 
double & GetElementRef (int i)
 Get reference to element at specified i. More...
 
void SetElement (int i, const double &value)
 Set element at specified i. More...
 
void Clear ()
 Set all coordinates to zero. More...
 
void SetElementsFrom (const TFastVector &vector, const double &expansionValue=double())
 Set elemenents from other vector without resizing. More...
 
void Translate (const TFastVector< MaxSize, double > &vector)
 Translate the point. More...
 
TFastVector< MaxSize, double > GetTranslated (const TFastVector< MaxSize, double > &vector)
 Get translated point. More...
 
void GetTranslated (const TFastVector< MaxSize, double > &vector, TFastVector< MaxSize, double > &result)
 /overloaded More...
 
void ScaledCumulate (const TFastVector< MaxSize, double > &vector, doublescale)
 Add second vector scaled by specified factor. More...
 
bool IsNull (doubletolerance=I_BIG_EPSILON) const
 Check if this vector is null. More...
 
double GetDotProduct (const TFastVector< MaxSize, double > &vector) const
 Return dot product of two vectors. More...
 
double GetLength2 () const
 Return euclidian length square. More...
 
double GetLength () const
 Return euclidian length. More...
 
double GetDistance2 (const TFastVector< MaxSize, double > &vector) const
 Return distance square between two vectors. More...
 
double GetDistance (const TFastVector< MaxSize, double > &vector) const
 Return distance between two vectors. More...
 
double GetElementsSum () const
 Get simple sum of all elements. More...
 
bool Normalize (doublelength=1.0)
 Normalize vector to specified length. More...
 
bool GetNormalized (TFastVector< MaxSize, double > &result, doublelength=1.0) const
 Return normalized vector with the same direction and specified length. More...
 
void GetMinimal (const TFastVector< MaxSize, double > &vector, TFastVector< MaxSize, double > &result) const
 Get vector with minimal elements values. More...
 
void GetMaximal (const TFastVector< MaxSize, double > &vector, TFastVector< MaxSize, double > &result) const
 Get vector with maximal elements values. More...
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive. More...
 
bool operator== (const TFastVector< MaxSize, double > &vector) const
 
bool operator!= (const TFastVector< MaxSize, double > &vector) const
 
bool operator< (const TFastVector< MaxSize, double > &vector) const
 
bool operator> (const TFastVector< MaxSize, double > &vector) const
 
bool operator<= (const TFastVector< MaxSize, double > &vector) const
 
bool operator>= (const TFastVector< MaxSize, double > &vector) const
 
TFastVector< MaxSize, double > operator- () const
 
TFastVector< MaxSize, double > operator- (const TFastVector< MaxSize, double > &vector) const
 
TFastVector< MaxSize, double > operator+ (const TFastVector< MaxSize, double > &vector) const
 
TFastVector< MaxSize, double > operator* (doublescalar) const
 
TFastVector< MaxSize, double > operator/ (doublescalar) const
 
TFastVector< MaxSize, double > & operator= (const TFastVector< MaxSize, double > &vector)
 
TFastVector< MaxSize, double > & operator+= (const TFastVector< MaxSize, double > &vector)
 
TFastVector< MaxSize, double > & operator-= (const TFastVector< MaxSize, double > &vector)
 
TFastVector< MaxSize, double > & operator*= (doublescalar)
 
TFastVector< MaxSize, double > & operator/= (doublescalar)
 
const double & operator[] (int i) const
 
double & operator[] (int i)
 

Additional Inherited Members

- Protected Attributes inherited from imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >
double m_elements [MaxSize]
 
int m_elementsCount
 

Detailed Description

Color implementation with variable components number and fixed maximal number of components.

Maximal number of components because to improve performance memory buffer for elements has fixed size.

Definition at line 38 of file CFastColor.h.

Member Typedef Documentation

Definition at line 41 of file CFastColor.h.

Constructor & Destructor Documentation

icmm::CFastColor::CFastColor ( )
inline

Default constructor.

It set number of elements to 0.

Definition at line 143 of file CFastColor.h.

References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements.

icmm::CFastColor::CFastColor ( int  componentsCount,
double  value = 0 
)
inlineexplicit

Constructor with explicit initialization of number of elements.

Definition at line 153 of file CFastColor.h.

icmm::CFastColor::CFastColor ( const CFastColor color)
inline
template<int Size>
icmm::CFastColor::CFastColor ( const imath::TVector< Size > &  vector)
inline

Definition at line 60 of file CFastColor.h.

icmm::CFastColor::CFastColor ( const icmm::CVarColor color)

Member Function Documentation

bool icmm::CFastColor::EnsureElementsCount ( int  count,
double  value = 0 
)
inline
icmm::CLab icmm::CFastColor::GetAsLab ( ) const
void icmm::CFastColor::GetNormalized ( CFastColor result) const

Get normalized color.

Normalized values have all components in the range [0, 1].

void icmm::CFastColor::GetRounded ( const imath::IDoubleManip manipulator,
CFastColor result 
)

Get color after components value rounding with specified precision.

Parameters
manipulatormanipulator object used to round single components.
resultresult object.
bool icmm::CFastColor::IsNormalized ( ) const
inline

Check if this color value is normalized.

Normalized values have all components in the range [0, 1].

Definition at line 199 of file CFastColor.h.

References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements.

bool icmm::CFastColor::IsRoundedEqual ( const CFastColor color,
const imath::IDoubleManip manipulator 
) const

Check if two values are equal after rounding.

Parameters
colorsecond color to comparison.
manipulatorvalue manipulator used to round single components.
bool icmm::CFastColor::IsSimilar ( const CFastColor color,
double  tolerance = I_BIG_EPSILON 
) const
inline

Allows to compare two colors with tolerance.

Definition at line 193 of file CFastColor.h.

References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetDistance().

void icmm::CFastColor::Normalize ( )

Make this color to be normalized.

Normalized values have all components in the range [0, 1].

icmm::CFastColor::operator icmm::CVarColor ( ) const
inline

Definition at line 215 of file CFastColor.h.

bool icmm::CFastColor::operator!= ( const CFastColor vector) const
inline

Definition at line 248 of file CFastColor.h.

References operator==().

CFastColor icmm::CFastColor::operator* ( const CFastColor color) const
inline

Definition at line 339 of file CFastColor.h.

CFastColor icmm::CFastColor::operator* ( double  value) const
inline
const CFastColor & icmm::CFastColor::operator*= ( const CFastColor color)
inline
const CFastColor & icmm::CFastColor::operator*= ( double  value)
inline
CFastColor icmm::CFastColor::operator+ ( const CFastColor color) const
inline

Definition at line 319 of file CFastColor.h.

const CFastColor & icmm::CFastColor::operator+= ( const CFastColor color)
inline
CFastColor icmm::CFastColor::operator- ( const CFastColor color) const
inline

Definition at line 329 of file CFastColor.h.

const CFastColor & icmm::CFastColor::operator-= ( const CFastColor color)
inline
CFastColor icmm::CFastColor::operator/ ( const CFastColor color) const
inline

Definition at line 349 of file CFastColor.h.

CFastColor icmm::CFastColor::operator/ ( double  value) const
inline
const CFastColor & icmm::CFastColor::operator/= ( const CFastColor color)
inline
const CFastColor & icmm::CFastColor::operator/= ( double  value)
inline
bool icmm::CFastColor::operator< ( const CFastColor vector) const
inline
bool icmm::CFastColor::operator<= ( const CFastColor vector) const
inline
CFastColor & icmm::CFastColor::operator= ( const CFastColor color)
inline
bool icmm::CFastColor::operator== ( const CFastColor vector) const
inline
bool icmm::CFastColor::operator> ( const CFastColor vector) const
inline
bool icmm::CFastColor::operator>= ( const CFastColor vector) const
inline
bool icmm::CFastColor::Serialize ( iser::IArchive archive)
void icmm::CFastColor::SetAsLab ( const icmm::CLab lab)

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

© 2007-2017 Witold Gantzke and Kirill Lepskiy