Public Types | Public Member Functions | List of all members
icmm::TComposedColor< Size > Class Template Reference

Generic color implementation. More...

#include <TComposedColor.h>

Inheritance diagram for icmm::TComposedColor< Size >:
imath::TVector< Size > iser::ISerializable istd::IChangeable istd::IPolymorphic

Public Types

typedef imath::TVector< Size > BaseClass
 
typedef BaseClass::Elements Elements
 
- Public Types inherited from imath::TVector< Size >
typedef double ElementType
 
typedef double Elements [Size]
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ACF_INTERNAL = 0, CF_ALL_DATA, CF_ANY, CF_DESTROYING,
  CF_DELEGATED, CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0, SO_OBSERVE = 1 << 0, SO_COPY = 1 << 1, SO_CLONE = 1 << 2,
  SO_COMPARE = 1 << 3, SO_RESET = 1 << 4
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT, CM_WITHOUT_REFS, CM_WITH_REFS, CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 

Public Member Functions

 TComposedColor ()
 
 TComposedColor (const BaseClass &value)
 
 TComposedColor (const imath::CVarVector &vector)
 
void GetRounded (const imath::IDoubleManip &manipulator, TComposedColor< Size > &result)
 Get color after components value rounding with specified precision. More...
 
bool IsRoundedEqual (const TComposedColor< Size > &color, const imath::IDoubleManip &manipulator) const
 Check if two values are equal after rounding. More...
 
bool IsSimilar (const TComposedColor< Size > &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 (TComposedColor< Size > &result) const
 Get normalized color. More...
 
TComposedColor< Size > operator+ (const TComposedColor< Size > &color) const
 
TComposedColor< Size > operator- (const TComposedColor< Size > &color) const
 
TComposedColor< Size > operator* (const TComposedColor< Size > &color) const
 
TComposedColor< Size > operator/ (const TComposedColor< Size > &color) const
 
TComposedColor< Size > operator* (double value) const
 
TComposedColor< Size > operator/ (double value) const
 
const TComposedColor< Size > & operator= (const TComposedColor< Size > &color)
 
const TComposedColor< Size > & operator= (double colorValue)
 
const TComposedColor< Size > & operator+= (const TComposedColor< Size > &color)
 
const TComposedColor< Size > & operator-= (const TComposedColor< Size > &color)
 
const TComposedColor< Size > & operator*= (const TComposedColor< Size > &color)
 
const TComposedColor< Size > & operator/= (const TComposedColor< Size > &color)
 
const TComposedColor< Size > & operator*= (double value)
 
const TComposedColor< Size > & operator/= (double value)
 
virtual bool Serialize (iser::IArchive &archive)
 Load or store state of this object as a archive stream. More...
 
- Public Member Functions inherited from imath::TVector< Size >
 TVector ()
 Create an uninitialized point. More...
 
 TVector (const TVector< Size, double > &vector)
 Copy constructor. 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 SetAllElements (const double &value)
 Set some value to all elements. More...
 
void Reset ()
 Set all coordinates to zero. More...
 
void Clear ()
 Set all coordinates to zero. More...
 
const TVector< Size, double >
::Elements
GetElements () const
 Get read-only access to internal element container. More...
 
TVector< Size, double >::ElementsGetElementsRef ()
 Get access to internal element container. More...
 
void Translate (const TVector< Size, double > &vector)
 Translate the point. More...
 
TVector< Size, double > GetTranslated (const TVector< Size, double > &vector)
 Get translated point. More...
 
void GetTranslated (const TVector< Size, double > &vector, TVector< Size, double > &result)
 /overloaded More...
 
void ScaledCumulate (const TVector< Size, 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 TVector< Size, 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 TVector< Size, double > &vector) const
 Return distance square between two vectors. More...
 
double GetDistance (const TVector< Size, 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 (TVector< Size, double > &result, doublelength=1.0) const
 Return normalized vector with the same direction and specified length. More...
 
void GetMinimal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with minimal elements values. More...
 
void GetMaximal (const TVector< Size, double > &vector, TVector< Size, 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 TVector< Size, double > &vector) const
 
bool operator!= (const TVector< Size, double > &vector) const
 
bool operator< (const TVector< Size, double > &vector) const
 
bool operator> (const TVector< Size, double > &vector) const
 
bool operator<= (const TVector< Size, double > &vector) const
 
bool operator>= (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator- () const
 
TVector< Size, double > operator- (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator+ (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator* (doublescalar) const
 
TVector< Size, double > operator/ (doublescalar) const
 
TVector< Size, double > & operator+= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator-= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator*= (doublescalar)
 
TVector< Size, double > & operator/= (doublescalar)
 
const double & operator[] (int i) const
 
double & operator[] (int i)
 
- Public Member Functions inherited from iser::ISerializable
virtual quint32 GetMinimalVersion (int versionId) const
 Get minimal needed version to correct storing of this data. More...
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations. More...
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one. More...
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object. More...
 
virtual IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object. More...
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state. More...
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction. More...
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction. More...
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes. More...
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Additional Inherited Members

- Static Public Member Functions inherited from imath::TVector< Size >
static int GetElementsCount ()
 Get number of elements. More...
 
static bool SetElementsCount (int count)
 Set number of elements. More...
 
static const TVector< Size,
double > & 
GetZero ()
 Get vector with all coordinates set to 0. More...
 
- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes. More...
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set. More...
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set. More...
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set. More...
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event. More...
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event. More...
 
- Protected Attributes inherited from imath::TVector< Size >
Elements m_elements
 

Detailed Description

template<int Size>
class icmm::TComposedColor< Size >

Generic color implementation.

Definition at line 26 of file TComposedColor.h.

Member Typedef Documentation

template<int Size>
typedef imath::TVector<Size> icmm::TComposedColor< Size >::BaseClass

Definition at line 29 of file TComposedColor.h.

template<int Size>
typedef BaseClass::Elements icmm::TComposedColor< Size >::Elements

Definition at line 30 of file TComposedColor.h.

Constructor & Destructor Documentation

template<int Size>
icmm::TComposedColor< Size >::TComposedColor ( )
inline

Definition at line 100 of file TComposedColor.h.

template<int Size>
icmm::TComposedColor< Size >::TComposedColor ( const BaseClass value)
inline

Definition at line 107 of file TComposedColor.h.

template<int Size>
icmm::TComposedColor< Size >::TComposedColor ( const imath::CVarVector vector)
inlineexplicit

Definition at line 117 of file TComposedColor.h.

References imath::CVarVector::GetElementsCount().

Member Function Documentation

template<int Size>
void icmm::TComposedColor< Size >::GetNormalized ( TComposedColor< Size > &  result) const

Get normalized color.

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

Definition at line 356 of file TComposedColor.h.

References icmm::TComposedColor< Size >::Normalize().

template<int Size>
void icmm::TComposedColor< Size >::GetRounded ( const imath::IDoubleManip manipulator,
TComposedColor< Size > &  result 
)

Get color after components value rounding with specified precision.

Parameters
manipulatormanipulator object used to round single components.
resultresult object.

Definition at line 317 of file TComposedColor.h.

References imath::TIValueManip< ValueType >::GetRounded().

template<int Size>
bool icmm::TComposedColor< Size >::IsNormalized ( ) const
inline

Check if this color value is normalized.

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

Definition at line 138 of file TComposedColor.h.

template<int Size>
bool icmm::TComposedColor< Size >::IsRoundedEqual ( const TComposedColor< Size > &  color,
const imath::IDoubleManip manipulator 
) const

Check if two values are equal after rounding.

Parameters
colorsecond color to comparision.
manipulatorvalue manipulator used to round single components.

Definition at line 326 of file TComposedColor.h.

References imath::TIValueManip< ValueType >::IsEqual().

template<int Size>
bool icmm::TComposedColor< Size >::IsSimilar ( const TComposedColor< Size > &  color,
double  tolerance = I_BIG_EPSILON 
) const
inline

Allows to compare two colors with tolerance.

Definition at line 131 of file TComposedColor.h.

template<int Size>
void icmm::TComposedColor< Size >::Normalize ( )

Make this color to be normalized.

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

Definition at line 339 of file TComposedColor.h.

Referenced by icmm::TComposedColor< Size >::GetNormalized().

template<int Size>
TComposedColor< Size > icmm::TComposedColor< Size >::operator* ( const TComposedColor< Size > &  color) const
inline

Definition at line 179 of file TComposedColor.h.

template<int Size>
TComposedColor< Size > icmm::TComposedColor< Size >::operator* ( double  value) const
inline

Definition at line 205 of file TComposedColor.h.

template<int Size>
const TComposedColor< Size > & icmm::TComposedColor< Size >::operator*= ( const TComposedColor< Size > &  color)
inline

Definition at line 271 of file TComposedColor.h.

template<int Size>
const TComposedColor< Size > & icmm::TComposedColor< Size >::operator*= ( double  value)
inline

Definition at line 297 of file TComposedColor.h.

template<int Size>
TComposedColor< Size > icmm::TComposedColor< Size >::operator+ ( const TComposedColor< Size > &  color) const
inline

Definition at line 153 of file TComposedColor.h.

template<int Size>
const TComposedColor< Size > & icmm::TComposedColor< Size >::operator+= ( const TComposedColor< Size > &  color)
inline

Definition at line 253 of file TComposedColor.h.

template<int Size>
TComposedColor< Size > icmm::TComposedColor< Size >::operator- ( const TComposedColor< Size > &  color) const
inline

Definition at line 166 of file TComposedColor.h.

template<int Size>
const TComposedColor< Size > & icmm::TComposedColor< Size >::operator-= ( const TComposedColor< Size > &  color)
inline

Definition at line 262 of file TComposedColor.h.

template<int Size>
TComposedColor< Size > icmm::TComposedColor< Size >::operator/ ( const TComposedColor< Size > &  color) const
inline

Definition at line 192 of file TComposedColor.h.

template<int Size>
TComposedColor< Size > icmm::TComposedColor< Size >::operator/ ( double  value) const
inline

Definition at line 218 of file TComposedColor.h.

template<int Size>
const TComposedColor< Size > & icmm::TComposedColor< Size >::operator/= ( const TComposedColor< Size > &  color)
inline

Definition at line 284 of file TComposedColor.h.

template<int Size>
const TComposedColor< Size > & icmm::TComposedColor< Size >::operator/= ( double  value)
inline

Definition at line 306 of file TComposedColor.h.

template<int Size>
const TComposedColor< Size > & icmm::TComposedColor< Size >::operator= ( const TComposedColor< Size > &  color)
inline

Definition at line 231 of file TComposedColor.h.

template<int Size>
const TComposedColor< Size > & icmm::TComposedColor< Size >::operator= ( double  colorValue)
inline

Definition at line 242 of file TComposedColor.h.

template<int Size>
bool icmm::TComposedColor< Size >::Serialize ( iser::IArchive archive)
virtual

Load or store state of this object as a archive stream.

Type of operation is depending on archive type.

See Also
iser::IArchive

Implements iser::ISerializable.

Reimplemented in icmm::CCmyk, icmm::CHsv, icmm::CCmy, icmm::CRgb, and icmm::CLab.

Definition at line 367 of file TComposedColor.h.

References iser::IArchive::BeginMultiTag(), iser::IArchive::BeginTag(), iser::IArchive::EndTag(), iser::IArchive::IsStoring(), NULL, iser::IArchive::Process(), iser::CArchiveTag::TT_LEAF, and iser::CArchiveTag::TT_MULTIPLE.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy