BrushPaint.TilingTexture


public final class BrushPaint.TilingTexture extends BrushPaint.TextureLayer


A texture layer that will repeat according to a 2D affine transformation of vertex positions. Each copy of the texture will have the same size and shape, modulo reflections.

Summary

Nested types

Builder for TilingTexture.

Specification of the origin point to use for the texture.

Public constructors

TilingTexture(
    @NonNull String clientTextureId,
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeX,
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeY,
    float offsetX,
    float offsetY,
    @AngleDegreesFloat float rotationDegrees,
    @NonNull BrushPaint.TextureLayer.SizeUnit sizeUnit,
    @NonNull BrushPaint.TilingTexture.Origin origin,
    @NonNull BrushPaint.TextureLayer.Wrap wrapX,
    @NonNull BrushPaint.TextureLayer.Wrap wrapY,
    @NonNull BrushPaint.TextureLayer.BlendMode blendMode
)

Creates a new TilingTexture with the specified parameters.

Public methods

static final @NonNull BrushPaint.TilingTexture.Builder

Returns a new TilingTexture.Builder.

final @NonNull BrushPaint.TilingTexture
copy(
    @NonNull String clientTextureId,
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeX,
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeY,
    float offsetX,
    float offsetY,
    @AngleDegreesFloat float rotationDegrees,
    @NonNull BrushPaint.TextureLayer.SizeUnit sizeUnit,
    @NonNull BrushPaint.TilingTexture.Origin origin,
    @NonNull BrushPaint.TextureLayer.Wrap wrapX,
    @NonNull BrushPaint.TextureLayer.Wrap wrapY,
    @NonNull BrushPaint.TextureLayer.BlendMode blendMode
)

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

boolean
equals(Object other)
final @NonNull String
final float

The horizontal offset for the texture, specified as a fraction of the texture width.

final float

The vertical offset for the texture, specified as a fraction of the texture height.

final @NonNull BrushPaint.TilingTexture.Origin

The origin that will be used for positioning this texture layer.

final float

Angle specifying the rotation of the texture.

final @NonNull BrushPaint.TextureLayer.SizeUnit

The units in which this texture layer's width and height are measured.

final float

The width of the texture, specified in sizeUnits.

final float

The height of the texture, specified in sizeUnits.

final @NonNull BrushPaint.TextureLayer.Wrap

The horizontal wrapping mode for this texture layer.

final @NonNull BrushPaint.TextureLayer.Wrap

The vertical wrapping mode for this texture layer.

int
final @NonNull BrushPaint.TilingTexture.Builder

Returns a Builder with values set equivalent to this.

@NonNull String

Inherited methods

From androidx.ink.brush.BrushPaint.TextureLayer
final @NonNull BrushPaint.TextureLayer.BlendMode

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

Public constructors

TilingTexture

Added in 1.1.0-alpha03
public TilingTexture(
    @NonNull String clientTextureId,
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeX,
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeY,
    float offsetX,
    float offsetY,
    @AngleDegreesFloat float rotationDegrees,
    @NonNull BrushPaint.TextureLayer.SizeUnit sizeUnit,
    @NonNull BrushPaint.TilingTexture.Origin origin,
    @NonNull BrushPaint.TextureLayer.Wrap wrapX,
    @NonNull BrushPaint.TextureLayer.Wrap wrapY,
    @NonNull BrushPaint.TextureLayer.BlendMode blendMode
)

Creates a new TilingTexture with the specified parameters.

Java callers should use the Builder class instead.

Parameters
@NonNull String clientTextureId

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.

@FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeX

The X size in TextureLayer.SizeUnit of the image specified by clientTextureId.

@FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeY

The Y size in TextureLayer.SizeUnit of the image specified by clientTextureId.

float offsetX

An offset into the texture, specified as fractions of the texture sizeX.

float offsetY

An offset into the texture, specified as fractions of the texture sizeY.

@AngleDegreesFloat float rotationDegrees

Angle in degrees specifying the rotation of the texture. The rotation is carried out about the center of the texture's first repetition along both axes.

@NonNull BrushPaint.TextureLayer.SizeUnit sizeUnit

The units used to specify sizeX and sizeY.

@NonNull BrushPaint.TilingTexture.Origin origin

The origin point to be used for texture space.

@NonNull BrushPaint.TextureLayer.Wrap wrapX

The wrap mode along the horizontal texture axis.

@NonNull BrushPaint.TextureLayer.Wrap wrapY

The wrap mode along the vertical texture axis.

@NonNull BrushPaint.TextureLayer.BlendMode blendMode

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

Public methods

builder

Added in 1.1.0-alpha03
public static final @NonNull BrushPaint.TilingTexture.Builder builder()

Returns a new TilingTexture.Builder.

copy

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture copy(
    @NonNull String clientTextureId,
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeX,
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeY,
    float offsetX,
    float offsetY,
    @AngleDegreesFloat float rotationDegrees,
    @NonNull BrushPaint.TextureLayer.SizeUnit sizeUnit,
    @NonNull BrushPaint.TilingTexture.Origin origin,
    @NonNull BrushPaint.TextureLayer.Wrap wrapX,
    @NonNull BrushPaint.TextureLayer.Wrap wrapY,
    @NonNull BrushPaint.TextureLayer.BlendMode blendMode
)

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

Java callers should use Builder instead.

equals

public boolean equals(Object other)

getClientTextureId

Added in 1.1.0-alpha03
public final @NonNull String getClientTextureId()

getOffsetX

Added in 1.1.0-alpha03
public final float getOffsetX()

The horizontal offset for the texture, specified as a fraction of the texture width.

getOffsetY

Added in 1.1.0-alpha03
public final float getOffsetY()

The vertical offset for the texture, specified as a fraction of the texture height.

getOrigin

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Origin getOrigin()

The origin that will be used for positioning this texture layer.

getRotationDegrees

Added in 1.1.0-alpha03
public final float getRotationDegrees()

Angle specifying the rotation of the texture. The rotation is carried out about the center of the texture's first repetition along both axes.

getSizeUnit

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TextureLayer.SizeUnit getSizeUnit()

The units in which this texture layer's width and height are measured.

getSizeX

Added in 1.1.0-alpha03
public final float getSizeX()

The width of the texture, specified in sizeUnits.

getSizeY

Added in 1.1.0-alpha03
public final float getSizeY()

The height of the texture, specified in sizeUnits.

getWrapX

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TextureLayer.Wrap getWrapX()

The horizontal wrapping mode for this texture layer.

getWrapY

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TextureLayer.Wrap getWrapY()

The vertical wrapping mode for this texture layer.

hashCode

public int hashCode()

toBuilder

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder toBuilder()

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

toString

public @NonNull String toString()