ICF 3.0.5.47
Technical documentation of ICF Libraries
icmm::CRgb Class Reference

Primitive for representation of RGB color value. More...

#include <CRgb.h>

Inheritance diagram for icmm::CRgb:
Collaboration diagram for icmm::CRgb:

Public Types

enum  ComponentIndex { CI_RED , CI_GREEN , CI_BLUE , CI_LAST = CI_BLUE }
 
typedef TComposedColor< 3 > BaseClass
 
- Public Types inherited from icmm::TComposedColor< 3 >
typedef imath::TVector< Size > BaseClass
 
typedef BaseClass::Elements Elements
 
- Public Types inherited from imath::TVector< Size, Element >
typedef Element ElementType
 
typedef std::array< Element, Size > Elements
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ICF_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 , SO_CHANGE_LOCK = 1 << 5
}
 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

 CRgb (double r=0.0, double g=0.0, double b=0.0)
 
 CRgb (const CRgb &color)
 
double GetRed () const
 
void SetRed (double value)
 
double GetGreen () const
 
void SetGreen (double value)
 
double GetBlue () const
 
void SetBlue (double value)
 
bool Serialize (iser::IArchive &archive)
 Load or store state of this object as a archive stream.
 
CRgb operator+ (const CRgb &color) const
 
CRgb operator- (const CRgb &color) const
 
CRgb operator* (const CRgb &color) const
 
CRgb operator/ (const CRgb &color) const
 
CRgb operator* (double value) const
 
CRgb operator/ (double value) const
 
CRgboperator= (const CRgb &color)
 
const CRgboperator+= (const CRgb &color)
 
const CRgboperator-= (const CRgb &color)
 
const CRgboperator*= (const CRgb &color)
 
const CRgboperator/= (const CRgb &color)
 
const CRgboperator*= (double value)
 
const CRgboperator/= (double value)
 
- Public Member Functions inherited from icmm::TComposedColor< 3 >
 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.
 
bool IsRoundedEqual (const TComposedColor< Size > &color, const imath::IDoubleManip &manipulator) const
 Check if two values are equal after rounding.
 
bool IsSimilar (const TComposedColor< Size > &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 (TComposedColor< Size > &result) const
 Get normalized color.
 
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/ (const TComposedColor< Size > &color) 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*= (double value)
 
const TComposedColor< Size > & operator/= (const TComposedColor< Size > &color)
 
const TComposedColor< Size > & operator/= (double value)
 
- Public Member Functions inherited from imath::TVector< Size, Element >
 TVector ()
 Create an uninitialized point.
 
 TVector (const TVector< Size, Element > &vector)
 Copy constructor.
 
 TVector (TVector< Size, Element > &&vector) noexcept
 Move constructor.
 
const Element & GetElement (int i) const
 Get element at specified i.
 
Element & GetElementRef (int i)
 Get reference to element at specified i.
 
void SetElement (int i, const Element &value)
 Set element at specified i.
 
void SetAllElements (const Element &value)
 Set some value to all elements.
 
void Reset ()
 Set all coordinates to zero.
 
void Clear ()
 Set all coordinates to zero.
 
const TVector< Size, Element >::ElementsGetElements () const
 Get read-only access to internal element container.
 
TVector< Size, Element >::ElementsGetElementsRef ()
 Get access to internal element container.
 
void Translate (const TVector< Size, Element > &vector)
 Translate the point.
 
TVector< Size, Element > GetTranslated (const TVector< Size, Element > &vector)
 Get translated point.
 
void GetTranslated (const TVector< Size, Element > &vector, TVector< Size, Element > &result)
 /overloaded
 
void ScaledCumulate (const TVector< Size, Element > &vector, Element scale)
 Add second vector scaled by specified factor.
 
bool IsNull (Element tolerance=I_BIG_EPSILON) const
 Check if this vector is null.
 
Element GetDotProduct (const TVector< Size, Element > &vector) const
 Return dot product of two vectors.
 
Element GetLength2 () const
 Return euclidian length square.
 
Element GetLength () const
 Return euclidian length.
 
Element GetDistance2 (const TVector< Size, Element > &vector) const
 Return distance square between two vectors.
 
Element GetDistance (const TVector< Size, Element > &vector) const
 Return distance between two vectors.
 
Element GetElementsSum () const
 Get simple sum of all elements.
 
bool Normalize (Element length=1.0)
 Normalize vector to specified length.
 
bool GetNormalized (TVector< Size, Element > &result, Element length=1.0) const
 Return normalized vector with the same direction and specified length.
 
void GetMinimal (const TVector< Size, Element > &vector, TVector< Size, Element > &result) const
 Get vector with minimal elements values.
 
void GetMaximal (const TVector< Size, Element > &vector, TVector< Size, Element > &result) const
 Get vector with maximal elements values.
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive.
 
bool operator== (const TVector< Size, Element > &vector) const
 
bool operator!= (const TVector< Size, Element > &vector) const
 
bool operator< (const TVector< Size, Element > &vector) const
 
bool operator> (const TVector< Size, Element > &vector) const
 
bool operator<= (const TVector< Size, Element > &vector) const
 
bool operator>= (const TVector< Size, Element > &vector) const
 
TVector< Size, Element > operator- () const
 
TVector< Size, Element > operator+ (const TVector< Size, Element > &vector) const
 
TVector< Size, Element > operator- (const TVector< Size, Element > &vector) const
 
TVector< Size, Element > operator* (Element scalar) const
 
TVector< Size, Element > operator/ (Element scalar) const
 
TVector< Size, Element > & operator= (const TVector< Size, Element > &vector)
 
TVector< Size, Element > & operator= (TVector< Size, Element > &&vector)
 
TVector< Size, Element > & operator+= (const TVector< Size, Element > &vector)
 
TVector< Size, Element > & operator-= (const TVector< Size, Element > &vector)
 
TVector< Size, Element > & operator*= (Element scalar)
 
TVector< Size, Element > & operator/= (Element scalar)
 
const Element & operator[] (int i) const
 
Element & 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.
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations.
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one.
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object.
 
virtual std::unique_ptr< IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object.
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state.
 
virtual QMutex * GetChangesLock () const
 Get mutex beeing locked during changes, if available.
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction.
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction.
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes.
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes.
 

Additional Inherited Members

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

Detailed Description

Primitive for representation of RGB color value.

Please note, that normal components values are in range [0, 1].

Definition at line 22 of file CRgb.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 25 of file CRgb.h.

Member Enumeration Documentation

◆ ComponentIndex

Enumerator
CI_RED 
CI_GREEN 
CI_BLUE 
CI_LAST 

Definition at line 27 of file CRgb.h.

Constructor & Destructor Documentation

◆ CRgb() [1/2]

icmm::CRgb::CRgb ( double r = 0.0,
double g = 0.0,
double b = 0.0 )
inline

Definition at line 71 of file CRgb.h.

References CI_BLUE, CI_GREEN, CI_RED, and imath::TVector< Size, Element >::SetElement().

◆ CRgb() [2/2]

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

Definition at line 79 of file CRgb.h.

Member Function Documentation

◆ GetBlue()

double icmm::CRgb::GetBlue ( ) const
inline

Definition at line 111 of file CRgb.h.

References CI_BLUE, and imath::TVector< Size, Element >::GetElement().

◆ GetGreen()

double icmm::CRgb::GetGreen ( ) const
inline

Definition at line 99 of file CRgb.h.

References CI_GREEN, and imath::TVector< Size, Element >::GetElement().

◆ GetRed()

double icmm::CRgb::GetRed ( ) const
inline

Definition at line 87 of file CRgb.h.

References CI_RED, and imath::TVector< Size, Element >::GetElement().

◆ operator*() [1/2]

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

Definition at line 145 of file CRgb.h.

◆ operator*() [2/2]

CRgb icmm::CRgb::operator* ( double value) const
inline

Definition at line 165 of file CRgb.h.

◆ operator*=() [1/2]

const CRgb & icmm::CRgb::operator*= ( const CRgb & color)
inline

Definition at line 209 of file CRgb.h.

References icmm::TComposedColor< 3 >::operator*=().

◆ operator*=() [2/2]

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

Definition at line 225 of file CRgb.h.

References icmm::TComposedColor< 3 >::operator*=().

◆ operator+()

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

Definition at line 125 of file CRgb.h.

◆ operator+=()

const CRgb & icmm::CRgb::operator+= ( const CRgb & color)
inline

Definition at line 193 of file CRgb.h.

References icmm::TComposedColor< 3 >::operator+=().

◆ operator-()

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

Definition at line 135 of file CRgb.h.

◆ operator-=()

const CRgb & icmm::CRgb::operator-= ( const CRgb & color)
inline

Definition at line 201 of file CRgb.h.

References icmm::TComposedColor< 3 >::operator-=().

◆ operator/() [1/2]

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

Definition at line 155 of file CRgb.h.

◆ operator/() [2/2]

CRgb icmm::CRgb::operator/ ( double value) const
inline

Definition at line 175 of file CRgb.h.

◆ operator/=() [1/2]

const CRgb & icmm::CRgb::operator/= ( const CRgb & color)
inline

Definition at line 217 of file CRgb.h.

References icmm::TComposedColor< 3 >::operator/=().

◆ operator/=() [2/2]

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

Definition at line 233 of file CRgb.h.

References icmm::TComposedColor< 3 >::operator/=().

◆ operator=()

CRgb & icmm::CRgb::operator= ( const CRgb & color)
inline

Definition at line 185 of file CRgb.h.

References icmm::TComposedColor< 3 >::operator=().

◆ Serialize()

bool icmm::CRgb::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

Reimplemented from icmm::TComposedColor< 3 >.

◆ SetBlue()

void icmm::CRgb::SetBlue ( double value)
inline

Definition at line 117 of file CRgb.h.

References CI_BLUE, and imath::TVector< Size, Element >::SetElement().

◆ SetGreen()

void icmm::CRgb::SetGreen ( double value)
inline

Definition at line 105 of file CRgb.h.

References CI_GREEN, and imath::TVector< Size, Element >::SetElement().

◆ SetRed()

void icmm::CRgb::SetRed ( double value)
inline

Definition at line 93 of file CRgb.h.

References CI_RED, and imath::TVector< Size, Element >::SetElement().


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

© Witold Gantzke and Kirill Lepskiy