BrushFamily


public final class BrushFamily


A BrushFamily describes a family of brushes (e.g. “highlighter” or “pressure pen”), irrespective of their size or color.

For now, BrushFamily is an opaque type that can only be instantiated via StockBrushes. A future version of this module will allow creating fully custom BrushFamily objects.

BrushFamily objects are immutable.

Summary

Nested types

public static class BrushFamily.Companion

Public methods

boolean
equals(Object other)
int
@NonNull String

Protected methods

final void

Deletes native BrushFamily memory.

Extension functions

final void
AndroidBrushFamilyExtensions.encode(
    @NonNull BrushFamily receiver,
    @NonNull OutputStream output,
    @NonNull TextureBitmapStore textureBitmapStore
)

Write a gzip-compressed ink.proto.BrushFamily binary proto message representing the BrushFamily to the given OutputStream.

final void

Write a gzip-compressed serialized ink.proto.BrushFamily proto message representing the BrushFamily to the given OutputStream.

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

toString

public @NonNull String toString()

Protected methods

finalize

Added in 1.0.0
protected final void finalize()

Deletes native BrushFamily memory.

Extension functions

AndroidBrushFamilyExtensions.encode

public final void AndroidBrushFamilyExtensions.encode(
    @NonNull BrushFamily receiver,
    @NonNull OutputStream output,
    @NonNull TextureBitmapStore textureBitmapStore
)

Write a gzip-compressed ink.proto.BrushFamily binary proto message representing the BrushFamily to the given OutputStream. If hasFallbacks is true, then the stored, proto message including fallbacks for this BrushFamily will be used instead of recomputing the proto from the BrushFamily object.

Parameters
@NonNull BrushFamily receiver

The BrushFamily object to encode.

@NonNull OutputStream output

The OutputStream to write the gzip-compressed encoded bytes to.

@NonNull TextureBitmapStore textureBitmapStore

The TextureBitmapStore to use to encode the texture images within the encoded BrushFamily. If this is not desired behavior, e.g. if the application has a static set of texture images that it includes as resources, then this can be a TextureBitmapStore that always returns null.

BrushFamilyExtensions.encode

public final void BrushFamilyExtensions.encode(
    @NonNull BrushFamily receiver,
    @NonNull OutputStream output
)

Write a gzip-compressed serialized ink.proto.BrushFamily proto message representing the BrushFamily to the given OutputStream. If hasFallbacks is true, then the stored, proto message including fallbacks for this BrushFamily will be used instead of recomputing the proto from the BrushFamily object.