oculus1
diff libovr/Src/Kernel/OVR_Color.h @ 1:e2f9e4603129
added LibOVR and started a simple vr wrapper.
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 14 Sep 2013 16:14:59 +0300 |
parents | |
children | b069a5c27388 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libovr/Src/Kernel/OVR_Color.h Sat Sep 14 16:14:59 2013 +0300 1.3 @@ -0,0 +1,1 @@ 1.4 +/************************************************************************************ 1.5 1.6 PublicHeader: OVR.h 1.7 Filename : OVR_Color.h 1.8 Content : Contains color struct. 1.9 Created : February 7, 2013 1.10 Notes : 1.11 1.12 Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. 1.13 1.14 Use of this software is subject to the terms of the Oculus license 1.15 agreement provided at the time of installation or download, or which 1.16 otherwise accompanies this software in either electronic or hard copy form. 1.17 1.18 ************************************************************************************/ 1.19 #ifndef OVR_Color_h 1.20 #define OVR_Color_h 1.21 1.22 #include "OVR_Types.h" 1.23 1.24 namespace OVR { 1.25 1.26 struct Color 1.27 { 1.28 UByte R,G,B,A; 1.29 1.30 Color() {} 1.31 1.32 // Constructs color by channel. Alpha is set to 0xFF (fully visible) 1.33 // if not specified. 1.34 Color(unsigned char r,unsigned char g,unsigned char b, unsigned char a = 0xFF) 1.35 : R(r), G(g), B(b), A(a) { } 1.36 1.37 // 0xAARRGGBB - Common HTML color Hex layout 1.38 Color(unsigned c) 1.39 : R((unsigned char)(c>>16)), G((unsigned char)(c>>8)), 1.40 B((unsigned char)c), A((unsigned char)(c>>24)) { } 1.41 1.42 bool operator==(const Color& b) const 1.43 { 1.44 return R == b.R && G == b.G && B == b.B && A == b.A; 1.45 } 1.46 1.47 void GetRGBA(float *r, float *g, float *b, float* a) const 1.48 { 1.49 *r = R / 255.0f; 1.50 *g = G / 255.0f; 1.51 *b = B / 255.0f; 1.52 *a = A / 255.0f; 1.53 } 1.54 }; 1.55 1.56 } 1.57 1.58 #endif 1.59 \ No newline at end of file