ICF 3.0.5.47
Technical documentation of ICF Libraries
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:
Collaboration diagram for icmm::CFastColor:

Public Types

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

Public Member Functions

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

◆ BaseClass

Constructor & Destructor Documentation

◆ CFastColor() [1/5]

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.

◆ CFastColor() [2/5]

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.

◆ CFastColor() [3/5]

icmm::CFastColor::CFastColor ( const CFastColor & color)
inline

◆ CFastColor() [4/5]

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

Definition at line 60 of file CFastColor.h.

◆ CFastColor() [5/5]

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

Member Function Documentation

◆ EnsureElementsCount()

bool icmm::CFastColor::EnsureElementsCount ( int count,
double value = 0 )
inline

◆ GetAsLab()

icmm::CLab icmm::CFastColor::GetAsLab ( ) const

◆ GetNormalized()

void icmm::CFastColor::GetNormalized ( CFastColor & result) const

Get normalized color.

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

◆ GetRounded()

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.

◆ IsNormalized()

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.

◆ IsRoundedEqual()

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.

◆ IsSimilar()

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().

◆ Normalize()

void icmm::CFastColor::Normalize ( )

Make this color to be normalized.

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

◆ operator icmm::CVarColor()

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

Definition at line 215 of file CFastColor.h.

◆ operator!=()

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

Definition at line 248 of file CFastColor.h.

References operator==().

◆ operator*() [1/2]

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

Definition at line 339 of file CFastColor.h.

◆ operator*() [2/2]

◆ operator*=() [1/2]

◆ operator*=() [2/2]

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

◆ operator+()

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

Definition at line 319 of file CFastColor.h.

◆ operator+=()

◆ operator-()

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

Definition at line 329 of file CFastColor.h.

◆ operator-=()

◆ operator/() [1/2]

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

Definition at line 349 of file CFastColor.h.

◆ operator/() [2/2]

◆ operator/=() [1/2]

◆ operator/=() [2/2]

const CFastColor & icmm::CFastColor::operator/= ( double value)
inline

◆ operator<()

bool icmm::CFastColor::operator< ( const CFastColor & vector) const
inline

◆ operator<=()

bool icmm::CFastColor::operator<= ( const CFastColor & vector) const
inline

◆ operator=()

◆ operator==()

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

◆ operator>()

bool icmm::CFastColor::operator> ( const CFastColor & vector) const
inline

◆ operator>=()

bool icmm::CFastColor::operator>= ( const CFastColor & vector) const
inline

◆ Serialize()

bool icmm::CFastColor::Serialize ( iser::IArchive & archive)

◆ SetAsLab()

void icmm::CFastColor::SetAsLab ( const icmm::CLab & lab)

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

© Witold Gantzke and Kirill Lepskiy