SourceNode.Source


public final class SourceNode.Source


List of input properties along with their units that can act as sources for a androidx.ink.brush.BrushBehavior.

Behaviors that consider properties of the stroke input do not consider alterations to the visible position of that point in the stroke by brush behaviors that modify that position (e.g. TargetNode.Target.POSITION_OFFSET_X_IN_MULTIPLES_OF_BRUSH_SIZE). That is, the position, velocity, and acceleration of the stroke input may not match the visible position, velocity, and acceleration of that point in the drawn stroke. The stroke inputs considered by these behaviors are specifically the "modeled" inputs used to construct the stroke geometry, which may be upsampled, denoised, or otherwise transformed from the raw stroke input.

Summary

Public fields

static final @NonNull SourceNode.Source

Signed component acceleration of the modeled stroke input pointer in the direction of its velocity in centimeters per second squared.

static final @NonNull SourceNode.Source

Signed component of acceleration of the modeled stroke input in the direction of its velocity in multiples of the brush size per second squared.

static final @NonNull SourceNode.Source

Absolute acceleration of the modeled stroke input pointer in centimeters per second squared.

static final @NonNull SourceNode.Source

Absolute acceleration of the modeled stroke input in multiples of the brush size per second squared.

static final @NonNull SourceNode.Source

Signed component of acceleration of the modeled stroke input pointer perpendicular to its velocity, rotated 90 degrees in the direction from the positive x-axis towards the positive y-axis, in centimeters per second squared.

static final @NonNull SourceNode.Source

Signed component of acceleration of the modeled stroke input perpendicular to its velocity, rotated 90 degrees in the direction from the positive x-axis towards the positive y-axis, in multiples of the brush size per second squared.

static final @NonNull SourceNode.Source

Signed x component of the acceleration of the modeled stroke input pointer in centimeters per second squared.

static final @NonNull SourceNode.Source

Signed x component of the acceleration of the modeled stroke input in multiples of the brush size per second squared.

static final @NonNull SourceNode.Source

Signed y component of the acceleration of the modeled stroke input pointer in centimeters per second squared.

static final @NonNull SourceNode.Source

Signed y component of the acceleration of the modeled stroke input in multiples of the brush size per second squared.

static final @NonNull SourceNode.Source

Angle of the modeled stroke input's current direction of travel in stroke coordinate space, normalized to the range (-π, π].

static final @NonNull SourceNode.Source

Angle of the modeled stroke input's current direction of travel in stroke coordinate space, normalized to the range [0, 2π).

static final @NonNull SourceNode.Source

Distance from the current modeled input to the end of the stroke along the input path, as a fraction of the current total length of the stroke.

static final @NonNull SourceNode.Source

The distance left to be traveled from a given modeled input to the current last modeled input of the stroke in multiples of the brush size.

static final @NonNull SourceNode.Source

Distance in centimeters traveled by the modeled stroke input pointer along the input path from the start of the stroke.

static final @NonNull SourceNode.Source

Distance traveled by the inputs of the current stroke, starting at 0 at the first input, where one distance unit is equal to the brush size.

static final @NonNull SourceNode.Source

Signed x component of the modeled stroke input's current direction of travel in stroke coordinate space, normalized to the range -1, 1.

static final @NonNull SourceNode.Source

Signed y component of the modeled stroke input's current direction of travel in stroke coordinate space, normalized to the range -1, 1.

static final @NonNull SourceNode.Source

Stylus or touch pressure with values reported in the range 0, 1.

static final @NonNull SourceNode.Source

Stylus orientation with values reported in the range (-π, π].

static final @NonNull SourceNode.Source

Stylus orientation with values reported in the range [0, 2π).

static final @NonNull SourceNode.Source

Distance in centimeters alonge the input path from the real portion of the modeled stroke to this input.

static final @NonNull SourceNode.Source

Distance traveled by the inputs of the current prediction, starting at 0 at the last non-predicted input, in multiples of the brush size.

static final @NonNull SourceNode.Source

Elapsed time of the prediction in seconds, starting at 0 at the last non-predicted input.

static final @NonNull SourceNode.Source

Absolute speed of the modeled stroke input pointer in centimeters per second.

static final @NonNull SourceNode.Source

Absolute speed of the modeled stroke input in multiples of the brush size per second.

static final @NonNull SourceNode.Source

Stylus tilt with values reported in the range 0, π/2 radians.

static final @NonNull SourceNode.Source

Stylus tilt along the x axis in the range -π/2, π/2, with a positive value corresponding to tilt toward the respective positive axis.

static final @NonNull SourceNode.Source

Stylus tilt along the y axis in the range -π/2, π/2, with a positive value corresponding to tilt toward the respective positive axis.

static final @NonNull SourceNode.Source

Time elapsed from the current modeled stroke input until the last input in the stroke.

static final @NonNull SourceNode.Source

Time elapsed in seconds from between the start of the stroke and the current modeled stroke input.

static final @NonNull SourceNode.Source

Time elapsed in seconds since the modeled stroke input.

static final @NonNull SourceNode.Source

Time elapsed since the final input of the stroke, or zero if the final input hasn't arrived yet.

static final @NonNull SourceNode.Source

Signed x component of the modeled stroke input pointer's velocity in centimeters per second.

static final @NonNull SourceNode.Source

Signed x component of the velocity of the modeled stroke input in multiples of the brush size per second.

static final @NonNull SourceNode.Source

Signed y component of the modeled stroke input pointer's velocity in centimeters per second.

static final @NonNull SourceNode.Source

Signed y component of the velocity of the modeled stroke input in multiples of the brush size per second.

Public methods

@NonNull String

Public fields

ACCELERATION_FORWARD_IN_CENTIMETERS_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_FORWARD_IN_CENTIMETERS_PER_SECOND_SQUARED

Signed component acceleration of the modeled stroke input pointer in the direction of its velocity in centimeters per second squared.

ACCELERATION_FORWARD_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_FORWARD_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

Signed component of acceleration of the modeled stroke input in the direction of its velocity in multiples of the brush size per second squared. Note that this value doesn't take into account brush behaviors that offset the position of that visible point in the stroke.

ACCELERATION_IN_CENTIMETERS_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_IN_CENTIMETERS_PER_SECOND_SQUARED

Absolute acceleration of the modeled stroke input pointer in centimeters per second squared.

ACCELERATION_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

Absolute acceleration of the modeled stroke input in multiples of the brush size per second squared. Note that this value doesn't take into account brush behaviors that offset the position of that visible point in the stroke.

ACCELERATION_LATERAL_IN_CENTIMETERS_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_LATERAL_IN_CENTIMETERS_PER_SECOND_SQUARED

Signed component of acceleration of the modeled stroke input pointer perpendicular to its velocity, rotated 90 degrees in the direction from the positive x-axis towards the positive y-axis, in centimeters per second squared.

ACCELERATION_LATERAL_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_LATERAL_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

Signed component of acceleration of the modeled stroke input perpendicular to its velocity, rotated 90 degrees in the direction from the positive x-axis towards the positive y-axis, in multiples of the brush size per second squared. Note that this value doesn't take into account brush behaviors that offset the position of that visible point in the stroke.

ACCELERATION_X_IN_CENTIMETERS_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_X_IN_CENTIMETERS_PER_SECOND_SQUARED

Signed x component of the acceleration of the modeled stroke input pointer in centimeters per second squared.

ACCELERATION_X_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_X_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

Signed x component of the acceleration of the modeled stroke input in multiples of the brush size per second squared. Note that this value doesn't take into account brush behaviors that offset the position of that visible point in the stroke.

ACCELERATION_Y_IN_CENTIMETERS_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_Y_IN_CENTIMETERS_PER_SECOND_SQUARED

Signed y component of the acceleration of the modeled stroke input pointer in centimeters per second squared.

ACCELERATION_Y_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

public static final @NonNull SourceNode.Source ACCELERATION_Y_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

Signed y component of the acceleration of the modeled stroke input in multiples of the brush size per second squared. Note that this value doesn't take into account brush behaviors that offset the position of that visible point in the stroke.

DIRECTION_ABOUT_ZERO_IN_RADIANS

public static final @NonNull SourceNode.Source DIRECTION_ABOUT_ZERO_IN_RADIANS

Angle of the modeled stroke input's current direction of travel in stroke coordinate space, normalized to the range (-π, π]. A value of 0 indicates the direction of the positive x-axis; a value of π/2 indicates the direction of the positive y-axis.

DIRECTION_IN_RADIANS

public static final @NonNull SourceNode.Source DIRECTION_IN_RADIANS

Angle of the modeled stroke input's current direction of travel in stroke coordinate space, normalized to the range [0, 2π). A value of 0 indicates the direction of the positive x-axis; a value of π/2 indicates the direction of the positive y-axis.

DISTANCE_REMAINING_AS_FRACTION_OF_STROKE_LENGTH

public static final @NonNull SourceNode.Source DISTANCE_REMAINING_AS_FRACTION_OF_STROKE_LENGTH

Distance from the current modeled input to the end of the stroke along the input path, as a fraction of the current total length of the stroke. This value changes for each input as inputs are added.

DISTANCE_REMAINING_IN_MULTIPLES_OF_BRUSH_SIZE

public static final @NonNull SourceNode.Source DISTANCE_REMAINING_IN_MULTIPLES_OF_BRUSH_SIZE

The distance left to be traveled from a given modeled input to the current last modeled input of the stroke in multiples of the brush size. This value changes for each input as the stroke is drawn.

DISTANCE_TRAVELED_IN_CENTIMETERS

public static final @NonNull SourceNode.Source DISTANCE_TRAVELED_IN_CENTIMETERS

Distance in centimeters traveled by the modeled stroke input pointer along the input path from the start of the stroke.

DISTANCE_TRAVELED_IN_MULTIPLES_OF_BRUSH_SIZE

public static final @NonNull SourceNode.Source DISTANCE_TRAVELED_IN_MULTIPLES_OF_BRUSH_SIZE

Distance traveled by the inputs of the current stroke, starting at 0 at the first input, where one distance unit is equal to the brush size.

NORMALIZED_DIRECTION_X

public static final @NonNull SourceNode.Source NORMALIZED_DIRECTION_X

Signed x component of the modeled stroke input's current direction of travel in stroke coordinate space, normalized to the range -1, 1.

NORMALIZED_DIRECTION_Y

public static final @NonNull SourceNode.Source NORMALIZED_DIRECTION_Y

Signed y component of the modeled stroke input's current direction of travel in stroke coordinate space, normalized to the range -1, 1.

NORMALIZED_PRESSURE

public static final @NonNull SourceNode.Source NORMALIZED_PRESSURE

Stylus or touch pressure with values reported in the range 0, 1.

ORIENTATION_ABOUT_ZERO_IN_RADIANS

public static final @NonNull SourceNode.Source ORIENTATION_ABOUT_ZERO_IN_RADIANS

Stylus orientation with values reported in the range (-π, π].

ORIENTATION_IN_RADIANS

public static final @NonNull SourceNode.Source ORIENTATION_IN_RADIANS

Stylus orientation with values reported in the range [0, 2π).

PREDICTED_DISTANCE_TRAVELED_IN_CENTIMETERS

public static final @NonNull SourceNode.Source PREDICTED_DISTANCE_TRAVELED_IN_CENTIMETERS

Distance in centimeters alonge the input path from the real portion of the modeled stroke to this input. Zero for inputs before the predicted portion of the stroke.

PREDICTED_DISTANCE_TRAVELED_IN_MULTIPLES_OF_BRUSH_SIZE

public static final @NonNull SourceNode.Source PREDICTED_DISTANCE_TRAVELED_IN_MULTIPLES_OF_BRUSH_SIZE

Distance traveled by the inputs of the current prediction, starting at 0 at the last non-predicted input, in multiples of the brush size. Zero for inputs before the predicted portion of the stroke.

PREDICTED_TIME_ELAPSED_IN_SECONDS

public static final @NonNull SourceNode.Source PREDICTED_TIME_ELAPSED_IN_SECONDS

Elapsed time of the prediction in seconds, starting at 0 at the last non-predicted input. Zero for inputs before the predicted portion of the stroke.

SPEED_IN_CENTIMETERS_PER_SECOND

public static final @NonNull SourceNode.Source SPEED_IN_CENTIMETERS_PER_SECOND

Absolute speed of the modeled stroke input pointer in centimeters per second.

SPEED_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

public static final @NonNull SourceNode.Source SPEED_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

Absolute speed of the modeled stroke input in multiples of the brush size per second. Note that this value doesn't take into account brush behaviors that offset the position of the visual tip of the stroke.

TILT_IN_RADIANS

public static final @NonNull SourceNode.Source TILT_IN_RADIANS

Stylus tilt with values reported in the range 0, π/2 radians.

TILT_X_IN_RADIANS

public static final @NonNull SourceNode.Source TILT_X_IN_RADIANS

Stylus tilt along the x axis in the range -π/2, π/2, with a positive value corresponding to tilt toward the respective positive axis. In order for those values to be reported, both tilt and orientation have to be populated on the StrokeInput.

TILT_Y_IN_RADIANS

public static final @NonNull SourceNode.Source TILT_Y_IN_RADIANS

Stylus tilt along the y axis in the range -π/2, π/2, with a positive value corresponding to tilt toward the respective positive axis. In order for those values to be reported, both tilt and orientation have to be populated on the StrokeInput.

TIME_FROM_INPUT_TO_STROKE_END_IN_SECONDS

public static final @NonNull SourceNode.Source TIME_FROM_INPUT_TO_STROKE_END_IN_SECONDS

Time elapsed from the current modeled stroke input until the last input in the stroke.

TIME_OF_INPUT_IN_SECONDS

public static final @NonNull SourceNode.Source TIME_OF_INPUT_IN_SECONDS

Time elapsed in seconds from between the start of the stroke and the current modeled stroke input. The value remains fixed for any given part of the stroke once drawn.

TIME_SINCE_INPUT_IN_SECONDS

public static final @NonNull SourceNode.Source TIME_SINCE_INPUT_IN_SECONDS

Time elapsed in seconds since the modeled stroke input. This continues to increase even after all stroke inputs have completed, and can be used to drive stroke animations. This enumerators are only compatible with a SourceNode.sourceOutOfRangeBehavior of OutOfRange.CLAMP, to ensure that the animation will eventually end.

TIME_SINCE_STROKE_END_IN_SECONDS

public static final @NonNull SourceNode.Source TIME_SINCE_STROKE_END_IN_SECONDS

Time elapsed since the final input of the stroke, or zero if the final input hasn't arrived yet. This can be used to drive wet-layer stroke animations that should occur after the final input. This source is only compatible with a SourceNode.sourceOutOfRangeBehavior of OutOfRange.CLAMP, to ensure that the animation will eventually end.

VELOCITY_X_IN_CENTIMETERS_PER_SECOND

public static final @NonNull SourceNode.Source VELOCITY_X_IN_CENTIMETERS_PER_SECOND

Signed x component of the modeled stroke input pointer's velocity in centimeters per second.

VELOCITY_X_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

public static final @NonNull SourceNode.Source VELOCITY_X_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

Signed x component of the velocity of the modeled stroke input in multiples of the brush size per second. Note that this value doesn't take into account brush behaviors that offset the visible position of that point in the stroke.

VELOCITY_Y_IN_CENTIMETERS_PER_SECOND

public static final @NonNull SourceNode.Source VELOCITY_Y_IN_CENTIMETERS_PER_SECOND

Signed y component of the modeled stroke input pointer's velocity in centimeters per second.

VELOCITY_Y_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

public static final @NonNull SourceNode.Source VELOCITY_Y_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

Signed y component of the velocity of the modeled stroke input in multiples of the brush size per second. Note that this value doesn't take into account brush behaviors that offset the visible position of that point in the stroke.

Public methods

toString

public @NonNull String toString()