androidx.ink.geometry
Classes
AffineTransform |
An affine transformation in the plane. |
android
|
Box |
Represents an axis-aligned rectangle. |
android
|
BoxAccumulator |
A helper class for accumulating the minimum bounding boxes of zero or more geometry objects. |
android
|
ImmutableAffineTransform |
An immutable affine transformation in the plane. |
android
|
ImmutableBox |
An immutable axis-aligned rectangle. |
android
|
ImmutableParallelogram |
Immutable parallelogram (i.e. a quadrilateral with parallel sides), defined by its |
android
|
ImmutableSegment |
Represents a directed line segment between two points. |
android
|
ImmutableTriangle |
An immutable triangle, defined by its three corners |
android
|
ImmutableVec |
An immutable two-dimensional vector, i.e. an (x, y) coordinate pair. |
android
|
MutableAffineTransform |
A mutable affine transformation in the plane. |
android
|
MutableBox |
A mutable axis-aligned rectangle. |
android
|
MutableParallelogram |
Mutable parallelogram (i.e. a quadrilateral with parallel sides), defined by its |
android
|
MutableSegment |
Represents a mutable directed line segment between two points. |
android
|
MutableTriangle |
Represents a mutable triangle, defined by its three corners |
android
|
MutableVec |
A mutable two-dimensional vector, i.e. an (x, y) coordinate pair. |
android
|
Parallelogram |
This class represents a parallelogram defined by its |
android
|
PartitionedMesh |
An immutable** complex shape expressed as a set of triangles. |
android
|
Segment |
Represents a directed line segment between two points. |
android
|
Triangle |
android
|
|
Vec |
A two-dimensional vector, i.e. an (x, y) coordinate pair. |
android
|
Objects
Angle |
A utility for working with a signed angle. |
android
|
ImmutableAffineTransform.Companion |
android
|
|
ImmutableBox.Companion |
android
|
|
ImmutableVec.Companion |
android
|
|
Intersection |
Contains functions for intersection of ink geometry classes. |
android
|
Annotations
AngleDegreesFloat |
A signed angle in degrees. |
android
|
AngleRadiansFloat |
A signed angle in radians. |
android
|
Top-level functions summary
ImmutableAffineTransform? |
createAffineTransform(matrix: Matrix)Constructs an |
android
|
ImmutableBox? |
Constructs an |
android
|
ImmutableVec |
Constructs an |
android
|
Extension functions summary
BoxAccumulator |
BoxAccumulator.add(rect: RectF)Expands the accumulated bounding box (if necessary) such that it also contains |
android
|
ImmutableAffineTransform? |
ImmutableAffineTransform.Companion.from(matrix: Matrix)Constructs an |
android
|
ImmutableVec |
ImmutableVec.Companion.from(point: PointF)Constructs an |
android
|
ImmutableBox? |
ImmutableBox.Companion.from(rect: RectF)Constructs an |
android
|
Boolean |
BoxAccumulator.getBounds(outRect: RectF)Fill the given |
android
|
Path |
PartitionedMesh.outlinesToPath(renderGroupIndex: @IntRange(from = 0) Int)Returns a |
android
|
MutableAffineTransform |
MutableAffineTransform.populateFrom(matrix: Matrix)Fills this |
android
|
MutableVec |
MutableVec.populateFrom(point: PointF)Fills this |
android
|
Unit |
Writes the values from this |
android
|
Path |
PartitionedMesh.populateOutlines(Replaces the contents of |
android
|
PointF |
Vec.populatePointF(out: PointF) |
android
|
RectF |
Box.populateRectF(out: RectF) |
android
|
Matrix |
Constructs a |
android
|
PointF |
android
|
|
RectF |
Constructs a Rect with the same coordinates as the |
android
|
Top-level functions
createAffineTransform
fun createAffineTransform(matrix: Matrix): ImmutableAffineTransform?
Constructs an ImmutableAffineTransform with the values from matrix.
If matrix is not an affine transform, returns null instead.
Performance-sensitive code should use the populateFrom overload that takes a pre-allocated MutableAffineTransform, so that the instance can be reused across multiple calls.
Kotlin callers should prefer ImmutableAffineTransform.Companion.from.
createBox
fun createBox(rect: RectF): ImmutableBox?
Constructs an ImmutableBox with the values from rect.
If rect is empty, returns null instead.
Kotlin callers should prefer ImmutableBox.Companion.from.
createVec
fun createVec(point: PointF): ImmutableVec
Constructs an ImmutableVec with the values from point.
Kotlin callers should prefer ImmutableVec.Companion.from.
Extension functions
add
fun BoxAccumulator.add(rect: RectF): BoxAccumulator
Expands the accumulated bounding box (if necessary) such that it also contains rect. If rect is null, this is a no-op.
This is functionally equivalent to, but more efficient than: add(ImmutableBox.from(rect))
| Returns | |
|---|---|
BoxAccumulator |
|
from
fun ImmutableAffineTransform.Companion.from(matrix: Matrix): ImmutableAffineTransform?
Constructs an ImmutableAffineTransform with the values from matrix.
If matrix is not an affine transform, returns null instead.
Performance-sensitive code should use the populateFrom overload that takes a pre-allocated MutableAffineTransform, so that the instance can be reused across multiple calls.
Java callers should prefer AndroidGraphicsConverter.createAffineTransform(Matrix) (createAffineTransform).
from
fun ImmutableVec.Companion.from(point: PointF): ImmutableVec
Constructs an ImmutableVec with the values from point.
Java callers should prefer AndroidGraphicsConverter.createVec(PointF)(createVec).
from
fun ImmutableBox.Companion.from(rect: RectF): ImmutableBox?
Constructs an ImmutableBox with the values from rect.
If rect is empty, returns null instead.
Java callers should prefer AndroidGraphicsConverter.createBox(createBox).
getBounds
fun BoxAccumulator.getBounds(outRect: RectF): Boolean
Fill the given RectF with the bounds of this BoxAccumulator, returning whether or not the object was actually overwritten.
outlinesToPath
fun PartitionedMesh.outlinesToPath(renderGroupIndex: @IntRange(from = 0) Int): Path
Returns a Path containing the outlines in the render group at renderGroupIndex.
populateFrom
fun MutableAffineTransform.populateFrom(matrix: Matrix): MutableAffineTransform
Fills this MutableAffineTransform with the values from matrix.
If matrix is not an affine transform, throws IllegalArgumentException instead.
Leaves matrix unchanged. Returns this modified instance to allow chaining calls.
| Returns | |
|---|---|
MutableAffineTransform |
|
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if |
populateFrom
fun MutableVec.populateFrom(point: PointF): MutableVec
Fills this MutableVec with the values from point.
Leaves point unchanged. Returns the modified instance to allow chaining calls.
| Returns | |
|---|---|
MutableVec |
|
populateMatrix
fun AffineTransform.populateMatrix(out: Matrix): Unit
Writes the values from this AffineTransform to out.
Returns the modified Matrix to allow chaining calls.
populateOutlines
fun PartitionedMesh.populateOutlines(
renderGroupIndex: @IntRange(from = 0) Int,
out: Path
): Path
Replaces the contents of out with the outline of the render group at renderGroupIndex.
Returns the modified Path to allow chaining calls.
populatePointF
fun Vec.populatePointF(out: PointF): PointF
Writes the values from this Vec to out.
Returns the modified PointF instance to allow chaining calls.
populateRectF
fun Box.populateRectF(out: RectF): RectF
Writes the values from this Box to out.
Returns the modified RectF instance to allow chaining calls.
toMatrix
fun AffineTransform.toMatrix(): Matrix
Constructs a Matrix with the values from the AffineTransform.
Performance-sensitive code should use the populateMatrix overload that takes a pre-allocated Matrix, so that the instance can be reused across multiple calls.