JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
juce::FillType Class Referencefinal

Represents a colour or fill pattern to use for rendering paths. More...

#include "juce_FillType.h"

Public Member Functions

 FillType () noexcept
 Creates a default fill type, of solid black.
 
 FillType (Colour colour) noexcept
 Creates a fill type of a solid colour.
 
 FillType (const ColourGradient &gradient)
 Creates a gradient fill type.
 
 FillType (ColourGradient &&gradient)
 Creates a gradient fill type.
 
 FillType (const Image &image, const AffineTransform &transform) noexcept
 Creates a tiled image fill type.
 
 FillType (const FillType &)
 Creates a copy of another FillType.
 
FillTypeoperator= (const FillType &)
 Makes a copy of another FillType.
 
 FillType (FillType &&) noexcept
 Move constructor.
 
FillTypeoperator= (FillType &&) noexcept
 Move assignment operator.
 
 ~FillType () noexcept
 Destructor.
 
bool isColour () const noexcept
 Returns true if this is a solid colour fill, and not a gradient or image.
 
bool isGradient () const noexcept
 Returns true if this is a gradient fill.
 
bool isTiledImage () const noexcept
 Returns true if this is a tiled image pattern fill.
 
void setColour (Colour newColour) noexcept
 Turns this object into a solid colour fill.
 
void setGradient (const ColourGradient &newGradient)
 Turns this object into a gradient fill.
 
void setTiledImage (const Image &image, const AffineTransform &transform) noexcept
 Turns this object into a tiled image fill type.
 
void setOpacity (float newOpacity) noexcept
 Changes the opacity that should be used.
 
float getOpacity () const noexcept
 Returns the current opacity to be applied to the colour, gradient, or image.
 
bool isInvisible () const noexcept
 Returns true if this fill type is completely transparent.
 
FillType transformed (const AffineTransform &transform) const
 Returns a copy of this fill, adding the specified transform applied to the existing transform.
 
bool operator== (const FillType &) const
 
bool operator!= (const FillType &) const
 

Public Attributes

Colour colour
 The solid colour being used.
 
std::unique_ptr< ColourGradientgradient
 Returns the gradient that should be used for filling.
 
Image image
 The image that should be used for tiling.
 
AffineTransform transform
 The transform that should be applied to the image or gradient that's being drawn.
 

Detailed Description

Represents a colour or fill pattern to use for rendering paths.

This is used by the Graphics and DrawablePath classes as a way to encapsulate a brush type. It can either be a solid colour, a gradient, or a tiled image.

See also
Graphics::setFillType, DrawablePath::setFill

@tags{Graphics}

Definition at line 40 of file juce_FillType.h.

Constructor & Destructor Documentation

◆ FillType() [1/7]

juce::FillType::FillType ( )
noexcept

Creates a default fill type, of solid black.

Definition at line 29 of file juce_FillType.cpp.

◆ FillType() [2/7]

juce::FillType::FillType ( Colour  colour)
noexcept

Creates a fill type of a solid colour.

See also
setColour

Definition at line 34 of file juce_FillType.cpp.

◆ FillType() [3/7]

juce::FillType::FillType ( const ColourGradient gradient)

Creates a gradient fill type.

See also
setGradient

Definition at line 39 of file juce_FillType.cpp.

◆ FillType() [4/7]

juce::FillType::FillType ( ColourGradient &&  gradient)

Creates a gradient fill type.

See also
setGradient

Definition at line 44 of file juce_FillType.cpp.

◆ FillType() [5/7]

juce::FillType::FillType ( const Image image,
const AffineTransform transform 
)
noexcept

Creates a tiled image fill type.

The transform allows you to set the scaling, offset and rotation of the pattern.

See also
setTiledImage

Definition at line 49 of file juce_FillType.cpp.

◆ FillType() [6/7]

juce::FillType::FillType ( const FillType other)

Creates a copy of another FillType.

Definition at line 54 of file juce_FillType.cpp.

◆ FillType() [7/7]

juce::FillType::FillType ( FillType &&  other)
noexcept

Move constructor.

Definition at line 75 of file juce_FillType.cpp.

◆ ~FillType()

juce::FillType::~FillType ( )
noexcept

Destructor.

Definition at line 94 of file juce_FillType.cpp.

Member Function Documentation

◆ getOpacity()

float juce::FillType::getOpacity ( ) const
noexcept

Returns the current opacity to be applied to the colour, gradient, or image.

See also
setOpacity

Definition at line 114 of file juce_FillType.h.

◆ isColour()

bool juce::FillType::isColour ( ) const
noexcept

Returns true if this is a solid colour fill, and not a gradient or image.

Definition at line 85 of file juce_FillType.h.

◆ isGradient()

bool juce::FillType::isGradient ( ) const
noexcept

Returns true if this is a gradient fill.

Definition at line 88 of file juce_FillType.h.

◆ isInvisible()

bool juce::FillType::isInvisible ( ) const
noexcept

Returns true if this fill type is completely transparent.

Definition at line 145 of file juce_FillType.cpp.

◆ isTiledImage()

bool juce::FillType::isTiledImage ( ) const
noexcept

Returns true if this is a tiled image pattern fill.

Definition at line 91 of file juce_FillType.h.

◆ operator!=()

bool juce::FillType::operator!= ( const FillType other) const

Definition at line 106 of file juce_FillType.cpp.

◆ operator=() [1/2]

FillType & juce::FillType::operator= ( const FillType other)

Makes a copy of another FillType.

Definition at line 62 of file juce_FillType.cpp.

◆ operator=() [2/2]

FillType & juce::FillType::operator= ( FillType &&  other)
noexcept

Move assignment operator.

Definition at line 83 of file juce_FillType.cpp.

◆ operator==()

bool juce::FillType::operator== ( const FillType other) const

Definition at line 98 of file juce_FillType.cpp.

◆ setColour()

void juce::FillType::setColour ( Colour  newColour)
noexcept

Turns this object into a solid colour fill.

If the object was an image or gradient, those fields will no longer be valid.

Definition at line 111 of file juce_FillType.cpp.

◆ setGradient()

void juce::FillType::setGradient ( const ColourGradient newGradient)

Turns this object into a gradient fill.

Definition at line 118 of file juce_FillType.cpp.

◆ setOpacity()

void juce::FillType::setOpacity ( float  newOpacity)
noexcept

Changes the opacity that should be used.

If the fill is a solid colour, this just changes the opacity of that colour. For gradients and image tiles, it changes the opacity that will be used for them.

Definition at line 140 of file juce_FillType.cpp.

◆ setTiledImage()

void juce::FillType::setTiledImage ( const Image image,
const AffineTransform transform 
)
noexcept

Turns this object into a tiled image fill type.

The transform allows you to set the scaling, offset and rotation of the pattern.

Definition at line 132 of file juce_FillType.cpp.

◆ transformed()

FillType juce::FillType::transformed ( const AffineTransform transform) const

Returns a copy of this fill, adding the specified transform applied to the existing transform.

Definition at line 150 of file juce_FillType.cpp.

Member Data Documentation

◆ colour

Colour juce::FillType::colour

The solid colour being used.

If the fill type is not a solid colour, the alpha channel of this colour indicates the opacity that should be used for the fill, and the RGB channels are ignored.

Definition at line 130 of file juce_FillType.h.

◆ gradient

std::unique_ptr<ColourGradient> juce::FillType::gradient

Returns the gradient that should be used for filling.

This will be nullptr if the object is some other type of fill. If a gradient is active, the overall opacity with which it should be applied is indicated by the alpha channel of the colour variable.

Definition at line 137 of file juce_FillType.h.

◆ image

Image juce::FillType::image

The image that should be used for tiling.

If an image fill is active, the overall opacity with which it should be applied is indicated by the alpha channel of the colour variable.

Definition at line 143 of file juce_FillType.h.

◆ transform

AffineTransform juce::FillType::transform

The transform that should be applied to the image or gradient that's being drawn.

Definition at line 146 of file juce_FillType.h.


The documentation for this class was generated from the following files: