osgEarth 2.1.1
|
Static Public Member Functions | |
static void | write (const ImageUtils::PixelWriter *iw, const osg::Vec4f &c, int s, int t, int r, int m) |
Definition at line 785 of file ImageUtils.cpp.
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; }