osgEarth 2.1.1
Public Member Functions | Public Attributes

anonymous_namespace{ImageUtils.cpp}::MixImage Struct Reference

List of all members.

Public Member Functions

bool operator() (const osg::Vec4f &src, osg::Vec4f &dest)

Public Attributes

float _a
bool _srcHasAlpha
bool _destHasAlpha

Detailed Description

Definition at line 246 of file ImageUtils.cpp.


Member Function Documentation

bool anonymous_namespace{ImageUtils.cpp}::MixImage::operator() ( const osg::Vec4f &  src,
osg::Vec4f &  dest 
) [inline]

Definition at line 251 of file ImageUtils.cpp.

        {
            float sa = _srcHasAlpha ? _a * src.a() : _a;
            float da = _destHasAlpha ? dest.a() : 1.0f;
            dest.set(
                dest.r()*(1.0f-sa) + src.r()*sa,
                dest.g()*(1.0f-sa) + src.g()*sa,
                dest.b()*(1.0f-sa) + src.b()*sa,
                osg::maximum(sa, da) );             
            return true;
        }

Member Data Documentation

float anonymous_namespace{ImageUtils.cpp}::MixImage::_a

Definition at line 248 of file ImageUtils.cpp.

bool anonymous_namespace{ImageUtils.cpp}::MixImage::_destHasAlpha

Definition at line 249 of file ImageUtils.cpp.

bool anonymous_namespace{ImageUtils.cpp}::MixImage::_srcHasAlpha

Definition at line 249 of file ImageUtils.cpp.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines