#include <OSGColor.h>
Public Types | |
| typedef ValueTypeT | ValueType |
Public Member Functions | |
Constructors | |
| * | Color4 (void) |
| Color4 (const Color4 &source) | |
| Color4 (const ValueType red, const ValueType green, const ValueType blue, const ValueType alpha) | |
Destructors | |
| * | ~Color4 (void) |
Set | |
| *void | clear (void) |
| void | setValuesRGBA (const ValueType red, const ValueType green, const ValueType blue, const ValueType alpha) |
| void | setValuesHSV (const Real32 h, const Real32 s, const Real32 v) |
| void | setRandom (void) |
| void | setRGBA (UInt32 rgbPack) |
| void | setValue (const Char8 *szString) |
| void | setValue (Char8 *szString) |
Get | |
| *UInt32 | getRGBA (void) const |
| void | getValuesRGBA (ValueType &red, ValueType &green, ValueType &blue, ValueType &alpha) const |
| void | getValuesHSV (Real32 &h, Real32 &s, Real32 &v) const |
| ValueType | red (void) const |
| ValueType | green (void) const |
| ValueType | blue (void) const |
| ValueType | alpha (void) const |
| ValueType * | getValuesRGBA (void) |
| const ValueType * | getValuesRGBA (void) const |
Operators | |
| *Color4 | operator * (const ValueType val) |
| ValueType & | operator[] (const UInt32 uiIndex) |
| const ValueType & | operator[] (const UInt32 uiIndex) const |
| Color4 & | operator= (const Color4 &source) |
| bool | equals (const Color4 &other, const ValueType tolerance) const |
| bool | operator== (const Color4 &other) const |
| bool | operator!= (const Color4 &other) const |
Static Public Attributes | |
| static const Color4 | Null |
Protected Attributes | |
| ValueType | _rgba [4] |
Definition at line 175 of file OSGColor.h.
|
|||||
|
Definition at line 180 of file OSGColor.h. |
|
||||||||||
|
Definition at line 518 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00519 { 00520 _rgba[0] = TypeTraits<ValueTypeT>::getZeroElement(); 00521 _rgba[1] = TypeTraits<ValueTypeT>::getZeroElement(); 00522 _rgba[2] = TypeTraits<ValueTypeT>::getZeroElement(); 00523 _rgba[3] = TypeTraits<ValueTypeT>::getZeroElement(); 00524 }
|
|
||||||||||
|
Definition at line 528 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00529 { 00530 _rgba[0] = source._rgba[0]; 00531 _rgba[1] = source._rgba[1]; 00532 _rgba[2] = source._rgba[2]; 00533 _rgba[3] = source._rgba[3]; 00534 }
|
|
||||||||||||||||||||||||
|
Definition at line 538 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00542 { 00543 _rgba[0] = red; 00544 _rgba[1] = green; 00545 _rgba[2] = blue; 00546 _rgba[3] = alpha; 00547 }
|
|
||||||||||
|
Definition at line 551 of file OSGColor.inl.
|
|
||||||||||
|
Definition at line 557 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. Referenced by osg::DVRIsoShader::getLightSources(). 00558 { 00559 _rgba[0] = TypeTraits<ValueTypeT>::getZeroElement(); 00560 _rgba[1] = TypeTraits<ValueTypeT>::getZeroElement(); 00561 _rgba[2] = TypeTraits<ValueTypeT>::getZeroElement(); 00562 _rgba[3] = TypeTraits<ValueTypeT>::getZeroElement(); 00563 }
|
|
||||||||||||||||||||||||
|
Definition at line 567 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. Referenced by osg::VRMLMaterialDesc::endNode(), osg::VRMLMaterialDesc::endProtoInterface(), osg::SimpleMaterial::makeState(), osg::PhongMaterial::makeState(), osg::FresnelMaterial::makeState(), osg::OFFSceneFileType::read(), osg::SimpleMaterial::rebuildState(), osg::PhongMaterial::rebuildState(), osg::FresnelMaterial::rebuildState(), and osg::Color4< ValueTypeT >::setRandom(). 00571 { 00572 _rgba[0] = red; 00573 _rgba[1] = green; 00574 _rgba[2] = blue; 00575 _rgba[3] = alpha; 00576 }
|
|
||||||||||||||||||||
|
Definition at line 579 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00582 { 00583 Color3<ValueType>::convertFromHSV(_rgba, h, s, v); 00584 00585 _rgba[3] = TypeTraits<ValueTypeT>::getOneElement(); 00586 }
|
|
||||||||||
|
Definition at line 590 of file OSGColor.inl. References osg::Color4< ValueTypeT >::setValuesRGBA(). 00591 { 00592 Real32 rf = 1.0 / Real32(RAND_MAX); 00593 00594 setValuesRGBA(TypeTraits<ValueTypeT>::getPortion(rf * rand()), 00595 TypeTraits<ValueTypeT>::getPortion(rf * rand()), 00596 TypeTraits<ValueTypeT>::getPortion(rf * rand()), 00597 TypeTraits<ValueTypeT>::getPortion(rf * rand())); 00598 }
|
|
||||||||||
|
method to set the rgb values (ABGGRR) Definition at line 604 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00605 { 00606 for(Int32 i = 0; i < 4; ++i) 00607 { 00608 Real32 rTmp = Real32(rgbPack & 255) / 255.0f; 00609 00610 _rgba[i] = TypeTraits<ValueTypeT>::getPortion(rTmp); 00611 00612 rgbPack >>= 8; 00613 } 00614 }
|
|
||||||||||
|
Definition at line 618 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba, and osg::PointInterface< ValueTypeT, StorageInterfaceT >::setValueFromCString(). Referenced by osg::FieldDataTraits< Color4ub >::getFromString(), osg::FieldDataTraits< Color4f >::getFromString(), and osg::Color4< ValueTypeT >::setValue(). 00619 { 00620 // this is the easiest way, not the most efficient... 00621 Vec4f v; 00622 00623 v.setValueFromCString(szString); 00624 00625 _rgba[0] = ValueTypeT(v[0]); 00626 _rgba[1] = ValueTypeT(v[1]); 00627 _rgba[2] = ValueTypeT(v[2]); 00628 _rgba[3] = ValueTypeT(v[3]); 00629 }
|
|
||||||||||
|
Definition at line 633 of file OSGColor.inl. References osg::Color4< ValueTypeT >::setValue(). 00634 { 00635 setValue(static_cast<const Char8 *>(szString)); 00636 }
|
|
||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 642 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00643 { 00644 UInt32 pack = 0; 00645 00646 for(Int32 i = 3; i >= 0; --i) 00647 { 00648 pack = (pack << 8) | 00649 Int32(TypeTraits<ValueTypeT>::getFraction(_rgba[i]) * 00650 255.0f + 00651 0.5f ); 00652 } 00653 00654 return pack; 00655 }
|
|
||||||||||||||||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 659 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. Referenced by osg::SkyBackground::clear(), osg::DVRIsoShader::setupCombinerParametersDiffuse(), and osg::DVRIsoShader::setupCombinerParametersSpecular(). 00663 { 00664 red = _rgba[0]; 00665 green = _rgba[1]; 00666 blue = _rgba[2]; 00667 alpha = _rgba[3]; 00668 }
|
|
||||||||||||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 672 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00675 { 00676 Color3<ValueType>::convertToHSV(_rgba, h, s, v); 00677 }
|
|
||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 682 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. Referenced by cToV(), osg::operator<<(), osg::FieldDataTraits< Color4ub >::putToString(), and osg::FieldDataTraits< Color4f >::putToString(). 00683 { 00684 return _rgba[0]; 00685 }
|
|
||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 690 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. Referenced by cToV(), osg::operator<<(), osg::FieldDataTraits< Color4ub >::putToString(), and osg::FieldDataTraits< Color4f >::putToString(). 00691 { 00692 return _rgba[1]; 00693 }
|
|
||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 698 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. Referenced by cToV(), osg::operator<<(), osg::FieldDataTraits< Color4ub >::putToString(), and osg::FieldDataTraits< Color4f >::putToString(). 00699 { 00700 return _rgba[2]; 00701 }
|
|
||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 706 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. Referenced by cToV(), osg::operator<<(), osg::FieldDataTraits< Color4ub >::putToString(), and osg::FieldDataTraits< Color4f >::putToString(). 00707 { 00708 return _rgba[3]; 00709 }
|
|
||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 714 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00715 { 00716 return _rgba; 00717 }
|
|
||||||||||
|
method to get a packed rgb value (ABGGRR) Definition at line 722 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00723 { 00724 return _rgba; 00725 }
|
|
||||||||||
|
Definition at line 729 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00730 { 00731 Color4<ValueTypeT> returnValue; 00732 00733 returnValue._rgba[0] = _rgba[0] * val; 00734 returnValue._rgba[1] = _rgba[1] * val; 00735 returnValue._rgba[2] = _rgba[2] * val; 00736 returnValue._rgba[3] = _rgba[3] * val; 00737 00738 return returnValue; 00739 }
|
|
||||||||||
|
Definition at line 743 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00745 { 00746 return _rgba[uiIndex]; 00747 }
|
|
||||||||||
|
Definition at line 751 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00753 { 00754 return _rgba[uiIndex]; 00755 }
|
|
||||||||||
|
Definition at line 760 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. 00762 { 00763 if (this == &other) 00764 return *this; 00765 00766 _rgba[0] = other._rgba[0]; 00767 _rgba[1] = other._rgba[1]; 00768 _rgba[2] = other._rgba[2]; 00769 _rgba[3] = other._rgba[3]; 00770 00771 return *this; 00772 }
|
|
||||||||||||||||
|
equal within tolerance Definition at line 779 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba. Referenced by osg::MaterialChunk::operator==(), and osg::LightChunk::operator==(). 00781 { 00782 bool returnValue = true; 00783 00784 for(UInt32 i = 0; i < 4; i++) 00785 { 00786 returnValue &= ( ( _rgba[i] - other._rgba[i] <= tolerance) && 00787 (other._rgba[i] - _rgba[i] <= tolerance)); 00788 } 00789 00790 return returnValue; 00791 }
|
|
||||||||||
|
Definition at line 795 of file OSGColor.inl. References osg::Color4< ValueTypeT >::_rgba, and osg::Eps. 00796 { 00797 bool returnValue = true; 00798 00799 for(UInt32 i = 0; i < 4; i++) 00800 { 00801 returnValue &= ( ( _rgba[i] - other._rgba[i] <= Eps) && 00802 (other._rgba[i] - _rgba[i] <= Eps)); 00803 } 00804 00805 return returnValue; 00806 }
|
|
||||||||||
|
Definition at line 810 of file OSGColor.inl.
|
|
|||||
|
Definition at line 513 of file OSGColor.inl. |
|
|||||
1.4.3