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 companion properties

SourceNode.Source

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

Cmn
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.

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
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.

Cmn
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.

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
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.

Cmn
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.

Cmn
SourceNode.Source

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

Cmn
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.

Cmn
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.

Cmn
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.

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
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.

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
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.

Cmn
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.

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

Time elapsed in seconds since the modeled stroke input.

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn
SourceNode.Source

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

Cmn

Public functions

open String
Cmn

Public companion properties

ACCELERATION_FORWARD_IN_CENTIMETERS_PER_SECOND_SQUARED

val ACCELERATION_FORWARD_IN_CENTIMETERS_PER_SECOND_SQUAREDSourceNode.Source

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

val ACCELERATION_FORWARD_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUAREDSourceNode.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. 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

val ACCELERATION_IN_CENTIMETERS_PER_SECOND_SQUAREDSourceNode.Source

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

ACCELERATION_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

val ACCELERATION_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUAREDSourceNode.Source

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

val ACCELERATION_LATERAL_IN_CENTIMETERS_PER_SECOND_SQUAREDSourceNode.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.

ACCELERATION_LATERAL_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUARED

val ACCELERATION_LATERAL_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUAREDSourceNode.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. 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

val ACCELERATION_X_IN_CENTIMETERS_PER_SECOND_SQUAREDSourceNode.Source

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

val ACCELERATION_X_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUAREDSourceNode.Source

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

val ACCELERATION_Y_IN_CENTIMETERS_PER_SECOND_SQUAREDSourceNode.Source

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

val ACCELERATION_Y_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND_SQUAREDSourceNode.Source

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

val DIRECTION_ABOUT_ZERO_IN_RADIANSSourceNode.Source

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

val DIRECTION_IN_RADIANSSourceNode.Source

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

val DISTANCE_REMAINING_AS_FRACTION_OF_STROKE_LENGTHSourceNode.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. This value changes for each input as inputs are added.

DISTANCE_REMAINING_IN_MULTIPLES_OF_BRUSH_SIZE

val DISTANCE_REMAINING_IN_MULTIPLES_OF_BRUSH_SIZESourceNode.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. This value changes for each input as the stroke is drawn.

DISTANCE_TRAVELED_IN_CENTIMETERS

val DISTANCE_TRAVELED_IN_CENTIMETERSSourceNode.Source

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

val DISTANCE_TRAVELED_IN_MULTIPLES_OF_BRUSH_SIZESourceNode.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.

NORMALIZED_DIRECTION_X

val NORMALIZED_DIRECTION_XSourceNode.Source

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

val NORMALIZED_DIRECTION_YSourceNode.Source

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

val NORMALIZED_PRESSURESourceNode.Source

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

ORIENTATION_ABOUT_ZERO_IN_RADIANS

val ORIENTATION_ABOUT_ZERO_IN_RADIANSSourceNode.Source

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

ORIENTATION_IN_RADIANS

val ORIENTATION_IN_RADIANSSourceNode.Source

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

PREDICTED_DISTANCE_TRAVELED_IN_CENTIMETERS

val PREDICTED_DISTANCE_TRAVELED_IN_CENTIMETERSSourceNode.Source

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

val PREDICTED_DISTANCE_TRAVELED_IN_MULTIPLES_OF_BRUSH_SIZESourceNode.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. Zero for inputs before the predicted portion of the stroke.

PREDICTED_TIME_ELAPSED_IN_SECONDS

val PREDICTED_TIME_ELAPSED_IN_SECONDSSourceNode.Source

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

val SPEED_IN_CENTIMETERS_PER_SECONDSourceNode.Source

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

SPEED_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

val SPEED_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECONDSourceNode.Source

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

val TILT_IN_RADIANSSourceNode.Source

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

TILT_X_IN_RADIANS

val TILT_X_IN_RADIANSSourceNode.Source

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

val TILT_Y_IN_RADIANSSourceNode.Source

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

val TIME_FROM_INPUT_TO_STROKE_END_IN_SECONDSSourceNode.Source

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

TIME_OF_INPUT_IN_SECONDS

val TIME_OF_INPUT_IN_SECONDSSourceNode.Source

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

val TIME_SINCE_INPUT_IN_SECONDSSourceNode.Source

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

val TIME_SINCE_STROKE_END_IN_SECONDSSourceNode.Source

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

val VELOCITY_X_IN_CENTIMETERS_PER_SECONDSourceNode.Source

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

VELOCITY_X_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

val VELOCITY_X_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECONDSourceNode.Source

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

val VELOCITY_Y_IN_CENTIMETERS_PER_SECONDSourceNode.Source

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

VELOCITY_Y_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECOND

val VELOCITY_Y_IN_MULTIPLES_OF_BRUSH_SIZE_PER_SECONDSourceNode.Source

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 functions

toString

open fun toString(): String