BrushPaint.StampingTexture



A texture that is "stamped" onto each particle of the stroke, scaled or rotated appropriately to cover the whole particle.

Summary

Nested types

Builder for StampingTexture.

Public companion functions

BrushPaint.StampingTexture.Builder

Returns a new StampingTexture.Builder.

Cmn

Public constructors

StampingTexture(
    clientTextureId: String,
    blendMode: BrushPaint.TextureLayer.BlendMode
)

Creates a new StampingTexture with the specified parameters.

Cmn
StampingTexture(
    clientTextureId: String,
    blendMode: BrushPaint.TextureLayer.BlendMode,
    animationFrames: @IntRange(from = 1, to = 16777216) Int,
    animationRows: @IntRange(from = 1, to = 4096) Int,
    animationColumns: @IntRange(from = 1, to = 4096) Int,
    animationDurationMillis: @IntRange(from = 0, to = 16777216) Long,
    animationRepeatMode: BrushPaint.AnimationRepeatMode
)

Creates a new StampingTexture with the specified parameters.

Cmn

Public functions

BrushPaint.StampingTexture
copy(
    clientTextureId: String,
    blendMode: BrushPaint.TextureLayer.BlendMode
)

Creates a copy of this and allows named properties to be altered while keeping the rest unchanged.

Cmn
BrushPaint.StampingTexture
copy(
    clientTextureId: String,
    blendMode: BrushPaint.TextureLayer.BlendMode,
    animationFrames: @IntRange(from = 1, to = 16777216) Int,
    animationRows: @IntRange(from = 1, to = 4096) Int,
    animationColumns: @IntRange(from = 1, to = 4096) Int,
    animationDurationMillis: @IntRange(from = 0, to = 16777216) Long,
    animationRepeatMode: BrushPaint.AnimationRepeatMode
)

Creates a copy of this and allows named properties to be altered while keeping the rest unchanged.

Cmn
open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
BrushPaint.StampingTexture.Builder

Returns a Builder with values set equivalent to this.

Cmn
open String
Cmn

Public properties

Int
Cmn
Long
Cmn
Int
Cmn
BrushPaint.AnimationRepeatMode
Cmn
Int
Cmn
String

The client texture ID for this texture layer.

Cmn

Inherited functions

From androidx.ink.brush.BrushPaint.TextureLayer
Version

Returns the minimum required Version for this TextureLayer.

Cmn

Inherited properties

From androidx.ink.brush.BrushPaint.TextureLayer
BrushPaint.TextureLayer.BlendMode

The rule by which the texture layers up to and including this one are combined with the subsequent layer.

Cmn

Public companion functions

Public constructors

StampingTexture

StampingTexture(
    clientTextureId: String,
    blendMode: BrushPaint.TextureLayer.BlendMode = BlendMode.MODULATE
)

Creates a new StampingTexture with the specified parameters.

Parameters
clientTextureId: String

A string identifier of an image that provides the color for a particular pixel for this layer. The coordinates within this image that will be used are determined by the other parameters.

blendMode: BrushPaint.TextureLayer.BlendMode = BlendMode.MODULATE

The method by which the texture layers up to this one (index <= i) are combined with the subsequent texture layer (index == i+1). For the last texture layer, this defines the method by which the texture layer is combined with the brush color (possibly after that color gets per-vertex adjustments).

StampingTexture

StampingTexture(
    clientTextureId: String,
    blendMode: BrushPaint.TextureLayer.BlendMode = BlendMode.MODULATE,
    animationFrames: @IntRange(from = 1, to = 16777216) Int = 1,
    animationRows: @IntRange(from = 1, to = 4096) Int = 1,
    animationColumns: @IntRange(from = 1, to = 4096) Int = 1,
    animationDurationMillis: @IntRange(from = 0, to = 16777216) Long = 1000,
    animationRepeatMode: BrushPaint.AnimationRepeatMode = AnimationRepeatMode.RESTART
)

Creates a new StampingTexture with the specified parameters.

Java callers should use the Builder class instead.

Parameters
clientTextureId: String

A string identifier of an image that provides the color for a particular pixel for this layer. The coordinates within this image that will be used are determined by the other parameters.

blendMode: BrushPaint.TextureLayer.BlendMode = BlendMode.MODULATE

The method by which the texture layers up to this one (index <= i) are combined with the subsequent texture layer (index == i+1). For the last texture layer, this defines the method by which the texture layer is combined with the brush color (possibly after that color gets per-vertex adjustments).

animationFrames: @IntRange(from = 1, to = 16777216) Int = 1

The number of animation frames in this texture, or 1 for no animation. If greater than 1, then the texture image is treated as a grid of animation frame images, with dimensions of animationRows by animationColumns frames. The frames will be indexed in row-major order, where row=0 and column=0 is frame index 0, then row=0 and column=1 is frame index 1, and so on. animationFrames must be at most the product of animationRows and animationColumns, and there may be unused frame cells in the final row.

animationRows: @IntRange(from = 1, to = 4096) Int = 1

The number of frame rows in this texture. See animationFrames for more detail. When constructing an animation texture image, avoid making it too large in any one dimension by choosing values for animationRows and animationColumns that are close to each other, but just large enough such that animationFrames<= animationRows * animationColumns.

animationColumns: @IntRange(from = 1, to = 4096) Int = 1

Like animationRows, but for columns.

animationDurationMillis: @IntRange(from = 0, to = 16777216) Long = 1000

The duration of one complete animation loop for this texture (either passing through each frame once if animationRepeatMode is AnimationRepeatMode.RESTART, or passing back and forth through each frame if animationRepeatMode is AnimationRepeatMode.REVERSE), or zero to disable automatic looping animations (in which case the current animation frame will be controlled solely by any androidx.ink.brush.behavior.TargetNode.Target.PAINT_ANIMATION_PROGRESS_OFFSET behavior targets). Must be between 0 and 2^24 (inclusive). Ignored if animationFrames is 1 (its default value), because that indicates that animation is disabled.

animationRepeatMode: BrushPaint.AnimationRepeatMode = AnimationRepeatMode.RESTART

Specifies what should happen when the animation reaches the last frame: either it can immediately restart back at the first frame, or it can reverse direction. Ignored if animationFrames is 1 (its default value), because that indicates that animation is disabled.

Public functions

copy

fun copy(
    clientTextureId: String = this.clientTextureId,
    blendMode: BrushPaint.TextureLayer.BlendMode = this.blendMode
): BrushPaint.StampingTexture

Creates a copy of this and allows named properties to be altered while keeping the rest unchanged.

Java callers should use Builder instead.

copy

fun copy(
    clientTextureId: String = this.clientTextureId,
    blendMode: BrushPaint.TextureLayer.BlendMode = this.blendMode,
    animationFrames: @IntRange(from = 1, to = 16777216) Int = this.animationFrames,
    animationRows: @IntRange(from = 1, to = 4096) Int = this.animationRows,
    animationColumns: @IntRange(from = 1, to = 4096) Int = this.animationColumns,
    animationDurationMillis: @IntRange(from = 0, to = 16777216) Long = this.animationDurationMillis,
    animationRepeatMode: BrushPaint.AnimationRepeatMode = this.animationRepeatMode
): BrushPaint.StampingTexture

Creates a copy of this and allows named properties to be altered while keeping the rest unchanged.

Java callers should use Builder instead.

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toBuilder

fun toBuilder(): BrushPaint.StampingTexture.Builder

Returns a Builder with values set equivalent to this. Java developers, use the returned builder to build a copy of a StampingTexture. Kotlin developers, see copy method.

toString

open fun toString(): String

Public properties

animationColumns

val animationColumns: Int

animationDurationMillis

val animationDurationMillis: Long

animationFrames

val animationFrames: Int

animationRepeatMode

val animationRepeatMode: BrushPaint.AnimationRepeatMode

animationRows

val animationRows: Int

clientTextureId

val clientTextureId: String

The client texture ID for this texture layer.