Subversion Repositories gelsvn

Rev

Rev 89 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 89 Rev 595
-
 
1
/* ----------------------------------------------------------------------- *
-
 
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
-
 
3
 * Copyright (C) the authors and DTU Informatics
-
 
4
 * For license and list of authors, see ../../doc/intro.pdf
-
 
5
 * ----------------------------------------------------------------------- */
-
 
6
 
-
 
7
/** @file Vec3uc.h
-
 
8
 * @brief 3D unsigned char vector.
-
 
9
 */
-
 
10
 
1
#ifndef __CGLA_VEC3UC_H__
11
#ifndef __CGLA_VEC3UC_H__
2
#define __CGLA_VEC3UC_H__
12
#define __CGLA_VEC3UC_H__
3
 
13
 
4
#include "Vec3i.h"
14
#include "Vec3i.h"
5
 
15
 
6
namespace CGLA {
16
namespace CGLA {
7
	typedef unsigned char UChar;
17
	typedef unsigned char UChar;
8
 
18
 
9
	/** \brief 3D unsigned char vector. */
19
	/** \brief 3D unsigned char vector. */
10
	class Vec3uc: public ArithVec3Int<UChar,Vec3uc>
20
	class Vec3uc: public ArithVec3Int<UChar,Vec3uc>
11
	{
21
	{
12
 
22
 
13
	public:
23
	public:
14
		
24
		
15
		/// Construct 0 vector
25
		/// Construct 0 vector
16
		Vec3uc() {}
26
		Vec3uc() {}
17
 
27
 
18
		/// Construct 3D uchar vector
28
		/// Construct 3D uchar vector
19
		Vec3uc(UChar a, UChar b, UChar c): 
29
		Vec3uc(UChar a, UChar b, UChar c): 
20
			ArithVec3Int<UChar,Vec3uc>(a,b,c) {}
30
			ArithVec3Int<UChar,Vec3uc>(a,b,c) {}
21
 
31
 
22
		/// Convert from int vector. 
32
		/// Convert from int vector. 
23
		explicit Vec3uc(const Vec3i& v): 
33
		explicit Vec3uc(const Vec3i& v): 
24
			ArithVec3Int<UChar,Vec3uc>(v[0]&0xff, v[1]&0xff, v[2]&0xff) {}
34
			ArithVec3Int<UChar,Vec3uc>(v[0]&0xff, v[1]&0xff, v[2]&0xff) {}
25
	};
35
	};
26
 
36
 
27
 
37
 
28
}
38
}
29
#endif
39
#endif
30
 
40
 
31
 
41