osgEarth 2.1.1
Static Public Member Functions

anonymous_namespace{ImageUtils.cpp}::ColorWriter< GL_UNSIGNED_SHORT_5_5_5_1, GLushort > Struct Template Reference

List of all members.

Static Public Member Functions

static void write (const ImageUtils::PixelWriter *iw, const osg::Vec4f &c, int s, int t, int r, int m)

Detailed Description

template<>
struct anonymous_namespace{ImageUtils.cpp}::ColorWriter< GL_UNSIGNED_SHORT_5_5_5_1, GLushort >

Definition at line 785 of file ImageUtils.cpp.


Member Function Documentation

static void anonymous_namespace{ImageUtils.cpp}::ColorWriter< GL_UNSIGNED_SHORT_5_5_5_1, GLushort >::write ( const ImageUtils::PixelWriter iw,
const osg::Vec4f &  c,
int  s,
int  t,
int  r,
int  m 
) [inline, static]

Definition at line 787 of file ImageUtils.cpp.

        {
            GLushort
                red = (unsigned short)(c.r()*255),
                g = (unsigned short)(c.g()*255),
                b = (unsigned short)(c.b()*255),
                a = c.a() < 0.15 ? 0 : 1;

            GLushort* ptr = (GLushort*)iw->data(s, t, r, m);
            *ptr = (((red) & (0xf8)) << 8) | (((g) & (0xf8)) << 3) | (((b) & (0xF8)) >> 2) | a;
        }

Here is the call graph for this function:


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