openshot-audio
0.1.2
|
#include <juce_Drawable.h>
Classes | |
class | Positioner |
class | ValueTreeWrapperBase |
Protected Member Functions | |
Drawable () | |
void | transformContextToCorrectOrigin (Graphics &) |
void | parentHierarchyChanged () override |
void | setBoundsToEnclose (const Rectangle< float > &) |
Drawable (const Drawable &) | |
![]() | |
virtual ComponentPeer * | createNewPeer (int styleFlags, void *nativeWindowToAttachTo) |
Protected Attributes | |
Point< int > | originRelativeToComponent |
Friends | |
class | DrawableComposite |
class | DrawableShape |
Additional Inherited Members | |
![]() | |
enum | FocusChangeType { focusChangedByMouseClick, focusChangedByTabKey, focusChangedDirectly } |
The base class for objects which can draw themselves, e.g. polygons, images, etc.
|
protected |
The base class can't be instantiated directly.
|
virtual |
Destructor.
|
pure virtual |
Creates a deep copy of this Drawable object.
Use this to create a new copy of this and any sub-objects in the tree.
Implemented in DrawableComposite, DrawableText, DrawableImage, DrawablePath, and DrawableRectangle.
Tries to turn some kind of image file into a drawable.
The data could be an image that the ImageFileFormat class understands, or it could be SVG.
|
static |
Tries to turn a stream containing some kind of image data into a drawable.
The data could be an image that the ImageFileFormat class understands, or it could be SVG.
Tries to turn a file containing some kind of image data into a drawable.
The data could be an image that the ImageFileFormat class understands, or it could be SVG.
|
static |
Attempts to parse an SVG (Scalable Vector Graphics) document, and to turn this into a Drawable tree.
The object returned must be deleted by the caller. If something goes wrong while parsing, it may return nullptr.
SVG is a pretty large and complex spec, and this doesn't aim to be a full implementation, but it can return the basic vector objects.
|
static |
Tries to create a Drawable from a previously-saved ValueTree. The ValueTree must have been created by the createValueTree() method. If there are any images used within the drawable, you'll need to provide a valid ImageProvider object that can be used to retrieve these images from whatever type of identifier is used to represent them. Internally, this uses a ComponentBuilder, and registerDrawableTypeHandlers().
|
pure virtual |
Creates a ValueTree to represent this Drawable. The ValueTree that is returned can be turned back into a Drawable with createFromValueTree(). If there are any images used in this drawable, you'll need to provide a valid ImageProvider object that can be used to create storable representations of them.
Implemented in DrawableComposite, DrawableText, DrawableImage, DrawablePath, and DrawableRectangle.
void Drawable::draw | ( | Graphics & | g, |
float | opacity, | ||
const AffineTransform & | transform = AffineTransform::identity |
||
) | const |
Renders this Drawable object.
Note that the preferred way to render a drawable in future is by using it as a component and adding it to a parent, so you might want to consider that before using this method.
void Drawable::drawAt | ( | Graphics & | g, |
float | x, | ||
float | y, | ||
float | opacity | ||
) | const |
Renders the Drawable at a given offset within the Graphics context.
The coordinates passed-in are used to translate the object relative to its own origin before drawing it - this is basically a quick way of saying:
Note that the preferred way to render a drawable in future is by using it as a component and adding it to a parent, so you might want to consider that before using this method.
void Drawable::drawWithin | ( | Graphics & | g, |
const Rectangle< float > & | destArea, | ||
RectanglePlacement | placement, | ||
float | opacity | ||
) | const |
Renders the Drawable within a rectangle, scaling it to fit neatly inside without changing its aspect-ratio.
The object can placed arbitrarily within the rectangle based on a Justification type, and can either be made as big as possible, or just reduced to fit.
Note that the preferred way to render a drawable in future is by using it as a component and adding it to a parent, so you might want to consider that before using this method.
g | the graphics context to render onto |
destArea | the target rectangle to fit the drawable into |
placement | defines the alignment and rescaling to use to fit this object within the target rectangle. |
opacity | the opacity to use, in the range 0 to 1.0 |
|
pure virtual |
Returns the area that this drawble covers. The result is expressed in this drawable's own coordinate space, and does not take into account any transforms that may be applied to the component.
Implemented in DrawableShape, DrawableComposite, DrawableText, and DrawableImage.
DrawableComposite * Drawable::getParent | ( | ) | const |
Returns the DrawableComposite that contains this object, if there is one.
|
overrideprotectedvirtual |
Called to indicate that the component's parents have changed.
When a component is added or removed from its parent, this method will be called on all of its children (recursively - so all children of its children will also be called as well).
Subclasses can override this if they need to react to this in some way.
Reimplemented from Component.
Reimplemented in DrawableComposite.
Parses an SVG path string and returns it.
|
static |
Registers a set of ComponentBuilder::TypeHandler objects that can be used to load all the different Drawable types from a saved state.
Recursively replaces a colour that might be used for filling or stroking. return true if any instances of this colour were found.
Reimplemented in DrawableShape.
void Drawable::setOriginWithOriginalSize | ( | Point< float > | originWithinParent | ) |
Resets any transformations on this drawable, and positions its origin within its parent component.
void Drawable::setTransformToFit | ( | const Rectangle< float > & | areaInParent, |
RectanglePlacement | placement | ||
) |
Sets a transform for this drawable that will position it within the specified area of its parent component.
|
protected |
|
friend |
|
friend |