LMMS
Loading...
Searching...
No Matches
juce_ColourGradient.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
38{
39public:
45 ColourGradient() noexcept;
46
48 ColourGradient (ColourGradient&&) noexcept;
49 ColourGradient& operator= (const ColourGradient&);
50 ColourGradient& operator= (ColourGradient&&) noexcept;
51
52 //==============================================================================
70 ColourGradient (Colour colour1, float x1, float y1,
71 Colour colour2, float x2, float y2,
72 bool isRadial);
73
92 Colour colour2, Point<float> point2,
93 bool isRadial);
94
95 //==============================================================================
97 static ColourGradient vertical (Colour colour1, float y1,
98 Colour colour2, float y2);
99
101 static ColourGradient horizontal (Colour colour1, float x1,
102 Colour colour2, float x2);
103
105 template <typename Type>
106 static ColourGradient vertical (Colour colourTop, Colour colourBottom, Rectangle<Type> area)
107 {
108 return vertical (colourTop, (float) area.getY(), colourBottom, (float) area.getBottom());
109 }
110
112 template <typename Type>
113 static ColourGradient horizontal (Colour colourLeft, Colour colourRight, Rectangle<Type> area)
114 {
115 return horizontal (colourLeft, (float) area.getX(), colourRight, (float) area.getRight());
116 }
117
120
121 //==============================================================================
127 void clearColours();
128
140 int addColour (double proportionAlongGradient, Colour colour);
141
143 void removeColour (int index);
144
146 void multiplyOpacity (float multiplier) noexcept;
147
148 //==============================================================================
150 int getNumColours() const noexcept;
151
156 double getColourPosition (int index) const noexcept;
157
161 Colour getColour (int index) const noexcept;
162
166 void setColour (int index, Colour newColour) noexcept;
167
171 Colour getColourAtPosition (double position) const noexcept;
172
173 //==============================================================================
179 int createLookupTable (const AffineTransform& transform, HeapBlock<PixelARGB>& resultLookupTable) const;
180
186 void createLookupTable (PixelARGB* resultLookupTable, int numEntries) const noexcept;
187
189 bool isOpaque() const noexcept;
190
192 bool isInvisible() const noexcept;
193
194 //==============================================================================
196
203
204 bool operator== (const ColourGradient&) const noexcept;
205 bool operator!= (const ColourGradient&) const noexcept;
206
207
208private:
209 //==============================================================================
211 {
212 bool operator== (ColourPoint) const noexcept;
213 bool operator!= (ColourPoint) const noexcept;
214
215 double position;
217 };
218
220
222};
223
224} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
#define final
Definition DistrhoDefines.h:74
Definition juce_AffineTransform.h:43
Definition juce_Array.h:56
Definition juce_ColourGradient.h:38
static ColourGradient horizontal(Colour colour1, float x1, Colour colour2, float x2)
Definition juce_ColourGradient.cpp:90
ColourGradient() noexcept
Definition juce_ColourGradient.cpp:29
Point< float > point2
Definition juce_ColourGradient.h:195
static ColourGradient vertical(Colour colour1, float y1, Colour colour2, float y2)
Definition juce_ColourGradient.cpp:85
bool isRadial
Definition juce_ColourGradient.h:202
Array< ColourPoint > colours
Definition juce_ColourGradient.h:219
static ColourGradient vertical(Colour colourTop, Colour colourBottom, Rectangle< Type > area)
Definition juce_ColourGradient.h:106
Point< float > point1
Definition juce_ColourGradient.h:195
static ColourGradient horizontal(Colour colourLeft, Colour colourRight, Rectangle< Type > area)
Definition juce_ColourGradient.h:113
Definition juce_Colour.h:38
Definition juce_HeapBlock.h:87
Definition juce_PixelFormats.h:59
Definition juce_Point.h:42
Definition juce_Rectangle.h:67
ValueType getRight() const noexcept
Definition juce_Rectangle.h:139
ValueType getBottom() const noexcept
Definition juce_Rectangle.h:142
ValueType getX() const noexcept
Definition juce_Rectangle.h:127
ValueType getY() const noexcept
Definition juce_Rectangle.h:130
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition juce_LeakedObjectDetector.h:138
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
Definition juce_ColourGradient.h:211
Colour colour
Definition juce_ColourGradient.h:216
double position
Definition juce_ColourGradient.h:215
#define const
Definition zconf.h:137