Crazy Eddie's GUI System  0.8.2
 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  r(0.0f), g(0.0f), b(0.0f)
66  {}
67 
68  RGB_Colour(const Lab_Colour& colour);
69  RGB_Colour(const HSV_Colour& colour);
70  RGB_Colour(const CEGUI::Colour& colour);
71 
72  unsigned char r;
73  unsigned char g;
74  unsigned char b;
75 
76  RGB_Colour operator*(const float& number) const;
77  RGB_Colour operator+(const RGB_Colour& colour) const;
78 };
79 
80 class CEGUI_COMMONDIALOGS_API Lab_Colour :
81  public AllocatedObject<Lab_Colour>
82 {
83 public:
84  Lab_Colour(float LValue, float aValue, float bValue) :
85  L(LValue), a(aValue), b(bValue)
86  {}
87 
88  Lab_Colour() :
89  L(0.0f), a(0.0f), b(0.0f)
90  {}
91 
92  Lab_Colour(const RGB_Colour& colour);
93  Lab_Colour(const HSV_Colour& colour);
94  Lab_Colour(const CEGUI::Colour& colour);
95 
96 
97  float L;
98  float a;
99  float b;
100 };
101 
102 class CEGUI_COMMONDIALOGS_API HSV_Colour :
103  public AllocatedObject<HSV_Colour>
104 {
105 public:
106  HSV_Colour(float HValue, float SValue, float VValue) :
107  H(HValue), S(SValue), V(VValue)
108  {}
109 
110  HSV_Colour() :
111  H(0.0f), S(0.0f), V(0.0f)
112  {}
113 
114  HSV_Colour(const RGB_Colour& colour);
115  HSV_Colour(const Lab_Colour& colour);
116  HSV_Colour(const CEGUI::Colour& colour);
117 
118  float H;
119  float S;
120  float V;
121 };
122 
123 }
124 
125 #if defined(_MSC_VER)
126 # pragma warning(pop)
127 #endif
128 
129 #endif
130