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