//! Byte\95Û\8e\9d\82ÌGBA
struct bRGBA
{
- char r;
- char g;
- char b;
- char a;
+ int r;
+ int g;
+ int b;
+ int a;
bRGBA()
{}
);
}
};
+#ifndef SWIG
inline std::ostream &operator<<(std::ostream &os, const bRGBA &rhs)
{
return os
<< '[' << rhs.r << ',' << rhs.g << ',' << rhs.b << ',' << rhs.a << ']';
}
+#endif
+
//! Float\95Û\8e\9d\82ÌRGBA
struct fRGBA
float g;
float b;
float a;
+
+ fRGBA()
+ {}
+
+ fRGBA(float _r, float _g, float _b, float _a)
+ : r(_r), g(_g), b(_b), a(_a)
+ {}
+
+ static fRGBA createFromUInt(unsigned int uint)
+ {
+ return fRGBA(
+ (uint & 0x000000FF) / 255.0f,
+ (uint & 0x0000FF00 >> 8) / 255.0f,
+ (uint & 0x00FF0000 >> 16) / 255.0f,
+ (uint & 0xFF000000 >> 24) / 255.0f
+ );
+ }
};
+#ifndef SWIG
inline std::ostream &operator<<(std::ostream &os, const fRGBA &rhs)
{
return os
<< '[' << rhs.r << ',' << rhs.g << ',' << rhs.b << ',' << rhs.a << ']';
}
+#endif
//! Float\95Û\8e\9d\82ÌRGB
float g;
float b;
};
+#ifndef SWIG
inline std::ostream &operator<<(std::ostream &os, const fRGB &rhs)
{
return os
<< '[' << rhs.r << ',' << rhs.g << ',' << rhs.b << ',' << ']';
}
+#endif
} // namespace color