AndroidGraphicsConverter
public final class AndroidGraphicsConverter
Summary
Public methods |
|
|---|---|
static final @NonNull BoxAccumulator |
add(@NonNull BoxAccumulator receiver, @NonNull RectF rect)Expands the accumulated bounding box (if necessary) such that it also contains |
static final ImmutableAffineTransform |
createAffineTransform(@NonNull Matrix matrix)Constructs an |
static final ImmutableBox |
Constructs an |
static final @NonNull ImmutableVec |
Constructs an |
static final ImmutableAffineTransform |
from(Constructs an |
static final ImmutableBox |
from(@NonNull ImmutableBox.Companion receiver, @NonNull RectF rect)Constructs an |
static final @NonNull ImmutableVec |
from(@NonNull ImmutableVec.Companion receiver, @NonNull PointF point)Constructs an |
static final boolean |
getBounds(@NonNull BoxAccumulator receiver, @NonNull RectF outRect)Fill the given |
static final @NonNull Path |
outlinesToPath(Returns a |
static final @NonNull MutableAffineTransform |
populateFrom(Fills this |
static final @NonNull MutableVec |
populateFrom(@NonNull MutableVec receiver, @NonNull PointF point)Fills this |
static final void |
populateMatrix(@NonNull AffineTransform receiver, @NonNull Matrix out)Writes the values from this |
static final @NonNull Path |
populateOutlines(Replaces the contents of |
static final @NonNull PointF |
populatePointF(@NonNull Vec receiver, @NonNull PointF out) |
static final @NonNull RectF |
populateRectF(@NonNull Box receiver, @NonNull RectF out) |
static final @NonNull Matrix |
toMatrix(@NonNull AffineTransform receiver)Constructs a |
static final @NonNull PointF |
|
static final @NonNull RectF |
Constructs a Rect with the same coordinates as the |
Public methods
add
public static final @NonNull BoxAccumulator add(@NonNull BoxAccumulator receiver, @NonNull RectF rect)
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 | |
|---|---|
@NonNull BoxAccumulator |
|
createAffineTransform
public static final ImmutableAffineTransform createAffineTransform(@NonNull Matrix matrix)
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
public static final ImmutableBox createBox(@NonNull RectF rect)
Constructs an ImmutableBox with the values from rect.
If rect is empty, returns null instead.
Kotlin callers should prefer ImmutableBox.Companion.from.
createVec
public static final @NonNull ImmutableVec createVec(@NonNull PointF point)
Constructs an ImmutableVec with the values from point.
Kotlin callers should prefer ImmutableVec.Companion.from.
from
public static final ImmutableAffineTransform from(
@NonNull ImmutableAffineTransform.Companion receiver,
@NonNull Matrix matrix
)
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
public static final ImmutableBox from(@NonNull ImmutableBox.Companion receiver, @NonNull RectF rect)
Constructs an ImmutableBox with the values from rect.
If rect is empty, returns null instead.
Java callers should prefer AndroidGraphicsConverter.createBox(createBox).
from
public static final @NonNull ImmutableVec from(@NonNull ImmutableVec.Companion receiver, @NonNull PointF point)
Constructs an ImmutableVec with the values from point.
Java callers should prefer AndroidGraphicsConverter.createVec(PointF)(createVec).
getBounds
public static final boolean getBounds(@NonNull BoxAccumulator receiver, @NonNull RectF outRect)
Fill the given RectF with the bounds of this BoxAccumulator, returning whether or not the object was actually overwritten.
outlinesToPath
public static final @NonNull Path outlinesToPath(
@NonNull PartitionedMesh receiver,
@IntRange(from = 0) int renderGroupIndex
)
Returns a Path containing the outlines in the render group at renderGroupIndex.
populateFrom
public static final @NonNull MutableAffineTransform populateFrom(
@NonNull MutableAffineTransform receiver,
@NonNull Matrix matrix
)
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 | |
|---|---|
@NonNull MutableAffineTransform |
|
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if |
populateFrom
public static final @NonNull MutableVec populateFrom(@NonNull MutableVec receiver, @NonNull PointF point)
Fills this MutableVec with the values from point.
Leaves point unchanged. Returns the modified instance to allow chaining calls.
| Returns | |
|---|---|
@NonNull MutableVec |
|
populateMatrix
public static final void populateMatrix(@NonNull AffineTransform receiver, @NonNull Matrix out)
Writes the values from this AffineTransform to out.
Returns the modified Matrix to allow chaining calls.
| Returns | |
|---|---|
void |
populateOutlines
public static final @NonNull Path populateOutlines(
@NonNull PartitionedMesh receiver,
@IntRange(from = 0) int renderGroupIndex,
@NonNull Path out
)
Replaces the contents of out with the outline of the render group at renderGroupIndex.
Returns the modified Path to allow chaining calls.
populatePointF
public static final @NonNull PointF populatePointF(@NonNull Vec receiver, @NonNull PointF out)
Writes the values from this Vec to out.
Returns the modified PointF instance to allow chaining calls.
populateRectF
public static final @NonNull RectF populateRectF(@NonNull Box receiver, @NonNull RectF out)
Writes the values from this Box to out.
Returns the modified RectF instance to allow chaining calls.
toMatrix
public static final @NonNull Matrix toMatrix(@NonNull AffineTransform receiver)
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.