openshot-audio  0.1.5
juce_FillType.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_FILLTYPE_H_INCLUDED
26 #define JUCE_FILLTYPE_H_INCLUDED
27 
28 
29 //==============================================================================
39 {
40 public:
41  //==============================================================================
44 
48  FillType (Colour colour) noexcept;
49 
53  FillType (const ColourGradient& gradient);
54 
59  FillType (const Image& image, const AffineTransform& transform) noexcept;
60 
62  FillType (const FillType&);
63 
65  FillType& operator= (const FillType&);
66 
67  #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
69  FillType& operator= (FillType&&) noexcept;
70  #endif
71 
73  ~FillType() noexcept;
74 
75  //==============================================================================
77  bool isColour() const noexcept { return gradient == nullptr && image.isNull(); }
78 
80  bool isGradient() const noexcept { return gradient != nullptr; }
81 
83  bool isTiledImage() const noexcept { return image.isValid(); }
84 
87  void setColour (Colour newColour) noexcept;
88 
90  void setGradient (const ColourGradient& newGradient);
91 
95  void setTiledImage (const Image& image, const AffineTransform& transform) noexcept;
96 
101  void setOpacity (float newOpacity) noexcept;
102 
106  float getOpacity() const noexcept { return colour.getFloatAlpha(); }
107 
109  bool isInvisible() const noexcept;
110 
114  FillType transformed (const AffineTransform& transform) const;
115 
116  //==============================================================================
123 
130 
136 
139 
140  //==============================================================================
141  bool operator== (const FillType&) const;
142  bool operator!= (const FillType&) const;
143 
144 private:
146 };
147 
148 
149 #endif // JUCE_FILLTYPE_H_INCLUDED
bool isNull() const noexcept
Definition: juce_Image.h:147
#define noexcept
Definition: juce_CompilerSupport.h:141
ScopedPointer< ColourGradient > gradient
Definition: juce_FillType.h:129
AffineTransform transform
Definition: juce_FillType.h:138
Definition: juce_ColourGradient.h:35
bool isTiledImage() const noexcept
Definition: juce_FillType.h:83
#define JUCE_API
Definition: juce_StandardHeader.h:139
Image image
Definition: juce_FillType.h:135
float getFloatAlpha() const noexcept
Definition: juce_Colour.cpp:321
float getOpacity() const noexcept
Definition: juce_FillType.h:106
bool isColour() const noexcept
Definition: juce_FillType.h:77
Definition: juce_Colour.h:35
Definition: juce_FillType.h:38
bool operator==(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:565
bool isGradient() const noexcept
Definition: juce_FillType.h:80
Definition: juce_Image.h:54
Definition: juce_AffineTransform.h:40
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
Colour colour
Definition: juce_FillType.h:122
bool operator!=(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:566
bool isValid() const noexcept
Definition: juce_Image.h:139