Subversion Repositories gelsvn

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 bj 1
#ifndef __CGLA_VEC4UC_H__
2
#define __CGLA_VEC4UC_H__
3
 
4
#include "Vec4f.h"
5
 
6
namespace CGLA {
7
	typedef unsigned char UChar;
8
 
89 jab 9
	/** \brief 4D unsigned char vector. */
2 bj 10
	class Vec4uc: public ArithVec<UChar,Vec4uc,4>
11
	{
12
 
13
	public:
14
 
15
		/// Construct 0 vector
16
		Vec4uc() {}
17
 
18
		/// Construct 0 vector
19
		Vec4uc(unsigned char a): ArithVec<UChar,Vec4uc,4>(a,a,a,a) {}
20
 
21
		/// Construct 4D uchar vector
22
		Vec4uc(UChar _a, UChar _b, UChar _c,UChar _d): 
23
			ArithVec<UChar,Vec4uc,4>(_a,_b,_c,_d) {}
24
 
25
		/// Convert from float vector. 
26
		explicit Vec4uc(const Vec4f& v): 
27
			ArithVec<UChar,Vec4uc,4>(UChar(v[0]), UChar(v[1]), 
28
															 UChar(v[2]), UChar(v[3])) {}
29
 
30
		operator Vec4f() const
31
		{
32
			return  Vec4f((*this)[0],(*this)[1],(*this)[2],(*this)[3]);
33
		}
34
 
35
	};
36
 
37
 
38
}
39
#endif
40