nux-1.14.0
HueRangeValuator.h
00001 /*
00002  * Copyright 2010 Inalogic® Inc.
00003  *
00004  * This program is free software: you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License, as
00006  * published by the  Free Software Foundation; either version 2.1 or 3.0
00007  * of the License.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranties of
00011  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00012  * PURPOSE.  See the applicable version of the GNU Lesser General Public
00013  * License for more details.
00014  *
00015  * You should have received a copy of both the GNU Lesser General Public
00016  * License along with this program. If not, see <http://www.gnu.org/licenses/>
00017  *
00018  * Authored by: Jay Taoko <jaytaoko@inalogic.com>
00019  *
00020  */
00021 
00022 
00023 #ifndef HUERANGEVALUATOR_H
00024 #define HUERANGEVALUATOR_H
00025 
00026 
00027 #if defined(NUX_OS_WINDOWS)
00028 #include "NuxGraphics/Events.h"
00029 #elif defined(NUX_OS_LINUX)
00030 #include "NuxGraphics/Events.h"
00031 #endif
00032 #include "EditTextBox.h"
00033 #include "StaticTextBox.h"
00034 #include "HLayout.h"
00035 
00036 namespace nux
00037 {
00038 
00039   class HueRangeValuator : public RangeValue
00040   {
00041   public:
00042     HueRangeValuator (float value = 0.0f, float vmin = 0, float vmax = 1.0f);
00043     ~HueRangeValuator();
00044 
00045     virtual void Draw (GraphicsEngine &GfxContext, bool force_draw);
00046     void SetHLSLight (float light)
00047     {
00048       m_HLSLight = light;
00049     }
00050     void SetHSVValue (float value)
00051     {
00052       m_HSVValue = value;
00053     }
00054     void SetHLSSaturation (float saturation)
00055     {
00056       m_HLSSaturation = saturation;
00057     }
00058     void SetHSVSaturation (float saturation)
00059     {
00060       m_HSVSaturation = saturation;
00061     }
00062     void ModelHSV()
00063     {
00064       m_Model = color::HSV;
00065     }
00066     void ModelHLS()
00067     {
00068       m_Model = color::HLS;
00069     }
00070     color::Model GetModel() const
00071     {
00072       return m_Model;
00073     }
00074 
00075   protected:
00076     void InitializeWidgets();
00077     void InitializeLayout();
00078 
00079   private:
00080     float m_HLSSaturation;
00081     float m_HLSLight;
00082     float m_HSVSaturation;
00083     float m_HSVValue;
00084 
00085     color::Model m_Model;
00086   };
00087 
00088 }
00089 
00090 #endif // HUERANGEVALUATOR_H
00091 
00092 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends