Show
Ignore:
Timestamp:
09/03/05 22:56:25 (9 years ago)
Author:
robert
Message:

Changed red()/green()/blue()/alpha() to r()/g()/b()/a() for greater consistency
across Vec* classes and with OpenGL Shander Lanaguage.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgvolume/osgvolume.cpp

    r4465 r4496  
    929929    mutable unsigned int    _pos; 
    930930     
    931     inline void luminance(float& l) const { l = _colours[_pos++].red(); }  
    932     inline void alpha(float& a) const { a = _colours[_pos++].alpha(); }  
    933     inline void luminance_alpha(float& l,float& a) const { l = _colours[_pos].red(); a = _colours[_pos++].alpha(); }  
    934     inline void rgb(float& r,float& g,float& b) const { r = _colours[_pos].red(); g = _colours[_pos].green(); b = _colours[_pos].blue(); } 
    935     inline void rgba(float& r,float& g,float& b,float& a) const {  r = _colours[_pos].red(); g = _colours[_pos].green(); b = _colours[_pos].blue(); a = _colours[_pos++].alpha(); } 
     931    inline void luminance(float& l) const { l = _colours[_pos++].r(); }  
     932    inline void alpha(float& a) const { a = _colours[_pos++].a(); }  
     933    inline void luminance_alpha(float& l,float& a) const { l = _colours[_pos].r(); a = _colours[_pos++].a(); }  
     934    inline void rgb(float& r,float& g,float& b) const { r = _colours[_pos].r(); g = _colours[_pos].g(); b = _colours[_pos].b(); } 
     935    inline void rgba(float& r,float& g,float& b,float& a) const {  r = _colours[_pos].r(); g = _colours[_pos].g(); b = _colours[_pos].b(); a = _colours[_pos++].a(); } 
    936936}; 
    937937 
     
    10641064}; 
    10651065 
    1066 struct ModulatAlphaByLuminanceOperator 
    1067 { 
    1068     ModulatAlphaByLuminanceOperator() {} 
     1066struct ModulateAlphaByLuminanceOperator 
     1067{ 
     1068    ModulateAlphaByLuminanceOperator() {} 
    10691069 
    10701070    inline void luminance(float&) const {}  
     
    10751075}; 
    10761076 
    1077 struct ModulatAlphaByColourOperator 
    1078 { 
    1079     ModulatAlphaByColourOperator(const osg::Vec4& colour):_colour(colour) { _lum = _colour.length(); } 
     1077struct ModulateAlphaByColourOperator 
     1078{ 
     1079    ModulateAlphaByColourOperator(const osg::Vec4& colour):_colour(colour) { _lum = _colour.length(); } 
    10801080     
    10811081    osg::Vec4 _colour; 
     
    10861086    inline void luminance_alpha(float& l,float& a) const { a*= l*_lum; }  
    10871087    inline void rgb(float&,float&,float&) const {} 
    1088     inline void rgba(float& r,float& g,float& b,float& a) const { a = (r*_colour.red()+g*_colour.green()+b*_colour.blue()+a*_colour.alpha()); } 
     1088    inline void rgba(float& r,float& g,float& b,float& a) const { a = (r*_colour.r()+g*_colour.g()+b*_colour.b()+a*_colour.a()); } 
    10891089}; 
    10901090 
     
    11061106        case (MODULATE_ALPHA_BY_LUMINANCE): 
    11071107            std::cout<<"doing conversion MODULATE_ALPHA_BY_LUMINANCE"<<std::endl; 
    1108             modifyImage(image,ModulatAlphaByLuminanceOperator());  
     1108            modifyImage(image,ModulateAlphaByLuminanceOperator());  
    11091109            break; 
    11101110        case (MODULATE_ALPHA_BY_COLOUR): 
    11111111            std::cout<<"doing conversion MODULATE_ALPHA_BY_COLOUR"<<std::endl; 
    1112             modifyImage(image,ModulatAlphaByColourOperator(colour));  
     1112            modifyImage(image,ModulateAlphaByColourOperator(colour));  
    11131113            break; 
    11141114        case (REPLACE_ALPHA_WITH_LUMINACE):