added converter from/to qtcolor to/from vcg::color4b

This commit is contained in:
granzuglia 2009-10-02 09:55:31 +00:00
parent d3b6444cb4
commit 2edaa2853f
1 changed files with 26 additions and 0 deletions

26
wrap/qt/col_qt_convert.h Normal file
View File

@ -0,0 +1,26 @@
#ifndef COL_QT_CONVERT_H_
#define COL_QT_CONVERT_H_
#include <QColor>
#include "../../vcg/space/color4.h"
namespace vcg
{
class ColorConverter
{
public:
template<typename T>
static vcg::Color4<T> convertQColorToColor4(const QColor& col)
{
return vcg::Color4<T>(T(col.red()),T(col.green()),T(col.blue()),T(col.alpha()));
}
template<typename T>
static QColor convertColor4ToQColor(const vcg::Color4<T>& col)
{
return QColor(int(col.X()),int(col.Y()),int(col.Z()),int(col.W()));
}
};
}
#endif