Subversion Repositories gelsvn

Rev

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

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