diff --git a/include/osg/Vec4d b/include/osg/Vec4d index 35f252364..0c4cb9596 100644 --- a/include/osg/Vec4d +++ b/include/osg/Vec4d @@ -94,6 +94,17 @@ class Vec4d inline value_type z() const { return _v[2]; } inline value_type w() const { return _v[3]; } + inline value_type& red() { return _v[0]; } + inline value_type& green() { return _v[1]; } + inline value_type& blue() { return _v[2]; } + inline value_type& alpha() { return _v[3]; } + + inline value_type red() const { return _v[0]; } + inline value_type green() const { return _v[1]; } + inline value_type blue() const { return _v[2]; } + inline value_type alpha() const { return _v[3]; } + + inline unsigned long asABGR() const { return (unsigned long)clampTo((_v[0]*255.0),0.0,255.0)<<24 | diff --git a/include/osg/Vec4f b/include/osg/Vec4f index 8e571ed53..02d7e80c8 100644 --- a/include/osg/Vec4f +++ b/include/osg/Vec4f @@ -88,6 +88,16 @@ class Vec4f inline value_type z() const { return _v[2]; } inline value_type w() const { return _v[3]; } + inline value_type& red() { return _v[0]; } + inline value_type& green() { return _v[1]; } + inline value_type& blue() { return _v[2]; } + inline value_type& alpha() { return _v[3]; } + + inline value_type red() const { return _v[0]; } + inline value_type green() const { return _v[1]; } + inline value_type blue() const { return _v[2]; } + inline value_type alpha() const { return _v[3]; } + inline unsigned long asABGR() const { return (unsigned long)clampTo((_v[0]*255.0f),0.0f,255.0f)<<24 |