openshot-audio  0.1.6
juce_ColourSelector.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_COLOURSELECTOR_H_INCLUDED
26 #define JUCE_COLOURSELECTOR_H_INCLUDED
27 
28 
29 //==============================================================================
39  public ChangeBroadcaster,
40  protected SliderListener
41 {
42 public:
43  //==============================================================================
46  {
47  showAlphaChannel = 1 << 0,
49  showColourAtTop = 1 << 1,
50  showSliders = 1 << 2,
51  showColourspace = 1 << 3
52  };
53 
54  //==============================================================================
65  ColourSelector (int flags = (showAlphaChannel | showColourAtTop | showSliders | showColourspace),
66  int edgeGap = 4,
67  int gapAroundColourSpaceComponent = 7);
68 
70  ~ColourSelector();
71 
72  //==============================================================================
80  Colour getCurrentColour() const;
81 
83  void setCurrentColour (Colour newColour);
84 
85  //==============================================================================
92  virtual int getNumSwatches() const;
93 
102  virtual Colour getSwatchColour (int index) const;
103 
112  virtual void setSwatchColour (int index, const Colour& newColour) const;
113 
114 
115  //==============================================================================
124  {
125  backgroundColourId = 0x1007000,
126  labelTextColourId = 0x1007001
127  };
128 
129 
130 private:
131  //==============================================================================
132  class ColourSpaceView;
133  class HueSelectorComp;
134  class SwatchComponent;
135  class ColourComponentSlider;
136  class ColourSpaceMarker;
138  friend class ColourSpaceView;
140  friend class HueSelectorComp;
142 
143  Colour colour;
144  float h, s, v;
145  ScopedPointer<Slider> sliders[4];
146  ScopedPointer<ColourSpaceView> colourSpace;
147  ScopedPointer<HueSelectorComp> hueSelector;
148  OwnedArray<SwatchComponent> swatchComponents;
149  const int flags;
150  int edgeGap;
151  Rectangle<int> previewArea;
152 
153  void setHue (float newH);
154  void setSV (float newS, float newV);
155  void updateHSV();
156  void update();
157  void sliderValueChanged (Slider*) override;
158  void paint (Graphics&) override;
159  void resized() override;
160 
162 
163  #if JUCE_CATCH_DEPRECATED_CODE_MISUSE
164  // This constructor is here temporarily to prevent old code compiling, because the parameters
165  // have changed - if you get an error here, update your code to use the new constructor instead..
166  ColourSelector (bool);
167  #endif
168 };
169 
170 
171 #endif // JUCE_COLOURSELECTOR_H_INCLUDED
Definition: juce_ColourSelector.cpp:196
Definition: juce_ColourSelector.cpp:70
ColourSelectorOptions
Definition: juce_ColourSelector.h:45
Definition: juce_ChangeBroadcaster.h:35
#define JUCE_API
Definition: juce_StandardHeader.h:139
ColourIds
Definition: juce_ColourSelector.h:123
Definition: juce_Rectangle.h:36
virtual void resized()
Definition: juce_Component.cpp:2272
there are legal restrictions on arithmetic coding Invalid progressive parameters caller expects u Cannot quantize more than d color components Adobe APP14 flags
Definition: juce_JPEGLoader.cpp:127
Definition: juce_Colour.h:35
virtual void paint(Graphics &g)
Definition: juce_Component.cpp:1929
Definition: juce_Component.h:33
Definition: juce_Slider.h:503
Definition: juce_ColourSelector.h:38
Definition: juce_ContainerDeletePolicy.h:44
Definition: juce_OwnedArray.h:55
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_GraphicsContext.h:42
Definition: juce_ColourSelector.cpp:162
Definition: juce_Slider.h:50
virtual void sliderValueChanged(Slider *slider)=0