Crazy Eddie's GUI System  0.8.7
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 
52 {
53  ColourPickerSliderMode_L,
54  ColourPickerSliderMode_A,
55  ColourPickerSliderMode_B
56 };
57 
58 class CEGUI_COMMONDIALOGS_API Lab_Colour;
59 class CEGUI_COMMONDIALOGS_API RGB_Colour;
60 class CEGUI_COMMONDIALOGS_API HSV_Colour;
61 
63 class CEGUI_COMMONDIALOGS_API RGB_Colour :
64  public AllocatedObject<RGB_Colour>
65 {
66 public:
67  RGB_Colour(unsigned char red, unsigned char green, unsigned char blue) :
68  r(red), g(green), b(blue)
69  {}
70 
71  RGB_Colour() :
72  r(0), g(0), b(0)
73  {}
74 
75  RGB_Colour(const Lab_Colour& colour);
76  RGB_Colour(const HSV_Colour& colour);
77  RGB_Colour(const CEGUI::Colour& colour);
78 
79  unsigned char r;
80  unsigned char g;
81  unsigned char b;
82 
83  RGB_Colour operator*(const float& number) const;
84  RGB_Colour operator+(const RGB_Colour& colour) const;
85 };
86 
88 class CEGUI_COMMONDIALOGS_API Lab_Colour :
89  public AllocatedObject<Lab_Colour>
90 {
91 public:
92  Lab_Colour(float LValue, float aValue, float bValue) :
93  L(LValue), a(aValue), b(bValue)
94  {}
95 
96  Lab_Colour() :
97  L(0.0f), a(0.0f), b(0.0f)
98  {}
99 
100  Lab_Colour(const RGB_Colour& colour);
101  Lab_Colour(const HSV_Colour& colour);
102  Lab_Colour(const CEGUI::Colour& colour);
103 
104 
105  float L;
106  float a;
107  float b;
108 };
109 
111 class CEGUI_COMMONDIALOGS_API HSV_Colour :
112  public AllocatedObject<HSV_Colour>
113 {
114 public:
115  HSV_Colour(float HValue, float SValue, float VValue) :
116  H(HValue), S(SValue), V(VValue)
117  {}
118 
119  HSV_Colour() :
120  H(0.0f), S(0.0f), V(0.0f)
121  {}
122 
123  HSV_Colour(const RGB_Colour& colour);
124  HSV_Colour(const Lab_Colour& colour);
125  HSV_Colour(const CEGUI::Colour& colour);
126 
127  float H;
128  float S;
129  float V;
130 };
131 
132 }
133 
134 #if defined(_MSC_VER)
135 # pragma warning(pop)
136 #endif
137 
138 #endif
139 
Definition: MemoryAllocatedObject.h:109
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Class representing an RGB colour using unsigned chars.
Definition: Types.h:63
Class representing an HSV (hue, saturation and value) colour using floats.
Definition: Types.h:111
Class representing a Colour according to the L*a*b* standard.
Definition: Types.h:88
String CEGUIEXPORT operator+(const String &str1, const String &str2)
Return String object that is the concatenation of the given inputs.
ColourPickerSliderMode
Enum defining the ColourPicker Slider mode.
Definition: Types.h:51
Class representing colour values within the system.
Definition: Colour.h:44