Crazy Eddie's GUI System  0.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Types.h
1 /***********************************************************************
2  filename: CEGUIColourPickerConversions.h
3  created: 20th February 2010
4  author: Lukas E Meindl
5 
6  purpose: Header of the ColourPicker colour type classes
7 *************************************************************************/
8 /***************************************************************************
9 * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining
12 * a copy of this software and associated documentation files (the
13 * "Software"), to deal in the Software without restriction, including
14 * without limitation the rights to use, copy, modify, merge, publish,
15 * distribute, sublicense, and/or sell copies of the Software, and to
16 * permit persons to whom the Software is furnished to do so, subject to
17 * the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be
20 * included in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
29 ***************************************************************************/
30 #ifndef CEGUI_COLOUR_PICKER_TYPES_H
31 #define CEGUI_COLOUR_PICKER_TYPES_H
32 
33 #include "CEGUI/CommonDialogs/Module.h"
34 #include "CEGUI/Window.h"
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 #endif
40 
41 
42 namespace CEGUI
43 {
44 
45 enum ColourPickerSliderMode
46 {
47  ColourPickerSliderMode_L,
48  ColourPickerSliderMode_A,
49  ColourPickerSliderMode_B
50 };
51 
52 class CEGUI_COMMONDIALOGS_API Lab_Colour;
53 class CEGUI_COMMONDIALOGS_API RGB_Colour;
54 class CEGUI_COMMONDIALOGS_API HSV_Colour;
55 
56 class CEGUI_COMMONDIALOGS_API RGB_Colour :
57  public AllocatedObject<RGB_Colour>
58 {
59 public:
60  RGB_Colour(unsigned char red, unsigned char green, unsigned char blue) :
61  r(red), g(green), b(blue)
62  {}
63 
64  RGB_Colour() {}
65  RGB_Colour(const Lab_Colour& colour);
66  RGB_Colour(const HSV_Colour& colour);
67  RGB_Colour(const CEGUI::Colour& colour);
68 
69  unsigned char r;
70  unsigned char g;
71  unsigned char b;
72 
73  RGB_Colour operator*(const float& number) const;
74  RGB_Colour operator+(const RGB_Colour& colour) const;
75 };
76 
77 class CEGUI_COMMONDIALOGS_API Lab_Colour :
78  public AllocatedObject<Lab_Colour>
79 {
80 public:
81  Lab_Colour(float LValue, float aValue, float bValue) :
82  L(LValue), a(aValue), b(bValue)
83  {}
84 
85  Lab_Colour() {}
86  Lab_Colour(const RGB_Colour& colour);
87  Lab_Colour(const HSV_Colour& colour);
88  Lab_Colour(const CEGUI::Colour& colour);
89 
90 
91  float L;
92  float a;
93  float b;
94 };
95 
96 class CEGUI_COMMONDIALOGS_API HSV_Colour :
97  public AllocatedObject<HSV_Colour>
98 {
99 public:
100  HSV_Colour(float HValue, float SValue, float VValue) :
101  H(HValue), S(SValue), V(VValue)
102  {}
103 
104  HSV_Colour() {}
105  HSV_Colour(const RGB_Colour& colour);
106  HSV_Colour(const Lab_Colour& colour);
107  HSV_Colour(const CEGUI::Colour& colour);
108 
109  float H;
110  float S;
111  float V;
112 };
113 
114 }
115 
116 #if defined(_MSC_VER)
117 # pragma warning(pop)
118 #endif
119 
120 #endif
121