openshot-audio
0.1.6
|
#include <juce_graphics.h>
Public Member Functions | |
Line () noexcept | |
Line (const Line &other) noexcept | |
Line (ValueType startX, ValueType startY, ValueType endX, ValueType endY) noexcept | |
Line (const Point< ValueType > startPoint, const Point< ValueType > endPoint) noexcept | |
Line & | operator= (const Line &other) noexcept |
~Line () noexcept | |
ValueType | getStartX () const noexcept |
ValueType | getStartY () const noexcept |
ValueType | getEndX () const noexcept |
ValueType | getEndY () const noexcept |
Point< ValueType > | getStart () const noexcept |
Point< ValueType > | getEnd () const noexcept |
void | setStart (ValueType newStartX, ValueType newStartY) noexcept |
void | setEnd (ValueType newEndX, ValueType newEndY) noexcept |
void | setStart (const Point< ValueType > newStart) noexcept |
void | setEnd (const Point< ValueType > newEnd) noexcept |
const Line | reversed () const noexcept |
void | applyTransform (const AffineTransform &transform) noexcept |
ValueType | getLength () const noexcept |
bool | isVertical () const noexcept |
bool | isHorizontal () const noexcept |
Point< ValueType >::FloatType | getAngle () const noexcept |
Line< float > | toFloat () const noexcept |
Line< double > | toDouble () const noexcept |
bool | operator== (const Line &other) const noexcept |
bool | operator!= (const Line &other) const noexcept |
Point< ValueType > | getIntersection (const Line &line) const noexcept |
bool | intersects (const Line &line, Point< ValueType > &intersection) const noexcept |
bool | intersects (const Line &other) const noexcept |
Point< ValueType > | getPointAlongLine (ValueType distanceFromStart) const noexcept |
Point< ValueType > | getPointAlongLine (ValueType distanceFromStart, ValueType perpendicularDistance) const noexcept |
Point< ValueType > | getPointAlongLineProportionally (ValueType proportionOfLength) const noexcept |
ValueType | getDistanceFromPoint (const Point< ValueType > targetPoint, Point< ValueType > &pointOnLine) const noexcept |
ValueType | findNearestProportionalPositionTo (const Point< ValueType > point) const noexcept |
Point< ValueType > | findNearestPointTo (const Point< ValueType > point) const noexcept |
bool | isPointAbove (const Point< ValueType > point) const noexcept |
Line | withShortenedStart (ValueType distanceToShortenBy) const noexcept |
Line | withShortenedEnd (ValueType distanceToShortenBy) const noexcept |
Represents a line.
This class contains a bunch of useful methods for various geometric tasks.
The ValueType template parameter should be a primitive type - float or double are what it's designed for. Integer types will work in a basic way, but some methods that perform mathematical operations may not compile, or they may not produce sensible results.
|
inlinenoexcept |
Creates a line, using (0, 0) as its start and end points.
|
inlinenoexcept |
Creates a copy of another line.
|
inlinenoexcept |
Creates a line based on the coordinates of its start and end points.
|
inlinenoexcept |
Creates a line from its start and end points.
|
inlinenoexcept |
Destructor.
|
inlinenoexcept |
Applies an affine transform to the line's start and end points.
|
inlinenoexcept |
Finds the point on this line which is nearest to a given point.
|
inlinenoexcept |
Finds the point on this line which is nearest to a given point, and returns its position as a proportional position along the line.
|
inlinenoexcept |
Returns the line's angle.
This value is the number of radians clockwise from the 12 o'clock direction, where the line's start point is considered to be at the centre.
|
inlinenoexcept |
Returns the smallest distance between this line segment and a given point.
So if the point is close to the line, this will return the perpendicular distance from the line; if the point is a long way beyond one of the line's end-point's, it'll return the straight-line distance to the nearest end-point.
pointOnLine receives the position of the point that is found.
|
inlinenoexcept |
Returns the line's end point.
|
inlinenoexcept |
Returns the x coordinate of the line's end point.
|
inlinenoexcept |
Returns the y coordinate of the line's end point.
|
inlinenoexcept |
Finds the intersection between two lines.
line | the line to intersect with |
|
inlinenoexcept |
Returns the length of the line.
|
inlinenoexcept |
Returns the location of the point which is a given distance along this line.
distanceFromStart | the distance to move along the line from its start point. This value can be negative or longer than the line itself |
|
inlinenoexcept |
Returns a point which is a certain distance along and to the side of this line.
This effectively moves a given distance along the line, then another distance perpendicularly to this, and returns the resulting position.
distanceFromStart | the distance to move along the line from its start point. This value can be negative or longer than the line itself |
perpendicularDistance | how far to move sideways from the line. If you're looking along the line from its start towards its end, then a positive value here will move to the right, negative value move to the left. |
|
inlinenoexcept |
Returns the location of the point which is a given distance along this line proportional to the line's length.
proportionOfLength | the distance to move along the line from its start point, in multiples of the line's length. So a value of 0.0 will return the line's start point and a value of 1.0 will return its end point. (This value can be negative or greater than 1.0). |
|
inlinenoexcept |
Returns the line's start point.
|
inlinenoexcept |
Returns the x coordinate of the line's start point.
|
inlinenoexcept |
Returns the y coordinate of the line's start point.
|
inlinenoexcept |
Finds the intersection between two lines.
line | the other line |
intersection | the position of the point where the lines meet (or where they would meet if they were infinitely long) the intersection (if the lines intersect). If the lines are parallel, this will just be set to the position of one of the line's endpoints. |
|
inlinenoexcept |
Returns true if this line intersects another.
|
inlinenoexcept |
Returns true if the line's start and end y coordinates are the same.
|
inlinenoexcept |
Returns true if the given point lies above this line.
The return value is true if the point's y coordinate is less than the y coordinate of this line at the given x (assuming the line extends infinitely in both directions).
|
inlinenoexcept |
Returns true if the line's start and end x coordinates are the same.
|
inlinenoexcept |
Compares two lines.
|
inlinenoexcept |
Copies a line from another one.
|
inlinenoexcept |
Compares two lines.
|
inlinenoexcept |
Returns a line that is the same as this one, but with the start and end reversed,
|
inlinenoexcept |
Changes this line's end point
|
inlinenoexcept |
Changes this line's end point
|
inlinenoexcept |
Changes this line's start point
|
inlinenoexcept |
Changes this line's start point
|
inlinenoexcept |
Casts this line to double coordinates.
|
inlinenoexcept |
Casts this line to float coordinates.
|
inlinenoexcept |
Returns a shortened copy of this line.
This will chop off part of the end of this line by a certain amount, (leaving the start-point the same), and return the new line.
|
inlinenoexcept |
Returns a shortened copy of this line.
This will chop off part of the start of this line by a certain amount, (leaving the end-point the same), and return the new line.