|
ACF $AcfVersion:0$
|
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 |
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. | |
| CFastColor (std::initializer_list< double > values) | |
| Initializer list constructor. | |
| template<int Size> | |
| CFastColor (const imath::TVector< Size > &vector) | |
| CFastColor (const icmm::CVarColor &color) | |
| Constructor from iterator pair. | |
| 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 |
| 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) |
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 (std::initializer_list< double > values) | |
| Initializer list 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 |
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 157 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 167 of file CFastColor.h.
|
inline |
Copy constructor.
Definition at line 182 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Initializer list constructor.
Definition at line 197 of file CFastColor.h.
|
inline |
Definition at line 65 of file CFastColor.h.
| icmm::CFastColor::CFastColor | ( | const icmm::CVarColor & | color | ) |
Constructor from iterator pair.
|
inline |
Definition at line 232 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 248 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 242 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 264 of file CFastColor.h.
|
inline |
Definition at line 297 of file CFastColor.h.
References operator==().
|
inline |
Definition at line 388 of file CFastColor.h.
|
inline |
Definition at line 408 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 495 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements.
|
inline |
Definition at line 525 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 368 of file CFastColor.h.
|
inline |
Definition at line 461 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 378 of file CFastColor.h.
|
inline |
Definition at line 478 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 398 of file CFastColor.h.
|
inline |
Definition at line 426 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 510 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::m_elements.
|
inline |
Definition at line 539 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 303 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), and I_BIG_EPSILON.
|
inline |
Definition at line 336 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), and I_BIG_EPSILON.
|
inline |
Definition at line 444 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 278 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), and I_BIG_EPSILON.
Referenced by operator!=().
|
inline |
Definition at line 320 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), and I_BIG_EPSILON.
|
inline |
Definition at line 352 of file CFastColor.h.
References imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MAX_COLOR_COMPONENTS_COUNT >::GetElementsCount(), and I_BIG_EPSILON.
| bool icmm::CFastColor::Serialize | ( | iser::IArchive & | archive | ) |
| void icmm::CFastColor::SetAsLab | ( | const icmm::CLab & | lab | ) |