StockBrushes


public static class StockBrushes


Provides a fixed set of stock BrushFamily objects that any app can use.

All brush designs are versioned, so apps can safely store input points and brush specs instead of the pixel result, but be able to regenerate strokes from stored input points that look like the strokes originally drawn by the user. Brush designs are intended to evolve over time, and are released as update packs to the stock library.

Each successive brush version will keep to the spirit of the brush, but the actual effect can change between versions. For example, a new version of the highlighter may introduce a variation on how round the tip is, or what sort of curve maps color to pressure.

We generally recommend that applications use the latest brush version available; but some use cases, such as art, should be careful to track which version of a brush was used if the document is regenerated, so that the user gets the same visual result.

Summary

Public fields

static @NonNull StockBrushes

Public methods

static final @NonNull BrushFamily

The latest version of a chisel-tip brush that is intended for highlighting text in a document (when used with a translucent brush color).

static final @NonNull BrushFamily

Version 1 of a chisel-tip brush that is intended for highlighting text in a document (when used with a translucent brush color).

static final @NonNull BrushFamily

The latest version of a simple, circular fixed-width brush.

static final @NonNull BrushFamily

Version 1 of a simple, circular fixed-width brush.

static final @NonNull BrushFamily

The latest version of a pressure- and speed-sensitive brush that is optimized for handwriting with a stylus.

static final @NonNull BrushFamily

Version 1 of a pressure- and speed-sensitive brush that is optimized for handwriting with a stylus.

Public fields

INSTANCE

Added in 1.0.0-alpha02
public static @NonNull StockBrushes INSTANCE

Public methods

getHighlighterLatest

Added in 1.0.0-alpha02
public static final @NonNull BrushFamily getHighlighterLatest()

The latest version of a chisel-tip brush that is intended for highlighting text in a document (when used with a translucent brush color).

The behavior of this BrushFamily may change in future releases, as it always points to the latest version of the pressure pen.

getHighlighterV1

Added in 1.0.0-alpha02
public static final @NonNull BrushFamily getHighlighterV1()

Version 1 of a chisel-tip brush that is intended for highlighting text in a document (when used with a translucent brush color).

The behavior of this BrushFamily will not meaningfully change in future releases. More significant updates would be contained in a BrushFamily with a different name specifying a later version number.

getMarkerLatest

Added in 1.0.0-alpha02
public static final @NonNull BrushFamily getMarkerLatest()

The latest version of a simple, circular fixed-width brush.

The behavior of this BrushFamily may change in future releases, as it always points to the latest version of the marker.

getMarkerV1

Added in 1.0.0-alpha02
public static final @NonNull BrushFamily getMarkerV1()

Version 1 of a simple, circular fixed-width brush.

The behavior of this BrushFamily will not meaningfully change in future releases. More significant updates would be contained in a BrushFamily with a different name specifying a later version number.

getPressurePenLatest

Added in 1.0.0-alpha02
public static final @NonNull BrushFamily getPressurePenLatest()

The latest version of a pressure- and speed-sensitive brush that is optimized for handwriting with a stylus.

The behavior of this BrushFamily may change in future releases, as it always points to the latest version of the pressure pen.

getPressurePenV1

Added in 1.0.0-alpha02
public static final @NonNull BrushFamily getPressurePenV1()

Version 1 of a pressure- and speed-sensitive brush that is optimized for handwriting with a stylus.

The behavior of this BrushFamily will not meaningfully change in future releases. More significant updates would be contained in a BrushFamily with a different name specifying a later version number.