Color implementation with variable components number and fixed maximal number of components. More...
#include <CFastColor.h>
Public Types | |
typedef imath::TFastVector < MAX_COLOR_COMPONENTS_COUNT > | BaseClass |
![]() | |
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 |
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/= (const CFastColor &color) |
const CFastColor & | operator*= (double value) |
const CFastColor & | operator/= (double value) |
bool | Serialize (iser::IArchive &archive) |
![]() | |
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 | |
![]() | |
double | m_elements [MaxSize] |
int | m_elementsCount |
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.
Definition at line 41 of file CFastColor.h.
|
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.
|
inlineexplicit |
Constructor with explicit initialization of number of elements.
Definition at line 153 of file CFastColor.h.
|
inline |
Copy constructor.
Definition at line 168 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Definition at line 60 of file CFastColor.h.
icmm::CFastColor::CFastColor | ( | const icmm::CVarColor & | color | ) |
|
inline |
Definition at line 183 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::SetElementsCount().
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.
manipulator | manipulator object used to round single components. |
result | result object. |
|
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.
color | second color to comparison. |
manipulator | value manipulator used to round single components. |
|
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].
|
inline |
Definition at line 215 of file CFastColor.h.
|
inline |
Definition at line 248 of file CFastColor.h.
References operator==().
|
inline |
Definition at line 339 of file CFastColor.h.
|
inline |
Definition at line 359 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elements.
|
inline |
Definition at line 446 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elements.
|
inline |
Definition at line 476 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::operator*=().
|
inline |
Definition at line 319 of file CFastColor.h.
|
inline |
Definition at line 412 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, imath::TFastVector< MaxSize, Element >::m_elements, imath::TFastVector< MaxSize, Element >::m_elementsCount, imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elementsCount, and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::operator+=().
|
inline |
Definition at line 329 of file CFastColor.h.
|
inline |
Definition at line 429 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, imath::TFastVector< MaxSize, Element >::m_elements, imath::TFastVector< MaxSize, Element >::m_elementsCount, imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elementsCount, and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::operator-=().
|
inline |
Definition at line 349 of file CFastColor.h.
|
inline |
Definition at line 377 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elements.
|
inline |
Definition at line 461 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elements.
|
inline |
Definition at line 490 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::operator/=().
|
inline |
Definition at line 254 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), and I_BIG_EPSILON.
|
inline |
Definition at line 287 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), and I_BIG_EPSILON.
|
inline |
Definition at line 395 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements, imath::TFastVector< MaxSize, Element >::m_elements, imath::TFastVector< MaxSize, Element >::m_elementsCount, imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elementsCount, and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::operator=().
|
inline |
Definition at line 229 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), I_BIG_EPSILON, and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::operator[]().
Referenced by operator!=().
|
inline |
Definition at line 271 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), and I_BIG_EPSILON.
|
inline |
Definition at line 303 of file CFastColor.h.
References imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), and I_BIG_EPSILON.
bool icmm::CFastColor::Serialize | ( | iser::IArchive & | archive | ) |
void icmm::CFastColor::SetAsLab | ( | const icmm::CLab & | lab | ) |
© 2007-2017 Witold Gantzke and Kirill Lepskiy