diff --git a/vcg/space/color4.h b/vcg/space/color4.h index d97e7480..8d7c71c3 100644 --- a/vcg/space/color4.h +++ b/vcg/space/color4.h @@ -261,6 +261,7 @@ inline static Color4 ColorRamp(const float &minf,const float &maxf ,float v ) inline static unsigned short ToUnsignedB5G5R5(const Color4 &) { return 0;} inline static unsigned short ToUnsignedR5G5B5(const Color4 &) { return 0;} +inline static unsigned int ToUnsignedA8R8G8B8(const Color4 &) { return 0;} inline static Color4 FromUnsignedB5G5R5(unsigned short) { @@ -439,6 +440,17 @@ inline unsigned short Color4::ToUnsignedR5G5B5(const Color4 +inline unsigned int Color4::ToUnsignedA8R8G8B8(const Color4 &cc) +{ + unsigned int r = cc[0]; + unsigned int g = cc[1]; + unsigned int b = cc[2]; + unsigned int a = cc[3]; + unsigned int res = (r << 16) | (g << 8) | (b) | (a << 24); + return res; +} + template<> inline Color4 Color4::FromUnsignedR5G5B5(unsigned short val)